Просмотр исходного кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

yusheng 10 месяцев назад
Родитель
Сommit
14696b0ece

+ 82 - 0
src/views/material/BOMmanage/file/fileSearch.vue

@@ -0,0 +1,82 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="77px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 6 }">
+        <el-form-item label="编码:">
+          <el-input clearable v-model.trim="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 6 }">
+        <el-form-item label="文档名称:">
+          <el-input clearable v-model.trim="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        code: '',
+        name: ''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+        // controlList: []
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {
+      // this.getControlList();
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+
+      // getControlList() {
+      //   const params = {
+      //     pageNum: 1,
+      //     size: -1
+      //   };
+      //   control.list().then((res) => {
+      //     this.controlList = res.list;
+      //   });
+      // }
+    }
+  };
+</script>

+ 6 - 3
src/views/material/BOMmanage/file/index.vue

@@ -11,6 +11,7 @@
   >
   >
     <div>
     <div>
       <el-card shadow="never" v-loading="loading">
       <el-card shadow="never" v-loading="loading">
+        <file-search @search="reload" />
         <ele-split-layout
         <ele-split-layout
           width="240px"
           width="240px"
           allow-collapse
           allow-collapse
@@ -73,11 +74,12 @@
 <script>
 <script>
   import { getDocTreeListAPI, filePageAPI } from '@/api/material/file';
   import { getDocTreeListAPI, filePageAPI } from '@/api/material/file';
   import { mapGetters } from 'vuex';
   import { mapGetters } from 'vuex';
+  import fileSearch from './fileSearch.vue';
 
 
   import fileBrowse from '../file/fileBrowse.vue';
   import fileBrowse from '../file/fileBrowse.vue';
 
 
   export default {
   export default {
-    components: { fileBrowse },
+    components: { fileBrowse, fileSearch },
     mixins: [],
     mixins: [],
 
 
     data() {
     data() {
@@ -243,9 +245,10 @@
         });
         });
       },
       },
       /* 刷新表格 */
       /* 刷新表格 */
-      reload() {
+      reload(where) {
         this.$refs.table.reload({
         this.$refs.table.reload({
-          pageNum: 1
+          pageNum: 1,
+          where
         });
         });
       },
       },
 
 

+ 2 - 2
src/views/rulesManagement/matterRules/components/ProductModal.vue

@@ -264,13 +264,13 @@
           };
           };
         });
         });
 
 
-        this.$emit('chooseModal', _arr);
+        this.$emit('chooseModal', ..._arr, this.receiveIndex);
         this.handleClose();
         this.handleClose();
       },
       },
       chooseRadio(row) {
       chooseRadio(row) {
         console.log(row, '勾选');
         console.log(row, '勾选');
         this.visible = false;
         this.visible = false;
-        this.$emit('chooseRadio', row,this.rowDataBom);
+        this.$emit('chooseRadio', row, this.rowDataBom);
       }
       }
     }
     }
   };
   };

+ 44 - 1
src/views/rulesManagement/matterRules/components/matter-add.vue

@@ -247,7 +247,11 @@
     </ele-modal>
     </ele-modal>
     <operation-guideDialog ref="operationGuideDialog" @save="saveEdit" />
     <operation-guideDialog ref="operationGuideDialog" @save="saveEdit" />
     <!-- 零部件 -->
     <!-- 零部件 -->
-    <ProductModal ref="productRefs" @chooseRadio="chooseRadio" />
+    <ProductModal
+      ref="productRefs"
+      @chooseRadio="chooseRadio"
+      @chooseModal="chooseModal"
+    />
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
@@ -582,7 +586,46 @@
           this.$message.error('请添加事项内容!');
           this.$message.error('请添加事项内容!');
         }
         }
       },
       },
+
+      chooseModal(clickBomData, index) {
+        console.log(this.formData, '开始');
+        console.log(clickBomData, 'clickBomData');
+        this.formData.ruleItems[index] = clickBomData;
+        this.formData.ruleItems[index].categoryCode = clickBomData.code;
+        this.formData.ruleItems[index].categoryName = clickBomData.name;
+        const data = deepClone(this.formData);
+        this.formData = data;
+        // this.$set(this, 'formData', this.formData);
+        // this.$refs.contentConfigForm &&
+        //   this.$refs.contentConfigForm.resetFields();
+        // this.$refs.multipleTable.setData(this.formData.ruleItems);
+        // this.$set(
+        //   this.formData.ruleItems[index],
+        //   'categoryCode',
+        //   clickBomData.code
+        // );
+        // this.$set(
+        //   this.formData.ruleItems[index],
+        //   'categoryName',
+        //   clickBomData.name
+        // );
+        // this.$set()
+        // this.$forceUpdate();
+
+        console.log(data, '结束');
+
+        // const findex = val[0].findex;
+        // const items = val.map((item) => ({
+        //   ...this.formData.ruleItems[findex],
+        //   categoryCode: item.code,
+        //   categoryName: item.name
+        // }));
+        // this.formData.ruleItems.splice(findex + 1, 0, ...items);
+        // this.formData.ruleItems.splice(findex, 1);
+      },
+
       chooseRadio(val, clickBomData) {
       chooseRadio(val, clickBomData) {
+        console.log(val, clickBomData, 'val, clickBomData');
         if (val.length > 0) {
         if (val.length > 0) {
           console.log('clickBomData--------------------', clickBomData);
           console.log('clickBomData--------------------', clickBomData);
 
 

+ 1 - 1
src/views/rulesManagement/matterRules/components/operationGuideDialog.vue

@@ -179,7 +179,7 @@
       },
       },
 
 
       chooseModal(data) {
       chooseModal(data) {
-        this.form.toolList = [...this.form.toolList, ...data];
+        this.form.toolList = [...this.form.toolList, data];
       },
       },
 
 
       removeItem(idx, row) {
       removeItem(idx, row) {