diff --git a/src/api/workCheck/index.js b/src/api/workCheck/index.js index b1c1ac99..fd8ff45f 100644 --- a/src/api/workCheck/index.js +++ b/src/api/workCheck/index.js @@ -18,3 +18,21 @@ export const saveProCheck = (data) => { }); }; +// 检验项目列表 +export const getInspectionItemList = (params) => { + return request({ + url: '/api/blade-desk/QA/InspectionItem/list', + method: 'get', + params: params, + }); +}; + +// 检验标准列表 +export const getInspectionStandardList = (params) => { + return request({ + url: '/api/blade-desk/QA/Standard/list', + method: 'get', + params: params, + }); +}; + diff --git a/src/views/productionDisposition/hearingDialog.vue b/src/views/productionDisposition/hearingDialog.vue index 1a840e58..9f96962d 100644 --- a/src/views/productionDisposition/hearingDialog.vue +++ b/src/views/productionDisposition/hearingDialog.vue @@ -7,12 +7,69 @@ 内部审理 - - + + + {{detailInfo.woCode}} + {{detailInfo.productionDisposition}} + {{detailInfo.cardNo}} + {{detailInfo.batchNo}} + {{detailInfo.partCode}} + {{detailInfo.prodName}} + {{detailInfo.totalNum}} + + + + {{detailInfo.scale}}{{detailInfo.scale && detailInfo.scale != '' ? '%' : ''}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{detailInfo.woCode}} {{detailInfo.productionDisposition}} {{detailInfo.cardNo}} @@ -21,55 +78,61 @@ {{detailInfo.materialCode}} {{detailInfo.materialName}} - + + + + + - + + + + - - - 返修 @@ -146,36 +209,48 @@ --> - - -
- 插入一行 - 删除选择行 + + +
+
+ 故障原因 +
+
+ 插入一行 + 删除选择行 +
+
- + - + + + @@ -214,70 +291,71 @@
- -
- 插入一行 - 删除选择行 + +
+
+ 责任零件 +
+
+ 插入一行 + 删除选择行 +
- - + + - + - + - + - + - - + + - + @@ -304,6 +382,7 @@ import {getFaultClassList,getQuestionClassList,getQuestionClassList2,getProductionDispositionDetail, createProductionDisposition,getHistoryOrderList,setHistoryOrderValue,getDispositionTypeList,getResponsiblePartList, getResponsibleBatchList,getRelatedPartList,getRelatedBatchList,getSameLotList} from "@/api/qualityManagement/productionTesting/productionDisposition" +import { getDictionary } from '@/api/system/dict'; export default { props: { showDialog: { @@ -348,6 +427,16 @@ export default { dutyBatchArr:[], //责任批号下拉 relevantPartArr:[], //相关零件下拉 relevantBatchArr:[], //相关批号下拉 + poorReasonList:[], + cascaderProps:{ + // 自定义字段名(如果你的接口返回的不是 value 和 label,需要在这里映射) + value: 'id', + label: 'name', + // 开启懒加载 + lazy: true, + // 懒加载方法 + lazyLoad: this.lazyLoadMethod + } } }, mounted() { @@ -361,9 +450,61 @@ export default { this.getResponsibleBatch() this.getRelatedPart() this.getRelatedBatch() + this.getDictionary() // this.getQuestionSmall() }, methods: { + changeUnqualifiedQty(val,type){ + console.log('insideInfo.unqualifiedQty--------',this.insideInfo.unqualifiedQty) + if(type == 'erp'){ + if(this.detailInfo.totalNum == 0){ + this.detailInfo.scale = 0 + return + } + this.detailInfo.scale = (val / this.detailInfo.totalNum * 100).toFixed(2) + } + + }, + + changeFaultQty(val,index){ + console.log('val--------',val) + console.log('index--------',index) + if(this.detailInfo.unqualifiedQty == 0){ + this.faultList[index].scale = 0 + return + } + this.faultList[index].scale = (this.faultList[index].qty / this.detailInfo.unqualifiedQty * 100).toFixed(2) + }, + getDictionary() { + getDictionary({ code: 'defective_cause' }).then(res => { + this.poorReasonList = res.data.data; + }); + }, + async lazyLoadMethod(node, resolve){ + console.log('node---------',node) + let firstData = [] + if(node.level == 0){ + const level0Data = await getFaultClassList() + console.log('level0Data---------',level0Data) + firstData = level0Data.data.data + }else if(node.level == 1){ + const level1Data = await getQuestionClassList({parentId:node.value}) + console.log('level1Data---------',level1Data) + firstData = level1Data.data.data + }else{ + const level2Data = await getQuestionClassList2({parentId:node.value}) + level2Data.data.data.map(item => item.leaf = true) + console.log('level2Data---------',level2Data) + firstData = level2Data.data.data + } + console.log('firstData---------',firstData) + resolve(firstData) + }, + handleCascaderChange(val,row){ + row.ngType2Id = val[0] + row.ngType3Id = val[1] + row.ngType4Id = val[2] + }, changeOrderMode(){ this.dutyList.map(item =>{ item.dutyPart = '' @@ -480,6 +621,7 @@ export default { id:this.rsId }).then(res =>{ this.detailInfo = res.data.data + // this.detailInfo.totalNum = 15 this.insideInfo = res.data.data console.log('hace---------------',this.detailInfo.hasSaved) if(this.detailInfo.hasSaved == 1){ @@ -497,7 +639,8 @@ export default { ) res.data.data.faultList.map((item,index) =>{ item._select = false - this.getQuestionSmall(item.ngType3Id,index) + item.selectedValue = [item.ngType2Id,item.ngType3Id,item.ngType4Id] + // this.getQuestionSmall(item.ngType3Id,index) }) this.faultList = res.data.data.faultList res.data.data.dutyList.map(item =>{ @@ -506,10 +649,14 @@ export default { this.dutyList = res.data.data.dutyList }else{ // this.detailInfo = res.data.data + // this.detailInfo.productionDisposition = res.data.data.productionDisposition || '测试工序' + // this.detailInfo.cardNo = res.data.data.cardNo || '1023452022' + // this.detailInfo.batchNo = res.data.data.batchNo || 'bat001' + // this.detailInfo.partCode = res.data.data.partCode || 'bat001' this.detailInfo.refWoId = '' - this.detailInfo.poorReason = '' - this.detailInfo.poorDesc = '' - this.detailInfo.reviewOrderMode = '' + this.detailInfo.poorReason = this.detailInfo.poorReason ? this.detailInfo.poorReason : '' + this.detailInfo.poorDesc = this.detailInfo.poorDesc ? this.detailInfo.poorDesc :'' + this.detailInfo.reviewOrderMode = '1' this.detailInfo.unqualifiedQty = '' this.detailInfo.scale = '' // this.detailInfo.upCode = '' @@ -612,13 +759,37 @@ export default { this.detailInfo.submitType = val this.detailInfo.faultDeleteIds = this.faultDeleteIds.join(',') this.detailInfo.dutyDeleteIds = this.dutyDeleteIds.join(',') - console.log('detail---------------------',this.detailInfo) - createProductionDisposition(this.detailInfo).then(res =>{ - if(res.data.code == 200){ - this.$message.success(val == '-1' ? '保存成功' : '提交成功') - this.closeDialog(true) - } + this.detailInfo.faultList.map(item =>{ + if(item.selectedValue) delete item.selectedValue }) + if(this.detailInfo.faultList.length > 0){ + let tmp = this.detailInfo.faultList.find(item => !item.ngType4Id) + if(tmp){ + this.$message.error('故障原因数据请补充完整!') + return + } + + let value = this.detailInfo.faultList.reduce((sum, item) => sum + Number(item.qty), 0) + console.log('value---------------------',value) + if(value > this.detailInfo.unqualifiedQty){ + this.$message.error('故障原因数量相加之和不可大于不合格数量!') + return + } + } + if(this.detailInfo.dutyList.length > 0){ + let tmp = this.detailInfo.dutyList.find(item => !item.dutyPart || !item.dutyBatch) + if(tmp){ + this.$message.error('责任零件数据请补充完整!') + return + } + } + console.log('detail---------------------',this.detailInfo) + // createProductionDisposition(this.detailInfo).then(res =>{ + // if(res.data.code == 200){ + // this.$message.success(val == '-1' ? '保存成功' : '提交成功') + // this.closeDialog(true) + // } + // }) }, // 内部审理提交 submitInside(){ @@ -661,6 +832,10 @@ export default { display: flex; align-items: center; margin-bottom: 20px; + + &.search{ + margin-bottom: 0; + } } .margin-top { margin-top: 24px; @@ -674,4 +849,16 @@ export default { .table_box { width: 100%; } + +.title_box{ + display: flex; + align-items: center; + justify-content: space-between; + + .title{ + font-size: 14px; + color: #303133; + font-weight: bold; + } +} \ No newline at end of file diff --git a/src/views/productionTesting/productionQuality.vue b/src/views/productionTesting/productionQuality.vue index 51e6dadf..f7041ff2 100644 --- a/src/views/productionTesting/productionQuality.vue +++ b/src/views/productionTesting/productionQuality.vue @@ -95,23 +95,34 @@ :column="5" border style="margin-top: 24px" - > + > + + - +
-
-
+ -->
- + + + + + -