Commit 2154d366 authored by jingnan's avatar jingnan 👀

ERP相关_扫码记实接口修改及子表返回值处理

parent 73ab51b4
......@@ -6,7 +6,7 @@
</p>
<scan v-show="false" :id="onlyUuid" @getQrCode="getQRcode">扫码录入</scan>
<!-- 表格 -->
<div>
<div class="dee-table">
<el-table
v-loading="loading"
:data="tableData"
......@@ -166,10 +166,18 @@ export default {
sortable: true,
minWidth: 80
},
{
title: '扫码数量',
show: true,
key: 'recordData.amount',
align: 'center',
sortable: true,
minWidth: 100
},
{
title: '采购标准',
show: true,
key: 'extScanCodeRecords[0].purchaseSTD',
key: 'recordData.purchaseSTD',
align: 'center',
sortable: true,
minWidth: 120
......@@ -178,26 +186,26 @@ export default {
title: '实发型号/件号',
show: true,
minWidth: '160',
key: 'extScanCodeRecords[0].modelNo',
key: 'recordData.modelNo',
align: 'center',
sortable: true
},
{
title: '追溯信息',
show: true,
key: 'extScanCodeRecords[0].retrospect',
align: 'center',
sortable: true,
minWidth: 120
},
{
title: '单据编号',
show: true,
key: 'extScanCodeRecords[0].docNo',
key: 'recordData.retrospect',
align: 'center',
sortable: true,
minWidth: 120
},
// {
// title: '单据编号',
// show: true,
// key: 'recordData.docNo',
// align: 'center',
// sortable: true,
// minWidth: 120
// },
{
title: '状态',
show: true,
......@@ -248,18 +256,38 @@ export default {
{}
)
.then((res) => {
this.tableData = res.items.map((p) => {
if (!p.extScanCodeRecords) {
p.extScanCodeRecords = []
p.scanCodeRecordsState = '未确认'
const resData = []
res.items.map((p) => {
if (p.extScanCodeRecords && p.extScanCodeRecords.length > 0) {
p.extScanCodeRecords.forEach(record => {
resData.push({
recordData: record,
scanCodeRecordsState: record.status,
popoverVisible: false,
uuid: uuidv4(),
...p
})
})
} else {
p.scanCodeRecordsState = p.extScanCodeRecords[0].status
}
return {
popoverVisible: false,
uuid: uuidv4(),
...p
resData.push({
popoverVisible: false,
uuid: uuidv4(),
...p,
scanCodeRecordsState: '未确认'
})
}
this.tableData = resData
// if (!p.extScanCodeRecords) {
// p.extScanCodeRecords = []
// p.scanCodeRecordsState = '未确认'
// } else {
// p.scanCodeRecordsState = p.recordData.status
// }
// return {
// popoverVisible: false,
// uuid: uuidv4(),
// ...p
// }
})
// this.tablePagination.total = res.items.totalElements
})
......@@ -368,7 +396,7 @@ export default {
// operator: 'REMOVE'
// }
// 发送请求
post(`ExtScanCodeRecord/removeScanCode?id=${row.extScanCodeRecords[0].id}&reqName=${row.extMaterial.resType2.typeName}`, {})
post(`ExtScanCodeRecord/removeScanCode?id=${row.recordData.id}&reqName=${row.extMaterial.resType2.typeName}`, {})
.then((res) => {
if (res.message.includes('成功')) {
this.init()
......
......@@ -5,7 +5,7 @@
<span v-show="flag">提示:当零件类型为外购成品时,实称重量/去除重量才可双击编辑!</span>
</p>
<scan v-show="false" :id="onlyUuid" @getQrCode="getScanBar">扫码录入</scan>
<div>
<div class="dee-table">
<el-table
v-loading="loading"
:data="tableData"
......@@ -18,8 +18,8 @@
<el-table-column type="index" :width="80" label="序号" align="center" />
<el-table-column v-if="flag" :width="120" label="扫码录入" align="center">
<template slot-scope="scope">
<!-- v-if="scope.row.extMaterial.resType2.typeName === '标准件' " -->
<el-popover
v-if="scope.row.extMaterial.resType2.typeName === '标准件' "
v-model="scope.row.popoverVisible"
placement="right"
width="260"
......@@ -430,7 +430,7 @@ export default {
this.timer = null
},
deeTableEdit(row, column, cell, event) {
var that = this
const that = this
if (row.extMaterial.resType2.typeName !== '外购成品' || !row.jobResponseOutStorageVOS || !this.flag) return
if (column.property === 'actualWeight') {
this.setRowValue = row.actualWeight
......@@ -461,7 +461,7 @@ export default {
// this.init()
// },
deeTableBlur(row, status) {
var that = this
const that = this
const param = {
operator: 'MODIFY',
id: row.weigthObj.id,
......@@ -569,13 +569,13 @@ export default {
*/
getQRcode(row) {
// 发送请求
var id = this.rowId
var scanid = this.typing.scanId
var count = this.typing.count
const id = this.rowId
const scanId = this.typing.scanId
const count = this.typing.count
row.popoverVisible = false
row.stateName = '已出库'
post(
`/ExtScanCodeRecord/saveMaterialConfirmationHead?suppId=${id}&jbOutId=${scanid}&amount=${count}`,
`/ExtScanCodeRecord/scanErpSorting?suppId=${id}&erpJobId=${scanId}&amount=${count}`,
{},
)
.then((res) => {
......@@ -604,18 +604,46 @@ export default {
})
},
async getScanName(value) {
this.scanIdShow = false
const params = {
'searchItems': {
'items': [
{
'fieldName': 'id',
'operator': 'EQ',
'value': value
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'erpSortingItem',
'openProps': [
{
'name': 'extMaterial'
}
]
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post(
`/JobResponseOutStorage/getModelNo?id=${value}`,
{}
`/JobResponseSorting/search`,
params
)
.then((res) => {
if (res.message.includes('成功')) {
this.typing.scanName = res.items
if (res.items && res.items.content && res.items.content.length && res.items.content[0].erpSortingItem && res.items.content[0].erpSortingItem.extMaterial) {
this.scanIdShow = false
this.typing.scanName = res.items.content[0].erpSortingItem.extMaterial.modelNo
} else {
this.$message({
showClose: true,
message: '查询失败',
message: '二维码不正确',
type: 'error'
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment