ÎļþÃû´Ó src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue ÐÞ¸Ä |
| | |
| | | <div class="page-header"> |
| | | <div class="header-left"> |
| | | <a @click="$router.go(-1)"><i class="icon-btn-back"></i></a> |
| | | <h2>ç¼è¾-äº§åæ£éªå</h2> |
| | | <h2 v-if="resultVal!=null && processInspectVo.id!=null">æ¥ç-äº§åæ£éªå</h2> |
| | | <h2 v-else>ç¼è¾-äº§åæ£éªå</h2> |
| | | </div> |
| | | <div class="btn-group header-right"> |
| | | <el-button @click="addTestProject" v-if="processInspectVo.id==null">çææ£éªé¡¹ç®</el-button> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="è´¨é追溯å·ï¼"> |
| | | <el-input disabled v-model="processInspectVo.qualityTraceability" |
| | | placeholder="请è¾å
¥è´¨é追溯å·" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="产ååç§°ï¼"> |
| | | <el-select style="width: 100%" @change="changeOptionsSamplename" :disabled="processInspectVo.id != null" |
| | | v-model="processInspectVo.material" size="small" placeholder="è¯·éæ©äº§ååç§°"> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="产åç¼ç ï¼"> |
| | | <el-input disabled v-model="processInspectVo.mcode" |
| | |
| | | placeholder="请è¾å
¥åä½" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="æ°éï¼"> |
| | | <el-input v-model="processInspectVo.quantity" placeholder="请è¾å
¥æ°é" |
| | |
| | | <div class="finishedProduct-detail"> |
| | | <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-col v-if="resultVal==null" :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-col> |
| | |
| | | placement="top-start"> |
| | | <el-input :disabled="scope.row.eId == null" v-model="scope.row.empiricalValueAddss[index]" |
| | | @blur="changeState(scope.row, index)" placeholder="请è¾å
¥æ£æµå¼"></el-input> |
| | | <span v-if="resultVal != null" v-text="scope.row.empiricalValueAddss[index]"></span> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceName" label="è¯éªè®¾å¤" min-width="250"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="resultVal!=null && processInspectVo.id!=null" v-text="scope.row.ename"></span> |
| | | <div v-else> |
| | | <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> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç»è®º" fixed="right" min-width="100"> |
| | |
| | | <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> |
| | | <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> |
| | | <el-button type="text" :disabled="resultVal!=null && processInspectVo.id!=null" @click="submitSave()" size="small">䏿¥</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | resultVal: null, |
| | | deviceList: [], |
| | | hasChildren: true, |
| | | optionsSamplename: [], |
| | |
| | | mounted() { |
| | | this.getDeviceList() |
| | | this.processInspectVo.id = this.$route.query.id |
| | | this.resultVal = this.$route.query.resultVal |
| | | if(this.resultVal == null){ |
| | | let val = sessionStorage.getItem("finished-resultVal"); |
| | | val == undefined ? this.resultVal=null : this.resultVal = val |
| | | } |
| | | this.init() |
| | | }, |
| | | methods: { |
| | |
| | | number: value |
| | | } |
| | | updateFinishedInspectById(data).then(res => { |
| | | if(res.data.data.indexOf("æå") > 0){ |
| | | this.$message.success("䏿¥æå"); |
| | | this.checkTestState() |
| | | }else{ |
| | | this.$message.warning(res.data.data) |
| | | } |
| | | }); |
| | | }).catch(() => {}); |
| | | }else{ |
| | | updateFinishedInspectById({id:this.processInspectVo.id,number:0}).then(res => { |
| | | if(res.data.data.indexOf("æå") > 0){ |
| | | this.$message.success("䏿¥æå"); |
| | | this.checkTestState() |
| | | }else{ |
| | | this.$message.warning(res.data.data) |
| | | } |
| | | }); |
| | | } |
| | | this.init() |
| | | }, |
| | | checkTestState(){ |
| | | let resultVal = '1' |
| | | this.inspectionItems.forEach(item=>{ |
| | | if(item.children){ |
| | | item.children.forEach(obj=>{ |
| | | if(obj.iresult == 0){ |
| | | resultVal = '0' |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | this.resultVal = resultVal |
| | | this.inspectionResultForm[0].result = resultVal |
| | | sessionStorage.setItem("finished-resultVal",resultVal) |
| | | }, |
| | | init(){ |
| | | let id = this.processInspectVo.id |
| | |
| | | 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(obj.inspectionValue){ |
| | | arr = obj.inspectionValue.split(",") |
| | | } |
| | | if(obj.iresult && obj.iresult == 0){ |
| | | resultVal = 0 |
| | | } |
| | | obj.empiricalValueAddss = arr |
| | | if(arr.length > this.empiricalValueAdd){ |
| | |
| | | materialCode: result.materialCode, |
| | | material: result.material, |
| | | userName: Array.from(new Set(userList)).join(","), |
| | | result: resultVal, |
| | | result: this.resultVal==null ? '' : this.resultVal, |
| | | }] |
| | | }).catch(error=>{ |
| | | console.log(error) |
| | |
| | | <style scoped> |
| | | .finishedProduct-detail { |
| | | width: 100%; |
| | | height: 470px; |
| | | height: 500px; |
| | | padding: 10px 20px; |
| | | display: flex; |
| | | border: 1px solid #ddd; |
| | |
| | | |
| | | .finishedProduct-basic { |
| | | background-color: #fff; |
| | | height: 155px; |
| | | height: 120px; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | padding: 10px 20px; |