|
|
@ -81,6 +81,7 @@ import { ProductionMain,ProductionMainRules,ProductionDetail,ProductionDetailRul |
|
|
|
import * as ProductionMainApi from '@/api/wms/productionMain' |
|
|
|
import * as ProductionDetailApi from '@/api/wms/productionDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import * as ItemBasicApi from '@/api/wms/itembasic' |
|
|
|
|
|
|
|
// 生产计划主 |
|
|
|
defineOptions({ name: 'ProductionMain' }) |
|
|
@ -100,21 +101,47 @@ const updataTableColumns = (val) => { |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
|
nextTick(() => { |
|
|
|
nextTick(async() => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
|
await ItemBasicApi.getItembasicPage({ |
|
|
|
code: row['itemCode'] |
|
|
|
}).then(res => { |
|
|
|
row['uom'] = res?.list[0].uom |
|
|
|
}).catch(err =>{ |
|
|
|
console.log(err); |
|
|
|
}) |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
if(formField == 'workshop'){ |
|
|
|
setV['workshop'] = val[0]['code'] |
|
|
|
setV['productionLine'] = '' |
|
|
|
if(tableData.value){ |
|
|
|
tableData.value.forEach(item => { |
|
|
|
item.itemCode ='' |
|
|
|
item.bomVersion = '' |
|
|
|
item.uom = '' |
|
|
|
}) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
} |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// 查询页面返回——详情 |
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
|
nextTick(() => { |
|
|
|
nextTick(async() => { |
|
|
|
const setV = {} |
|
|
|
await ItemBasicApi.getItembasicPage({ |
|
|
|
code: setV['itemCode'] |
|
|
|
}).then(res => { |
|
|
|
setV['uom'] = res.list[0].uom |
|
|
|
}).catch(err =>{ |
|
|
|
console.log(err); |
|
|
|
}) |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
}) |
|
|
|