| | |
| | | <div class="page-header"> |
| | | <div class="header-left"> |
| | | <a @click="$router.go(-1)"><i class="icon-btn-back"></i></a> |
| | | <h2>ç¼è¾-äº§åæ£éª</h2> |
| | | <h2>ç¼è¾-äº§åæ£éªå</h2> |
| | | </div> |
| | | <div class="btn-group header-right"> |
| | | <el-button @click="addTestProject">çææ£éªé¡¹ç®</el-button> |
| | | <el-button @click="addTestProject" v-if="processInspectVo.id==null">çææ£éªé¡¹ç®</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="page-main"> |
| | |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="订åå·ï¼"> |
| | | <el-input @blur="selectInfoByOrderId" v-model="processInspectVo.orderNumber" placeholder="请è¾å
¥è®¢åå·" autocomplete="off" /> |
| | | <el-input @blur="selectInfoByOrderId" :disabled="processInspectVo.id != null" |
| | | v-model="processInspectVo.orderNumber" placeholder="请è¾å
¥è®¢åå·" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="产ååç§°ï¼"> |
| | | <el-select style="width: 100%" @change="changeOptionsSamplename" |
| | | <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-col :span="6"> |
| | | <el-form-item label="æ°éï¼"> |
| | | <el-input v-model="processInspectVo.quantity" placeholder="请è¾å
¥æ°é" |
| | | autocomplete="off" /> |
| | | autocomplete="off" :disabled="processInspectVo.id != null" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form> |
| | | </div> |
| | | <div class="finishedProduct-detail"> |
| | | <el-row style="width:100%;z-index: 10;height:50px;"> |
| | | <el-row style="width:100%;z-index: 10;height:30px;"> |
| | | <el-col :span="12" class="inspectionProject_span">æ£éªé¡¹ç®</el-col> |
| | | <el-col :span="12" class="inspectionProject_span" style="text-align: right;"> |
| | | <el-button size="mini" @click="clickAddInspectionColumn()">æ·»å æ£éªå¼å</el-button> |
| | | <el-button size="mini" @click="clickDeleteInspectionColumn()">å 餿£éªå¼å</el-button> |
| | | <el-button size="mini" @click="clickAddInspectionColumn()">æ·»å æ£æµå¼å</el-button> |
| | | <el-button size="mini" @click="clickDeleteInspectionColumn()">å 餿£æµå¼å</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="width:100%;"> |
| | | <el-col :span="24"> |
| | | <el-table border :data="inspectionItems" max-height="400" height="calc(100vh - 550px)" |
| | | <el-table border :data="inspectionItems" height="400" |
| | | :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}" |
| | | :cell-style="{textAlign:'center'}" row-key="iid" |
| | | :cell-style="{textAlign:'center'}" row-key="iid" default-expand-all |
| | | style="width: 100%" ref="table" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> |
| | | <el-table-column type="index" label="åºå·" width="60"></el-table-column> |
| | | <el-table-column label="项ç®" prop="father"></el-table-column> |
| | | <el-table-column prop="iname" label="ææ "></el-table-column> |
| | | <el-table-column prop="iunit" label="åä½"></el-table-column> |
| | | <el-table-column prop="required" label="æ åå¼"></el-table-column> |
| | | <el-table-column label="项ç®" prop="father" width="240" ></el-table-column> |
| | | <el-table-column prop="iname" label="ææ " width="240" ></el-table-column> |
| | | <el-table-column prop="iunit" label="åä½" width="240" ></el-table-column> |
| | | <el-table-column prop="required" label="æ åå¼" width="240" ></el-table-column> |
| | | <el-table-column prop="inspectionValue" v-for="(item, index) in empiricalValueAdd" :key="index" label="æ£æµå¼" |
| | | min-width="100" style="text-align: center;"> |
| | | width="240" style="text-align: center;"> |
| | | <template slot-scope="scope"> |
| | | <el-tooltip :disabled="scope.row.dname != null" class="item" effect="dark" content="请å
éæ©è®¾å¤ï¼" |
| | | <el-tooltip v-if="scope.row.iname!=null" :disabled="scope.row.eId != null" |
| | | class="item" effect="dark" content="请å
éæ©è®¾å¤ï¼" |
| | | placement="top-start"> |
| | | <!-- <el-input :disabled="scope.row.dname === null" v-model="scope.row.empiricalValueAddss[index]" |
| | | @blur="changeState(scope.row, index)" placeholder="请è¾å
¥æ£æµå¼"></el-input> --> |
| | | <el-input :disabled="scope.row.eId == null" v-model="scope.row.empiricalValueAddss[index]" |
| | | @blur="changeState(scope.row, index)" placeholder="请è¾å
¥æ£æµå¼"></el-input> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="dname" label="è¯éªè®¾å¤" min-width="100"> |
| | | <el-table-column prop="deviceName" label="è¯éªè®¾å¤" min-width="250"> |
| | | <template slot-scope="scope"> |
| | | <el-button v-if="!scope.row.isSelectDevice" type="text" @click="clickTableSelect(scope)">{{ |
| | | scope.row.dname == null ? "è¯·éæ©" : scope.row.dname |
| | | }}</el-button> |
| | | <el-select v-if="scope.row.isSelectDevice" style="width: 100%;" @change="clickNodeSure(scope.row)" v-model="filterText" placeholder="è¯·éæ©"> |
| | | <el-option v-for="item in materialOptions" :key="item.id" :label="item.device" :value="item.id"> |
| | | </el-option> |
| | | <el-select style="width:100%" v-model="scope.row.eId" |
| | | v-if="scope.row.iname != null" filterable @change="updateDevice(scope.row)"> |
| | | <el-option v-for="(item,index) in deviceList" |
| | | :key="index" :value="item.id" :label="item.number +'-'+ item.name"></el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceName" label="è¯éªè®¾å¤" min-width="260"> |
| | | <template slot-scope="scope"> |
| | | <el-select style="width:100%" v-model="scope.row.equipmentId" filterable @change="updateDevice(scope.row)"> |
| | | <el-option v-for="(item,index) in deviceList" |
| | | :key="index" :value="item.id" :label="item.number +'-'+ item.name"></el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç»è®º" fixed="right" min-width="100"> |
| | | <template slot-scope="scope"> |
| | | <span style="color: #34BD66;" v-if="scope.row.result === 1">åæ ¼</span> |
| | | <span style="color: #E84738;" v-else-if="scope.row.result === 0">ä¸åæ ¼</span> |
| | | <span v-show="scope.row.result === null">ææªç»è®º</span> |
| | | <div v-if="scope.row.iname!=null"> |
| | | <span style="color: #34BD66;" v-if="scope.row.iresult == 1">åæ ¼</span> |
| | | <span style="color: #E84738;" v-else-if="scope.row.iresult == 0">ä¸åæ ¼</span> |
| | | <span v-else>ææ ç»è®º</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div class="finishedProduct-detail"> |
| | | <div class="finishedProduct-result"> |
| | | <el-row style="width:100%"> |
| | | <el-col :span="24">æ£æµç»æ</el-col> |
| | | </el-row> |
| | | <el-row style="width:100%;margin-top:-180px"> |
| | | <el-row style="width:100%;"> |
| | | <el-col :span="24"> |
| | | <el-table border max-height="400" :data="inspectionResultForm" |
| | | <el-table border height="90" :data="inspectionResultForm" |
| | | :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}" |
| | | :cell-style="{textAlign:'center'}"> |
| | | <el-table-column prop="id" label="ç©æç¼å·"></el-table-column> |
| | | <el-table-column prop="name" label="ç©æåç§°"></el-table-column> |
| | | <el-table-column prop="inspecter" label="æ£éªå"></el-table-column> |
| | | <el-table-column prop="conclusion" label="æ£éªç»è®º"></el-table-column> |
| | | <el-table-column prop="operation" label="䏿¥"></el-table-column> |
| | | <el-table-column prop="materialCode" label="ç©æç¼å·"></el-table-column> |
| | | <el-table-column prop="material" label="ç©æåç§°"></el-table-column> |
| | | <el-table-column prop="userName" label="æ£éªå"></el-table-column> |
| | | <el-table-column prop="result" label="æ£éªç»è®º"> |
| | | <template slot-scope="scope"> |
| | | <el-tag type="success" v-if="scope.row.result == 1">åæ ¼</el-tag> |
| | | <el-tag type="danger" v-else-if="scope.row.result == 0">ä¸åæ ¼</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½"> |
| | | <template> |
| | | <el-button type="text" @click="submitSave()" size="small">䏿¥</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | <el-dialog title="è¯·éæ©è®¾å¤" :visible.sync="centerDialogVisible" width="20%"> |
| | | <div class="div_device_dialog"> |
| | | <el-select style="width: 100%;" @change="clickNodeSure()" v-model="filterText" placeholder="è¯·éæ©"> |
| | | <el-option v-for="item in materialOptions" :key="item.id" :label="item.device" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { |
| | | chooseMater, |
| | | addFinish, |
| | | queryById, } from '@/api/quality/finishedProduct' |
| | | import { updateDeviceById,selectDevice } from '@/api/quality/rawMaterial' |
| | | queryById, |
| | | updateDeviceById, |
| | | updateFinishedInsProduct, |
| | | updateFinishedInspectById, |
| | | } from '@/api/quality/finishedProduct' |
| | | import { selectDevice } from '@/api/quality/rawMaterial' |
| | | export default { |
| | | data() { |
| | | return { |
| | | deviceList: [], |
| | | hasChildren: true, |
| | | showUp: false, |
| | | isAddProject: false, |
| | | showLook: false, |
| | | detailId: 0, |
| | | rowInfp: {}, |
| | | search: { |
| | | countSize: 10, |
| | | pageSize: 1, |
| | | result: "", // æ£æµç¶æ |
| | | name: "", // 产ååç§° |
| | | techfather: "" // å·¥åº |
| | | }, |
| | | optionsSamplename: [], |
| | | inspectionTable: [], |
| | | tableColumn: [], |
| | | optionSoptionSprocesses: [], |
| | | optionTechnology: [], |
| | | inspectionTableTotal: 0, |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | treeProject: [], |
| | | // æ·»å å |
| | | empiricalValueAdd: 1, |
| | | // ç¼è¾æ¶å卿é¿çåæ°åï¼åå é¤å¤æ |
| | | empiricalValueAddMaxNumber: 0, |
| | | showAddPage: false, |
| | | processInspectVo: { |
| | | id: null, |
| | | material: null, |
| | |
| | | unit: null, |
| | | technologyId: null |
| | | }, |
| | | InspectioniD: null, |
| | | addInspectionform: [ |
| | | { |
| | | number: "", |
| | | username: "", |
| | | projectname: "", |
| | | tracenumber: "", |
| | | code: "", |
| | | class: "", |
| | | specificationmodel: "", |
| | | unit: "", |
| | | quantity: "", |
| | | group: "", |
| | | worker: "", |
| | | machine: "" |
| | | }] |
| | | , |
| | | inspectionItems: [], // æ°å¢æ£éªé¡¹ç®è¡¨æ ¼ |
| | | inspectionResultForm: [ |
| | | { |
| | | id: "", |
| | | name: "", |
| | | inspecter: "", |
| | | conclusion: "", |
| | | operation: "" |
| | | } |
| | | ], |
| | | options: [], |
| | | value: "", |
| | | rowList: [], |
| | | spanArr: [], |
| | | position: 0, |
| | | // 设å¤éæ©æ æ¾ç¤º |
| | | centerDialogVisible: false, |
| | | filterText: "", |
| | | materialOptions: [], |
| | | defaultProps: { |
| | | // è®¾å¤æ æ°æ®è®¾ç½® |
| | | children: "children", |
| | | label: "name" |
| | | }, |
| | | nodeData: { |
| | | id: 0, |
| | | name: null |
| | | }, // nodeç¹å»ä¿åå½åç¹å»æ°æ® |
| | | clickSelectDevice: { |
| | | index: null, // ç¹å»éæ©åå¨å½åè¡ç´¢å¼ |
| | | rpId: null // ç¹å»éæ©åå¨å½åè¡é¡¹ç®Id |
| | | } |
| | | }; |
| | | inspectionResultForm: [], |
| | | } |
| | | }, |
| | | watch: { |
| | | }, |
| | |
| | | }, |
| | | mounted() { |
| | | this.getDeviceList() |
| | | this.processInspectVo.id = this.$route.query.id |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | submitSave(){ |
| | | let pro = 0 |
| | | this.inspectionItems.forEach(item => { |
| | | if(item.children){ |
| | | let arr = item.children.filter(obj=>{ |
| | | return obj.iresult == 0; |
| | | }) |
| | | console.log("aaa--",arr,arr.length) |
| | | pro+=arr.length |
| | | } |
| | | }) |
| | | if (pro > 0) { |
| | | this.$prompt('请è¾å
¥ä¸åæ ¼æ°é', 'ä¸åæ ¼æ°é', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | inputPattern: /^\d+$/, |
| | | inputErrorMessage: '请è¾å
¥æ£ç¡®æ°åæ ¼å¼' |
| | | }).then(({ value }) => { |
| | | let data = { |
| | | id: this.processInspectVo.id, |
| | | number: value |
| | | } |
| | | updateFinishedInspectById(data).then(res => { |
| | | this.$message.success("䏿¥æå"); |
| | | }); |
| | | }).catch(() => {}); |
| | | }else{ |
| | | updateFinishedInspectById({id:this.processInspectVo.id,number:0}).then(res => { |
| | | this.$message.success("䏿¥æå"); |
| | | }); |
| | | } |
| | | this.init() |
| | | }, |
| | | init(){ |
| | | let id = this.processInspectVo.id |
| | | if(id != null){ |
| | | queryById(id).then(res=>{ |
| | | let result = res.data.data |
| | | this.processInspectVo.orderNumber = result.orderNumber |
| | | this.processInspectVo.mcode = result.materialCode |
| | | this.processInspectVo.prname = result.customerName |
| | | this.processInspectVo.sname = result.projectName |
| | | this.processInspectVo.material = result.material |
| | | this.processInspectVo.specificationsModel = result.specs |
| | | this.processInspectVo.unit = result.punit |
| | | this.processInspectVo.quantity = result.quantity |
| | | let resultVal = 1 |
| | | let userList = [] |
| | | result.children.forEach(item=>{ |
| | | item.iid = Math.random() |
| | | if(item.children != undefined){ |
| | | item.children.forEach(obj=>{ |
| | | let arr = [] |
| | | if(obj.userName){ |
| | | userList.push(obj.userName) |
| | | } |
| | | if(obj.inspectionValue){ |
| | | arr = obj.inspectionValue.split(",") |
| | | } |
| | | if(obj.iresult && obj.iresult == 0){ |
| | | resultVal = 0 |
| | | } |
| | | obj.empiricalValueAddss = arr |
| | | if(arr.length > this.empiricalValueAdd){ |
| | | this.empiricalValueAdd = arr.length |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | this.inspectionItems = result.children |
| | | this.inspectionResultForm = [{ |
| | | materialCode: result.materialCode, |
| | | material: result.material, |
| | | userName: Array.from(new Set(userList)).join(","), |
| | | result: resultVal, |
| | | }] |
| | | }).catch(error=>{ |
| | | console.log(error) |
| | | }) |
| | | } |
| | | }, |
| | | getDeviceList(){ |
| | | selectDevice(null).then(res=>{ |
| | | this.deviceList = res.data.data |
| | | this.deviceList = res.data.data |
| | | }) |
| | | }, |
| | | updateDevice(row){ |
| | | if(this.dataForm.id != null){ |
| | | updateDeviceById({equiomentId:row.equipmentId,rpId:row.rpId}).then(res=>{ |
| | | updateDeviceById({equiomentId:row.eId,fpid:row.iId}).then(res=>{ |
| | | }).catch(error=>{ |
| | | console.log(error) |
| | | }) |
| | | } |
| | | }, |
| | | changeOptionsSamplename(val) { |
| | | let sample = this.optionsSamplename.filter(o => { |
| | |
| | | this.processInspectVo.specificationsModel = sample.specs |
| | | this.processInspectVo.unit = sample.unit |
| | | }, |
| | | handleClick(row) { |
| | | this.rowInfp = row |
| | | this.showLook = true |
| | | }, |
| | | updateInsInfo(row) { |
| | | this.rowInfp = row |
| | | this.showUp = true |
| | | }, |
| | | searchPro() { |
| | | this.search.countSize = this.pageSize |
| | | this.search.pageSize = this.currentPage |
| | | this.defaultInitializationTable() |
| | | }, |
| | | // ç¹å»è¡¨æ ¼éæ©è§¦å |
| | | clickTableSelect(scope) { |
| | | if(this.clickSelectDevice.index!=null){ |
| | | this.$set(this.inspectionItems[this.clickSelectDevice.index],'isSelectDevice',false) |
| | | } |
| | | this.clickSelectDevice.index = scope.$index; |
| | | this.clickSelectDevice.rpId = scope.row.id; |
| | | this.getOptions(scope.row); |
| | | }, |
| | | changeState(row, index) { |
| | | if (row.did != null && row.did != '') { |
| | | // let val = row.empiricalValueAddss.filter(item => { |
| | | // return item != '' && item != null |
| | | // }) |
| | | // let eq = val.filter(item => { |
| | | // return /^[^><=]/.test(item) |
| | | // }) |
| | | // if (eq.length > 0) { |
| | | // this.$message({ |
| | | // message: "æ£æµå¼[" + eq + "]æ ¼å¼é¦ä½åºå
å«>,<æè
=", |
| | | // type: 'warning' |
| | | // }); |
| | | // return |
| | | // } |
| | | if (row.iid != null && row.iid != '') { |
| | | let str = "" |
| | | row.empiricalValueAddss.forEach(e => { |
| | | str += e + "," |
| | | }) |
| | | if (str.slice(0, -1) === '' || str.slice(0, -1) === null || str.slice(0, -1) === undefined) { |
| | | str = str.slice(0,-1); |
| | | if (str === undefined || str === '' || str === null ) { |
| | | return |
| | | } |
| | | this.$axios.post(this.$api.url.inspectionItemlose_focus_update, { |
| | | deviceId: row.did, |
| | | inspectionItemId: row.id, |
| | | inspectionValue: str.slice(0, -1) |
| | | }, { |
| | | headers: { "Content-Type": "application/json" } |
| | | }).then(res => { |
| | | row.result = res.data.result |
| | | row.username = res.data.username |
| | | let obj = { |
| | | equiomentId: row.eId, |
| | | fpid: row.iid, |
| | | inspectionValue: str |
| | | } |
| | | updateFinishedInsProduct(obj).then(res=>{ |
| | | if(res.data.code == 0){ |
| | | this.$message.success("æ´æ°æå") |
| | | }else{ |
| | | this.$message.error("æ´æ°å¤±è´¥") |
| | | } |
| | | this.init() |
| | | }) |
| | | } else { |
| | | this.$message({ |
| | | message: 'è¯·éæ©æ©è®¾å¤ï¼', |
| | | type: 'warning' |
| | | }); |
| | | } |
| | | }, |
| | | addTestProject() { |
| | |
| | | let proList = response.data.data.children |
| | | proList.forEach(item=>{ |
| | | item.iid = Math.random(); |
| | | if(item.children != undefined){ |
| | | item.children.forEach(obj=>{ |
| | | obj.empiricalValueAddss = [] |
| | | }) |
| | | } |
| | | }) |
| | | this.inspectionItems = proList |
| | | }).catch(error=>{ |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // è¡¨æ ¼åå§åæ¥å£ |
| | | defaultInitializationTable() { |
| | | // this.$axios |
| | | // .post(this.$api.url.selectProcessInspectsList, this.search) |
| | | // .then(res => { |
| | | // this.inspectionTableTotal = res.data.total; |
| | | // this.inspectionTable = res.data.row; |
| | | // }); |
| | | }, |
| | | // æ·»å è¡ |
| | | clickAddLine() { |
| | | let obj = { |
| | | material: "", |
| | | materialCode: "", |
| | | orderNumber: "", |
| | | quantity: 0, |
| | | specificationsModel: "", |
| | | techfather: "", |
| | | techname: "", |
| | | technologyId: 0, |
| | | unit: "" |
| | | }; |
| | | this.inspectionItems.push(obj); |
| | | }, |
| | | // å é¤è¡ |
| | | clickDeleteline(scope) { |
| | | this.inspectionItems.splice(scope.$index, 1); |
| | | }, |
| | | // å 餿£éªå¼å |
| | | clickDeleteInspectionColumn() { |
| | | if (this.empiricalValueAdd - 1 === 0) { |
| | |
| | | if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) { |
| | | this.empiricalValueAdd = this.empiricalValueAdd - 1; |
| | | this.inspectionItems.forEach(i => { |
| | | i.testValueList.splice(this.empiricalValueAdd, 1); |
| | | i.empiricalValueAddss.splice(this.empiricalValueAdd, 1); |
| | | }); |
| | | } |
| | | } |
| | |
| | | <style scoped> |
| | | .finishedProduct-detail { |
| | | width: 100%; |
| | | height: 460px; |
| | | height: 470px; |
| | | padding: 10px 20px; |
| | | display: flex; |
| | | border: 1px solid #ddd; |
| | | background-color: #fff; |
| | | margin-top: 10px; |
| | | box-sizing: border-box; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .finishedProduct-result { |
| | | width: 100%; |
| | | height: 150px; |
| | | padding: 10px 20px; |
| | | display: flex; |
| | | border: 1px solid #ddd; |