|
|
@ -42,6 +42,8 @@ |
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
:isOpenSearchTable="true" |
|
|
|
fieldTableColumn="packingNumber" |
|
|
|
@success="getList" |
|
|
|
:rules="ScrapRequestMainRules" |
|
|
|
:formAllSchemas="ScrapRequestMain.allSchemas" |
|
|
@ -104,6 +106,7 @@ const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref([...ScrapRequestMain.allSchemas.tableColumns,...ScrapRequestDetail.allSchemas.tableMainColumns]) |
|
|
|
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
@ -114,16 +117,32 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
nextTick(() => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
row['packingNumber'] = val[0]['packingNumber'] |
|
|
|
row['batch'] = val[0]['batch'] |
|
|
|
row['fromLocationCode'] = val[0]['locationCode'] |
|
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
|
row['uom'] = val[0]['uom'] |
|
|
|
// val.forEach(item=>{ |
|
|
|
// const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
|
// newRow[formField] = item[searchField] |
|
|
|
// newRow['packingNumber'] = item['packingNumber'] |
|
|
|
// newRow['batch'] = item['batch'] |
|
|
|
// newRow['fromLocationCode'] = item['locationCode'] |
|
|
|
// newRow['itemCode'] = item['itemCode'] |
|
|
|
// newRow['uom'] = item['uom'] |
|
|
|
// tableData.value.push(newRow) |
|
|
|
// }) |
|
|
|
// 查询标准价格 |
|
|
|
let param = {'itemCode':val[0]['itemCode'] as string} |
|
|
|
let param = {'itemCodes':val.map(item=>item.itemCode).join(',') as string} |
|
|
|
StdcostpriceApi.queryStdcostpriceByItemCode(param).then(res => { |
|
|
|
row['singlePrice'] = res.price |
|
|
|
val.forEach(item=>{ |
|
|
|
const itemCode = res.find(item1=>item1['itemCode']==item['itemCode']) |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
|
newRow[formField] = item[searchField] |
|
|
|
newRow['packingNumber'] = item['packingNumber'] |
|
|
|
newRow['batch'] = item['batch'] |
|
|
|
newRow['fromLocationCode'] = item['locationCode'] |
|
|
|
newRow['itemCode'] = item['itemCode'] |
|
|
|
newRow['uom'] = item['uom'] |
|
|
|
newRow['singlePrice'] = itemCode?itemCode['price']:'' |
|
|
|
tableData.value.push(newRow) |
|
|
|
}) |
|
|
|
// row['singlePrice'] = res.price |
|
|
|
}) |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|