Pārlūkot izejas kodu

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!177
黄梓星 2 gadi atpakaļ
vecāks
revīzija
a51ab532c9

+ 0 - 4
src/components/popover-select/index.vue

@@ -97,10 +97,6 @@ export default {
     };
   },
   computed: {
-    // innerValue() {
-    //   const { value, multiple } = this.$props;
-    //   return multiple ? "" : value;
-    // },
     innerValue: {
       get() {
         const { value, multiple } = this.$props;

+ 20 - 6
src/views/purchase/DemandSummary/index.vue

@@ -700,17 +700,31 @@ export default {
       }
     },
     // 行关闭
+    closeitem() {
+      let param = this.ids.join()
+      shutDownSummary(param).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("操作成功");
+          this.getList(this.queryParams)
+        }
+      })
+    },
     closeLine() {
       if (this.ids.length == 0) {
         this.$modal.msgWarning("请选中至少一条数据");
       } else {
-        let param = this.ids.join()
-        shutDownSummary(param).then(res => {
-          if (res.code === 200) {
-            this.$modal.msgSuccess("操作成功");
-            this.getList(this.queryParams)
-          }
+        console.log('选中数组', this.allSelection)
+        let item = this.allSelection.some(item => {
+          return item.demandNum >= 2
         })
+        if (item) {
+          this.$modal.confirm('选中项有多个需求单位,是否确定关闭?').then(function () {
+          }).then(() => {
+            this.closeitem()
+          }).catch(() => {})
+        } else {
+          this.closeitem()
+        }
       }
     },
     // 搜索区参照选择

+ 3 - 0
src/views/purchase/PurchaseDemandList/add.vue

@@ -767,6 +767,9 @@ export default {
           if (item.demandId) {
             delete item.demandId
           }
+          if (item.allotCode) {
+            delete item.allotCode
+          }
         })
       }
     },

+ 10 - 0
src/views/purchase/apply/add/index.vue

@@ -60,6 +60,16 @@ export default {
         const { code, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
+          this.params.createBy = null;
+          this.params.priceCode = null;
+          this.params.createByName = null;
+          this.params.effectiveDate = null;
+          this.params.priceApplyItems = this.params.priceApplyItems.map(
+            (item) => ({ ...item, createByName: null, updateByName: null })
+          );
+          this.params.priceApplyOrgs = this.params.priceApplyOrgs.map(
+            (item) => ({ ...item, createByName: null, updateByName: null })
+          );
           return true;
         } else {
           return false;

+ 8 - 1
src/views/purchase/apply/edit/index.vue

@@ -23,7 +23,11 @@ export default {
       ...useData(Column),
     };
   },
-  computed: {},
+  computed: {
+    root: function () {
+      return this.$parent.$parent;
+    },
+  },
   watch: {
     "params.puOrgName": watchPuOrgName(),
     "params.priceApplyOrgs": watchPriceApplyOrgs(),
@@ -124,6 +128,9 @@ export default {
             const params = { ...this.params };
             const { msg, code } = await SAVE(params);
             if (code === 200) {
+              const { id } = this.params;
+              const { fetchItem } = this.root.$refs.SeeModel;
+              await fetchItem(id);
               this.hide();
               this.$emit("success");
               this.$notify.success(msg);

+ 1 - 1
src/views/purchase/catalogue/column.js

@@ -9,7 +9,7 @@ export const FormColumns = [
   // },
   { key: "materialName", title: "物料" },
   { key: "materialCode", title: "物料编码" },
-  { key: "materialClassify", title: "物料一级分类" },
+  // { key: "materialClassify", title: "物料一级分类" },
   { key: "manufacturerName", title: "生产厂家名称" },
   // { key: "manufacturer", title: "生产厂家" },
   { key: "model", title: "物料型号" },

+ 2 - 2
src/views/purchase/contract/edit/index.vue

@@ -83,14 +83,14 @@ export default {
     },
     //
     async useRowRemove(prop, scope) {
-      const { ROMVE } = TABLE;
+      const { REMOVE } = TABLE;
       const {
         row: { id, contractId },
       } = scope;
       try {
         // try
         this.loading = true;
-        const { code } = ROMVE(id, prop);
+        const { code } = REMOVE(id, prop);
         if (code === 200) {
           this.fetchItem(contractId);
         }

+ 1 - 2
src/views/purchase/purchase-order/add/column.js

@@ -650,8 +650,7 @@ export const TabColumns = [
       { //materialRate  materialRateName
         key: "tax", 
         title: "税率",
-        inputType: "InputNumber",
-        controlsPosition: "right",
+        inputType: "Input",
         disabled:true,
         width: 180,
       },

+ 7 - 6
src/views/purchase/purchase-order/add/index.vue

@@ -379,7 +379,7 @@ export default {
     // 子表参照改变之后
    async handleTabReferChange(val,  type, source) {
 
-      // 触发物料参照询价   && source.qty && source.qty != ""
+      // 触发物料参照询价 
       if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
 
         source['qty'] = 0;
@@ -449,17 +449,18 @@ export default {
     // 询价 getPrice
     async handleGetPrice() {
       try {
-        // let { puOrg, priceType, customer, assignSupplier, material, } = data;
+
         let { code, data } = await orderApi.getPrice({ ...this.params });
+
         if (code == 200) {
+
           this.params = data;
+
         }
-      } catch (error) {
-      } finally {
-      }
-    },
 
+      } catch (error) {} 
     
+    },
 
   },
   created() {