Browse Source

发料申请 修改明细数据生产线工位不一致提示

master
陈薪名 12 months ago
parent
commit
bd3aab844a
  1. 25
      src/views/wms/issueManage/issue/issueRequestMain/index.vue
  2. 36
      src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts

25
src/views/wms/issueManage/issue/issueRequestMain/index.vue

@ -294,7 +294,13 @@ const tableData = ref([])
// //
const handleAddTable = () => { const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) // 线
let tableForm = JSON.parse(JSON.stringify(tableFormKeys))
if (tableData.value.length > 0) {
tableForm.productionLineCode = tableData.value[0].productionLineCode
tableForm.workStationCode = tableData.value[0].workStationCode
}
tableData.value.push(tableForm)
} }
// //
const handleDeleteTable = (item, index) => { const handleDeleteTable = (item, index) => {
@ -304,6 +310,23 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // data.subList = tableData.value //
// 线
if (tableData.value.length > 0) {
let productionLineCode = tableData.value[0].productionLineCode
let workStationCode = tableData.value[0].workStationCode
for(var i=0;i<tableData.value.length;i++) {
if(productionLineCode !== tableData.value[i].productionLineCode){
message.warning('子表数据:生产线存在不同数据,请修改成统一数据!')
formRef.value.formLoading = false
return;
}
if(workStationCode !== tableData.value[i].workStationCode){
message.warning('子表数据:工位存在不同数据,请修改成统一数据!')
formRef.value.formLoading = false
return;
}
}
}
try { try {
if (formType === 'create') { if (formType === 'create') {
await IssueRequestMainApi.createIssueRequestMain(data) await IssueRequestMainApi.createIssueRequestMain(data)

36
src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts

@ -34,24 +34,6 @@ const userDept = userStore.userSelfInfo.dept
* @returns {Array} * @returns {Array}
*/ */
export const IssueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([ export const IssueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
value: '1',
componentProps: {
disabled: true
}
}
},
{ {
label: '车间代码', label: '车间代码',
field: 'workshopCode', field: 'workshopCode',
@ -76,6 +58,24 @@ export const IssueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
value: '1',
componentProps: {
disabled: true
}
}
},
{ {
label: '从仓库代码', label: '从仓库代码',
field: 'fromWarehouseCode', field: 'fromWarehouseCode',

Loading…
Cancel
Save