| | |
| | | import {VXETable} from "vxe-table"; |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import {useI18n} from "vue-i18n"; |
| | | import { computed } from 'vue' |
| | | import UpdateOrderCraft from "@/components/sd/order/UpdateOrderCraft.vue"; |
| | | import {filterChanged} from "@/hook"; |
| | | let productGlassTypeStore = useProductGlassTypeStore() |
| | |
| | | const saveCraft = () => { |
| | | //rowIndex.value.process = craftObj.newCraft.join('->') |
| | | let orderProcess= craftObj.newCraft.join('->') |
| | | request.post(`/processCard/updateProcess/${rowIndex.value.process_id}/${rowIndex.value.technology_number}/${rowIndex.value.order_id}/${orderProcess}`, craftObj).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({ |
| | | path: '/main/processCard/SelectDetailProcessCard', |
| | | query: {processId: processId,random: Math.random()} |
| | | }) |
| | | } else { |
| | | //获取差异工序 |
| | | const diffCraft = computed(() => { |
| | | return [ |
| | | ...craftObj.oldCraft.filter(item => !craftObj.newCraft.includes(item)), //删除 |
| | | ...craftObj.newCraft.filter(item => !craftObj.oldCraft.includes(item))//增加 |
| | | ] |
| | | }) |
| | | if (diffCraft.value == '') {//无变化不执行后续 |
| | | return |
| | | } |
| | | //获取最新报工工序的顺序 |
| | | request.post(`/processCard/getNewProcess/${rowIndex.value.process_id}/${rowIndex.value.order_number}/${rowIndex.value.technology_number}/${diffCraft.value}`).then((res) => { |
| | | if (res.code == 200 ) { |
| | | if (res.data){ |
| | | request.post(`/processCard/updateProcess/${rowIndex.value.process_id}/${rowIndex.value.order_number}/${rowIndex.value.technology_number}/${rowIndex.value.order_id}/${orderProcess}`, craftObj).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({ |
| | | path: '/main/processCard/SelectDetailProcessCard', |
| | | query: {processId: processId,random: Math.random()} |
| | | }) |
| | | } else { |
| | | |
| | | ElMessage.warning('保存失败,检查是否报工') |
| | | ElMessage.warning(t('processCard.updateProcessMsg')) |
| | | |
| | | } |
| | | }) |
| | | craftVisible.value= false |
| | | }else { |
| | | ElMessage.warning(t('processCard.updateProcessMsg')) |
| | | } |
| | | } |
| | | }) |
| | | craftVisible.value= false |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | rowIndex.value = row |
| | | } |
| | | |
| | | const updateTerminationNo = (row) => { |
| | | let processId = row.process_id |
| | | let orderNumber = row.order_number |
| | | request.post(`/processCard/updateTerminationNo/${processId}/${orderNumber}`).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({ |
| | | path: '/main/processCard/SelectDetailProcessCard', |
| | | query: {processId: processId,random: Math.random()} |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const updateTermination = (row) => { |
| | | let processId = row.process_id |
| | | let orderNumber = row.order_number |
| | |
| | | completed.value=res.data.data |
| | | completedOk.value = row.quantity*1 - completed.value*1 |
| | | //弹窗 |
| | | ElMessageBox.prompt( t('processCard.maxCompleted')+completed.value, { |
| | | ElMessageBox.prompt( t('processCard.maxCompleted'), { |
| | | confirmButtonText: t('basicData.save'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | | inputPattern:/^(\d+|)$/, |
| | | inputErrorMessage: t('processCard.terminationMsg'), |
| | | inputValue:row.quantity |
| | | }).then(({ value }) => { |
| | | if (completedOk.value < value ) { |
| | | ElMessage.warning(t('processCard.terminationMsg')) |
| | | return |
| | | } |
| | | |
| | | request.post(`/processCard/updateTermination/${processId}/${orderNumber}/${value}`).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {title: t('basicData.operate'), width: 120, slots: { default: 'button_slot' },fixed:"left",}, |
| | | {title: t('basicData.operate'), width: 200, slots: { default: 'button_slot' },fixed:"left",}, |
| | | { type: 'seq',fixed:"left", title: t('basicData.Number'), width: 50 }, |
| | | {field: 'order_id', title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 110 }, |
| | | {field: 'process_id', width: 140, title: t('processCard.processId') ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | |
| | | |
| | | }) |
| | | ElMessageBox.confirm( |
| | | "是否合并?", |
| | | t('processCard.msg.msg6'), |
| | | { |
| | | confirmButtonText: t('basicData.confirmButtonText'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="updateCraft(row)" link type="primary" size="small">{{$t('craft.updateCraft')}}</el-button> |
| | | <el-button @click="updateTermination(row)" link type="primary" size="small">终止</el-button> |
| | | <el-button @click="updateTermination(row)" link type="primary" size="small">{{$t('processCard.termination')}}</el-button> |
| | | <el-button @click="updateTerminationNo(row)" link type="primary" size="small">{{$t('processCard.terminationNo')}}</el-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |