Browse Source

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!570
黄梓星 1 năm trước cách đây
mục cha
commit
c1bbf11ab0

+ 18 - 1
src/api/business/purchase/purchase-order.js

@@ -101,6 +101,22 @@ const close = (data) => {
     data,
   });
 }
+// 采购订单行关闭
+const itemClose = (data) => {
+  return request({
+    url: `/pu/order/item/close`,
+    method: "post",
+    data,
+  });
+}
+// 采购订单行打开
+const itemOpen = (data) => {
+  return request({
+    url: `/pu/order/item/open`,
+    method: "post",
+    data,
+  });
+}
 
 // 采购订单发送NC
 const toNc = (data) => {
@@ -222,5 +238,6 @@ export default {
   downloadFailData,
   oaBack,
   modifyBuyer,
-  
+  itemClose,
+  itemOpen,
 }

+ 5 - 2
src/components/popover-select-v2/index.vue

@@ -110,8 +110,11 @@ export default {
   methods: {
     // open dialog
     async open() {
-      this.visible = true;
-      await this.useReset();
+      let { disabled } = this.$attrs;
+      if (!disabled) {
+        this.visible = true;
+        await this.useReset();
+      }
     },
     // hide dialog
     async hide() {

+ 27 - 1
src/views/material/requisition/details/index.vue

@@ -193,6 +193,30 @@ export default {
         this.count++;
       },
     },
+    "params.sysMaterialMedcineApply.isDrug": {
+      handler: function (nVal, oVal) {
+        if (nVal === "2") {
+          this.rules.registrationNo = [
+            {
+              required: true,
+              message: "注册证号/备案凭证编号",
+              trigger: "change",
+            },
+          ];
+          this.rules.medicalInstruments = [
+            {
+              required: true,
+              message: "管理类别",
+              trigger: "change",
+            },
+          ];
+        } else {
+          this.rules.registrationNo = null;
+          this.rules.medicalInstruments = null;
+        }
+        this.count++;
+      },
+    },
   },
   methods: {
     setVisible(prop) {
@@ -404,7 +428,9 @@ export default {
         this.loading = true;
         let params = await this.handleParams();
         if (params) {
-          let { code, msg } = await betchSubmit({ ids: [Number(params.id)] });
+          let { code, msg } = await betchSubmit({
+            ids: [Number(params.sysMaterialApply.id)],
+          });
           code == 200 && this.hide();
           this.$notify({
             type: code == 200 ? "success" : "error",

+ 27 - 6
src/views/purchase/PurchaseDemandList/add.vue

@@ -6,7 +6,7 @@
       <el-row :gutter="10">
         <el-col :span="1.5">
           <el-form-item label="业务类型" prop="billType" :rules="{ required: true, message: '请选择业务类型', trigger: 'blur' }">
-            <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="mini" style="width: 200px">
+            <el-select clearable v-model="basicForm.billType" @change="changeBillType(basicForm.billType)" :disabled="sonDisable" size="mini" style="width: 200px">
               <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
               </el-option>
             </el-select>
@@ -44,7 +44,7 @@
 
         <el-col :span="1.5">
           <el-form-item label="需求计划" prop="planType" :rules="{ required: true, message: '请选择需求计划', trigger: 'blur' }">
-            <el-select :disabled="sonDisable" v-model="basicForm.planType" size="mini" style="width: 200px" @change="changeplanType()">
+            <el-select :disabled="sonDisable" v-model="basicForm.planType" size="mini" style="width: 200px" @change="changeplanType(basicForm.planType)">
               <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
               </el-option>
             </el-select>
@@ -837,8 +837,21 @@ export default {
       }
     },
     // 改变需求计划改变需求日期
-    changeplanType() {
+    changeplanType(val) {
       this.dafaultDate()
+      console.log(val)
+      if (val == 'JJXQ') {
+        this.basicForm.billType = 'JJXQ'
+      } else {
+        if (this.basicForm.billType == 'JJXQ') {
+          this.basicForm.billType = ''
+        }
+      }
+      if (val == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
+        this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'Y'})
+      } else {
+        this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'N'})
+      }
     },
     // 无限滚动加载配置
     load() {
@@ -858,8 +871,9 @@ export default {
       })
     },
     // 更改业务类型调整明细行内补单或紧急标识
-    changeBillType() {
-      if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
+    changeBillType(val) {
+      console.log(val)
+      if (val == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
         this.isBDXQ = true
         this.BDZT = false
         this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
@@ -872,7 +886,14 @@ export default {
           item.additionalSupplierName = null
         })
       }
-      if (this.basicForm.billType == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
+      if (val == 'JJXQ') {
+        this.basicForm.planType = 'JJXQ'
+      } else {
+        if (this.basicForm.planType == 'JJXQ') {
+          this.basicForm.planType = ''
+        }
+      }
+      if (val == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
         this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'Y'})
       } else {
         this.basicForm.puDemandItemList.forEach(item => { item.isUrgency = 'N' })

+ 91 - 92
src/views/purchase/apply/add/columns.js

@@ -115,6 +115,13 @@ export default function useColumns() {
       },
       TableColumns: [
         {
+          item: { key: "materialCode", title: "物料编码", required: true },
+          attr: {
+            is: "el-input",
+            clearable: true,
+          },
+        },
+        {
           item: { key: "materialName", title: "物料名称", required: true },
           attr: {
             is: "el-popover-select-v2",
@@ -136,18 +143,11 @@ export default function useColumns() {
             },
           },
         },
-        {
-          item: { key: "materialCode", title: "物料编码", required: true },
-          attr: {
-            is: "el-input",
-            clearable: true,
-          }, 
-        },
-        { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
         { item: { key: "specification", title: "规格" }, attr: {} },
         { item: { key: "model", title: "型号" }, attr: {} },
+        { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
         {
-          item: { key: "unitName", title: "单位", hidden: false },
+          item: { key: "unitName", title: "单位" },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "name",
@@ -155,19 +155,19 @@ export default function useColumns() {
             dataMapping: { unit: "id", unitCode: "code", unitName: "name" },
           },
         },
-        {
-          item: { key: "puUnitName", title: "采购单位", hidden: false },
-          attr: {
-            is: "el-popover-select-v2",
-            valueKey: "name",
-            referName: "UNIT_PARAM",
-            dataMapping: {
-              puUnit: "id",
-              puUnitCode: "code",
-              puUnitName: "name",
-            },
-          },
-        },
+        // {
+        //   item: { key: "puUnitName", title: "采购单位", hidden: false },
+        //   attr: {
+        //     is: "el-popover-select-v2",
+        //     valueKey: "name",
+        //     referName: "UNIT_PARAM",
+        //     dataMapping: {
+        //       puUnit: "id",
+        //       puUnitCode: "code",
+        //       puUnitName: "name",
+        //     },
+        //   },
+        // },
         {
           item: { key: "conversionRate", title: "采购换算率", required: true },
           attr: {
@@ -179,13 +179,16 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "tax", title: "税率%", required: true },
+          item: { key: "customerName", title: "客户" },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "ntaxrate",
-            referName: "TAX_RATE_PARAM",
-            dataMapping: { tax: "ntaxrate" },
-            disabled: true,
+            valueKey: "name",
+            referName: "CUSTOMER_PARAM",
+            dataMapping: {
+              customer: "id",
+              customerCode: "code",
+              customerName: "name",
+            },
           },
         },
         {
@@ -196,27 +199,37 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "price", title: "无税单价", required: true },
-          attr: {
-            formatter: (prop) => {
-              const { tax = 0, taxPrice = 0 } = prop;
-              return (prop.price = iunitprice(tax, taxPrice));
-            },
-          },
-        },
-        {
-          item: { key: "currencyName", title: "币种" },
+          item: { key: "tax", title: "税率%", required: true },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
-            referName: "CURRENCY_PARAM",
-            dataMapping: {
-              currency: "id",
-              currencyCode: "code",
-              currencyName: "name",
-            },
+            valueKey: "ntaxrate",
+            referName: "TAX_RATE_PARAM",
+            dataMapping: { tax: "ntaxrate" },
+            disabled: true,
           },
         },
+        // {
+        //   item: { key: "price", title: "无税单价", required: true },
+        //   attr: {
+        //     formatter: (prop) => {
+        //       const { tax = 0, taxPrice = 0 } = prop;
+        //       return (prop.price = iunitprice(tax, taxPrice));
+        //     },
+        //   },
+        // },
+        // {
+        //   item: { key: "currencyName", title: "币种" },
+        //   attr: {
+        //     is: "el-popover-select-v2",
+        //     valueKey: "name",
+        //     referName: "CURRENCY_PARAM",
+        //     dataMapping: {
+        //       currency: "id",
+        //       currencyCode: "code",
+        //       currencyName: "name",
+        //     },
+        //   },
+        // },
         {
           item: {
             key: "periodBegin",
@@ -243,19 +256,6 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "customerName", title: "客户" },
-          attr: {
-            is: "el-popover-select-v2",
-            valueKey: "name",
-            referName: "CUSTOMER_PARAM",
-            dataMapping: {
-              customer: "id",
-              customerCode: "code",
-              customerName: "name",
-            },
-          },
-        },
-        {
           item: { key: "recentlyPrice", title: "最近价格" },
           attr: {
             is: "el-input-number",
@@ -295,39 +295,6 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "priceType", title: "价格类型", required: true },
-          attr: {
-            is: "el-select",
-            dictName: "sys_price_type",
-            value: "order",
-          },
-        },
-        {
-          item: { key: "isDistributionPrice", title: "配送价", required: true },
-          attr: {
-            is: "el-select",
-            dictName: "is_effective",
-            value: "N",
-          },
-        },
-
-        {
-          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
-          attr: {
-            is: "el-select",
-            dictName: "is_effective",
-            value: "N",
-          },
-        },
-        {
-          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
-          attr: {
-            is: "el-select",
-            dictName: "is_effective",
-            value: "N",
-          },
-        },
-        {
           item: { width: 100, key: "priceDiffer", title: "单价差" },
           attr: {
             formatter: (prop) => {
@@ -375,8 +342,40 @@ export default function useColumns() {
             },
           },
         },
+        {
+          item: { key: "priceType", title: "价格类型", required: true },
+          attr: {
+            is: "el-select",
+            dictName: "sys_price_type",
+            value: "order",
+          },
+        },
+        {
+          item: { key: "isDistributionPrice", title: "配送价", required: true },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
 
         {
+          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        {
+          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        {
           item: { width: 150, key: "supplierName", title: "供应商名称1" },
           attr: { is: "el-input" },
         },
@@ -462,8 +461,8 @@ export default function useColumns() {
             precision: CONFIG.precision,
           },
         },
-        { item: { key: "createByName", title: "创建人名称" }, attr: {} },
-        { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
+        // { item: { key: "createByName", title: "创建人名称" }, attr: {} },
+        // { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
         {
           item: { key: "isPriceAdjustment", title: "", width: 10 },
           attr: {

+ 91 - 92
src/views/purchase/apply/copy/columns.js

@@ -115,6 +115,13 @@ export default function useColumns() {
       },
       TableColumns: [
         {
+          item: { key: "materialCode", title: "物料编码", required: true },
+          attr: {
+            is: "el-input",
+            clearable: true,
+          },
+        },
+        {
           item: { key: "materialName", title: "物料名称", required: true },
           attr: {
             is: "el-popover-select-v2",
@@ -136,18 +143,11 @@ export default function useColumns() {
             },
           },
         },
-        {
-          item: { key: "materialCode", title: "物料编码", required: true },
-          attr: {
-            is: "el-input",
-            clearable: true,
-          },
-        },
-        { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
         { item: { key: "specification", title: "规格" }, attr: {} },
         { item: { key: "model", title: "型号" }, attr: {} },
+        { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
         {
-          item: { key: "unitName", title: "单位", hidden: false },
+          item: { key: "unitName", title: "单位"},
           attr: {
             is: "el-popover-select-v2",
             valueKey: "name",
@@ -155,19 +155,19 @@ export default function useColumns() {
             dataMapping: { unit: "id", unitCode: "code", unitName: "name" },
           },
         },
-        {
-          item: { key: "puUnitName", title: "采购单位", hidden: false },
-          attr: {
-            is: "el-popover-select-v2",
-            valueKey: "name",
-            referName: "UNIT_PARAM",
-            dataMapping: {
-              puUnit: "id",
-              puUnitCode: "code",
-              puUnitName: "name",
-            },
-          },
-        },
+        // {
+        //   item: { key: "puUnitName", title: "采购单位", hidden: false },
+        //   attr: {
+        //     is: "el-popover-select-v2",
+        //     valueKey: "name",
+        //     referName: "UNIT_PARAM",
+        //     dataMapping: {
+        //       puUnit: "id",
+        //       puUnitCode: "code",
+        //       puUnitName: "name",
+        //     },
+        //   },
+        // },
         {
           item: { key: "conversionRate", title: "采购换算率", required: true },
           attr: {
@@ -179,13 +179,16 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "tax", title: "税率%", required: true },
+          item: { key: "customerName", title: "客户" },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "ntaxrate",
-            referName: "TAX_RATE_PARAM",
-            dataMapping: { tax: "ntaxrate" },
-            disabled: true,
+            valueKey: "name",
+            referName: "CUSTOMER_PARAM",
+            dataMapping: {
+              customer: "id",
+              customerCode: "code",
+              customerName: "name",
+            },
           },
         },
         {
@@ -196,27 +199,37 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "price", title: "无税单价", required: true },
-          attr: {
-            formatter: (prop) => {
-              const { tax = 0, taxPrice = 0 } = prop;
-              return (prop.price = iunitprice(tax, taxPrice));
-            },
-          },
-        },
-        {
-          item: { key: "currencyName", title: "币种" },
+          item: { key: "tax", title: "税率%", required: true },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
-            referName: "CURRENCY_PARAM",
-            dataMapping: {
-              currency: "id",
-              currencyCode: "code",
-              currencyName: "name",
-            },
+            valueKey: "ntaxrate",
+            referName: "TAX_RATE_PARAM",
+            dataMapping: { tax: "ntaxrate" },
+            disabled: true,
           },
         },
+        // {
+        //   item: { key: "price", title: "无税单价", required: true },
+        //   attr: {
+        //     formatter: (prop) => {
+        //       const { tax = 0, taxPrice = 0 } = prop;
+        //       return (prop.price = iunitprice(tax, taxPrice));
+        //     },
+        //   },
+        // },
+        // {
+        //   item: { key: "currencyName", title: "币种" },
+        //   attr: {
+        //     is: "el-popover-select-v2",
+        //     valueKey: "name",
+        //     referName: "CURRENCY_PARAM",
+        //     dataMapping: {
+        //       currency: "id",
+        //       currencyCode: "code",
+        //       currencyName: "name",
+        //     },
+        //   },
+        // },
         {
           item: {
             key: "periodBegin",
@@ -243,19 +256,6 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "customerName", title: "客户" },
-          attr: {
-            is: "el-popover-select-v2",
-            valueKey: "name",
-            referName: "CUSTOMER_PARAM",
-            dataMapping: {
-              customer: "id",
-              customerCode: "code",
-              customerName: "name",
-            },
-          },
-        },
-        {
           item: { key: "recentlyPrice", title: "最近价格" },
           attr: {
             is: "el-input-number",
@@ -295,39 +295,6 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "priceType", title: "价格类型", required: true },
-          attr: {
-            is: "el-select",
-            dictName: "sys_price_type",
-            value: "order",
-          },
-        },
-        {
-          item: { key: "isDistributionPrice", title: "配送价", required: true },
-          attr: {
-            is: "el-select",
-            dictName: "is_effective",
-            value: "N",
-          },
-        },
-
-        {
-          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
-          attr: {
-            is: "el-select",
-            dictName: "is_effective",
-            value: "N",
-          },
-        },
-        {
-          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
-          attr: {
-            is: "el-select",
-            dictName: "is_effective",
-            value: "N",
-          },
-        },
-        {
           item: { width: 100, key: "priceDiffer", title: "单价差" },
           attr: {
             formatter: (prop) => {
@@ -376,8 +343,40 @@ export default function useColumns() {
             },
           },
         },
+        {
+          item: { key: "priceType", title: "价格类型", required: true },
+          attr: {
+            is: "el-select",
+            dictName: "sys_price_type",
+            value: "order",
+          },
+        },
+        {
+          item: { key: "isDistributionPrice", title: "配送价", required: true },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
 
         {
+          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        {
+          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        {
           item: { width: 150, key: "supplierName", title: "供应商名称1" },
           attr: { is: "el-input" },
         },
@@ -463,8 +462,8 @@ export default function useColumns() {
             precision: CONFIG.precision,
           },
         },
-        { item: { key: "createByName", title: "创建人名称" }, attr: {} },
-        { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
+        // { item: { key: "createByName", title: "创建人名称" }, attr: {} },
+        // { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
         {
           item: { key: "isPriceAdjustment", title: "", width: 10 },
           attr: {

+ 91 - 92
src/views/purchase/apply/edit/columns.js

@@ -115,6 +115,13 @@ export default function useColumns() {
       },
       TableColumns: [
         {
+          item: { key: "materialCode", title: "物料编码", required: true },
+          attr: {
+            is: "el-input",
+            clearable: true,
+          },
+        },
+        {
           item: { key: "materialName", title: "物料名称", required: true },
           attr: {
             is: "el-popover-select-v2",
@@ -136,18 +143,11 @@ export default function useColumns() {
             },
           },
         },
-        {
-          item: { key: "materialCode", title: "物料编码", required: true },
-          attr: {
-            is: "el-input",
-            clearable: true,
-          },
-        },
-        { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
         { item: { key: "specification", title: "规格" }, attr: {} },
         { item: { key: "model", title: "型号" }, attr: {} },
+        { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
         {
-          item: { key: "unitName", title: "单位", hidden: false },
+          item: { key: "unitName", title: "单位" },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "name",
@@ -155,19 +155,19 @@ export default function useColumns() {
             dataMapping: { unit: "id", unitCode: "code", unitName: "name" },
           },
         },
-        {
-          item: { key: "puUnitName", title: "采购单位", hidden: false },
-          attr: {
-            is: "el-popover-select-v2",
-            valueKey: "name",
-            referName: "UNIT_PARAM",
-            dataMapping: {
-              puUnit: "id",
-              puUnitCode: "code",
-              puUnitName: "name",
-            },
-          },
-        },
+        // {
+        //   item: { key: "puUnitName", title: "采购单位", hidden: false },
+        //   attr: {
+        //     is: "el-popover-select-v2",
+        //     valueKey: "name",
+        //     referName: "UNIT_PARAM",
+        //     dataMapping: {
+        //       puUnit: "id",
+        //       puUnitCode: "code",
+        //       puUnitName: "name",
+        //     },
+        //   },
+        // },
         {
           item: { key: "conversionRate", title: "采购换算率", required: true },
           attr: {
@@ -179,13 +179,16 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "tax", title: "税率%", required: true },
+          item: { key: "customerName", title: "客户" },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "ntaxrate",
-            referName: "TAX_RATE_PARAM",
-            dataMapping: { tax: "ntaxrate" },
-            disabled: true,
+            valueKey: "name",
+            referName: "CUSTOMER_PARAM",
+            dataMapping: {
+              customer: "id",
+              customerCode: "code",
+              customerName: "name",
+            },
           },
         },
         {
@@ -196,27 +199,37 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "price", title: "无税单价", required: true },
-          attr: {
-            formatter: (prop) => {
-              const { tax = 0, taxPrice = 0 } = prop;
-              return (prop.price = iunitprice(tax, taxPrice));
-            },
-          },
-        },
-        {
-          item: { key: "currencyName", title: "币种" },
+          item: { key: "tax", title: "税率%", required: true },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
-            referName: "CURRENCY_PARAM",
-            dataMapping: {
-              currency: "id",
-              currencyCode: "code",
-              currencyName: "name",
-            },
+            valueKey: "ntaxrate",
+            referName: "TAX_RATE_PARAM",
+            dataMapping: { tax: "ntaxrate" },
+            disabled: true,
           },
         },
+        // {
+        //   item: { key: "price", title: "无税单价", required: true },
+        //   attr: {
+        //     formatter: (prop) => {
+        //       const { tax = 0, taxPrice = 0 } = prop;
+        //       return (prop.price = iunitprice(tax, taxPrice));
+        //     },
+        //   },
+        // },
+        // {
+        //   item: { key: "currencyName", title: "币种" },
+        //   attr: {
+        //     is: "el-popover-select-v2",
+        //     valueKey: "name",
+        //     referName: "CURRENCY_PARAM",
+        //     dataMapping: {
+        //       currency: "id",
+        //       currencyCode: "code",
+        //       currencyName: "name",
+        //     },
+        //   },
+        // },
         {
           item: {
             key: "periodBegin",
@@ -243,19 +256,6 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "customerName", title: "客户" },
-          attr: {
-            is: "el-popover-select-v2",
-            valueKey: "name",
-            referName: "CUSTOMER_PARAM",
-            dataMapping: {
-              customer: "id",
-              customerCode: "code",
-              customerName: "name",
-            },
-          },
-        },
-        {
           item: { key: "recentlyPrice", title: "最近价格" },
           attr: {
             is: "el-input-number",
@@ -295,39 +295,6 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "priceType", title: "价格类型", required: true },
-          attr: {
-            is: "el-select",
-            dictName: "sys_price_type",
-            value: "order",
-          },
-        },
-        {
-          item: { key: "isDistributionPrice", title: "配送价", required: true },
-          attr: {
-            is: "el-select",
-            dictName: "is_effective",
-            value: "N",
-          },
-        },
-
-        {
-          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
-          attr: {
-            is: "el-select",
-            dictName: "is_effective",
-            value: "N",
-          },
-        },
-        {
-          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
-          attr: {
-            is: "el-select",
-            dictName: "is_effective",
-            value: "N",
-          },
-        },
-        {
           item: { width: 100, key: "priceDiffer", title: "单价差" },
           attr: {
             formatter: (prop) => {
@@ -376,8 +343,40 @@ export default function useColumns() {
             },
           },
         },
+        {
+          item: { key: "priceType", title: "价格类型", required: true },
+          attr: {
+            is: "el-select",
+            dictName: "sys_price_type",
+            value: "order",
+          },
+        },
+        {
+          item: { key: "isDistributionPrice", title: "配送价", required: true },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
 
         {
+          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        {
+          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        {
           item: { width: 150, key: "supplierName", title: "供应商名称1" },
           attr: { is: "el-input" },
         },
@@ -463,8 +462,8 @@ export default function useColumns() {
             precision: CONFIG.precision,
           },
         },
-        { item: { key: "createByName", title: "创建人名称" }, attr: {} },
-        { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
+        // { item: { key: "createByName", title: "创建人名称" }, attr: {} },
+        // { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
         {
           item: { key: "isPriceAdjustment", title: "", width: 10 },
           attr: {

+ 59 - 60
src/views/purchase/apply/see/columns.js

@@ -77,27 +77,27 @@ export default function useColumns() {
       },
       TableColumns: [
         {
-          item: { width: 100, key: "materialName", title: "物料名称" },
-          attr: {},
-        },
-        {
           item: { width: 100, key: "materialCode", title: "物料编码" },
           attr: {},
         },
         {
-          item: { width: 100, key: "manufacturerName", title: "生产厂家" },
+          item: { width: 100, key: "materialName", title: "物料名称" },
           attr: {},
         },
         { item: { width: 100, key: "specification", title: "规格" }, attr: {} },
         { item: { width: 100, key: "model", title: "型号" }, attr: {} },
         {
-          item: { width: 100, key: "unitName", title: "单位" },
+          item: { width: 100, key: "manufacturerName", title: "生产厂家" },
           attr: {},
         },
         {
-          item: { width: 100, key: "puUnitName", title: "采购单位" },
+          item: { width: 100, key: "unitName", title: "单位" },
           attr: {},
         },
+        // {
+        //   item: { width: 100, key: "puUnitName", title: "采购单位" },
+        //   attr: {},
+        // },
         {
           item: { width: 100, key: "conversionRate", title: "采购换算率" },
           attr: {
@@ -108,13 +108,8 @@ export default function useColumns() {
           },
         },
         {
-          item: { width: 100, key: "tax", title: "税率%" },
-          attr: {
-            is: "el-computed-input-v2",
-            formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
-            },
-          },
+          item: { width: 100, key: "customerName", title: "客户" },
+          attr: {},
         },
         {
           item: { width: 100, key: "taxPrice", title: "含税单价" },
@@ -126,7 +121,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { width: 100, key: "price", title: "无税单价" },
+          item: { width: 100, key: "tax", title: "税率%" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
@@ -134,10 +129,19 @@ export default function useColumns() {
             },
           },
         },
-        {
-          item: { width: 100, key: "currencyName", title: "币种" },
-          attr: {},
-        },
+        // {
+        //   item: { width: 100, key: "price", title: "无税单价" },
+        //   attr: {
+        //     is: "el-computed-input-v2",
+        //     formatter: (prop) => {
+        //       return prop == null ? 0 : (prop * 1);
+        //     },
+        //   },
+        // },
+        // {
+        //   item: { width: 100, key: "currencyName", title: "币种" },
+        //   attr: {},
+        // },
         {
           item: { width: 100, key: "periodBegin", title: "价格有效期(起)" },
           attr: {},
@@ -147,10 +151,6 @@ export default function useColumns() {
           attr: {},
         },
         {
-          item: { width: 100, key: "customerName", title: "客户" },
-          attr: {},
-        },
-        {
           item: { width: 100, key: "recentlyPrice", title: "最近价格" },
           attr: {},
         },
@@ -175,35 +175,6 @@ export default function useColumns() {
           },
         },
         {
-          item: { width: 100, key: "priceType", title: "价格类型" },
-          attr: {
-            is: "el-dict-tag",
-            dictName: "sys_price_type",
-          },
-        },
-        {
-          item: { width: 100, key: "isDistributionPrice", title: "配送价" },
-          attr: {
-            is: "el-dict-tag",
-            dictName: "is_effective",
-          },
-        },
-
-        {
-          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
-          attr: {
-            is: "el-dict-tag",
-            dictName: "is_effective",
-          },
-        },
-        {
-          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
-          attr: {
-            is: "el-dict-tag",
-            dictName: "is_effective",
-          },
-        },
-        {
           item: { width: 100, key: "priceDiffer", title: "单价差" },
           attr: {
             is: "el-computed-input-v2",
@@ -250,8 +221,36 @@ export default function useColumns() {
             },
           },
         },
+        {
+          item: { width: 100, key: "priceType", title: "价格类型" },
+          attr: {
+            is: "el-dict-tag",
+            dictName: "sys_price_type",
+          },
+        },
+        {
+          item: { width: 100, key: "isDistributionPrice", title: "配送价" },
+          attr: {
+            is: "el-dict-tag",
+            dictName: "is_effective",
+          },
+        },
 
         {
+          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
+          attr: {
+            is: "el-dict-tag",
+            dictName: "is_effective",
+          },
+        },
+        {
+          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
+          attr: {
+            is: "el-dict-tag",
+            dictName: "is_effective",
+          },
+        },
+        {
           item: { width: 100, key: "supplierName", title: "供应商名称1" },
           attr: {},
         },
@@ -347,14 +346,14 @@ export default function useColumns() {
           },
         },
 
-        {
-          item: { width: 100, key: "createByName", title: "创建人名称" },
-          attr: {},
-        },
-        {
-          item: { width: 100, key: "updateByName", title: "更新人名称" },
-          attr: {},
-        },
+        // {
+        //   item: { width: 100, key: "createByName", title: "创建人名称" },
+        //   attr: {},
+        // },
+        // {
+        //   item: { width: 100, key: "updateByName", title: "更新人名称" },
+        //   attr: {},
+        // },
       ],
     },
   ];

+ 1 - 1
src/views/purchase/equipmentData/add.vue

@@ -59,7 +59,7 @@
         <el-row>
           <el-col :span="1.5">
             <el-form-item label="是否项目/厂家年度授权" prop="isProjectOrFactoryEmpower">
-              <el-checkbox true-label= '0' false-label= '2' v-model="basicForm.isProjectOrFactoryEmpower"></el-checkbox>
+              <el-checkbox :disabled="sonDisable" true-label= '0' false-label= '2' v-model="basicForm.isProjectOrFactoryEmpower"></el-checkbox>
             </el-form-item>
           </el-col>
         </el-row>

+ 77 - 0
src/views/purchase/purchase-order/close/allClose.vue

@@ -0,0 +1,77 @@
+<!-- 整单关闭 -->
+<script>
+import orderApi from "@/api/business/purchase/purchase-order";
+export default {
+  name: "AllClose",
+  props: {
+    selectData: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      title: "整单关闭",
+    };
+  },
+  computed: {
+    innerValue: {
+      get() {
+        return this.$props.selectData;
+      },
+      set() {},
+    },
+    disabled: {
+      get() {
+        let { innerValue } = this;
+
+        if (
+          innerValue.length === 1 &&
+          innerValue[0].status == 2 &&
+          innerValue[0].isEnd === "N"
+        ) {
+          return false;
+        }
+        return true;
+      },
+      set() {},
+    },
+  },
+  methods: {
+    open() {
+      // 未审批状态下整单关闭
+      this.$prompt("请输入关闭原因", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        inputPattern: /\s*\S+?/,
+        inputErrorMessage: "关闭原因不能为空",
+      })
+        .then(async ({ value }) => {
+          let { innerValue } = this;
+          try {
+            let puOrderIds = innerValue.map((order) => Number(order.id));
+
+            let { code } = await orderApi.close({
+              puOrderIds,
+              closeReason: value,
+            });
+
+            if (code === 200) {
+              this.$emit("submit");
+              this.$notify.success({
+                message: msg,
+              });
+            }
+          } catch (error) {}
+        })
+        .catch(() => {});
+    },
+  },
+  created() {},
+};
+</script>
+<template>
+  <el-button :size="$attrs.size" @click="open" :disabled="disabled">{{
+    title
+  }}</el-button>
+</template>

+ 66 - 0
src/views/purchase/purchase-order/close/itemClose.vue

@@ -0,0 +1,66 @@
+<!-- 行关闭 -->
+<script>
+import orderApi from "@/api/business/purchase/purchase-order";
+export default {
+  name: "itemClose",
+  props: {
+    selectData: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      title: "行关闭",
+    };
+  },
+  computed: {
+    innerValue: {
+      get() {
+        return this.$props.selectData;
+      },
+      set() {},
+    },
+  },
+  methods: {
+    async open() {
+      let { innerValue } = this;
+
+      let data = innerValue.find((item) => item.isPayment === "Y");
+
+      if (!data) {
+        this.$confirm("是否继续此操作?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(async () => {
+            try {
+              let puOrderIds = innerValue.map((order) => Number(order.id));
+
+              let { code } = await orderApi.itemClose({
+                puOrderIds,
+              });
+
+              if (code === 200) {
+                this.$emit("submit");
+                this.$notify.success({
+                  message: msg,
+                });
+              }
+            } catch (error) {}
+          })
+          .catch(() => {});
+      } else {
+        this.$notify.warning({
+          message: "存在已经完成关闭的行",
+        });
+      }
+    },
+  },
+  created() {},
+};
+</script>
+<template>
+  <el-button :size="$attrs.size" @click="open">{{ title }}</el-button>
+</template>

+ 62 - 0
src/views/purchase/purchase-order/close/itemOpen.vue

@@ -0,0 +1,62 @@
+<!-- 行打开 -->
+<script>
+import orderApi from "@/api/business/purchase/purchase-order";
+export default {
+  name: "itemOpen",
+  props: {
+    selectData: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      title: "行打开",
+    };
+  },
+  computed: {
+    innerValue: {
+      get() {
+        return this.$props.selectData;
+      },
+      set() {},
+    },
+  },
+  methods: {
+    async open() {
+      let { innerValue } = this;
+      let data = innerValue.find((item) => item.isPayment === "N");
+      if (!data) {
+        this.$confirm("是否继续此操作?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(async () => {
+            try {
+              let puOrderIds = innerValue.map((order) => Number(order.id));
+              let { code } = await orderApi.itemOpen({
+                puOrderIds,
+              });
+              if (code === 200) {
+                this.$emit("submit");
+                this.$notify.success({
+                  message: msg,
+                });
+              }
+            } catch (error) {}
+          })
+          .catch(() => {});
+      } else {
+        this.$notify.warning({
+          message: "存在已经完成打开的行",
+        });
+      }
+    },
+  },
+  created() {},
+};
+</script>
+<template>
+  <el-button :size="$attrs.size" @click="open">{{ title }}</el-button>
+</template>

+ 23 - 28
src/views/purchase/purchase-order/index.vue

@@ -33,6 +33,9 @@ export default {
     Retrieve: () => import("@/components/Retrieve/index.vue"),
     ZpButton: () => import("./zhuan-pai/index.vue"),
     ZpjlButton: () => import("./zhuan-pai/record.vue"),
+    ZdgbButton: () => import("./close/allClose.vue"),
+    HgbButton: () => import("./close/itemClose.vue"),
+    HdkButton: () => import("./close/itemOpen.vue"),
     QueryScheme: () => import("@/components/query-scheme/index.vue"),
   },
   data() {
@@ -541,36 +544,14 @@ export default {
             if (code === 200) {
               this.handleRefreshList();
             }
+            this.$notify.success({
+              message: msg,
+            });
           } catch (error) {}
         })
         .catch(() => {});
     },
-    // 判断是否满足整单关闭
-    judgeIsAllClose() {
-      if (this.checkedList.length == 1) {
-        // if (this.checkedList[0].status == 0) {
-        if (this.judgeIsOption("allClose", this.checkedList[0])) {
-          // 未审批状态下整单关闭
-          return false;
-        }
-      }
-      return true;
-    },
-    // 整单关闭
-    handleAllClose() {
-      // 未审批状态下整单关闭
-      try {
-        this.handleConfirmTips(async () => {
-          let puOrderIds = this.checkedList.map((order) => Number(order.id));
 
-          let { code } = await orderApi.close({ puOrderIds });
-
-          if (code === 200) {
-            this.handleRefreshList();
-          }
-        });
-      } catch (error) {}
-    },
     // 付款协议
     async handlePaymentRequest() {
       // name:工号
@@ -662,8 +643,8 @@ export default {
               source.status == "9") &&
             source.isEnd === "N"
           );
-        case "allClose":
-          return source.status == 0 && source.isEnd === "N";
+        // case "allClose":
+        //   return source.status == 2 && source.isEnd === "N";
         case "return":
           return (
             source.source != 3 &&
@@ -750,7 +731,11 @@ export default {
             :disabled="judgeIsAllReturn()"
             >整单退回</el-button
           >
-          <!-- <el-button :size="size" @click="handleAllClose" :disabled="judgeIsAllClose()">整单关闭</el-button> -->
+          <zdgb-button
+            :select-data="checkedList"
+            :size="size"
+            @submit="handleRefreshList"
+          ></zdgb-button>
         </el-button-group>
 
         <el-button-group style="margin: 0 10px">
@@ -866,6 +851,16 @@ export default {
           :disabled="judgeIsLineReturn()"
           >行退回</el-button
         >
+        <hgb-button
+          :select-data="checkedTabList"
+          :size="size"
+          @submit="handleRefreshList"
+        ></hgb-button>
+        <hdk-button
+          :select-data="checkedTabList"
+          :size="size"
+          @submit="handleRefreshList"
+        ></hdk-button>
       </el-row>
       <el-tabs
         v-model="tabName"