From 9b18523c852a24806937ebb4de3a231abef9173d Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期三, 08 五月 2024 14:56:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/quality/finishedProductInspection/finishedProduct-form.vue |  126 ++++++++++++++++++++++++++++++++++-------
 1 files changed, 104 insertions(+), 22 deletions(-)

diff --git a/src/views/quality/finishedProductInspection/finishedProduct-form.vue b/src/views/quality/finishedProductInspection/finishedProduct-form.vue
index ca7bb5f..e3a41b4 100644
--- a/src/views/quality/finishedProductInspection/finishedProduct-form.vue
+++ b/src/views/quality/finishedProductInspection/finishedProduct-form.vue
@@ -285,6 +285,54 @@
                         </el-table-column>
                         </el-table>
                 </el-tab-pane>
+                <el-tab-pane label="闄勪欢">
+                    <el-table :data="configFileTableData" height="400px">
+                        <el-table-column
+                        prop="orderNumber"
+                        align="center"
+                        label="璁㈠崟鍙�"
+                        show-overflow-tooltip
+                        >
+                        </el-table-column>
+                        <el-table-column
+                        prop="originalFileName"
+                        align="center"
+                        label="鍘熸枃浠跺悕"
+                        width="200"
+                        >
+                        </el-table-column>
+                        <el-table-column prop="fileName" align="center" label="鏂囦欢鍚庣紑">
+                        </el-table-column>
+                        <el-table-column prop="createUser" align="center" label="涓婁紶浜�">
+                        </el-table-column>
+                        <el-table-column
+                        prop="createTime"
+                        align="center"
+                        label="涓婁紶鏃堕棿"
+                        show-overflow-tooltip
+                        >
+                        </el-table-column>
+                        <el-table-column prop="updateUser" align="center" label="鏇存柊浜�">
+                        </el-table-column>
+                        <el-table-column
+                        prop="updateTime"
+                        align="center"
+                        label="鏇存柊鏃堕棿"
+                        show-overflow-tooltip
+                        >
+                        </el-table-column>
+                        <el-table-column fixed="right" align="center" label="鎿嶄綔">
+                        <template slot-scope="scope">
+                            <el-button
+                            @click="downloadProcessConfigFiles(scope.row)"
+                            type="text"
+                            size="small"
+                            >涓嬭浇</el-button
+                            >
+                        </template>
+                        </el-table-column>
+                    </el-table>
+                </el-tab-pane>
             </el-tabs>
 
         </div>
@@ -351,12 +399,15 @@
  import { getIfsLocationByGroupCopyAll } from '@/api/warehouse/location'
  import qrCodeApp from '@/views/common/qrCodeApp'
  import { getStore } from '@/util/store'
+ import { getProcessConfigFile } from '@/api/plan/manufacturingorder'
+ import * as customerorder from '@/api/plan/customerorder'
 export default {
     components:{
         qrCodeApp
     },
     data() {
         return {
+            dataForm:null,
             progrecessFileLoading: false,
             processConfigFileTableData: [],
             headers: {
@@ -408,6 +459,7 @@
             },
             inspectionItems: [], // 鏂板妫�楠岄」鐩〃鏍�
             inspectionResultForm: [],
+            configFileTableData:[]
         }
     },
     watch: {
@@ -431,6 +483,21 @@
         this.init()
     },
     methods: {
+        getProcessConfigFile(){
+            getProcessConfigFile({
+            orderNumber: this.dataForm.orderNumber,
+            lineNumber: this.dataForm.customerNo
+            }).then((res)=>{
+                this.configFileTableData = res.data.data
+            })
+        },
+        downloadProcessConfigFiles(row){
+            customerorder.downloadProcessConfigFile(
+                row.fileName,
+                row.bucketName,
+                row.originalFileName
+            )
+        },
       saveTable(){
         let finishedInsProducts = [];
         if(this.inspectionItems.length>0){
@@ -553,22 +620,31 @@
                 result: this.inspectionResultForm[0].result
             }
             if (pro > 0) {
-                this.$prompt('璇疯緭鍏ヤ笉鍚堟牸鏁伴噺', '涓嶅悎鏍兼暟閲�', {
-                    confirmButtonText: '纭畾',
-                    cancelButtonText: '鍙栨秷',
-                    inputPattern: /^\d+$/,
-                    inputErrorMessage: '璇疯緭鍏ユ纭暟瀛楁牸寮�'
-                }).then(({ value }) => {
-                    obj.number = value
-                    updateFinishedInspectById(obj).then(res => {
-                        if(res.data.data.indexOf("鎴愬姛") > 0){
-                            this.$message.success("涓婃姤鎴愬姛");
-                            this.checkTestState()
-                        }else{
-                            this.$message.warning(res.data.data)
-                        }
-                    });
-                }).catch(() => {});
+                obj.number = 1;
+                updateFinishedInspectById(obj).then(res => {
+                    if(res.data.data.indexOf("鎴愬姛") > 0){
+                        this.$message.success("涓婃姤鎴愬姛");
+                        this.checkTestState()
+                    }else{
+                        this.$message.warning(res.data.data)
+                    }
+                });
+                // this.$prompt('璇疯緭鍏ヤ笉鍚堟牸鏁伴噺', '涓嶅悎鏍兼暟閲�', {
+                //     confirmButtonText: '纭畾',
+                //     cancelButtonText: '鍙栨秷',
+                //     inputPattern: /^\d+$/,
+                //     inputErrorMessage: '璇疯緭鍏ユ纭暟瀛楁牸寮�'
+                // }).then(({ value }) => {
+                //     obj.number = value
+                //     updateFinishedInspectById(obj).then(res => {
+                //         if(res.data.data.indexOf("鎴愬姛") > 0){
+                //             this.$message.success("涓婃姤鎴愬姛");
+                //             this.checkTestState()
+                //         }else{
+                //             this.$message.warning(res.data.data)
+                //         }
+                //     });
+                // }).catch(() => {});
             }else{
                 updateFinishedInspectById(obj).then(res => {
                     if(res.data.data.indexOf("鎴愬姛") > 0){
@@ -601,6 +677,7 @@
             if(id != null){
                 queryById(id).then(res=>{
                     let result = res.data.data
+                    this.dataForm = result
                     this.processInspectVo.finInsNo = result.finInsNo
                     this.processInspectVo.orderNumber = result.orderNumber
                     this.processInspectVo.mcode = result.materialCode
@@ -628,10 +705,14 @@
                                 if(obj.inspectionValue){
                                     arr = obj.inspectionValue.split(",")
                                 }
-                                obj.empiricalValueAddss = arr
+                                this.$set(obj,'empiricalValueAddss',arr)
+                                // obj.empiricalValueAddss = arr
                                 if(obj.note){
-                                        snote=obj.inote
-                                    }
+                                    // obj.inote=obj.note
+                                    this.$set(obj,'inote',obj.note)
+                                }else{
+                                    this.$set(obj,'inote',null)
+                                }
                                 if(arr.length > this.empiricalValueAdd){
                                     this.empiricalValueAdd = arr.length
                                 }
@@ -661,6 +742,7 @@
                         userName: Array.from(new Set(userList)).join(","),
                         result: this.resultVal==null ? rVal : this.resultVal,
                     }]
+                    this.getProcessConfigFile()
                 }).catch(error=>{
                     console.error(error)
                 })
@@ -795,7 +877,7 @@
                                 arr.splice((arr.length-1),1)
                                 let obj = {
                                     devideId: i.eId,
-                                    fpid: row.iid,
+                                    fpid: i.iid,
                                     inspectionValue: arr.join(","),
                                     note : i.inote
                                 }
@@ -816,11 +898,11 @@
             } else {
                 if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
                     this.empiricalValueAdd = this.empiricalValueAdd - 1;
-                    // this.changeRowResult()
-                    this.saveTable()
+                    this.changeRowResult()
                     this.inspectionItems.forEach(i => {
                         i.empiricalValueAddss.splice(this.empiricalValueAdd, 1);
                     });
+                    this.saveTable()
                 }
             }
         },

--
Gitblit v1.9.3