瀏覽代碼

物料申请单-由四级分类带出一二三级分类;

002390 1 年之前
父節點
當前提交
6716a4a02e

+ 8 - 0
src/api/requisition/basic.js

@@ -185,4 +185,12 @@ export const REFER = (data, params) => {
     data: data,
     params: params,
   });
+}
+
+export function classifyDetails(params) {
+  return request({
+    url: `/system/classify/details`,
+    method: 'get',
+    params: params,
+  })
 }

+ 2 - 1
src/views/material/requisition/details/columns.js

@@ -127,7 +127,8 @@ export default function useColumns(){
               children: "children",
             },
             dataMapping: {
-              classifyId:'id'
+              classifyId:'id',
+              
             }
           },
         },

+ 31 - 3
src/views/material/requisition/details/index.vue

@@ -6,6 +6,7 @@ import {
   editReq,
   saveAndToOa,
   betchSubmit,
+  classifyDetails,
 } from "@/api/requisition/basic";
 import { REFER } from "@/components/popover-select/api/index";
 export default {
@@ -115,7 +116,6 @@ export default {
             });
 
             if (code == 200) {
-              console.log(rows, "rows");
               let { id, code, name } = rows[0];
               this.params.sysMaterialMedcineItemApply = [
                 {
@@ -452,13 +452,28 @@ export default {
       open();
     },
     materialReferenceChange(prop, { source }) {
-      console.log(prop, "prop");
-      console.log(source, "source");
       this.params.sysMaterialApply = {
         ...this.params.sysMaterialApply,
         ...source,
       };
     },
+    // 四级分类带出一二三级分类
+    async classifyNameChange(prop, { source }) {
+      console.log(source, "source");
+      let { classifyId } = source;
+      try {
+        let {
+          code,
+          msg,
+          data: { oneClass, twoClass, threeClass },
+        } = await classifyDetails({ id: classifyId });
+        if (code == 200) {
+          source.oneClass = oneClass;
+          source.twoClass = twoClass;
+          source.threeClass = threeClass;
+        }
+      } catch (error) {}
+    },
   },
   created() {},
   mounted() {},
@@ -581,6 +596,19 @@ export default {
               </el-button>
             </component>
           </template>
+          <!-- 四级分类 -->
+          <template slot="classifyName" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="addType === 'see'"
+              @change="classifyNameChange"
+              style="width: 100%"
+            >
+            </component>
+          </template>
           <!-- 药品 -->
           <template slot="isDrug" slot-scope="scope">
             <component

+ 9 - 11
src/views/material/requisition/index.vue

@@ -140,24 +140,22 @@ export default {
       if (!filterList.length && this.selectData.length) {
         this.handleConfirmTips(async () => {
           try {
-            this.failLoad = true;
-
+            this.loading = true;
             let ids = this.selectData.map((item) => Number(item.id));
-
             let { code, msg } = await betchSubmit({ ids });
-
             if (code == 200) {
+              this.$notify.success({
+                message: msg,
+              });
               this.reset();
+            } else {
+              this.$notify.error({
+                message: msg,
+              });
             }
-
-            this.$notify({
-              title: code == 200 ? msg : "error",
-              type: code == 200 ? "success" : "error",
-              message: code == 200 ? "" : msg,
-            });
           } catch (error) {
           } finally {
-            this.failLoad = false;
+            this.loading = false;
           }
         });
       } else {