| | |
| | | <div class="formwrapper"> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="过程检验编号:"> |
| | | <el-input @blur="selectInfoByOrderId" disabled |
| | | v-model="processInspectVo.proInsNo" autocomplete="off" /> |
| | | <el-form-item label="过程检验编号"> |
| | | <el-input disabled |
| | | v-model="processInspectVo.proInsNo" placeholder="过程检验编号" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="订单号:" prop="orderNumber"> |
| | | <el-form-item label="车间订单号" prop="moNumber"> |
| | | <el-input @blur="selectInfoByOrderId" :disabled="processInspectVo.id != null" |
| | | v-model="processInspectVo.orderNumber" placeholder="请输入订单号" autocomplete="off" /> |
| | | v-model="processInspectVo.moNumber" placeholder="请输入车间订单号" autocomplete="off" > |
| | | <el-button |
| | | slot="append" |
| | | icon="el-icon-full-screen" |
| | | :disabled="resultVal!=null" |
| | | @click="Turnonthecamera"></el-button> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="产品名称:"> |
| | | <el-form-item label="销售订单号" prop="orderNumber"> |
| | | <el-input disabled |
| | | v-model="processInspectVo.orderNumber" placeholder="销售订单号" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="产品名称"> |
| | | <el-tooltip class="item" effect="dark" :content="processInspectVo.material"> |
| | | <el-select style="width: 100%" @change="changeOptionsSamplename" |
| | | :disabled="processInspectVo.id != null" v-model="processInspectVo.material" |
| | | size="small" placeholder="请选择产品名称"> |
| | | <el-option v-for="(item, index) in optionsSamplename" :key="index" |
| | | :label="item.material" :value="item.materialCode"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input v-model="processInspectVo.material" disabled placeholder="产品名称"></el-input> |
| | | </el-tooltip> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="产品编号:"> |
| | | <el-input disabled v-model="processInspectVo.materialCode" placeholder="请输入产品编号" |
| | | autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="规格型号:"> |
| | | <el-form-item label="产品编号"> |
| | | <el-input disabled v-model="processInspectVo.materialCode" placeholder="产品编号" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="规格型号"> |
| | | <el-tooltip class="item" effect="dark" :content="processInspectVo.specs"> |
| | | <el-input disabled v-model="processInspectVo.specs" |
| | | autocomplete="off" /> |
| | | <el-input disabled v-model="processInspectVo.specs" placeholder="规格型号" autocomplete="off" /> |
| | | </el-tooltip> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="6"> |
| | | <el-form-item label="工序名称"> |
| | | <el-form-item label="工单" prop="operationTaskId"> |
| | | <el-select style="width: 100%" :disabled="processInspectVo.id != null" |
| | | v-model="processInspectVo.technologyOperationId" size="small" placeholder="请选择工序"> |
| | | <el-option v-for="(item, index) in technologyList" :key="index" :label="item.name" |
| | | :value="item.technologyOperationId"> |
| | | v-model="processInspectVo.operationTaskId" size="small" placeholder="请选择工单"> |
| | | <el-option v-for="(item, index) in technologyList" :key="index" :label="item.name+'-'+item.optaskNo" |
| | | :value="item.operationTaskId"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="单位:"> |
| | | <el-input disabled v-model="processInspectVo.unit" placeholder="请输入单位" |
| | | autocomplete="off" /> |
| | | <el-form-item label="单位"> |
| | | <el-input disabled v-model="processInspectVo.unit" placeholder="单位" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="客户名称" prop="customerName"> |
| | | <el-input v-model="processInspectVo.customerName" placeholder="客户名称" autocomplete="off" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="数量:"> |
| | | <el-form-item label="工程名称" prop="projectName"> |
| | | <el-input v-model="processInspectVo.projectName" placeholder="工程名称" autocomplete="off" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="数量" prop="quantity"> |
| | | <el-input v-model="processInspectVo.quantity" placeholder="请输入数量" autocomplete="off" |
| | | :disabled="processInspectVo.id != null" /> |
| | | </el-form-item> |
| | |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | title="扫描" |
| | | :visible.sync="qrcode" |
| | | width="60%"> |
| | | <div style="height: 100vh;width: 100%;"> |
| | | <qr-code-app ref="codeCompont" @ok="getResultInfo" @cancelCodeDialog="cancelCodeDialog"></qr-code-app> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="qrcode = false">取 消</el-button> |
| | | <el-button type="primary" @click="qrcode = false">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="设备扫描" |
| | | :visible.sync="deviceCode" |
| | | width="60%"> |
| | |
| | | } from '@/api/quality/processInspect' |
| | | import { selectDevice } from '@/api/quality/processInspect' |
| | | import qrCodeApp from '@/views/common/qrCodeApp' |
| | | import { validatePositiveInteger } from '@/util/validate' |
| | | export default { |
| | | components:{ |
| | | qrCodeApp |
| | | }, |
| | | data() { |
| | | return { |
| | | qrcode: false, |
| | | row: null, |
| | | proIndex: 0, |
| | | deviceCode: false, |
| | | rules: { |
| | | orderNumber: [{required:true,message:'订单号不能为空',trigger:'blur'}] |
| | | moNumber: [{required:true,message:'车间订单号不能为空',trigger:'blur'}], |
| | | quantity: [{required:true,validator: validatePositiveInteger,trigger:'blur'}], |
| | | operationTaskId: [{required:true,message: '请选择工单',trigger:'change'}], |
| | | }, |
| | | dataVal: [{ |
| | | label: '是', |
| | |
| | | empiricalValueAddMaxNumber: 0, |
| | | processInspectVo: { |
| | | id: null, |
| | | moNumber: null, |
| | | proInsNo: null, |
| | | material: null, |
| | | materialCode: null, |
| | |
| | | quantity: null, |
| | | specs: null, |
| | | unit: null, |
| | | technologyOperationId: null |
| | | operationTaskId: null, |
| | | customerName: null, |
| | | projectName: null |
| | | }, |
| | | inspectionItems: [], // 新增检验项目表格 |
| | | inspectionResultForm: [], |
| | |
| | | let val = sessionStorage.getItem("process-resultVal-" + this.processInspectVo.id); |
| | | val == undefined ? this.resultVal = null : this.resultVal = val |
| | | } |
| | | console.log(this.resultVal); |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | cancelCodeDialog(){ |
| | | this.qrcode = false |
| | | }, |
| | | getResultInfo(data){ |
| | | if(!data.includes("moNo")){ |
| | | this.$message.warning('未识别出车间订单号信息!'); |
| | | } |
| | | let obj=JSON.parse(data) |
| | | let info={"code":obj["moNo"]} |
| | | if(info.code){ |
| | | this.processInspectVo.moNumber = obj["moNo"] |
| | | this.selectInfoByOrderId() |
| | | }else{ |
| | | this.$message.warning('未识别出车间订单号信息!'); |
| | | } |
| | | }, |
| | | // 打开相机 |
| | | Turnonthecamera() { |
| | | this.qrcode = true |
| | | this.$refs.codeCompont.openCamera() |
| | | }, |
| | | cancelDeviceCodeDialog(){ |
| | | this.deviceCode = false |
| | | }, |
| | | getDeviceResultInfo(val){ |
| | | console.log("扫描后数据",val); |
| | | let id=val.split("id@")[1] |
| | | if(id!=undefined&&id!=''&&id!=null){ |
| | | let filterData=this.deviceList.filter(item=>{ |
| | | return item.id==id |
| | | })[0] |
| | | console.log(filterData); |
| | | this.row.eId=Number(id) |
| | | this.updateDevice(this.row) |
| | | }else{ |
| | | this.$message({ |
| | | message: '未识别出二位码计量器具信息!', |
| | | message: '未识别出计量器具信息!', |
| | | type: 'warning' |
| | | }); |
| | | } |
| | | }, |
| | | codeDevice(row,index){ |
| | | this.row=row |
| | | console.log("row",row); |
| | | this.deviceCode =true |
| | | this.$refs.codeDeviceCompont.openCamera() |
| | | this.proIndex=index |
| | |
| | | if (id != null) { |
| | | queryById(id).then(res => { |
| | | let result = res.data.data |
| | | this.processInspectVo.moNumber = result.moNumber |
| | | this.processInspectVo.operationTaskId = result.technologyOperationName |
| | | this.processInspectVo.proInsNo = result.proInsNo |
| | | this.processInspectVo.projectName = result.projectName |
| | | this.processInspectVo.customerName = result.customerName |
| | | this.processInspectVo.orderNumber = result.orderNumber |
| | | this.processInspectVo.materialCode = result.materialCode |
| | | this.processInspectVo.material = result.material |
| | | this.processInspectVo.technologyOperationId = result.technologyOperationName |
| | | this.processInspectVo.specs = result.specs |
| | | this.processInspectVo.unit = result.punit |
| | | this.processInspectVo.quantity = result.quantity |
| | |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | //产品名称,选择 |
| | | changeOptionsSamplename(val) { |
| | | let sample = this.optionsSamplename.filter(o => { |
| | | return o.materialCode == val |
| | | })[0] |
| | | this.processInspectVo.materialCode = sample.materialCode |
| | | this.processInspectVo.specs = sample.specs |
| | | this.processInspectVo.unit = sample.unit |
| | | this.processInspectVo.material = sample.material |
| | | this.technologyList = sample.children |
| | | }, |
| | | changeState(row,isChecked) { |
| | | const _than = this |
| | | if(isChecked){ |
| | |
| | | addTestProject() { |
| | | let val = this.processInspectVo |
| | | const _than = this |
| | | this.$refs.addInspectionform.validate(valid=>{ |
| | | if(valid){ |
| | | addProcess(val).then(res => { |
| | | let id = res.data.data |
| | | if (id != null) { |
| | |
| | | }).catch(error => { |
| | | console.log(error) |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | selectInfoByOrderId() { |
| | | this.$refs.addInspectionform.validate(valid=>{ |
| | | if(valid){ |
| | | if(this.processInspectVo.moNumber){ |
| | | chooseMater({ |
| | | orderNumber: this.processInspectVo.orderNumber |
| | | moNo: this.processInspectVo.moNumber |
| | | }).then(res => { |
| | | if (res.data.data != null) { |
| | | this.optionsSamplename = res.data.data.children |
| | | let data = res.data.data |
| | | if (data) { |
| | | this.technologyList = data.children |
| | | this.processInspectVo.materialCode = data.materialCode |
| | | this.processInspectVo.orderNumber = data.orderNumber |
| | | this.processInspectVo.projectName = data.projectName |
| | | this.processInspectVo.customerName = data.customerName |
| | | this.processInspectVo.material = data.material |
| | | this.processInspectVo.specs = data.specs |
| | | this.processInspectVo.unit = data.unit |
| | | } else { |
| | | this.$message({ |
| | | message: '没有该订单号!', |
| | | type: 'warning' |
| | | }); |
| | | this.optionsSamplename = [] |
| | | this.$message.warning('没有该车间订单号!'); |
| | | this.technologyList = [] |
| | | this.processInspectVo.materialCode = null |
| | | this.processInspectVo.orderNumber = null |
| | | this.processInspectVo.material = null |
| | | this.processInspectVo.specs = null |
| | | this.processInspectVo.unit = null |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | changeRowResult(){ |
| | | if(this.inspectionItems){ |