From 847696329faa795077d966845f37b88fbd3a2cdc Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期二, 21 五月 2024 16:33:28 +0800 Subject: [PATCH] 2023-5-21 selOutBatchNo接口 质量的过程检验,新增不触发接口,编辑或者查看才触发 与 追溯select切换只显示第一条数据问题 --- src/views/product/producttraceability/index.vue | 362 ++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 254 insertions(+), 108 deletions(-) diff --git a/src/views/product/producttraceability/index.vue b/src/views/product/producttraceability/index.vue index e526c63..437b369 100644 --- a/src/views/product/producttraceability/index.vue +++ b/src/views/product/producttraceability/index.vue @@ -2,25 +2,36 @@ <div class="product-traceability-div"> <div class="product-traceability-hearder-div"> <div style="width: 600px;margin-left:3px;"> - <tRemoteSelect - v-model="systemNo" - :columns="partColumn" - :data="partList" - :formatter="labelFormatter" - :selectLoading="selectLoading" - :valueColumn="valueColumn" - @selectChange="changePart()" - @remoteSearch="queryPart" - ></tRemoteSelect> + <el-row :gutter="10"> + <el-col :span="16"> + <tRemoteSelect + v-model="systemNo" + :columns="partColumn" + :data="partList" + :formatter="labelFormatter" + :selectLoading="selectLoading" + ref="systemSelect" + :valueColumn="valueColumn" + @selectChange="queryBatchNoData" + @remoteSearch="queryPart" + ></tRemoteSelect> + </el-col> + <el-col :span="8"> + <el-select @change="changePart" v-model="selBatchNo" class="lmes-select" placeholder="璇烽�夋嫨鎵规鍙�"> + <el-option :label="item" :value="item" :key="index" v-for="(item,index) in selBatchNoList"></el-option> + </el-select> + </el-col> + </el-row> + </div> - <div style="margin-left:20px;"> + <!-- <div style="margin-left:20px;"> <el-radio v-model="traceType" label="posite" @change="changeTraceType" >鍙嶅悜杩芥函</el-radio > <el-radio v-model="traceType" label="negate" @change="changeTraceType" >姝e悜杩芥函</el-radio > - </div> + </div> --> </div> <div class="product-traceability-body-div"> <div class="product-traceability-relationship-div"> @@ -262,10 +273,10 @@ <div>宸ヤ綔绔欙細</div> <div>鎶ュ伐鍗曞彿锛�</div> <div>鎶ュ伐浜哄憳锛�</div> - <div>浜у搧缂栧彿锛�</div> + <div>鎵规鍙凤細</div> <div>闆朵欢鍙凤細</div> <div>鍗曚綅锛�</div> - <div>浜у嚭鏁伴噺锛�</div> + </div> <div class="product-traceability-producttracking-val-div"> <div :title="currProductTracking.workstationName"> @@ -280,7 +291,6 @@ {{ currProductTracking.partNo }} </div> <div>{{ currProductTracking.unit }}</div> - <div>{{ currProductTracking.productQty }}</div> </div> </div> <div class="product-traceability-producttracking-item-div"> @@ -288,24 +298,26 @@ <div>鐝粍锛�</div> <div>姹囨姤宸ュ簭锛�</div> <div>姹囨姤鏃堕棿锛�</div> - <div>鎵瑰彿锛�</div> + <!-- <div>鎵瑰彿锛�</div> --> <div>闆朵欢鎻忚堪锛�</div> <div>鐢熶骇鏃ユ湡锛�</div> + <div>浜у嚭鏁伴噺锛�</div> </div> <div class="product-traceability-producttracking-val-div"> <div>{{ currProductTracking.crewName }}</div> <div>{{ currProductTracking.operationName }}</div> <div>{{ currProductTracking.trackingTime }}</div> - <div>{{ currProductTracking.systemNo }}</div> + <!-- <div>{{ currProductTracking.systemNo }}</div> --> <div :title="currProductTracking.partName"> {{ currProductTracking.partName }} </div> <div>{{ currProductTracking.productDate }}</div> + <div>{{ currProductTracking.productQty }}</div> </div> </div> </div> </el-tab-pane> - <el-tab-pane label="宸ユ淇℃伅" name="宸ユ淇℃伅"> + <!-- <el-tab-pane label="宸ユ淇℃伅" name="宸ユ淇℃伅"> <div style="margin-top:10px;"> <el-table ref="stepRecordTable" @@ -330,10 +342,113 @@ </el-table-column> </el-table> </div> - </el-tab-pane> + </el-tab-pane> --> <el-tab-pane label="妫�娴嬩俊鎭�" name="妫�娴嬩俊鎭�"> - <div style="margin-top:10px;"> - <el-tabs type="card"> + <div style="margin-top:10px;height: 80vh;overflow-y: scroll;"> + <div class="process" v-if="process"> + <el-divider + class="pane-divider" + direction="vertical" + ></el-divider> + <span style="font-size:14px;font-weight:bold" + >杩囩▼妫�</span> + <div style="font-size: 12px;margin-top: 10px;margin-left: 10px;">鏍峰搧鍚嶏細<span style="font-weight: 700;">{{process.sampleName}}</span></div> + <el-table + stripe + :data="process.sampleItem" + :height="paramsTableHeight" + :header-cell-style="paramsTableHeaderStyle0" + :row-class-name="tableRowClassName" + class="taskinfo-params-table" + style="margin: 10px;width: 95%;" + > + <el-table-column + prop="father" + label="椤圭洰" + align="center" + min-width="75px" + /> + <el-table-column + prop="name" + label="鎸囨爣" + align="center" + min-width="100px" + /> + <el-table-column + prop="result" + label="缁撴灉" + align="center" + min-width="60px" + > + <template slot-scope="scope"> + {{ + scope.row.isQualified == 0 + ? '涓嶅悎鏍�' + : (scope.row.isQualified==1?'鍚堟牸':'') + }} + </template> + </el-table-column> + <el-table-column + prop="userName" + label="妫�楠屼汉" + align="center" + min-width="90px" + /> + </el-table> + </div> + <div class="product" v-if="finished" :class="{checkMore:process}"> + <el-divider + class="pane-divider" + direction="vertical" + ></el-divider> + <span style="font-size:14px;font-weight:bold" + >浜у搧妫�</span> + <div style="font-size: 12px;margin-top: 10px;margin-left: 10px;">鏍峰搧鍚嶏細<span style="font-weight: 700;">{{finished.sampleName}}</span></div> + <el-table + stripe + :data="finished.sampleItem" + :height="paramsTableHeight" + :header-cell-style="paramsTableHeaderStyle0" + :row-class-name="tableRowClassName" + class="taskinfo-params-table" + style="margin: 10px;width: 95%;" + > + <el-table-column + prop="father" + label="椤圭洰" + align="center" + min-width="75px" + /> + <el-table-column + prop="name" + label="鎸囨爣" + align="center" + min-width="100px" + /> + <el-table-column + prop="result" + label="缁撴灉" + align="center" + min-width="60px" + > + <template slot-scope="scope"> + {{ + scope.row.isQualified == 0 + ? '涓嶅悎鏍�' + : (scope.row.isQualified==1?'鍚堟牸':'') + }} + </template> + </el-table-column> + <el-table-column + prop="userName" + label="妫�楠屼汉" + align="center" + min-width="90px" + /> + </el-table> + </div> + <!-- <p v-show="!process&&!finished">鏆傛棤鏁版嵁</p> --> + <!-- <el-tabs type="card"> <el-tab-pane v-for="(item, index) in checkItemList" :key="item.reportTypeLabel" @@ -412,30 +527,12 @@ </el-table-column> </el-table> </el-tab-pane> - <!--<el-tab-pane label="闄勪欢"> - <el-upload - drag - ref="upload" - action="/mes/reportSample/upload" - :headers="headers" - :auto-upload="true" - :file-list="fileList" - list-type="text" - :on-preview="handlePreview" - :with-credentials="true" - > - <i class="el-icon-upload"></i> - <div class="el-upload__text"> - 灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em> - </div> - </el-upload> - </el-tab-pane>--> - </el-tabs> + </el-tabs> --> </div> </el-tab-pane> <el-tab-pane label="鐢熶骇璁板綍" name="鐢熶骇璁板綍"> <div style="margin-top:10px;"> - <div style="padding:0px 14px;height: 100%;overflow: auto;"> + <div style="padding:0px 14px;height: 80vh !important;overflow: auto;"> <div class="product-record-div"> <div class="product-record-div-left"> <div class="product-record-list-header"> @@ -535,7 +632,7 @@ </el-table-column> </el-table> </el-tab-pane> - <el-tab-pane label="闄勪欢"> + <!-- <el-tab-pane label="闄勪欢"> <el-upload ref="upload" action="/mes/operationTask/upload" @@ -545,7 +642,7 @@ :auto-upload="false" list-type="picture" ></el-upload - ></el-tab-pane> + ></el-tab-pane> --> </el-tabs> </div> </div> @@ -657,7 +754,7 @@ </el-tabs> </div> </el-tab-pane> - <el-tab-pane label="妯″叿淇℃伅" name="妯″叿淇℃伅"> + <!-- <el-tab-pane label="妯″叿淇℃伅" name="妯″叿淇℃伅"> <div style="margin-top:10px;"> <el-table ref="mouldRecordTable" @@ -762,7 +859,7 @@ </el-table-column> </el-table> </div> - </el-tab-pane> + </el-tab-pane> --> </el-tabs> </div> </div> @@ -970,12 +1067,16 @@ .taskinfo-params-table >>> td { padding: 3px 0px; } +.checkMore{ + margin-top: 20px; +} </style> <script> import { queryByNo, queryDiagram, - queryOperationTask + queryOperationTask, + queryByCustomerOrderId } from '@/api/product/producttraceability' import { getTemplateRecord, @@ -1000,20 +1101,34 @@ }, selectLoading: false, systemNo: null, + selBatchNo: null, + selBatchNoList: [], selectedProductSystemNo: null, - valueColumn: 'systemNo', + valueColumn: 'customerOrderId', partColumn: [ { - prop: 'batchNo', - label: '鎵规鍙�' + prop: 'customerOrderNo', + label: '閿�鍞鍗曞彿' }, { - prop: 'systemNo', - label: '绯荤粺鍙�' + prop: 'entityName', + label: '椤圭洰鍚嶇О' }, { - prop: 'partName', - label: '闆朵欢鍚嶇О' + prop: 'partNo', + label: '浜у搧缂栧彿' + }, + { + prop: 'productName', + label: '浜у搧鍚嶇О' + }, + { + prop: 'specs', + label: '浜у搧鍨嬪彿' + }, + { + prop: 'productType', + label: '浜у搧绫诲瀷' } ], partList: [], @@ -1103,7 +1218,9 @@ traceType: 'posite', reportTypeOptions: [], checkItemList: [], - mouldRecordList: [] + mouldRecordList: [], + finished:null, + process:null } }, mounted() { @@ -1112,6 +1229,16 @@ this.resize() }, methods: { + queryBatchNoData(){ + this.selBatchNo = null + queryByCustomerOrderId({customerOrderId : this.systemNo}).then(res=>{ + if(res.status===200){ + this.selBatchNoList = res.data.data + } + }).catch(error=>{ + console.error(error) + }) + }, // 鍔犺浇娴忚鍣ㄧ獥鍙e彉鍖栬嚜閫傚簲 resize() { window.addEventListener('resize', () => { @@ -1179,17 +1306,17 @@ }, labelFormatter(ele) { let partLabel - const part = this.partList.find((item) => ele.systemNo === item.systemNo) + const part = this.partList.find((item) => ele.customerOrderId === item.customerOrderId) if (part !== undefined) { partLabel = - '绯荤粺鍙凤細' + - part.systemNo + + '閿�鍞鍗曞彿锛�' + + part.customerOrderNo + ' ' + - '闆朵欢鍚嶇О锛�' + - part.partName + + '浜у搧鍚嶇О锛�' + + part.productName + ' ' + - '鎵规鍙凤細' + - part.batchNo + '浜у搧缂栧彿锛�' + + part.partNo } return partLabel }, @@ -1214,10 +1341,12 @@ } else { this.partList = [] } + this.selBatchNo = null + this.selBatchNoList = [] }, changePart() { - if (this.systemNo != null && this.systemNo !== '') { - const query = { systemNo: this.systemNo, traceType: this.traceType } + if (this.selBatchNo != null && this.selBatchNo !== '') { + const query = { systemNo: this.selBatchNo, traceType: this.traceType } queryDiagram(query) .then((response) => { var data = response.data @@ -1227,15 +1356,15 @@ const hasOutNode = data.data.linkDataArray.find((ele) => { return ele.from === item.key }) - item.batchNo = 'SN鍙�:' + item.batchNo + item.batchNo = '鎵规鍙�:' + item.batchNo item.quantity = '鎶曞叆鏁伴噺:' + (hasOutNode ? item.quantity : 0) + ' ' + item.unit - item.ifsBatchNo = - 'IFS鎵规鍙�:' + - (item.ifsBatchNo == null ? '' : item.ifsBatchNo) + // item.ifsBatchNo = + // 'IFS鎵规鍙�:' + + // (item.ifsBatchNo == null ? '' : item.ifsBatchNo) }) this.modelData = { nodeDataArray: data.data.nodeDataArray, @@ -1262,7 +1391,6 @@ _that.selectedProductSystemNo = nodeData.key.split('_')[0] // const query = { systemNo: 'XT000131' } const query = { systemNo: nodeData.key.split('_')[0] } - console.log(query) queryOperationTask(query) .then((response) => { var data = response.data @@ -1295,39 +1423,51 @@ _that.currProductTracking = {} } // 妫�娴嬩俊鎭� - const sampleItemList = data.data.sampleItems - if (sampleItemList != null && sampleItemList.length > 0) { - _that.paramValues = sampleItemList - _that.checkItemList = [] - sampleItemList.forEach((item) => { - const reportTypeLabel = _that.reportTypeOptions.find( - (el) => { - return item.reportType == el.value - } - ) - if (reportTypeLabel) { - const existCheckItem = _that.checkItemList.find( - (checkItem) => { - return ( - reportTypeLabel.label == checkItem.reportTypeLabel - ) - } - ) - if (existCheckItem) { - existCheckItem.itemList.push(item) - } else { - _that.checkItemList.push({ - reportTypeLabel: reportTypeLabel.label, - itemList: [item] - }) - } - } - }) - // reportTypeOptions - } else { - _that.paramValues = [] - _that.checkItemList = [] + const sampleItems = data.data.sampleItems + // 妫�娴嬩俊鎭�-杩囩▼妫� + if(sampleItems&&sampleItems.process&&sampleItems.process.length>0){ + _that.process = sampleItems.process[0] + }else{ + _that.process = null } + // 妫�娴嬩俊鎭�-浜у搧妫� + if(sampleItems&&sampleItems.finished&&sampleItems.finished.length>0){ + _that.finished = sampleItems.finished[0] + }else{ + _that.finished = null + } + // if (sampleItemList != null && sampleItemList.length > 0) { + // _that.paramValues = sampleItemList + // _that.checkItemList = [] + // sampleItemList.forEach((item) => { + // const reportTypeLabel = _that.reportTypeOptions.find( + // (el) => { + // return item.reportType == el.value + // } + // ) + // if (reportTypeLabel) { + // const existCheckItem = _that.checkItemList.find( + // (checkItem) => { + // return ( + // reportTypeLabel.label == checkItem.reportTypeLabel + // ) + // } + // ) + // if (existCheckItem) { + // existCheckItem.itemList.push(item) + // } else { + // _that.checkItemList.push({ + // reportTypeLabel: reportTypeLabel.label, + // itemList: [item] + // }) + // } + // } + // }) + // // reportTypeOptions + // } else { + // _that.paramValues = [] + // _that.checkItemList = [] + // } _that.currOperateTask = data.data.operationTask if (_that.currOperateTask == null) { _that.currOperateTask = { @@ -1355,12 +1495,11 @@ _that.productRecordParamValues = [] _that.paramTabs = [] } else { - // 宸ユ淇℃伅 - console.log('nodeData', nodeData.batchNo) - _that.getStepRecords({ - id: _that.currOperateTask.id, - sn: nodeData.batchNo.split('SN鍙�:')[1] - }) + // 宸ユ淇℃伅--鎶ラ敊娉ㄩ噴鎺変簡 + // _that.getStepRecords({ + // id: _that.currOperateTask.id, + // sn: nodeData.batchNo.split('SN鍙�:')[1] + // }) // 宸ヨ壓鍙傛暟淇℃伅 _that.queryTechnologyInfo(_that.currOperateTask.id) // 鐢熶骇璁板綍 @@ -1384,7 +1523,6 @@ }) } }) - console.log(param.diagram.selection) }, // 鏍规嵁宸ュ崟id锛屾煡璇㈠搴旂殑宸ヨ壓鍙傛暟淇℃伅 queryTechnologyInfo(taskId) { @@ -1570,7 +1708,6 @@ }, // 鍒囨崲杩芥函妯″紡 changeTraceType() { - console.log('traceType', this.traceType) this.changePart() }, paramsTableHeaderStyle({ row, column, rowIndex, columnIndex }) { @@ -1582,6 +1719,15 @@ } return headerStyle }, + paramsTableHeaderStyle0({ row, column, rowIndex, columnIndex }) { + let headerStyle = 'background:#599ef4;color:#fff;' + if (columnIndex === 0) { + headerStyle += 'border-radius: 6px 0px 0px 0px;' + } else if (columnIndex === 3) { + headerStyle += 'border-radius: 0px 6px 0px 0px;' + } + return headerStyle + }, tableRowClassName({ row, rowIndex }) { if (rowIndex % 2 === 1) { return 'stripe-row' -- Gitblit v1.9.3