From b5d7cad27e6d6382cc375a7bbfb91aad0c31195c Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 31 十月 2023 18:05:56 +0800
Subject: [PATCH] 	modified:   src/api/quality/finishedProduct.js 	modified:   src/api/quality/rawMaterial.js 	modified:   src/router/views/index.js 	new file:   src/views/common/rawMaterial-part.vue 	modified:   src/views/common/ztt-table.vue 	modified:   src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue 	modified:   src/views/quality/finishedProductInspection/index.vue 	modified:   src/views/quality/rawMaterial/rawMaterial-form.vue

---
 src/views/quality/rawMaterial/rawMaterial-form.vue                           |  136 +++++--
 src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue |  387 +++++++----------------
 src/router/views/index.js                                                    |   17 +
 src/views/common/rawMaterial-part.vue                                        |  240 +++++++++++++++
 src/views/quality/finishedProductInspection/index.vue                        |   92 -----
 src/api/quality/finishedProduct.js                                           |   15 
 src/api/quality/rawMaterial.js                                               |   16 +
 src/views/common/ztt-table.vue                                               |    7 
 8 files changed, 510 insertions(+), 400 deletions(-)

diff --git a/src/api/quality/finishedProduct.js b/src/api/quality/finishedProduct.js
index 6f3c763..5d0063b 100644
--- a/src/api/quality/finishedProduct.js
+++ b/src/api/quality/finishedProduct.js
@@ -14,4 +14,19 @@
     method: 'get',
     params: query
   })
+}
+
+export function addFinish(obj) {
+  return request({
+    url: '/mes/qualityFinishedInspect/addFinish',
+    method: 'post',
+    data: obj
+  })
+}
+
+export function queryById(obj) {
+  return request({
+    url: '/mes/qualityFinishedInspect/'+obj,
+    method: 'get',
+  })
 }
\ No newline at end of file
diff --git a/src/api/quality/rawMaterial.js b/src/api/quality/rawMaterial.js
index 63298c9..a19ccb2 100644
--- a/src/api/quality/rawMaterial.js
+++ b/src/api/quality/rawMaterial.js
@@ -61,3 +61,19 @@
   })
 }
 
+export function chooseIFS(data) {
+  return request({
+    url: '/mes/rawInspect/chooseIFS',
+    method: 'post',
+    params: data
+  })
+}
+
+export function selectHisByCode(data) {
+  return request({
+    url: '/mes/rawInsProduct/seleHisByCode',
+    method: 'get',
+    params: data
+  })
+}
+
diff --git a/src/router/views/index.js b/src/router/views/index.js
index b3402ed..4e5ee6e 100644
--- a/src/router/views/index.js
+++ b/src/router/views/index.js
@@ -162,6 +162,23 @@
     ]
   },
   {
+    path: '/quality/finishedProduct',
+    component: Layout,
+    children: [
+      {
+        path: 'finishedProduct-form',
+        name: 'finishedProductForm',
+        component: () =>
+          import(/* webpackChunkName: "views" */ '@/views/quality/finishedProductInspection/finishedProductInspectionAdd'),
+        meta: {
+          keepAlive: false,
+          isTab: false,
+          isAuth: false
+        }
+      }
+    ]
+  },
+  {
     path: '/quality/newReport',
     component: Layout,
     children: [
diff --git a/src/views/common/rawMaterial-part.vue b/src/views/common/rawMaterial-part.vue
new file mode 100644
index 0000000..7d4a24f
--- /dev/null
+++ b/src/views/common/rawMaterial-part.vue
@@ -0,0 +1,240 @@
+<template>
+    <el-dialog
+      v-diadrag
+      width="60%"
+      title="鎶ユ淇℃伅"
+      top="5vh"
+      :visible.sync="innerVisible"
+      append-to-body
+      @close="$emit('update:currshowlist', false)"
+      :show="currshowlist"
+      class="part-dialog"
+      id="rawMaterial-part-dialog"
+    >
+      <ttable
+        :table="table"
+        @handleSelectionChange="handleSelectionChange"
+        @currentChange="handleCurrentChange"
+        :uploadInfo="uploadInfo"
+        :prelang="prelang"
+        :options="options"
+        :bottomOffset="350"
+        :ajaxFun="ajaxFun"
+        :paramObj="paramObj"
+        :isShowPagination="false"
+        ref="rawPartTable"
+      >
+        <template #toolbar></template>
+      </ttable>
+  
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="innerVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="saveSelectRow">纭� 瀹�</el-button>
+      </div>
+    </el-dialog>
+  </template>
+  <script>
+  import ttable from '@/views/common/ztt-table'
+  import { chooseIFS } from '@/api/quality/rawMaterial'
+  export default {
+    props: {
+      currshowlist: {
+        type: Boolean,
+        default: false
+      },
+      paramObj: {
+        type: Object,
+        default: () => {
+          return {}
+        }
+      },
+      multiSelect: {
+        type: Boolean,
+        default: false
+      },
+      parentSelectedObj: {
+        type: Object,
+        default: null
+      },
+      parentSelectedIndex: {
+        type: Number,
+        default: null
+      }
+    },
+    data() {
+      return {
+        ajaxFun: chooseIFS,
+        innerVisible: false,
+        listLoading: true,
+        currentRow: null,
+        multipleSelection: [],
+        uploadInfo: {
+          // 鏄惁灞曠ず涓婁紶EXCEL浠ュ強瀵瑰簲鐨剈rl
+          isShow: false,
+          url: ''
+        },
+        prelang: 'operation',
+        options: {
+          height: 300, // 榛樿楂樺害-涓轰簡琛ㄥご鍥哄畾
+          stripe: true, // 鏄惁涓烘枒椹汗 table
+          highlightCurrentRow: false, // 鏄惁瑕侀珮浜綋鍓嶈
+          border: true, // 鏄惁鏈夌旱鍚戣竟妗�
+          lazy: false, // 鏄惁闇�瑕佹噿鍔犺浇
+          fit: true, // 鍒楃殑瀹藉害鏄惁鑷拺寮�
+          multiSelect: false, //
+          seqNo: true,
+          isGeneralSearch: false,
+          isRefresh: false, // 鏄惁鏄剧ず鍒锋柊鎸夐挳
+          isShowHide: false, // 鏄惁鏄剧ず鏄惧奖鎸夐挳
+          isSearch: false, // 楂樼骇鏌ヨ鎸夐挳
+          defaultOrderBy: { column: 'formTime', direction: 'desc' }
+        },
+        table: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 20,
+          data: [],
+          // 鏍囬
+          column: [
+            {
+              minWidth: '100',
+              prop: 'message',
+              label: 'message',
+              isTrue: false,
+            },
+            {
+              minWidth: '100',
+              prop: 'code',
+              label: '闆朵欢鍙�',
+              sort: true,
+              isTrue: true,
+              isSearch: true,
+              searchInfoType: 'text'
+            },
+            {
+              minWidth: '100',
+              prop: 'name',
+              label: '鍘熸潗鏂欏悕绉�',
+              sort: true,
+              isTrue: true,
+              isSearch: true,
+              searchInfoType: 'text'
+            },
+            {
+              minWidth: '100',
+              prop: 'formTime',
+              label: '鏉ユ枡鏃ユ湡',
+              sort: true,
+              isTrue: true,
+              isSearch: true,
+              searchInfoType: 'text'
+            },
+            {
+              minWidth: '100',
+              prop: 'specs',
+              label: '瑙勬牸鍨嬪彿',
+              sort: true,
+              isTrue: true,
+              isSearch: true,
+              searchInfoType: 'text'
+            },
+            {
+              minWidth: '100',
+              prop: 'unit',
+              label: '鍗曚綅',
+              sort: true,
+              isTrue: true,
+              isSearch: true,
+              searchInfoType: 'text'
+            },
+            {
+              minWidth: '100',
+              prop: 'supplier',
+              label: '渚涘簲鍟�',
+              sort: true,
+              isTrue: true,
+              isSearch: true,
+              searchInfoType: 'text'
+            },
+            {
+              minWidth: '100',
+              prop: 'number',
+              label: '鏁伴噺',
+              sort: true,
+              isTrue: true,
+              isSearch: true,
+              searchInfoType: 'text'
+            },
+          ],
+        },
+      }
+    },
+    components: {
+      ttable
+    },
+    created(){
+      
+    },
+    mounted() {
+
+    },
+    methods: {
+      getData() {
+        if (this.$refs.rawPartTable !== undefined) {
+          this.$refs.rawPartTable.getDataList()
+        }
+      },
+      saveSelectRow() {
+        if (this.multiSelect) {
+          this.$emit('handleSelectionChange', this.multipleSelection)
+        } else {
+          this.$emit(
+            'listenToPartEvent',
+            this.currentRow,
+            this.parentSelectedObj,
+            this.parentSelectedIndex
+          )
+        }
+        this.innerVisible = false
+      },
+      handleCurrentChange(row) {
+        this.currentRow = row
+      },
+      handleSelectionChange(val) {
+        // 澶氳閫変腑
+        this.multipleSelection = val
+      },
+    },
+    watch: {
+      currshowlist() {
+        this.innerVisible = this.currshowlist
+        if (this.currshowlist) {
+          this.$nextTick(() => {
+            this.getData()
+          })
+        }
+      }
+    },
+  }
+  </script>
+  <style>
+  .part-dialog .el-dialog__header {
+    padding: 10px 20px 10px;
+  }
+  .part-dialog .el-dialog__header .el-dialog__headerbtn {
+    top: 10px;
+  }
+  .part-dialog .el-dialog__body {
+    padding: 5px 20px;
+  }
+  
+  .part-dialog .el-dialog__footer {
+    padding: 5px 20px 10px;
+  }
+  
+  .part-dialog .el-dialog__body .avue-crud__pagination {
+    margin-top: 0px;
+    margin-bottom: 5px;
+  }
+  </style>
+  
\ No newline at end of file
diff --git a/src/views/common/ztt-table.vue b/src/views/common/ztt-table.vue
index 1cae22a..724a966 100644
--- a/src/views/common/ztt-table.vue
+++ b/src/views/common/ztt-table.vue
@@ -967,7 +967,12 @@
         .apply(this, args)
         .then((response) => {
           var _this = this
-          _this.tableData = response.data.data.records
+          var resultData = response.data.data.records
+          if(resultData == undefined){
+            _this.tableData = response.data.data
+          }else{
+            _this.tableData = response.data.data.records
+          }
           _this.pagination.total = response.data.data.total
           // 缃┖閫変腑
           this.$refs.lmesTable.setCurrentRow()
diff --git a/src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue b/src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue
index c45132a..3115e72 100644
--- a/src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue
+++ b/src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue
@@ -7,7 +7,7 @@
             <h2>缂栬緫-浜у搧妫�楠�</h2>
         </div>
         <div class="btn-group header-right">
-            <el-button @click="addTestProjevt">鐢熸垚妫�楠岄」鐩�</el-button>
+            <el-button @click="addTestProject">鐢熸垚妫�楠岄」鐩�</el-button>
         </div>
     </div>
     <div class="page-main">
@@ -34,21 +34,21 @@
                             </el-form-item>
                         </el-col>
                         <el-col :span="6">
-                            <el-form-item label="浜у搧鍚嶇О锛�">
-                                <el-select style="width: 100%" @change="changeOptionsSamplename"
-                                    v-model="processInspectVo.material" size="small" placeholder="璇烽�夋嫨浜у搧鍚嶇О">
-                                    <el-option v-for="item in optionsSamplename" :key="item.id" :label="item.name"
-                                        :value="item.id + '-' + item.name">
-                                    </el-option>
-                                </el-select>
+                            <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-input disabled v-model="processInspectVo.qualityTraceability"
-                                    placeholder="璇疯緭鍏ヨ拷婧彿" autocomplete="off" />
+                            <el-form-item label="浜у搧鍚嶇О锛�">
+                                <el-select style="width: 100%" @change="changeOptionsSamplename"
+                                    v-model="processInspectVo.material" size="small" placeholder="璇烽�夋嫨浜у搧鍚嶇О">
+                                    <el-option v-for="(item,index) in optionsSamplename" :key="index" :label="item.material"
+                                        :value="item.materialCode">
+                                    </el-option>
+                                </el-select>
                             </el-form-item>
                         </el-col>
                         <el-col :span="6">
@@ -60,13 +60,13 @@
                         <el-col :span="6">
                             <el-form-item label="瑙勬牸鍨嬪彿锛�">
                                 <el-input disabled v-model="processInspectVo.specificationsModel"
-                                    placeholder="璇疯緭鍏ヤ骇鍝佺紪鐮�" autocomplete="off" />
+                                    placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�" autocomplete="off" />
                             </el-form-item>
                         </el-col>
                         <el-col :span="6">
                             <el-form-item label="鍗曚綅锛�">
                                 <el-input disabled v-model="processInspectVo.unit"
-                                    placeholder="璇疯緭鍏ヤ骇鍝佺紪鐮�" autocomplete="off" />
+                                    placeholder="璇疯緭鍏ュ崟浣�" autocomplete="off" />
                             </el-form-item>
                         </el-col>
                     </el-row>
@@ -91,21 +91,22 @@
             </el-row>
             <el-row style="width:100%;">
                 <el-col :span="24">
-                    <el-table border :data="inspectionItems" max-height="400" :span-method="handleSpanMethod" height="calc(100vh - 550px)"
-                        style="width: 100%">
+                    <el-table border :data="inspectionItems" max-height="400" height="calc(100vh - 550px)"
+                        :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}" 
+                        :cell-style="{textAlign:'center'}" row-key="iid"
+                        style="width: 100%" ref="table" :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
                         <el-table-column type="index" label="搴忓彿" width="60"></el-table-column>
                         <el-table-column label="椤圭洰" prop="father"></el-table-column>
-                        <el-table-column prop="name" label="鎸囨爣"></el-table-column>
-                        <el-table-column prop="unit" label="鍗曚綅"></el-table-column>
+                        <el-table-column prop="iname" label="鎸囨爣"></el-table-column>
+                        <el-table-column prop="iunit" label="鍗曚綅"></el-table-column>
                         <el-table-column prop="required" label="鏍囧噯鍊�"></el-table-column>
-                        <el-table-column prop="internal" label="鍐呮祴鍊�"></el-table-column>
                         <el-table-column prop="inspectionValue" v-for="(item, index) in empiricalValueAdd" :key="index" label="妫�娴嬪��"
                             min-width="100" style="text-align: center;">
                             <template slot-scope="scope">
                                 <el-tooltip :disabled="scope.row.dname != null" class="item" effect="dark" content="璇峰厛閫夋嫨璁惧锛�"
                                     placement="top-start">
-                                    <el-input :disabled="scope.row.dname === null" v-model="scope.row.empiricalValueAddss[index]"
-                                        @blur="changeState(scope.row, index)" placeholder="璇疯緭鍏ユ娴嬪��"></el-input>
+                                    <!-- <el-input :disabled="scope.row.dname === null" v-model="scope.row.empiricalValueAddss[index]"
+                                        @blur="changeState(scope.row, index)" placeholder="璇疯緭鍏ユ娴嬪��"></el-input> -->
                                 </el-tooltip>
                             </template>
                         </el-table-column>
@@ -120,7 +121,15 @@
                                 </el-select>
                             </template>
                         </el-table-column>
-                        <el-table-column label="缁撹">
+                        <el-table-column prop="deviceName" label="璇曢獙璁惧" min-width="260">
+                            <template slot-scope="scope">
+                            <el-select style="width:100%" v-model="scope.row.equipmentId" 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>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="缁撹" fixed="right" min-width="100">
                             <template slot-scope="scope">
                                 <span style="color: #34BD66;" v-if="scope.row.result === 1">鍚堟牸</span>
                                 <span style="color: #E84738;" v-else-if="scope.row.result === 0">涓嶅悎鏍�</span>
@@ -137,7 +146,9 @@
             </el-row>
             <el-row style="width:100%;margin-top:-180px">
                 <el-col :span="24">
-                    <el-table border max-height="400" :data="inspectionResultForm">
+                    <el-table border max-height="400" :data="inspectionResultForm"
+                    :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}" 
+                    :cell-style="{textAlign:'center'}">
                         <el-table-column prop="id" label="鐗╂枡缂栧彿"></el-table-column>
                         <el-table-column prop="name" label="鐗╂枡鍚嶇О"></el-table-column>
                         <el-table-column prop="inspecter" label="妫�楠屽憳"></el-table-column>
@@ -160,9 +171,16 @@
 </template>
 
 <script>
+import { 
+    chooseMater,
+    addFinish,
+    queryById, } from '@/api/quality/finishedProduct'
+import { updateDeviceById,selectDevice } from '@/api/quality/rawMaterial'
 export default {
     data() {
         return {
+            deviceList: [],
+            hasChildren: true,
             showUp: false,
             isAddProject: false,
             showLook: false,
@@ -195,7 +213,7 @@
                 mcode: null,
                 prname: null,
                 sname: null,
-                orderNumber: "",
+                orderNumber: "ZTTIC20230001",
                 qualityTraceability: null,
                 quantity: null,
                 specificationsModel: null,
@@ -254,27 +272,40 @@
         };
     },
     watch: {
-        // filterText(val) {
-        //     this.$refs.tree.filter(val);
-        // }
+    },
+    beforeUpdate(){
+      this.$nextTick(()=>{
+        this.$refs.table.doLayout();
+      })
+    },
+    created() {
     },
     mounted() {
-        this.getTableData()
-        // this.getOptions();
+        this.getDeviceList()
     },
     methods: {
-        changeOptionsSamplename() {
-            let id = this.processInspectVo.material.split("-")[0]
-            let sample = this.optionsSamplename.filter(o => {
-                return o.id == id
-            })[0]
-            this.processInspectVo.qualityTraceability = sample.qualityTraceability
-            this.processInspectVo.mcode = sample.mcode
-            this.processInspectVo.specificationsModel = sample.specifications
-            this.processInspectVo.unit = sample.unit
+        getDeviceList(){
+            selectDevice(null).then(res=>{
+            this.deviceList = res.data.data
+            })
         },
-        comBack() {
-            this.$parent.comBackMain()
+        updateDevice(row){
+            if(this.dataForm.id != null){
+            updateDeviceById({equiomentId:row.equipmentId,rpId:row.rpId}).then(res=>{
+            }).catch(error=>{
+                console.log(error)
+            })
+            }
+        },
+        changeOptionsSamplename(val) {
+            let sample = this.optionsSamplename.filter(o => {
+                return o.materialCode == val
+            })[0]
+            // this.processInspectVo.qualityTraceability = sample.qualityTraceability
+            this.processInspectVo.mcode = sample.materialCode
+            this.processInspectVo.material = sample.material
+            this.processInspectVo.specificationsModel = sample.specs
+            this.processInspectVo.unit = sample.unit
         },
         handleClick(row) {
             this.rowInfp = row
@@ -284,44 +315,10 @@
             this.rowInfp = row
             this.showUp = true
         },
-        combackMain() {
-            this.showUp = false
-            this.showLook = false
-        },
         searchPro() {
             this.search.countSize = this.pageSize
             this.search.pageSize = this.currentPage
             this.defaultInitializationTable()
-        },
-        // 鐐瑰嚮璁惧鏍戜繚瀛樼偣鍑昏褰�
-        nodeClick(data) {
-            if (data.id != undefined) this.nodeData = data;
-        },
-        // 璁惧鏍戣繃婊ゆ悳绱�
-        filterNode(value, data) {
-            if (!value) return true;
-            return data.name.indexOf(value) !== -1;
-        },
-        // 鑾峰彇璁惧鏍戝唴瀹�
-        getOptions(row) {
-            this.$axios.get(this.$api.url.inspectionItemChooseDev, {
-                params: {
-                    father: row.father,
-                    name: row.name,
-                    technologyId: this.processInspectVo.technologyId
-                }
-            }).then(res => {
-                this.materialOptions = res.data;
-                this.filterText = row.did
-                if(this.materialOptions.length===1){
-                    this.$message({
-                    message: '璇ラ」鐩笅鍙湁涓�涓瘯楠岃澶囷紝鏃犻渶閫夋嫨锛�',
-                    type: 'warning'
-                });
-                    return
-                }
-                row.isSelectDevice = true
-            });
         },
         // 鐐瑰嚮琛ㄦ牸閫夋嫨瑙﹀彂
         clickTableSelect(scope) {
@@ -331,35 +328,6 @@
             this.clickSelectDevice.index = scope.$index;
             this.clickSelectDevice.rpId = scope.row.id;
             this.getOptions(scope.row);
-        },
-        // 鐐瑰嚮鏍戦噷闈㈢殑纭畾
-        clickNodeSure(row) {
-            let select = this.materialOptions.filter(item => {
-                return item.id === this.filterText
-            })[0]
-            this.nodeData.id = select.id
-            this.nodeData.name = select.device
-            if (this.detailId == null) {
-                this.inspectionItems[
-                    this.clickSelectDevice.index
-                ].did = this.nodeData.id;
-                this.inspectionItems[
-                    this.clickSelectDevice.index
-                ].dname = this.nodeData.name;
-                this.centerDialogVisible = false;
-            } else {
-                this.$axios
-                    .post(this.$api.url.inspectionItemUpdateDevByInsId, {
-                        id: this.clickSelectDevice.rpId,
-                        type: 2,
-                        devId: this.nodeData.id
-                    })
-                    .then(res => {
-                        this.getTableData()
-                        this.centerDialogVisible = false;
-                        row.isSelectDevice=false
-                    });
-            }
         },
         changeState(row, index) {
             if (row.did != null && row.did != '') {
@@ -400,187 +368,67 @@
                 });
             }
         },
-        // 姣忛〉鏉℃暟鏀瑰彉鏃惰Е鍙� 閫夋嫨涓�椤垫樉绀哄灏戣
-        handleSizeChange(val) {
-            this.search.countSize = val;
-            this.defaultInitializationTable();
-        },
-        handleSpanMethod({ row, column, rowIndex, columnIndex }) {
-            if (columnIndex === 0) {
-                const _row = this.spanArr[rowIndex];
-                const _col = _row > 0 ? 1 : 0;
-                return {
-                    rowspan: _row,
-                    colspan: _col
-                }
+        addTestProject() {
+            let val = this.processInspectVo
+            let data = {
+                customerName: val.prname,
+                material: val.material,
+                materialCode: val.mcode,
+                orderNumber: val.orderNumber,
+                projectName: val.sname,
+                quantity: val.quantity,
+                specs: val.specificationsModel,
+                unit: val.unit,
             }
-            if (columnIndex === 1) {
-                const _row = this.spanArr[rowIndex];
-                const _col = _row > 0 ? 1 : 0;
-                return {
-                    rowspan: _row,
-                    colspan: _col
-                }
-            }
-        },
-        // 鍚堝苟琛ㄦ牸
-        mergeTable() {
-            this.rowList = []
-            this.spanArr = []
-            this.position = 0
-            this.inspectionItems.forEach((item, index) => {
-                if (index === 0) {
-                    this.spanArr.push(1);
-                    this.position = 0;
-                } else {
-                    if (this.inspectionItems[index].father === this.inspectionItems[index - 1].father) {
-                        this.spanArr[this.position] += 1;
-                        this.spanArr.push(0);
-                    } else {
-                        this.spanArr.push(1);
-                        this.position = index;
-                    }
-                }
-            })
-        },
-        changeOptionSoptionSprocesses() {
-            this.optionTechnology = []
-            let working = this.optionSoptionSprocesses.filter(item => {
-                return item.name === this.processInspectVo.techfather
-            })[0]
-            this.optionTechnology = working.children
-        },
-        addTestProjevt() {
-            // this.isAddProject = true
-            let val = JSON.parse(JSON.stringify(this.processInspectVo))
-            val.material = this.processInspectVo.material.split("-")[1]
-            val.id = this.processInspectVo.material.split("-")[0]
-            this.$axios.post(this.$api.url.finishedInspectAddFinish, val, {
-                headers: { "Content-Type": "application/json" }
-            }).then(res => {
-                if (res.code == 201) {
-                    this.$message({
-                        message: res.message,
-                        type: 'warning'
-                    });
-                    return
-                }
-                this.detailId = res.data
-                this.inspectionResultForm[0].id = val.mcode
-                this.inspectionResultForm[0].name = val.material
-                this.getTableData()
-            })
-        },
-        getTableData() {
-            this.$axios.get(this.$api.url.finishedInspectSelectFinishInspectsListById, {
-                params: {
-                    id: this.detailId
-                }
-            }).then(res => {
-                this.processInspectVo.technologyId = res.data[0].techId
-            })
-            this.$axios.get(this.$api.url.inspectionItemListUser, {
-                params: {
-                    id: this.detailId,
-                    type: 2
-                }
-            }).then(res => {
-                if (res.data.length < 1) {
-                    return
-                }
-                this.inspectionItems = res.data
-                let arr = []
-                let val = JSON.parse(JSON.stringify(this.inspectionItems))
-                const uName = []
-                //杞垚涓�缁存暟缁�
-                val.forEach(l => {
-                    let father = l.father
-                    l.children.forEach(c => {
-                        c.father = father
-                        c.empiricalValueAddss = []
-                        if (c.inspectionValue != '' && c.inspectionValue != null) {
-                            c.empiricalValueAddss = c.inspectionValue.split(",");
-                        } else {
-                            c.empiricalValueAddss.push("")
-                        }
-                        uName.push(c['username'])
-                        c.isSelectDevice = false
-                        arr.push(c)
+            addFinish(data).then(res=>{
+                let id = res.data.data
+                if(id != null){
+                    queryById(id).then(response=>{
+                        console.log(response.data.data.children)
+                        let proList = response.data.data.children
+                        proList.forEach(item=>{
+                            item.iid = Math.random();
+                        })
+                        this.inspectionItems = proList
+                    }).catch(error=>{
+                        console.log(error);
                     })
-                })
-                this.inspectionItems = arr
-                let arrSort = JSON.parse(JSON.stringify(arr))
-                //鏍规嵁闆嗗悎瀵硅薄鏁扮粍闀垮害鎺掑簭
-                arrSort.sort((a, b) => {
-                    if (a.empiricalValueAddss.length < b.empiricalValueAddss.length) {
-                        return -1; // a鎺掑湪b鍓嶉潰
-                    } else if (a.empiricalValueAddss.length > b.empiricalValueAddss.length) {
-                        return 1; // a鎺掑湪b鍚庨潰
-                    } else {
-                        return 0; // 淇濇寔鐩稿椤哄簭涓嶅彉
-                    }
-                });
-                // console.log(arrSort);
-                console.log(uName);
-                let name = [...new Set(uName)].filter(item => item !== null);
-                let rname = ''
-                name.forEach(m => {
-                    rname += m + ","
-                })
-                this.inspectionResultForm[0].inspecter = rname.slice(0, -1)
-                this.empiricalValueAdd = arrSort[arrSort.length - 1].empiricalValueAddss.length
-                this.mergeTable(arr)
+                }
+            }).catch(error=>{
+                console.log(error)
             })
-        },
-        selectSample() {
-            let sample = this.optionsSamplename.filter(item => {
-                return item.name === this.processInspectVo.material
-            })[0]
-            this.processInspectVo.techfather = null
-            this.processInspectVo.techname = null
-            this.processInspectVo.materialCode = sample.code
-            this.processInspectVo.specificationsModel = sample.specifications
-            this.processInspectVo.unit = sample.unit
-            this.optionSoptionSprocesses = []
-            this.optionSoptionSprocesses = sample.children
         },
         selectInfoByOrderId() {
-            this.$axios.get(this.$api.url.finishedInspectChooseMater, {
-                params: {
+            chooseMater({
                     orderNumber: this.processInspectVo.orderNumber
-                }
-            }).then(res => {
-                if (res.data.length > 0) {
-                    console.log(res.data);
-                    this.processInspectVo.sname = res.data[0].sname
-                    this.processInspectVo.prname = res.data[0].prname
-                    this.optionsSamplename = res.data[0].children
+                }).then(res => {
+                if (res.data.data != null) {
+                    this.processInspectVo.sname = res.data.data.projectName
+                    this.processInspectVo.prname = res.data.data.customerName
+                    this.optionsSamplename = res.data.data.children
                 } else {
                     this.$message({
                         message: '娌℃湁璇ヨ鍗曞彿锛�',
                         type: 'warning'
                     });
+                    this.processInspectVo.sname = null
+                    this.processInspectVo.prname = null
+                    this.optionsSamplename = []
+                    this.processInspectVo.mcode = null
+                    this.processInspectVo.material = null
+                    this.processInspectVo.specificationsModel = null
+                    this.processInspectVo.unit = null
                 }
             })
         },
-        // 褰撳墠椤垫敼鍙樻椂瑙﹀彂 璺宠浆鍏朵粬椤�
-        handleCurrentChange(val) {
-            this.search.pageSize = val;
-            this.defaultInitializationTable();
-        },
-        // 鏄剧ず鏂板椤甸潰
-        handleAddNew() {
-            this.showAddPage = true;
-            // this.getTableData()
-        },
         // 琛ㄦ牸鍒濆鍖栨帴鍙�
         defaultInitializationTable() {
-            this.$axios
-                .post(this.$api.url.selectProcessInspectsList, this.search)
-                .then(res => {
-                    this.inspectionTableTotal = res.data.total;
-                    this.inspectionTable = res.data.row;
-                });
+            // this.$axios
+            //     .post(this.$api.url.selectProcessInspectsList, this.search)
+            //     .then(res => {
+            //         this.inspectionTableTotal = res.data.total;
+            //         this.inspectionTable = res.data.row;
+            //     });
         },
         // 娣诲姞琛�
         clickAddLine() {
@@ -618,9 +466,6 @@
             this.empiricalValueAdd = this.empiricalValueAdd + 1;
         }
     },
-    created() {
-        this.defaultInitializationTable(); // 鍒濆鍖栬〃鏍兼暟鎹�
-    }
 }
 </script>
 
@@ -639,7 +484,7 @@
 
 .finishedProduct-basic {
   background-color: #fff;
-  height: 150px;
+  height: 155px;
   display: flex;
   flex-wrap: wrap;
   padding: 10px 20px;
diff --git a/src/views/quality/finishedProductInspection/index.vue b/src/views/quality/finishedProductInspection/index.vue
index 73c770a..1ab2496 100644
--- a/src/views/quality/finishedProductInspection/index.vue
+++ b/src/views/quality/finishedProductInspection/index.vue
@@ -1,31 +1,6 @@
 <template>
 	<div class="content-main">
-		<div v-if="!showAdd&&!showLook&&!showUp" class="rawPage">
-			<!-- <div class="nav"> -->
-                <!-- <div class="title">
-                    <el-row>
-                        <el-col :span="12">浜у搧妫�楠�</el-col>
-                        <el-col :span="12">
-                            <el-button @click="handleAddNew" type="primary" size="mini" icon="el-icon-plus"
-                                style="background: #004EA2; ">鏂板</el-button>
-                            <el-button icon="el-icon-delete" size="mini">鍒犻櫎</el-button>
-                            <el-button icon="el-icon-download" size="mini">瀵煎嚭</el-button>
-                        </el-col>
-                    </el-row>
-                </div> -->
-				<!-- <span>妫�娴嬬粨鏋滐細</span>
-				<el-select v-model="searchData.result" size="small" placeholder="璇烽�夋嫨" style="width: 224px;margin-right: 52px;">
-					<el-option :value="''" label="鍏ㄩ儴"></el-option>
-					<el-option :value="1" label="鍚堟牸"></el-option>
-					<el-option :value="0" label="涓嶅悎鏍�"></el-option>
-				</el-select>
-				<span>浜у搧鍚嶇О锛�</span>
-				<el-input v-model="searchData.material" size="small" placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�"
-					style="width: 224px;margin-right: 52px;"></el-input>
-				<el-button size="mini" @click="()=>{searchData={};getInspectionTableData()}"><span>閲� 缃�</span></el-button>
-				<el-button size="mini" type="primary" @click="getInspectionTableData" style="background: #004EA2;"><span>鏌�
-						璇�</span></el-button> -->
-			<!-- </div> -->
+		<div class="rawPage">
             <basic-container>
                 <ttable 
                 :table="table"
@@ -37,56 +12,6 @@
                 <template #toolbar></template>
                 </ttable>
             </basic-container>
-			<!-- <div class="content-body">
-				<div class="inspectionTable">
-					<el-table ref="inspectionTable" height="620" :cell-style="{textAlign: 'center'}"
-						:header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
-						:data="inspectionTable" style="width: 100%">
-						<el-table-column type="selection" width="50">
-						</el-table-column>
-						<el-table-column prop="order_number" label="璁㈠崟鍙�" min-width="100" />
-						<el-table-column prop="customer_name" label="瀹㈡埛鍚嶇О" min-width="80" />
-						<el-table-column prop="project_name" label="宸ョ▼鍚嶇О" min-width="80" />
-						<el-table-column prop="quality_traceability" label="璐ㄩ噺杩芥函鍙�" min-width="108" />
-						<el-table-column prop="material_code" label="浜у搧缂栫爜" min-width="100" />
-						<el-table-column prop="material" label="浜у搧澶х被" min-width="72" />
-						<el-table-column prop="specifications_model" label="瑙勬牸鍨嬪彿" min-width="110" />
-						<el-table-column prop="unit" label="鍗曚綅" min-width="50" />
-						<el-table-column prop="quantity" label="鏁伴噺" min-width="50" />
-						<el-table-column prop="detectionPeriod" label="妫�楠屾棩鏈�" min-width="80" />
-						<el-table-column prop="result" label="妫�娴嬬粨鏋�" min-width="80">
-							<template slot-scope="scope">
-								<span style="color: #34BD66;" v-if="scope.row.result === 1">鍚堟牸</span>
-								<span style="color: #E84738;" v-else-if="scope.row.result === 0">涓嶅悎鏍�</span>
-								<span v-else-if="scope.row.result === null || scope.row.result === undefined">鏆傛湭缁撹</span>
-							</template>
-						</el-table-column>
-						<el-table-column label="鎿嶄綔" min-width="80">
-							<template slot-scope="scope">
-								<el-button type="text" size="small" @click="goToDetail(scope.row)">鏌ョ湅</el-button>
-								<el-button type="text" size="small">鎵撳嵃</el-button>
-								<el-button v-if="scope.row.result == null" type="text" size="small"
-									@click="goUp(scope.row)">缂栬緫</el-button>
-							</template>
-						</el-table-column>
-					</el-table>
-				</div> -->
-				<!-- 鍒嗛〉鍣� -->
-				<!-- <div class="pagination">
-					<el-pagination :current-page="pageParams.pageSize" :page-sizes="[10, 50, 100, 200]"
-						:page-size="pageParams.countSize" layout="total, sizes, prev, pager, next, jumper" :total="pageParams.total"
-						@size-change="handleSizeChange" @current-change="handleCurrentChange" />
-				</div> -->
-			<!-- </div> -->
-		</div>
-		<div class="newPage" v-if="showAdd">
-			<finishedProductInspectionAdd />
-		</div>
-		<div class="newPage" v-if="showLook">
-			<finishedProductInspectionLook :rowInfo="rowInfo" />
-		</div>
-		<div class="newPage" v-if="showUp">
-			<finishedProductInspectionUp :rowInfo="rowInfo" />
 		</div>
 	</div>
 </template>
@@ -227,7 +152,7 @@
                     {
                         text: '鏂板',
                         type: 'primary',
-                        fun: ()=>this.showAdd=true
+                        fun: this.addOrUpdateHandle
                     },
                     {
                         text: '鍒犻櫎',
@@ -315,6 +240,13 @@
 			// this.getInspectionTableData()
 		},
 		methods: {
+			// 鏂板 / 淇敼
+			addOrUpdateHandle(row) {
+				this.$router.push({
+					name: 'finishedProductForm',
+					query: { id: row == null ? null : row.id }
+				})
+			},
             formatResult(row, column, cellValue){
                 if(cellValue != undefined || cellValue != null){
                     if(cellValue == 0){
@@ -326,12 +258,6 @@
             },
             formatDateTime(row, column, cellValue) {
                 return cellValue ? fecha.format(new Date(cellValue), 'yyyy-MM-dd') : ''
-            },
-            addOrUpdateHandle(row) {
-                this.$router.push({
-                    name: 'rawMaterialForm',
-                    query: { id: row == null ? null : row.id }
-                })
             },
             handleSelectionChange(){
 
diff --git a/src/views/quality/rawMaterial/rawMaterial-form.vue b/src/views/quality/rawMaterial/rawMaterial-form.vue
index d877ccd..5ca9203 100644
--- a/src/views/quality/rawMaterial/rawMaterial-form.vue
+++ b/src/views/quality/rawMaterial/rawMaterial-form.vue
@@ -11,14 +11,6 @@
     </div>
     <div class="page-main">
       <div class="rawMaterial-basic">
-        <el-row style="width:100%;height:20px;margin-bottom:20px;" v-show="dataForm.id==null">
-          <el-col :span="20">
-            <span style="color:red;font-size:18px;padding: 0;margin: 0;">璇锋壂鎻忎簩缁寸爜鑾峰彇鏁版嵁</span>
-          </el-col>
-          <el-col :span="4" style="text-align: right;">
-            <el-button>鎵弿浜岀淮鐮�</el-button>
-          </el-col>
-        </el-row>
         <el-form
         :model="dataForm"
         :rules="dataRule"
@@ -27,15 +19,14 @@
         class="l-mes"
         label-width="110px">
             <el-row>
-            <el-col :span="6">
-                <el-form-item prop="formTime" label="鏉ユ枡鏃ユ湡">
-                <el-date-picker 
-                    v-model="dataForm.formTime"
-                    type="datetime"
-                    value-format="yyyy-MM-dd HH:mm:ss"
-                    disabled>
-
-                </el-date-picker>
+              <el-col :span="6">
+                <el-form-item label="闆朵欢鍙�" prop="code">
+                <el-input v-model="dataForm.code">
+                  <el-button
+                    slot="append"
+                    icon="el-icon-search"
+                    @click="queryCode()"></el-button>
+                </el-input>
                 </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -45,8 +36,14 @@
                 </el-form-item>
             </el-col>
             <el-col :span="6">
-                <el-form-item label="鍘熸潗鏂欑紪鐮�" prop="code">
-                <el-input v-model="dataForm.code" disabled></el-input>
+                <el-form-item prop="formTime" label="鏉ユ枡鏃ユ湡">
+                <el-date-picker 
+                    v-model="dataForm.formTime"
+                    type="datetime"
+                    value-format="yyyy-MM-dd HH:mm:ss"
+                    disabled>
+
+                </el-date-picker>
                 </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -102,12 +99,18 @@
         </el-row>
         <el-row style="width:100%;">
             <el-col :span="24">
-                <el-table :data="list" border style="width: 100%;" height="320">
+                <el-table :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}" 
+                :cell-style="{textAlign:'center'}" ref="table"
+                :data="list" border style="width: 100%;" height="320">
                   <el-table-column type="index" label="搴忓彿" width="60">
                   </el-table-column>
                   <el-table-column prop="name" label="椤圭洰" width="260">
                     <template slot-scope="scope">
-                      <el-input :disabled="dataForm.id != null" class="inline-input" v-model="scope.row.name"
+                      <el-select v-if="projectList.length > 0" :disabled="dataForm.id != null" class="inline-input" v-model="scope.row.name"
+                      filterable allow-create placeholder="璇疯緭鍏ユ垨閫夋嫨椤圭洰鍚嶇О" style="width:100%" @change="changeName(scope.$index,scope.row)">
+                        <el-option v-for="(item,index) in projectList" :key="index" :label="item.name" :value="item.name"/>
+                    </el-select>  
+                      <el-input v-else :disabled="dataForm.id != null" class="inline-input" v-model="scope.row.name"
                         placeholder="璇疯緭鍏ラ」鐩悕绉�"></el-input>
                     </template>
                   </el-table-column>
@@ -179,6 +182,7 @@
         </el-row>
       </div>
     </div>
+    <rawMaterialPartDialog :paramObj="paramObj" :currshowlist.sync="showPart"  @listenToPartEvent="selectPart" />
   </div>
 </template>
 
@@ -190,10 +194,21 @@
   getObj,
   updateRawInsProduct,
   updateRawInspectsById,
+  chooseIFS,
+  selectHisByCode,
   updateDeviceById, } from '@/api/quality/rawMaterial'
+  import rawMaterialPartDialog from '@/views/common/rawMaterial-part'
 export default {
+    computed:{},
+    components:{
+      rawMaterialPartDialog
+    },
     data(){
         return{
+            projectList: [],
+            paramObj: {},
+            IFSData: [],
+            showPart: false,
             // 娣诲姞鍒�
             empiricalValueAdd: 1,
             // 缂栬緫鏃跺瓨鍌ㄦ渶闀跨殑鍒楁暟瀛楋紝鍋氬垹闄ゅ垽鏂�
@@ -202,14 +217,14 @@
             dataForm:{
                 id: null,
                 judgeState: null,
-                formTime: '2023-10-28 00:00:00',
-                message: '-2050314,1,1,*,1002',
-                name: 'name',
-                code: 'code4',
-                specs: 'specs',
-                unit: 'mm',
-                number: '111',
-                supplier: 'supplier',
+                formTime: '',
+                message: '',
+                name: '',
+                code: '88.118.1/A0487643',
+                specs: '',
+                unit: '',
+                number: '',
+                supplier: '',
                 rawInsProducts: [{
                   equipmentId: 0,
                   name: '',
@@ -234,6 +249,11 @@
             deviceList: [],
         }
     },
+    beforeUpdate(){
+      this.$nextTick(()=>{
+        this.$refs.table.doLayout();
+      })
+    },
     mounted(){
       this.dataForm.id = this.$route.query.id
       this.init()
@@ -247,6 +267,34 @@
 
     },
     methods:{
+      changeName(index,row){
+        this.projectList.forEach(item=>{
+          if(row.name == item.name){
+            this.list[index].unit = item.unit
+            this.list[index].required = item.required
+          }
+        })
+      },
+      // 纭鍥炶皟
+      selectPart(param, nodePart, index) {
+        if (typeof param !== 'undefined') {
+          this.dataForm.code = param.code
+          this.dataForm.name = param.name
+          this.dataForm.formTime = param.formTime
+          this.dataForm.unit = param.unit
+          this.dataForm.specs = param.specs
+          this.dataForm.supplier = param.supplier
+          this.dataForm.number = param.number
+          this.dataForm.message = param.message
+          this.projectList = param.rawInsProducts
+        }
+      },
+      queryCode(){
+        this.paramObj = {
+          code: this.dataForm.code
+        }
+        this.showPart = true
+      },
       updateDevice(row){
         if(this.dataForm.id != null){
           updateDeviceById({equiomentId:row.equipmentId,rpId:row.rpId}).then(res=>{
@@ -283,6 +331,19 @@
       },
       addTeatValueColumn(){
         this.empiricalValueAdd = this.empiricalValueAdd + 1;
+      },
+      // 娣诲姞琛�
+      clickAddLine() {
+        let obj = {
+          equipmentId: null,
+          name: "",
+          required: "",
+          testValue: "",
+          unit: "",
+          testState: null,
+          testValueList: [],
+        };
+        this.list.push(obj);
       },
       // 鍒犻櫎琛�
       clickDeleteline(scope) {
@@ -381,27 +442,12 @@
           this.$message.error(error)
         })
       },
-      // 娣诲姞琛�
-      clickAddLine() {
-        let obj = {
-          equipmentId: null,
-          name: "",
-          required: "",
-          testValue: "",
-          unit: "",
-          testState: null,
-          testValueList: [],
-        };
-        this.list.push(obj);
-      },
       getDeviceList(){
         selectDevice(null).then(res=>{
           this.deviceList = res.data.data
         })
       },
     },
-    computed:{},
-    components:{}
 }
 </script>
 
@@ -420,7 +466,7 @@
 
 .rawMaterial-basic {
   background-color: #fff;
-  height: 150px;
+  height: 155px;
   display: flex;
   flex-wrap: wrap;
   padding: 10px 20px;

--
Gitblit v1.9.3