Commit 2154d366 authored by jingnan's avatar jingnan 👀

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

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