| | |
| | | const titleUploadData = ref({ |
| | | reportingWorkId: null, |
| | | //流程卡号 |
| | | processId: '', |
| | | processId: null, |
| | | //销售单号 |
| | | orderId: '', |
| | | reviewedState:0, |
| | |
| | | |
| | | gridOptions.toolbarConfig.buttons.push(button) |
| | | } |
| | | getQuantity() |
| | | inputDisabled.value = true |
| | | }) |
| | | } |
| | |
| | | const getWork = () => { |
| | | |
| | | let processId = titleUploadData.value.processId |
| | | // if (processId.indexOf("/") < 0) { |
| | | // |
| | | // ElMessage.warning("请输入正确格式流程卡") |
| | | // return |
| | | // } |
| | | // let indexOfChar = processId.indexOf("/") |
| | | // let leftString = processId.slice(0, indexOfChar) |
| | | // if (leftString.length != 13) { |
| | | // ElMessage.warning("请输入正确位数的流程卡") |
| | | // return |
| | | // } |
| | | let parts = processId.split('/'); |
| | | |
| | | if (processId.indexOf("/") < 0 ||parts[1].trim() == '') { |
| | | ElMessage.warning("请输入正确格式流程卡") |
| | | return |
| | | } |
| | | let indexOfChar = processId.indexOf("/") |
| | | let leftString = processId.slice(0, indexOfChar) |
| | | if (leftString.length != 14) { |
| | | ElMessage.warning("请输入正确位数的流程卡") |
| | | return |
| | | } |
| | | //工序 |
| | | let process = titleUploadData.value.thisProcess |
| | | if (process == "" || process == null) { |
| | |
| | | |
| | | request.post(`/reportingWork/addSelectLastWork/${processIdStr}/${technologyStr}/${process}`).then((res) => { |
| | | if (res.code == 200) { |
| | | if(res.data.data===null){ |
| | | if(res.data.data==null){ |
| | | ElMessage.error("未查询到此流程卡数据") |
| | | return |
| | | } |
| | | |
| | | //表头赋值 |
| | | titleUploadData.value = res.data.data |
| | | titleUploadData.value.processId = processId |
| | |
| | | } |
| | | } |
| | | const getQuantity = () => { |
| | | titleUploadData.value.thisCompletedQuantity = 0 |
| | | titleUploadData.value.thisWornQuantity = 0 |
| | | const arr = xGrid.value.getTableData().fullData |
| | | const returnArr = arr.filter((obj, index, self) => |
| | | self.findIndex((t) => t.order_number === obj.order_number) === index |
| | |
| | | titleUploadData.value.thisWornQuantity = sumBreak |
| | | } |
| | | |
| | | const changeTable=()=>{ |
| | | const $grid = xGrid.value |
| | | this.$grid.commitProxy('data', yourData) |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="height: 100%;width: 100%"> |
| | | <div id="head" style="height: 5%;width: 100%;margin-bottom: 5px"> |
| | | <el-input :disabled="inputDisabled" v-if="titleUploadData.reportingWorkId" v-model="titleUploadData.reportingWorkId" placeholder="报工编号" style="width: 200px" /> |
| | | <el-input :disabled="inputDisabled" v-model="titleUploadData.processId" placeholder="流程卡号" style="width: 200px" @keyup.enter.native="getWork"/> |
| | | <el-input :disabled="inputDisabled" v-model="titleUploadData.processId" placeholder="流程卡号" style="width: 200px" @keyup.enter.native="getWork();getQuantity()"/> |
| | | |
| | | <el-select :disabled="inputDisabled" v-model="titleUploadData.thisProcess" clearable placeholder="请选择工序" style="width: 120px" |
| | | @change="getWork"> |
| | | @change="getWork();getQuantity()"> |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | |
| | | <el-text>{{$t('reportingWorks.deviceType')}}:</el-text> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <el-select v-model="titleUploadData.deviceName" clearable :placeholder="$t('reportingWorks.pleaseDevice')"> |
| | | <el-select @change="getQuantity" v-model="titleUploadData.deviceName" clearable :placeholder="$t('reportingWorks.pleaseDevice')"> |
| | | <el-option |
| | | v-for="item in titleSelectJson['deviceType']" |
| | | :key="item.id" |
| | |
| | | <el-text>{{$t('reportingWorks.teamsType')}}:</el-text> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <el-select v-model="titleUploadData.teamsGroupsName" clearable :placeholder="$t('reportingWorks.selectTeam')"> |
| | | <el-select v-model="titleUploadData.teamsGroupsName" clearable :placeholder="$t('reportingWorks.selectTeam')"> |
| | | <el-option |
| | | v-for="item in titleSelectJson['teamsType']" |
| | | :key="item.id" |