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 ++++++++++++++++++++++++++++++---------------
 1 files changed, 91 insertions(+), 45 deletions(-)

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