chencc 1 an în urmă
părinte
comite
9b232d7955

+ 1 - 1
src/main.js

@@ -28,7 +28,7 @@ Vue.component('authSelection', authSelection);
 import Print from 'vue-printjs';
 Vue.use(Print);
 
-init();
+// init();
 
 // // register globally
 Vue.component('tinymce', TinymceEditor);

+ 1 - 1
src/views/material/BOMmanage/components/clientDialog.vue

@@ -267,7 +267,7 @@
       },
       confirm() {
         
-        if(this.current.id){
+        if(this.current?.id){
           this.radio ="";
           this.$emit('success', this.current);
           this.visible = false;

+ 56 - 29
src/views/material/BOMmanage/components/detailedList.vue

@@ -2,7 +2,7 @@
   <div class="ele-body">
 
     <BOMSearch @search="reload" :statusOpt="statusOpt" />
-    <ele-pro-table ref="table" :columns="columns" :datasource="datasource" class="dict-table"
+    <ele-pro-table ref="table" :key="tableKey" :columns="columns" :datasource="datasource" class="dict-table"
       tool-class="ele-toolbar-actions">
 
       <template v-slot:toolbar>
@@ -74,17 +74,17 @@
       </template>
 
       <template v-slot:factories="{ row }">
-        <div  style="display: flex;">
-          <el-input v-model="row.factories"  placeholder="请选择生产厂家" size="mini" style="width: 120px">
-        </el-input>
-        <!-- disabled -->
-        <!-- <el-button type="primary" @click="factoriesFn(row.code)">选择</el-button> -->
+        <div style="display: flex;">
+          <el-input v-model="row.factories" disabled :value="row.factories"  placeholder="请选择生产厂家" size="mini" style="width: 120px">
+          </el-input>
+          <!--  -->
+          <el-button type="primary" @click="factoriesFn(row.code)">选择</el-button>
           <!-- <el-select v-model="row.factories" size="mini" clearable class="ele-block" filterable placeholder="请选择生产厂家">
             <el-option v-for="(item, index) in sccjList" :key="item.id + index" :value="item.id"
               :label="item.name"></el-option>
           </el-select> -->
         </div>
-        
+
 
         <!-- <el-input v-model="row.factories" placeholder="请输入生产厂家" size="mini" style="width: 120px">
         </el-input> -->
@@ -126,7 +126,7 @@ import bomTreeDialog from './bomTreeDialog.vue';
 import standardOutput from './standardOutput.vue';
 export default {
   name: 'SystemDictionary',
-  components: { BOMSearch, bomTreeDialog, standardOutput,clientDialog },
+  components: { BOMSearch, bomTreeDialog, standardOutput, clientDialog },
 
   data() {
     return {
@@ -284,11 +284,14 @@ export default {
           value: 4
         }
       ],
+      isList:false,
       isId: null,
+      tableKey:"",
       list: [],//表格数据
+      listTow:[],
       newList: [],
       gysList: [],
-      sccjList:[],
+      sccjList: [],
       newTreeId: null,
       responsesList: [],
       dictList: []
@@ -346,37 +349,56 @@ export default {
       deep: true,
       immediate: true
     },
-
   },
+  // computed: {
+  //   processedItems() {
+  //     return this.list.map(item => {
+  //       // 处理逻辑
+  //       console.log(item);
+  //       // return processedItem;
+  //     });
+  //   }
+  // },
+
 
   methods: {
-    factoriesFn(code){
+    factoriesFn(code) {
       this.isId = code;
       this.$refs.clientSelectionRef.open();
     },
     // 选择工厂
     confirmSelection(obj) {
-      let list  = this.list;
-      list.map(v=>{
-       
-        if(v.code == this.isId){
+      let list = this.$refs.table.getData();
+      list.map(v => {
+
+        if (v.code == this.isId) {
           v.factories = obj.name;
-        } 
+        }
       });
+      console.log(list,'list');
       // arr.factories = obj.name;
-      
-
       this.$nextTick(() => {
         this.list = [...list];
+        this.listTow = JSON.parse(JSON.stringify(this.list));
+
+        console.log(this.listTow,'listTowlistTowlistTowlistTow');
         this.$refs.table.setData(this.list)
-        // setTimeout(() => {
-        //   this.$refs.table.setData([...list])
-        // },200)
+        this.updateFn()
+        this.tableKey = Date.now();
+        
       });
-    
+
       this.$forceUpdate();
     },
 
+    updateFn(list){
+      this.isList = true;
+      this.reload();
+      setTimeout(() => {
+        this.isList = false;
+      }, 1000);
+    },
+
     /* 表格数据源 */
     datasource({ where, page, limit }) {
       // let that = this;
@@ -429,13 +451,17 @@ export default {
       //     });
       // });
 
-      return getBomPageCategoryId({
+      let data =  getBomPageCategoryId({
         ...where,
         pageNum: page,
         size: limit,
         id: this.attributeData.id,
         bomType: this.attributeData.bomType
       });
+      if(this.isList){
+        data= this.listTow;
+      }
+      return data;
     },
 
     /* 刷新表格 */
@@ -465,7 +491,7 @@ export default {
         this.gysList = res.list;
       });
     },
-    
+
 
     handleAdd() {
       // // 打开树形对话框
@@ -642,13 +668,14 @@ export default {
         return this.$message.info('用量不能为空')
       }
       updateBatchBOM(list).then((res) => {
-        if(res){
+        if (res) {
           this.$message.success('保存成功');
-          this.$refs.table.reload({
-            pageNum: 1
-          });
+          this.reload();
+          // this.$refs.table.reload({
+          //   pageNum: 1
+          // });
         }
-        
+
       });
     }
   }