| | |
| | | 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 |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | craftObj.technologyNumber.push(...numberList.technologyNumber); |
| | | 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 |
| | | let process = row.process |
| | | const completed = ref() |
| | | const completedOk = ref() |
| | | //获取第一道工序完工数量 |
| | | request.post(`/processCard/selectCompleted/${processId}/${orderNumber}/${process}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | completed.value=res.data.data |
| | | completedOk.value = row.quantity*1 - completed.value*1 |
| | | //弹窗 |
| | | ElMessageBox.prompt( t('processCard.maxCompleted'), { |
| | | confirmButtonText: t('basicData.save'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | | inputPattern:/^(\d+|)$/, |
| | | inputErrorMessage: t('processCard.terminationMsg'), |
| | | inputValue:row.quantity |
| | | }).then(({ value }) => { |
| | | |
| | | request.post(`/processCard/updateTermination/${processId}/${orderNumber}/${value}`).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(res.msg) |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | //第一次加载 |
| | | |
| | | const {currentRoute} = useRouter() |
| | | const route = currentRoute.value |
| | | |
| | | let processId = route.query.processId |
| | | let merge = null |
| | | //第一次加载数据 |
| | | |
| | | request.post(`/processCard/flowCardDetail/${processId}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | merge = res.data.merge |
| | | if(merge != 0){ |
| | | gridOptions.toolbarConfig.buttons[0].name=t('processCard.cancelMerger') |
| | | } |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {title: t('basicData.operate'), width: 100, 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' }}, |
| | | {field: 'order_number', title: t('order.OrderNum') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 100}, |
| | | {field: 'technology_number', title: t('processCard.technologyNumber') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 100}, |
| | | {field: 'quantity', title: t('order.quantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 80}, |
| | | {field: 'termination_quantity', title: t('processCard.terminationQuantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 80}, |
| | | {field: 'child_width', title: t('order.width'),width: 80 }, |
| | | {field: 'child_height', title: t('order.height'),width: 80 }, |
| | | {field: 'area', title: t('order.area') ,showOverflow:"ellipsis",width: 70}, |
| | |
| | | {field: 'glass_child', title: t('reportingWorks.glassChild'),width: 200 }, |
| | | {field: 'founder', title: t('processCard.founder'),width: 110 }, |
| | | {field: 'splitFrame_time', title: t('processCard.splitFrameTime'),width: 110 }, |
| | | {field: 'concatNumber', title: '总序号',width: 110}, |
| | | {field: 'concatNumber', title: t('processCard.totalSequenceNumber'),width: 110}, |
| | | |
| | | ],//表头按钮 |
| | | |
| | |
| | | |
| | | }) |
| | | ElMessageBox.confirm( |
| | | "是否合并?", |
| | | t('processCard.msg.msg6'), |
| | | { |
| | | confirmButtonText: t('basicData.confirmButtonText'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | |
| | | type: 'warning', |
| | | } |
| | | ).then(()=>{ |
| | | request.post("/processCard/mergeFlowCard", flowData.value).then((res) => { |
| | | request.post(`/processCard/mergeFlowCard/${merge}`, flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({path: '/main/processCard/SelectProcessCard', query:{random:Math.random()}}) |
| | |
| | | <!--左边固定显示的插槽--> |
| | | <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">{{$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 }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="text" |
| | | v-model="option.data" |
| | | @keyup.enter.native="$panel.confirmFilter()" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </vxe-grid> |
| | | |
| | | <el-dialog id="processChange" |