From 3f6cd5f8b39c8fdae604090e0db3995123f28cc8 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期三, 24 四月 2024 18:33:21 +0800
Subject: [PATCH] xiug
---
src/views/product/producttraceability/index.vue | 351 +++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 250 insertions(+), 101 deletions(-)
diff --git a/src/views/product/producttraceability/index.vue b/src/views/product/producttraceability/index.vue
index 9bcd856..a4b1dd2 100644
--- a/src/views/product/producttraceability/index.vue
+++ b/src/views/product/producttraceability/index.vue
@@ -2,25 +2,35 @@
<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"
+ :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 +272,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 +290,6 @@
{{ currProductTracking.partNo }}
</div>
<div>{{ currProductTracking.unit }}</div>
- <div>{{ currProductTracking.productQty }}</div>
</div>
</div>
<div class="product-traceability-producttracking-item-div">
@@ -288,24 +297,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 +341,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 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
+ ? '涓嶅悎鏍�'
+ : '鍚堟牸'
+ }}
+ </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
+ ? '涓嶅悎鏍�'
+ : '鍚堟牸'
+ }}
+ </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,25 +526,7 @@
</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="鐢熶骇璁板綍">
@@ -535,7 +631,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 +641,7 @@
:auto-upload="false"
list-type="picture"
></el-upload
- ></el-tab-pane>
+ ></el-tab-pane> -->
</el-tabs>
</div>
</div>
@@ -657,7 +753,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 +858,7 @@
</el-table-column>
</el-table>
</div>
- </el-tab-pane>
+ </el-tab-pane> -->
</el-tabs>
</div>
</div>
@@ -970,12 +1066,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 +1100,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 +1217,9 @@
traceType: 'posite',
reportTypeOptions: [],
checkItemList: [],
- mouldRecordList: []
+ mouldRecordList: [],
+ finished:null,
+ process:null
}
},
mounted() {
@@ -1112,6 +1228,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', () => {
@@ -1182,14 +1308,14 @@
const part = this.partList.find((item) => ele.systemNo === item.systemNo)
if (part !== undefined) {
partLabel =
- '绯荤粺鍙凤細' +
- part.systemNo +
+ '閿�鍞鍗曞彿锛�' +
+ part.customerOrderNo +
' ' +
- '闆朵欢鍚嶇О锛�' +
- part.partName +
+ '浜у搧鍚嶇О锛�' +
+ part.productName +
' ' +
- '鎵规鍙凤細' +
- part.batchNo
+ '浜у搧缂栧彿锛�' +
+ part.partNo
}
return partLabel
},
@@ -1214,10 +1340,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 +1355,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,
@@ -1294,39 +1422,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 = {
@@ -1354,11 +1494,11 @@
_that.productRecordParamValues = []
_that.paramTabs = []
} else {
- // 宸ユ淇℃伅
- _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)
// 鐢熶骇璁板綍
@@ -1578,6 +1718,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