| | |
| | | <el-tab-pane label="检验项目"> |
| | | <el-row> |
| | | <el-col v-if="resultVal==null" :span="24" class="inspectionProject_span" style="text-align: right;"> |
| | | <el-button size="small" |
| | | type="primary" |
| | | @click="saveTable()">保存</el-button> |
| | | <el-button size="mini" @click="clickAddInspectionColumn()">添加检测值列</el-button> |
| | | <el-button size="mini" @click="clickDeleteInspectionColumn()">删除检测值列</el-button> |
| | | </el-col> |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="附件"> |
| | | <el-table :data="configFileTableData" height="400px"> |
| | | <el-table-column |
| | | prop="orderNumber" |
| | | align="center" |
| | | label="订单号" |
| | | show-overflow-tooltip |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="originalFileName" |
| | | align="center" |
| | | label="原文件名" |
| | | width="200" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column prop="fileName" align="center" label="文件后缀"> |
| | | </el-table-column> |
| | | <el-table-column prop="createUser" align="center" label="上传人"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="createTime" |
| | | align="center" |
| | | label="上传时间" |
| | | show-overflow-tooltip |
| | | > |
| | | </el-table-column> |
| | | <el-table-column prop="updateUser" align="center" label="更新人"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="updateTime" |
| | | align="center" |
| | | label="更新时间" |
| | | show-overflow-tooltip |
| | | > |
| | | </el-table-column> |
| | | <el-table-column fixed="right" align="center" label="操作"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | @click="downloadProcessConfigFiles(scope.row)" |
| | | type="text" |
| | | size="small" |
| | | >下载</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | |
| | | </div> |
| | |
| | | queryById, |
| | | updateDeviceById, |
| | | updateFinishedInsProduct, |
| | | updateFinishedInsProduct2, |
| | | updateFinishedInspectById, |
| | | selectDeviceAPI, |
| | | updateLocationIdById, |
| | |
| | | import { getIfsLocationByGroupCopyAll } from '@/api/warehouse/location' |
| | | import qrCodeApp from '@/views/common/qrCodeApp' |
| | | import { getStore } from '@/util/store' |
| | | import { getProcessConfigFile } from '@/api/plan/manufacturingorder' |
| | | import * as customerorder from '@/api/plan/customerorder' |
| | | export default { |
| | | components:{ |
| | | qrCodeApp |
| | | }, |
| | | data() { |
| | | return { |
| | | dataForm:null, |
| | | progrecessFileLoading: false, |
| | | processConfigFileTableData: [], |
| | | headers: { |
| | |
| | | }, |
| | | inspectionItems: [], // 新增检验项目表格 |
| | | inspectionResultForm: [], |
| | | configFileTableData:[] |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | getProcessConfigFile(){ |
| | | getProcessConfigFile({ |
| | | orderNumber: this.dataForm.orderNumber, |
| | | lineNumber: this.dataForm.customerNo |
| | | }).then((res)=>{ |
| | | this.configFileTableData = res.data.data |
| | | }) |
| | | }, |
| | | downloadProcessConfigFiles(row){ |
| | | customerorder.downloadProcessConfigFile( |
| | | row.fileName, |
| | | row.bucketName, |
| | | row.originalFileName |
| | | ) |
| | | }, |
| | | saveTable(){ |
| | | let finishedInsProducts = []; |
| | | if(this.inspectionItems.length>0){ |
| | | this.inspectionItems.forEach(item=>{ |
| | | if(item.children!=null&&item.children.length>0){ |
| | | item.children.forEach(item2=>{ |
| | | let obj = {}; |
| | | obj.id = item2.iid; |
| | | obj.note = item2.inote; |
| | | obj.required = item2.required; |
| | | obj.inspectionValue = item2.empiricalValueAddss.join(','); |
| | | obj.deviceId = item2.eId; |
| | | finishedInsProducts.push(obj); |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if(finishedInsProducts.length>0){ |
| | | updateFinishedInsProduct2(finishedInsProducts).then(res=>{ |
| | | if(res.data.code == 0){ |
| | | this.$message.success("更新成功") |
| | | }else{ |
| | | this.$message.error("更新失败") |
| | | } |
| | | this.init() |
| | | }) |
| | | } |
| | | }, |
| | | delProcessConfigFile(row) { |
| | | this.$confirm('是否删除该附件', '提示', { |
| | | confirmButtonText: '确定', |
| | |
| | | result: this.inspectionResultForm[0].result |
| | | } |
| | | if (pro > 0) { |
| | | this.$prompt('请输入不合格数量', '不合格数量', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | inputPattern: /^\d+$/, |
| | | inputErrorMessage: '请输入正确数字格式' |
| | | }).then(({ value }) => { |
| | | obj.number = value |
| | | updateFinishedInspectById(obj).then(res => { |
| | | if(res.data.data.indexOf("成功") > 0){ |
| | | this.$message.success("上报成功"); |
| | | this.checkTestState() |
| | | }else{ |
| | | this.$message.warning(res.data.data) |
| | | } |
| | | }); |
| | | }).catch(() => {}); |
| | | obj.number = 1; |
| | | updateFinishedInspectById(obj).then(res => { |
| | | if(res.data.data.indexOf("成功") > 0){ |
| | | this.$message.success("上报成功"); |
| | | this.checkTestState() |
| | | }else{ |
| | | this.$message.warning(res.data.data) |
| | | } |
| | | }); |
| | | // this.$prompt('请输入不合格数量', '不合格数量', { |
| | | // confirmButtonText: '确定', |
| | | // cancelButtonText: '取消', |
| | | // inputPattern: /^\d+$/, |
| | | // inputErrorMessage: '请输入正确数字格式' |
| | | // }).then(({ value }) => { |
| | | // obj.number = value |
| | | // updateFinishedInspectById(obj).then(res => { |
| | | // if(res.data.data.indexOf("成功") > 0){ |
| | | // this.$message.success("上报成功"); |
| | | // this.checkTestState() |
| | | // }else{ |
| | | // this.$message.warning(res.data.data) |
| | | // } |
| | | // }); |
| | | // }).catch(() => {}); |
| | | }else{ |
| | | updateFinishedInspectById(obj).then(res => { |
| | | if(res.data.data.indexOf("成功") > 0){ |
| | |
| | | if(id != null){ |
| | | queryById(id).then(res=>{ |
| | | let result = res.data.data |
| | | this.dataForm = result |
| | | this.processInspectVo.finInsNo = result.finInsNo |
| | | this.processInspectVo.orderNumber = result.orderNumber |
| | | this.processInspectVo.mcode = result.materialCode |
| | |
| | | if(obj.inspectionValue){ |
| | | arr = obj.inspectionValue.split(",") |
| | | } |
| | | obj.empiricalValueAddss = arr |
| | | this.$set(obj,'empiricalValueAddss',arr) |
| | | // obj.empiricalValueAddss = arr |
| | | if(obj.note){ |
| | | snote=obj.inote |
| | | } |
| | |
| | | userName: Array.from(new Set(userList)).join(","), |
| | | result: this.resultVal==null ? rVal : this.resultVal, |
| | | }] |
| | | this.getProcessConfigFile() |
| | | }).catch(error=>{ |
| | | console.error(error) |
| | | }) |
| | |
| | | if (str === undefined || str === '' || str === null ) { |
| | | return |
| | | } |
| | | let obj = { |
| | | deviceId: row.eId, |
| | | fpid: row.iid, |
| | | inspectionValue: str, |
| | | note : row.inote |
| | | } |
| | | updateFinishedInsProduct(obj).then(res=>{ |
| | | if(res.data.code == 0){ |
| | | this.$message.success("更新成功") |
| | | }else{ |
| | | this.$message.error("更新失败") |
| | | } |
| | | this.init() |
| | | }) |
| | | // let obj = { |
| | | // deviceId: row.eId, |
| | | // fpid: row.iid, |
| | | // inspectionValue: str, |
| | | // note : row.inote |
| | | // } |
| | | // updateFinishedInsProduct(obj).then(res=>{ |
| | | // if(res.data.code == 0){ |
| | | // this.$message.success("更新成功") |
| | | // }else{ |
| | | // this.$message.error("更新失败") |
| | | // } |
| | | // this.init() |
| | | // }) |
| | | } |
| | | }, |
| | | addTestProject() { |
| | |
| | | } else { |
| | | if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) { |
| | | this.empiricalValueAdd = this.empiricalValueAdd - 1; |
| | | this.changeRowResult() |
| | | // this.changeRowResult() |
| | | this.inspectionItems.forEach(i => { |
| | | i.empiricalValueAddss.splice(this.empiricalValueAdd, 1); |
| | | }); |
| | | this.saveTable() |
| | | } |
| | | } |
| | | }, |