diff --git a/src/api/mes/workScheduling/index.ts b/src/api/mes/workScheduling/index.ts index 14e42d6..b3773b0 100644 --- a/src/api/mes/workScheduling/index.ts +++ b/src/api/mes/workScheduling/index.ts @@ -79,8 +79,12 @@ export function completeHandle(data) { } //叫料 -export function callBasicItem(data) { - return http.get('/mes/orderDayBom/page', {data}) +export function callBasicItem(params) { + return http.get('/mes/orderDayBom/page', {params}) +} +export function callBasicItemForm(params) { + console.log(params) + return http.post('/mes/item-request-main/create-call-material', params) } //领料 diff --git a/src/pages/mes/workScheduling/callMaterial.vue b/src/pages/mes/workScheduling/callMaterial.vue index 3590519..2a309ed 100644 --- a/src/pages/mes/workScheduling/callMaterial.vue +++ b/src/pages/mes/workScheduling/callMaterial.vue @@ -15,7 +15,7 @@ 物料号:{{ item.repMaterialCode }} - 数量:{{ item.srcMaterialCounts * planCountStr }} + 计划数量:{{ item.srcMaterialCounts * planCountStr }} @@ -54,6 +54,7 @@ const workingNodeStr = ref('') const planMasterCodeStr = ref('') const schedulingCodeStr = ref('') const planCountStr = ref('') +const workroomCodeStr = ref('') const list = ref([]) @@ -65,7 +66,12 @@ const params = ref({ pageNo: 1, pageSize: 10, planDayCode: '', - processCode: '' + processCode: '', + remark:'' +}) + +const param = ref({ + remark:'' }) function getBomInspectList() { @@ -89,7 +95,25 @@ function getBomInspectList() { } function submitCMForm () { - console.log(list) + for (var i = 0; i < list.value.length; i++) { + console.log(list.value[i].repMaterialCode+":"+list.value[i].totalMaterialCounts); + list.value[i].schedulingCode = schedulingCodeStr.value + list.value[i].workroomCode= workroomCodeStr.value + if(/^\d+$/.test(list.value[i].totalMaterialCounts)){ + console.log(/^\d+$/.test(list.value[i].totalMaterialCounts)) + }else{ + proxy.$modal.alert("叫料数量请输入正确的数字"); + return + } + if( parseInt(list.value[i].totalMaterialCounts) > parseInt(list.value[i].srcMaterialCounts * planCountStr.value)){ + proxy.$modal.alert("叫料数量不能大于计划数量"); + return + } + } + param.value.remark = JSON.stringify(list.value) + workSchedulingListApi.callBasicItemForm(param.value).then((res) => { + console.log(res) + }) } //滑动到底部展示 @@ -101,12 +125,12 @@ onReachBottom(() => { onLoad((option) => { - console.log(JSON.parse(option.obj)) if (option.obj) { schedulingCodeStr.value = JSON.parse(option.obj).schedulingCode workingNodeStr.value = JSON.parse(option.obj).workingNode planMasterCodeStr.value = JSON.parse(option.obj).planMasterCode planCountStr.value = JSON.parse(option.obj).planCount + workroomCodeStr.value = JSON.parse(option.obj).workroomCode } }) onShow(() => {