LAPTOP-16IUEB3P\Lenovo преди 2 години
родител
ревизия
8875cb7b50

+ 9 - 0
src/api/material/manage.js

@@ -18,4 +18,13 @@ export async function addMaterial (data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
+}
+
+// 获取列表  
+export async function getMaterialList (data) {
+  const res = await request.post(`/main/category/getList`,data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 1 - 1
src/views/material/manage/components/RemarkInfo.vue

@@ -11,7 +11,7 @@
          <el-row :gutter="24">
            <el-col :span="24">
              <el-form-item label="附件" prop="allowReturns">
-                 <fileUpload v-model="form.imgList" module="file" :limit="4" ></fileUpload>
+                 <fileUpload v-model="form.remarkAttach" module="file" :limit="4" ></fileUpload>
              </el-form-item>
            </el-col>
            <el-col :span="24">

+ 5 - 34
src/views/material/manage/components/index-data.vue

@@ -57,12 +57,7 @@
 </template>
 
 <script>
-  import {
-    pageDictionaryData,
-    removeDictionaryData,
-    removeDictionaryDataBatch
-  } from '@/api/system/dictionary-data';
-  import { listDictionaries, removeDictionary } from '@/api/system/dictionary';
+  import { getMaterialList } from '@/api/material/manage.js';
   export default {
     components: { },
     data() {
@@ -160,7 +155,7 @@
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return listDictionaries({ pageNum: page, size: limit, ...where });
+        return getMaterialList({ pageNum: page, size: limit, ...where });
       },
       /* 刷新表格 */
       reload(where) {
@@ -193,37 +188,13 @@
             loading.close();
             // this.$message.error(e.message);
           });
-      },
-      /* 批量删除 */
-      removeBatch() {
-        if (!this.selection.length) {
-          this.$message.error('请至少选择一条数据');
-          return;
-        }
-        this.$confirm('确定要删除选中的字典项吗?', '提示', {
-          type: 'warning'
-        })
-          .then(() => {
-            const loading = this.$loading({ lock: true });
-            removeDictionaryDataBatch(this.selection.map((d) => d.dictDataId))
-              .then((msg) => {
-                loading.close();
-                this.$message.success(msg);
-                this.reload();
-              })
-              .catch((e) => {
-                loading.close();
-                // this.$message.error(e.message);
-              });
-          })
-          .catch(() => {});
       }
     },
     watch: {
       // 监听字典id变化
-      // dictId() {
-      //   this.reload();
-      // }
+      currentId() {
+        this.reload();
+      }
     }
   };
 </script>

+ 1 - 3
src/views/material/manage/index.vue

@@ -38,12 +38,10 @@
 
         <template v-slot:content>
           <!-- 物料列表 -->
-          <IndexData ref="listData" v-if="current" :dict-id="current.id" />
+          <IndexData ref="listData" v-if="current" :current-id="current.id" />
         </template>
       </ele-split-layout>
     </el-card>
-<!--    编辑弹窗
-    <dict-edit :visible.sync="showEdit" @done="reload" /> -->
   </div>
 </template>
 

+ 3 - 15
src/views/material/manage/manageMaterial.vue

@@ -186,7 +186,6 @@
            categoryLevelName:'',
          },
          remarkform:{},
-         imgList:[],
          chooseItem:null,
       };
     },
@@ -266,30 +265,19 @@
             return false;
           }
           this.loading = true;
-          const imgList = this.remarkform.imgList
-          const arr = []
-          if(imgList.length){
-             imgList.map(item=>{
-                arr.push(item.storePath)
-             })
-             this.form.remarkAttach = arr.join(',')
-          }
-          this.form.remark = this.remarkform.remark?this.remarkform.remark:''
           const data = {
-            ...this.form
+            ...this.form,
+            ...this.remarkform
           };
           addMaterial(data)
             .then((msg) => {
               this.loading = false;
               this.$message.success(msg);
-              this.updateVisible(false);
-              this.$emit('done');
+              this.$router.go(-1)
             })
             .catch((e) => {
               this.loading = false;
             });
-
-
         })
 
       }