quwangxin hace 2 años
padre
commit
bf5b7a5f4c
Se han modificado 1 ficheros con 15 adiciones y 15 borrados
  1. 15 15
      src/components/material/ChooseMaterial.vue

+ 15 - 15
src/components/material/ChooseMaterial.vue

@@ -16,7 +16,7 @@
               <el-col :span="6">
                 <el-input
                   v-model.trim="searchKey"
-                  placeholder="输入设备编码或名称"
+                  placeholder="输入编码或名称"
                   size="small"
                 ></el-input>
               </el-col>
@@ -67,7 +67,7 @@
     components: {
       AssetTree
     },
-    data() {
+    data () {
       return {
         materialdialog: false,
         selectionList: [],
@@ -119,8 +119,7 @@
       };
     },
     watch: {
-      selectionList(newVal, oldVal) {
-        console.log(newVal, oldVal);
+      selectionList (newVal, oldVal) {
         if (newVal.length < oldVal.length) {
           const arr = oldVal.filter(
             (item) => !newVal.find((p) => p.id === item.id)
@@ -133,22 +132,22 @@
       }
     },
     methods: {
-      open(memoList) {
+      open (memoList) {
         this.memoList = memoList;
         this.materialdialog = true;
         if (this.current?.id) {
           this.reload();
         }
       },
-      handleNodeClick(info) {
+      handleNodeClick (info) {
         this.current = info;
         this.reload();
       },
       // 获取根节点id
-      setRootId(id) {
+      setRootId (id) {
         this.rootId = id;
       },
-      handleDone({ data }) {
+      handleDone ({ data }) {
         if (this.memoList.length && data.length) {
           this.$nextTick(() => {
             this.$refs.table.setSelectedRowKeys(
@@ -157,34 +156,35 @@
           });
         }
       },
-      selectionChange(...rest) {
+      selectionChange (...rest) {
         console.log(rest);
       },
-      handleClose() {
+      handleClose () {
         this.materialdialog = false;
         this.searchKey = '';
       },
 
-      datasource({ page, limit }) {
+      datasource ({ page, limit }) {
         return getList({
           pageNum: page,
           size: limit,
+          categoryLevelId: this.current.id,
           searchKey: this.searchKey
         });
       },
-      reload() {
+      reload () {
         this.$refs.table.reload();
       },
       // 弹窗 - 按关键字搜索
-      searchByKeyWords() {
+      searchByKeyWords () {
         this.reload();
       },
       // 重置
-      reset() {
+      reset () {
         this.searchKey = '';
         this.reload();
       },
-      selected() {
+      selected () {
         if (!this.selectionList.length) {
           return this.$message.error('请选择物料!');
         }