Преглед изворни кода

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!145
黄梓星 пре 2 година
родитељ
комит
fa4b3298e2

+ 145 - 5
src/views/purchase/PurchaseDemandList/add.vue

@@ -1,5 +1,6 @@
 <template>
   <div id="addDemandList">
+    <el-card>
     <span>基本信息</span>
     <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
       <el-row :gutter="10">
@@ -153,10 +154,9 @@
     
 
     <span>明细信息</span>
-    <el-card>
       <div class="btn_grooup">
         <el-button type="primary" size="small" @click="addLine" v-if="!sonDisable">增行</el-button>
-        <el-button type="primary" size="small" v-if="!sonDisable">批量调整</el-button>
+        <el-button type="primary" size="small" v-if="!sonDisable" @click="adjustPl">批量调整</el-button>
         <el-button type="primary" size="small" v-if="sonPageStu == 'check' || sonPageStu == 'edit'" @click="showReserved">货权预留单</el-button>
       </div>
 
@@ -458,8 +458,8 @@
           </template>
         </el-table-column>
       </el-table>
-    </el-card>
   </el-form>
+  </el-card>
 
     <div class="btn_group">
       <el-col :span="1.5">
@@ -482,6 +482,85 @@
       <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
 
     </div>
+
+    <!-- 批量调整参数 -->
+    <el-dialog title="批量调整" :visible.sync="adjust.open" width="400px">
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6">价格类型</el-col>
+        <el-col :span="14">
+        <el-select clearable size="small" v-model="adjust.priceType">
+          <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
+          </el-option>
+        </el-select>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6">采购员</el-col>
+        <el-col :span="14">
+        <el-select clearable size="small" v-model="adjust.purchaseMan" @focus="chooseOrg('CONTACTS_PARAM', true, '采购员')">
+          <el-option v-for="item in purchaseManOptions" :key="item.id" :label="item.name" :value="item.code" />
+        </el-select>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6">收货仓库</el-col>
+        <el-col :span="14">
+        <el-input clearable size="small" v-model="adjust.warehouseName" @focus="chooseOrg('WAREHOUSE_PARAM', true, '收货仓库')">
+          <el-button size="small" slot="append" icon="el-icon-more" @click="chooseOrg('WAREHOUSE_PARAM', true, '收货仓库')"></el-button>
+        </el-input>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6">收货货位</el-col>
+        <el-col :span="14">
+        <el-input clearable size="small" v-model="adjust.allocationName" @focus="adjustHuoWei('ALLOCATION_PARAM', true, '收货货位', adjust.warehouse)">
+          <el-button size="small" slot="append" icon="el-icon-more" @click="adjustHuoWei('ALLOCATION_PARAM', true, '收货货位', adjust.warehouse)"></el-button>
+        </el-input>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6">业务备注</el-col>
+        <el-col :span="14">
+          <el-input clearable size="small" v-model="adjust.remark"/>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6">收货地址</el-col>
+        <el-col :span="14">
+          <el-input clearable size="small" v-model="adjust.deliveryAddressName" @focus="chooseOrg('ADDRESS_PARAM', true, '收货地址')">
+            <el-button size="small" slot="append" icon="el-icon-more" @click="chooseOrg('ADDRESS_PARAM', true, '收货地址')"></el-button>
+          </el-input>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6">收货地址编码</el-col>
+        <el-col :span="14">
+          <el-input disabled clearable size="small" v-model="adjust.deliveryAddress"/>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6">联系人</el-col>
+        <el-col :span="14">
+          <el-input disabled clearable size="small" v-model="adjust.contacts"/>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6">联系人电话</el-col>
+        <el-col :span="14">
+          <el-input disabled clearable size="small" v-model="adjust.contactsPhone"/>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6">详细地址</el-col>
+        <el-col :span="14">
+          <el-input disabled clearable size="small" v-model="adjust.address"/>
+        </el-col>
+      </el-row>
+      <div slot="footer" class="dialog-footer">
+      <el-button size="small" type="primary" @click="confirmAdjust">确 认</el-button>
+      <el-button size="small" @click="adjust.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -573,7 +652,25 @@ export default {
         }
       },
       isBDXQ: false,
-      isYl: false
+      isYl: false,
+      // 批量调整擦拭
+      adjust: {
+        open: false,
+        priceType: '',
+        purchaseMan: '',
+        purchaseManName: '',
+        warehouse: '',
+        warehouseName: '',
+        allocation: '',
+        allocationName: '',
+        remark:'',
+        deliveryAddress: '',
+        deliveryAddressName: '',
+        contacts: '',
+        contactsPhone: '',
+        address: ''
+      },
+      purchaseManOptions: []
     }
   },
   created() {
@@ -946,10 +1043,32 @@ export default {
           })
         }
       }
-      if(this.referCondition.type == 'CONTACTS_PARAM') {
+      if(this.referCondition.type == 'CONTACTS_PARAM' && this.referCondition.title == '需求人员') {
         this.personOptions = selection
         this.basicForm.demandPersonal = selection[0].code
       }
+      if(this.referCondition.type == 'CONTACTS_PARAM' && this.referCondition.title == '采购员') {
+        this.purchaseManOptions = selection
+        this.adjust.purchaseMan = selection[0].code
+        this.adjust.purchaseManName = selection[0].name
+      }
+      if(this.referCondition.type == 'WAREHOUSE_PARAM' && this.referCondition.title == '收货仓库') {
+        this.adjust.warehouse = selection[0].id
+        this.adjust.warehouseName = selection[0].name
+        this.adjust.allocation = ''
+        this.adjust.allocationName = ''
+      }
+      if(this.referCondition.type == 'ALLOCATION_PARAM' && this.referCondition.title == '收货货位') {
+        this.adjust.allocation = selection[0].id
+        this.adjust.allocationName = selection[0].name
+      }
+      if(this.referCondition.type == 'ADDRESS_PARAM' && this.referCondition.title == '收货地址') {
+        this.adjust.deliveryAddressName = selection[0].name
+        this.adjust.deliveryAddress = selection[0].code
+        this.adjust.contacts = selection[0].contactsName
+        this.adjust.contactsPhone = selection[0].contactsPhone
+        this.adjust.address = selection[0].address
+      }
       if(this.referCondition.type == 'DEPT_PARAM') {
         this.deptOptions = selection
         this.basicForm.demandDept = selection[0].id
@@ -1117,6 +1236,27 @@ export default {
         })
       }
     },
+    // 批量调整
+    adjustPl() {
+      this.adjust.open = true
+    },
+    // 批量调整确认
+    confirmAdjust() {
+      console.log('data', this.adjust)
+    },
+    // 批量调整选择货位
+    adjustHuoWei(type, isPage, title, stordocId) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      // 选择收货货位前先选择收货仓库
+      if (stordocId) {
+        this.referCondition.stordocId = stordocId
+        this.$refs.refer.init(this.referCondition)
+      } else {
+        this.$modal.msgWarning("请先选择收货仓库");
+      }
+    },
   }
 }
 </script>

+ 47 - 19
src/views/purchase/apply/add/column.js

@@ -12,13 +12,14 @@ export const FormColumns = [
     referName: "SUPPLIER_PARAM",
     valueKey: "name",
     dataMapping: {
-      supplier: "code",
+      supplier: "id",
+      supplierCode: "code",
       supplierName: "name",
     },
     require: true,
   },
   {
-    key: "supplier",
+    key: "supplierCode",
     title: "供应商编码",
     inputType: "Input",
     disabled: true,
@@ -31,13 +32,14 @@ export const FormColumns = [
     referName: "ORG_PARAM",
     valueKey: "name",
     dataMapping: {
-      puOrg: "code",
+      puOrg: "id",
+      puOrgCode: "code",
       puOrgName: "name",
     },
     require: true,
   },
   {
-    key: "puOrg",
+    key: "puOrgCode",
     title: "采购组织编码",
     inputType: "Input",
     disabled: true,
@@ -49,13 +51,14 @@ export const FormColumns = [
     inputType: "PopoverSelect",
     referName: "CURRENCY_PARAM",
     dataMapping: {
-      currency: "code",
+      currency: "id",
+      currencyCode: "code",
       currencyName: "name",
     },
     require: true,
   },
   {
-    key: "currency",
+    key: "currencyCode",
     title: "币种编码",
     inputType: "Input",
     disabled: true,
@@ -91,13 +94,14 @@ export const FormColumns = [
     inputType: "PopoverSelect",
     referName: "DEPT_PARAM",
     dataMapping: {
-      puDept: "code",
+      puDept: "id",
+      puDeptCode: "code",
       puDeptName: "name",
     },
     require: true,
   },
   {
-    key: "puDept",
+    key: "puDeptCode",
     title: "采购部门编码",
     inputType: "Input",
     disabled: true,
@@ -189,6 +193,7 @@ export const TabColumns = [
         require: true,
       },
       { title: "物料编码", key: "materialCode" },
+      { title: "物料ID", key: "material" },
       {
         title: "生产厂家",
         key: "manufacturerName",
@@ -212,12 +217,17 @@ export const TabColumns = [
         width: 300,
         referName: "UNIT_PARAM",
         dataMapping: {
-          unit: "code",
+          unit: "id",
+          unitCode: "code",
           unitName: "name",
         },
       },
       {
-        title: "单位",
+        title: "单位编码",
+        key: "unitCode",
+      },
+      {
+        title: "单位ID",
         key: "unit",
       },
       {
@@ -227,12 +237,17 @@ export const TabColumns = [
         width: 300,
         referName: "UNIT_PARAM",
         dataMapping: {
-          puUnit: "code",
+          puUnit: "id",
+          puUnitCode: "code",
           puUnitName: "name",
         },
       },
       {
-        title: "采购单位",
+        title: "采购单位编码",
+        key: "puUnitCode",
+      },
+      {
+        title: "采购单位ID",
         key: "puUnit",
       },
       {
@@ -279,12 +294,17 @@ export const TabColumns = [
         inputType: "PopoverSelect",
         referName: "CURRENCY_PARAM",
         dataMapping: {
-          currency: "code",
+          currency: "id",
+          currencyCode: "code",
           currencyName: "name",
         },
       },
       {
-        title: "币种",
+        title: "币种编码",
+        key: "currencyCode",
+      },
+      {
+        title: "币种ID",
         key: "currency",
       },
       {
@@ -305,21 +325,27 @@ export const TabColumns = [
             return time.getTime() < Date.now() + 3600 * 1000 * 24 * 365;
           },
         },
+        value: new Date(new Date().getTime() + 3600 * 1000 * 24 * 366),
         require: true,
       },
       {
-        title: "客户名称",
+        title: "客户",
         key: "customerName",
         inputType: "PopoverSelect",
         width: 300,
         referName: "CUSTOMER_PARAM",
         dataMapping: {
-          customer: "code",
+          customer: "id",
+          customerCode: "code",
           customerName: "name",
         },
       },
       {
-        title: "客户",
+        title: "客户编码",
+        key: "customerCode",
+      },
+      {
+        title: "客户ID",
         key: "customer",
       },
       {
@@ -374,11 +400,13 @@ export const TabColumns = [
         inputType: "PopoverSelect",
         referName: "ORG_PARAM",
         dataMapping: {
-          org: "code",
+          org: "id",
+          orgCode: "code",
           orgName: "name",
         },
       },
-      { title: "组织编码", key: "org" },
+      { title: "组织编码", key: "orgCode" },
+      { title: "组织ID", key: "org" },
       {
         title: "创建人名称",
         key: "createByName",

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

@@ -2,9 +2,11 @@
 import Column from "./column";
 import useData from "../hooks/data";
 import useDicts from "../hooks/dicts";
+import useWatch from "../hooks/watch";
 import useMethods from "../hooks/function";
 import useTable from "../hooks/table-function";
 import { SAVE } from "@/api/business/purchase/apply";
+const { watchPuOrgName } = useWatch();
 
 export default {
   name: "AddDrawer",
@@ -18,28 +20,7 @@ export default {
   },
   computed: {},
   watch: {
-    "params.puOrg": {
-      handler: function (newProp, oldProp) {
-        if (oldProp) {
-          this.params.priceApplyOrgs = this.params.priceApplyOrgs.filter(
-            (item) => item.org !== oldProp
-          );
-        }
-        if (newProp) {
-          const { puOrg: org, puOrgName: orgName } = this.params;
-          this.params.priceApplyOrgs.push({
-            org,
-            orgName,
-            createByName: undefined,
-            updateByName: undefined,
-          });
-        }
-      },
-    },
-    "params.priceApplyItems": {
-      handler: function () {},
-      deep: true,
-    },
+    "params.puOrgName": watchPuOrgName(),
   },
   methods: {
     //
@@ -135,16 +116,17 @@ export default {
         <el-button
           :size="size"
           circle
-          icon="el-icon-close"
-          @click="hide"
-        ></el-button>
-        <el-button
-          :size="size"
-          circle
           icon="el-icon-check"
           @click="useSubmit('ruleForm')"
         >
         </el-button>
+        <el-button
+          :size="size"
+          circle
+          type="danger"
+          icon="el-icon-close"
+          @click="hide"
+        ></el-button>
       </span>
     </template>
     <el-form
@@ -210,7 +192,6 @@ export default {
             ></file-upload>
           </el-form-item>
         </el-col>
-        <el-divider></el-divider>
         <el-col :span="24">
           <el-form-item label-width="0">
             <el-tabs v-model="tabName">
@@ -312,7 +293,6 @@ export default {
                   <el-table-column fixed="right" label="操作" width="100">
                     <template slot="header" slot-scope="scope">
                       <el-button
-                        v-if="params.puOrg && params.supplier"
                         circle
                         icon="el-icon-plus"
                         :size="size"

+ 0 - 365
src/views/purchase/apply/edit/column.js

@@ -1,365 +0,0 @@
-export const FormColumns = [
-  {
-    key: "priceName",
-    title: "价格名称",
-    inputType: "Input",
-    value: "价格申报单",
-  },
-  {
-    key: "supplierName",
-    title: "供应商",
-    inputType: "PopoverSelect",
-    referName: "SUPPLIER_PARAM",
-    valueKey: "name",
-    dataMapping: {
-      supplier: "code",
-      supplierName: "name",
-    },
-    require: true,
-  },
-  {
-    key: "supplier",
-    title: "供应商编码",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-  {
-    key: "puOrgName",
-    title: "采购组织",
-    inputType: "PopoverSelect",
-    referName: "ORG_PARAM",
-    valueKey: "name",
-    dataMapping: {
-      puOrg: "code",
-      puOrgName: "name",
-    },
-    require: true,
-  },
-  {
-    key: "puOrg",
-    title: "采购组织编码",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-  {
-    key: "currencyName",
-    title: "币种",
-    inputType: "PopoverSelect",
-    referName: "CURRENCY_PARAM",
-    dataMapping: {
-      currency: "code",
-      currencyName: "name",
-    },
-    require: true,
-  },
-  {
-    key: "currency",
-    title: "币种编码",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-  {
-    key: "explainStr",
-    title: "价格合理性说明",
-    inputType: "Input",
-    require: true,
-  },
-  {
-    key: "buyerName",
-    title: "采购员",
-    inputType: "PopoverSelect",
-    referName: "CONTACTS_PARAM",
-    dataMapping: {
-      buyer: "code",
-      buyerName: "name",
-    },
-    require: true,
-  },
-  {
-    key: "buyer",
-    title: "采购员编码",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-  {
-    key: "puDeptName",
-    title: "采购部门",
-    inputType: "PopoverSelect",
-    referName: "DEPT_PARAM",
-    dataMapping: {
-      puDept: "code",
-      puDeptName: "name",
-    },
-    require: true,
-  },
-  {
-    key: "puDept",
-    title: "采购部门编码",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-  {
-    key: "createByName",
-    title: "创建人",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-  {
-    key: "source",
-    title: "来源单据号",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-  {
-    key: "id",
-    title: "来源单据id",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-  {
-    key: "isEffective",
-    title: "是否已推价格",
-    inputType: "Select",
-    referName: "is_effective",
-  },
-  {
-    key: "effectiveDate",
-    title: "生效日期",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-  {
-    key: "file",
-    title: "附件",
-    inputType: "Upload",
-    span: 24,
-    disabled: true,
-    readonly: true,
-    value: [],
-  },
-  {
-    key: "sourceType",
-    title: "来源单据类型",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-  {
-    key: "status",
-    title: "单据状态",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-];
-
-export const TabColumns = [
-  {
-    title: "物料信息表",
-    key: "priceApplyItems",
-    tableColumns: [
-      {
-        title: "物料名称",
-        key: "materialName",
-        inputType: "PopoverSelect",
-        width: 200,
-        referName: "MATERIAL_PARAM",
-        dataMapping: {
-          material: "id",
-          materialCode: "code",
-          materialName: "name",
-          puUnit: "unitIdName",
-          specification: "specification",
-          manufacturer: "manufacturerIdName",
-        },
-      },
-      { title: "物料编码", key: "materialCode" },
-      {
-        title: "生产厂家",
-        key: "manufacturer",
-      },
-      {
-        title: "规格",
-        key: "specification",
-      },
-      {
-        title: "型号",
-        key: "model",
-      },
-      {
-        title: "单位名称",
-        key: "unitName",
-        inputType: "PopoverSelect",
-        width: 200,
-        referName: "UNIT_PARAM",
-        dataMapping: {
-          puUnit: "name",
-        },
-      },
-      {
-        title: "单位",
-        key: "unit",
-      },
-      {
-        title: "采购单位名称",
-        key: "puUnitName",
-        inputType: "PopoverSelect",
-        width: 200,
-        referName: "UNIT_PARAM",
-        dataMapping: {
-          puUnit: "name",
-        },
-      },
-      {
-        title: "采购单位",
-        key: "puUnit",
-      },
-      {
-        title: "采购换算率",
-        key: "conversionRate",
-        inputType: "InputNumber",
-        width: 200,
-      },
-      {
-        title: "税率%",
-        key: "tax",
-        inputType: "PopoverSelect",
-        referName: "TAX_RATE_PARAM",
-        dataMapping: {
-          tax: "ntaxrate",
-        },
-        width: 200,
-      },
-      {
-        title: "含税单价",
-        key: "taxPrice",
-        inputType: "InputNumber",
-        width: 200,
-      },
-      {
-        title: "无税单价",
-        key: "taxFreePrice",
-        inputType: "ComputedInput",
-        width: 200,
-        computed: (prop) => {
-          const { tax, taxPrice } = prop;
-          const newTax = Number(tax) / 100;
-          const taxFreePrice = (taxPrice / (1 + newTax)).toFixed(8);
-          return taxFreePrice === "NaN" ? null : taxFreePrice;
-        },
-      },
-      {
-        key: "currencyName",
-        title: "币种名称",
-        inputType: "PopoverSelect",
-        referName: "CURRENCY_PARAM",
-        dataMapping: {
-          currency: "code",
-          currencyName: "name",
-        },
-      },
-      {
-        title: "币种",
-        key: "currency",
-      },
-      {
-        key: "periodBegin",
-        title: "价格有效期(起)",
-        inputType: "DatePicker",
-        valueFormat: "yyyy-MM-dd",
-      },
-      {
-        key: "periodEnd",
-        title: "价格有效期(止)",
-        inputType: "DatePicker",
-        valueFormat: "yyyy-MM-dd",
-      },
-      {
-        title: "客户名称",
-        key: "customerName",
-        inputType: "PopoverSelect",
-        width: 200,
-        referName: "CUSTOMER_PARAM",
-        dataMapping: {
-          customer: "code",
-          customerName: "name",
-        },
-      },
-      {
-        title: "客户",
-        key: "customer",
-      },
-      {
-        title: "首次报批",
-        key: "isApprovalFirst",
-        width: 200,
-        inputType: "Select",
-        referName: "sys_yes_no",
-      },
-      {
-        title: "价格调整",
-        key: "isPriceAdjustment",
-        width: 200,
-        inputType: "Select",
-        referName: "sys_yes_no",
-      },
-      {
-        key: "priceType",
-        title: "价格类型",
-        inputType: "Select",
-        referName: "sys_price_type",
-      },
-      {
-        title: "配送价",
-        key: "isDistributionPrice",
-        width: 200,
-        inputType: "Select",
-        referName: "sys_yes_no",
-      },
-      {
-        title: "创建人名称",
-        key: "createByName",
-      },
-      {
-        title: "更新人名称",
-        key: "updateByName",
-      },
-    ],
-  },
-  {
-    title: "合同执行组织范围",
-    key: "priceApplyOrgs",
-    tableColumns: [
-      {
-        title: "组织名称",
-        key: "orgName",
-        inputType: "PopoverSelect",
-        referName: "ORG_PARAM",
-        dataMapping: {
-          org: "code",
-          orgName: "name",
-        },
-      },
-      { title: "组织编码", key: "org" },
-      {
-        title: "创建人名称",
-        key: "createByName",
-      },
-      {
-        title: "更新人名称",
-        key: "updateByName",
-      },
-    ],
-  },
-];
-
-export default { FormColumns, TabColumns };

+ 7 - 17
src/views/purchase/apply/edit/index.vue

@@ -1,10 +1,13 @@
 <script>
-import Column from "./column";
+import Column from "../add/column";
 import useData from "../hooks/data";
 import useDicts from "../hooks/dicts";
+import useWatch from "../hooks/watch";
 import useMethods from "../hooks/function";
 import useTable from "../hooks/table-function";
 import { SAVE } from "@/api/business/purchase/apply";
+const { watchPuOrgName, watchPriceApplyOrgs, watchPriceApplyItems } =
+  useWatch();
 
 export default {
   name: "EditDrawer",
@@ -22,22 +25,9 @@ export default {
   },
   computed: {},
   watch: {
-    "params.priceApplyOrgs": {
-      handler: function (newValue) {
-        this.newParams.priceApplyOrgs = newValue.filter(
-          (item) => item.delFlag === "0"
-        );
-      },
-      deep: true,
-    },
-    "params.priceApplyItems": {
-      handler: function (newValue) {
-        this.newParams.priceApplyItems = newValue.filter(
-          (item) => item.delFlag === "0"
-        );
-      },
-      deep: true,
-    },
+    "params.puOrgName": watchPuOrgName(),
+    "params.priceApplyOrgs": watchPriceApplyOrgs(),
+    "params.priceApplyItems": watchPriceApplyItems(),
   },
   methods: {
     //

+ 5 - 3
src/views/purchase/apply/hooks/function.js

@@ -77,10 +77,12 @@ export default function useMethods() {
         source.tax = ntaxrate === "0E-8" ? "0.00000000" : ntaxrate;
       });
       // task 2
-      fetchUnit(unitIdName).then(({ code, name }) => {
-        source.unit = code;
+      fetchUnit(unitIdName).then(({ id, code, name }) => {
+        source.unit = id;
+        source.unitCode = code;
         source.unitName = name;
-        source.puUnit = code;
+        source.puUnit = id;
+        source.puUnitCode = code;
         source.puUnitName = name;
       });
       // task 3

+ 7 - 0
src/views/purchase/apply/hooks/table-function.js

@@ -3,6 +3,13 @@ import { initParams } from "@/utils/init";
 export default function useTable() {
   // 新 增
   const add = ({ _this, prop }) => {
+    const { puOrgName, supplierName } = _this.params;
+    if (!supplierName) {
+      return _this.$notify.info("请选择供应商");
+    }
+    if (!puOrgName) {
+      return _this.$notify.info("请选择采购组织");
+    }
     const { tableColumns } = _this.tabColumns.find(
       (element) => element.key === prop
     );

+ 43 - 0
src/views/purchase/apply/hooks/watch.js

@@ -0,0 +1,43 @@
+export default function useWatch() {
+  const watchPuOrgName = () => ({
+    handler: function (newProp, oldProp) {
+      if (oldProp) {
+        this.params.priceApplyOrgs = this.params.priceApplyOrgs.filter(
+          (item) => item.orgName !== oldProp
+        );
+      }
+      if (newProp) {
+        const {
+          puOrg: org,
+          puOrgCode: orgCode,
+          puOrgName: orgName,
+        } = this.params;
+        this.params.priceApplyOrgs.push({
+          org,
+          orgCode,
+          orgName,
+          createByName: undefined,
+          updateByName: undefined,
+        });
+      }
+    },
+    deep: true,
+  });
+  const watchPriceApplyOrgs = () => ({
+    handler: function (newValue) {
+      this.newParams.priceApplyOrgs = newValue.filter(
+        (item) => item.delFlag === "0"
+      );
+    },
+    deep: true,
+  });
+  const watchPriceApplyItems = () => ({
+    handler: function (newValue) {
+      this.newParams.priceApplyItems = newValue.filter(
+        (item) => item.delFlag === "0"
+      );
+    },
+    deep: true,
+  });
+  return { watchPuOrgName, watchPriceApplyOrgs, watchPriceApplyItems };
+}

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

@@ -252,9 +252,9 @@ export default {
       :size="size"
       :data="tableData"
       highlight-current-row
-      @row-click="useSelect([$event])"
       @row-dblclick="useSee"
       @selection-change="useSelect"
+      @row-click="useSelect([$event])"
       style="width: 100%; margin: 20px 0 0 0"
     >
       <el-table-column

+ 7 - 6
src/views/purchase/apply/see/index.vue

@@ -75,12 +75,6 @@ export default {
     <template slot="title">
       <span>{{ title }}</span>
       <span>
-        <el-button
-          :size="size"
-          circle
-          icon="el-icon-close"
-          @click="hide"
-        ></el-button>
         <el-tooltip
           class="item"
           effect="dark"
@@ -135,6 +129,13 @@ export default {
             @click="useSubmit([params])"
           ></el-button>
         </el-tooltip>
+        <el-button
+          :size="size"
+          circle
+          type="danger"
+          icon="el-icon-close"
+          @click="hide"
+        ></el-button>
       </span>
     </template>
     <el-descriptions :size="size" :column="column" border style="margin: 10px">

+ 19 - 1
src/views/purchase/purchase-order/add/index.vue

@@ -114,21 +114,39 @@ export default {
         const { code, msg, data } = await orderApi.details(id);
 
         if (code === 200) {
+
           this.params = {
             ...data,
             id: "",
             code: "",
             status: "0",
             source: "3",
+            paymentMoney:'',
+            applyPaymentMoney:'',
+            closeTime:'',
+            isClose:'N',
+            isSendWms:'N',
+            rebateMoney:'',
+            isInvoice:'N',
+            invoiceMoney:'',
+            isEnd:'N',
+
           };
 
           for (const key in this.params) {
-            if (Array.isArray(this.params[key])) {
+            // if (Array.isArray(this.params[key])) {
+            if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
               this.params[key].forEach((v) => {
                 v.id = "";
               });
+
             }
           }
+          // 清空   累计本币开票金额、
+          // 累计付款金额、累计付款申请金额、累计开票主数量、最终关闭时间
+          // 、最终关闭、已同步WMS 、订单抵扣余额金额、订单使用返利金额、 发票标识
+          
+
         }
       } catch (err) {
         //

+ 20 - 15
src/views/purchase/purchase-order/index.vue

@@ -8,6 +8,7 @@ import {
   initColumns,
   initDicts,
 } from "@/utils/init";
+import { clearTimeout } from "timers";
 
 
 export default {
@@ -41,6 +42,8 @@ export default {
       checkedTabList: [],
       // 主表点击信息
       primaryResource:{},
+      timer:300,
+      timeOut:null,
     };
   },
   computed: {
@@ -132,6 +135,7 @@ export default {
     },
     // 查看
     async handleOpenSeeDrawer(row) {
+      window.clearInterval(this.timeOut);
       const { id } = row;
       const { setVisible, fetchItem } = this.$refs.seeDrawerFef;
       await setVisible(true);
@@ -145,22 +149,23 @@ export default {
       await fetchItem(id);
     },
     // 获取子表信息
-    async handleDetailsData(row) {
-      try {
-        this.primaryResource = row;
-        this.checkedTabList = [];
-        const { code, msg, data } = await orderApi.details(row.id);
-        if (code === 200) {
-          // 物料信息:puOrderItemList   执行结果:puOrderExecuteList
-          for (const key in this.tabTableDatas) {
-            this.tabTableDatas[key] = data[key];
+     handleDetailsData(row) {
+      window.clearTimeout(this.timeOut)
+      this.timeOut = setTimeout(async () =>{
+
+        try {
+          this.primaryResource = row;
+          this.checkedTabList = [];
+          const { code, msg, data } = await orderApi.details(row.id);
+          if (code === 200) {
+            // 物料信息:puOrderItemList   执行结果:puOrderExecuteList
+            for (const key in this.tabTableDatas) {
+              this.tabTableDatas[key] = data[key];
+            }
           }
-        }
-      } catch (err) {
-        //
-      } finally {
-        // this.loading = false;
-      }
+        } catch (err) {}
+      },this.timer)
+      
     },
 
     // 操作提示弹窗

+ 3 - 3
src/views/purchase/task/first-direct/column.js

@@ -26,7 +26,7 @@ export const TableColumns = [
     key: "purchaseQuantity",
     title: "本次采购数量",
     inputType: "InputNumber",
-    width: 200,
+    width: 300,
     min: (prop) => 0,
     max: (prop) => prop.puQty - (prop.executeQty || 0),
     controlsPosition: "right",
@@ -36,12 +36,12 @@ export const TableColumns = [
     title: "计划到货日期",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
-    width: 200,
+    width: 300,
     pickerOptions: {
       disabledDate(time) {
         return time.getTime() < Date.now();
       },
     },
   },
-  { key: "note", title: "备注", inputType: "Textarea", width: 200 },
+  { key: "note", title: "备注", inputType: "Textarea", width: 300 },
 ];

+ 4 - 7
src/views/purchase/task/first-direct/index.vue

@@ -37,7 +37,6 @@ export default {
         const { code, data } = await FIRSTDIRECT(prop);
         if (code === 200) {
           this.data = data;
-          console.log(this.data);
           return true;
         } else {
           return false;
@@ -75,9 +74,7 @@ export default {
       }
     },
   },
-  created() {
-    console.log("tableColumns", this.tableColumns);
-  },
+  created() {},
   mounted() {},
   destroyed() {},
 };
@@ -140,7 +137,7 @@ export default {
           :width="cItem.width || 200"
           show-overflow-tooltip
         >
-          <!-- <template slot-scope="scope">
+          <template slot-scope="scope">
             <el-input-number
               v-if="cItem.inputType === 'InputNumber'"
               v-model="scope.row[cItem.key]"
@@ -175,8 +172,8 @@ export default {
               :value="scope.row[cItem.key]"
               :options="dict.type[cItem.referName]"
             />
-            <span v-else>1{{ scope.row[cItem.key] }}</span>
-          </template> -->
+            <span v-else>{{ scope.row[cItem.key] }}</span>
+          </template>
         </el-table-column>
       </el-table>
     </div>

+ 3 - 1
src/views/purchase/task/index.vue

@@ -294,9 +294,11 @@ export default {
     <el-table
       :data="tableData"
       size="mini"
-      style="width: 100%; margin: 20px 0 0 0"
+      highlight-current-row
       @row-dblclick="useSee"
       @selection-change="useSelect"
+      @row-click="useSelect([$event])"
+      style="width: 100%; margin: 20px 0 0 0"
     >
       <el-table-column
         fixed

+ 1 - 0
src/views/purchase/task/see/index.vue

@@ -62,6 +62,7 @@ export default {
         <el-button
           :size="size"
           circle
+          type="danger"
           icon="el-icon-close"
           @click="visible = false"
         ></el-button>

+ 20 - 0
src/views/purchase/transferOrder/add.vue

@@ -942,6 +942,12 @@ export default {
         this.basicForm.deliveryInventoryOrg = selection[0].id
         this.basicForm.deliveryInventoryOrgCode = selection[0].code
         this.basicForm.deliveryInventoryOrgName = selection[0].name
+        // 清空调出仓库,部门
+        this.basicForm.deliveryWarehouse = ''
+        this.basicForm.deliveryWarehouseCode = ''
+        this.basicForm.deliveryWarehouseName = ''
+        this.basicForm.deliveryDept = ''
+        this.basicForm.deliveryDeptName = ''
         // 选择调入库存组织时判断调拨方式
         if (this.basicForm.storageInventoryOrg == this.basicForm.deliveryInventoryOrg) {
           this.basicForm.allotType = '4'
@@ -955,6 +961,9 @@ export default {
         this.basicForm.storageInventory = selection[0].code
         this.basicForm.storageInventoryOrgName = selection[0].name
         this.basicForm.onRouteAffilliation = selection[0].name
+        // 选择调入库存组织清空仓库
+        this.basicForm.storageWarehouse = ''
+        this.basicForm.storageWarehouseName = ''
         // 选择调入库存组织时判断调拨方式
         if (this.basicForm.storageInventoryOrg == this.basicForm.deliveryInventoryOrg) {
           this.basicForm.allotType = '4'
@@ -982,6 +991,11 @@ export default {
         this.basicForm.storageWarehouse = selection[0].id
         this.basicForm.storageWarehouseName = selection[0].name
         console.log('1111', selection[0].csFlag)
+        // 清空调入货位
+        this.materialInfo.forEach(item => {
+          item.storageAllocation = null
+          item.storageAllocationName = null
+        })
         if(selection[0].csFlag == 'N') {
           this.isDRCk = true
         } else {
@@ -994,6 +1008,11 @@ export default {
         this.basicForm.deliveryWarehouseCode = selection[0].code
         this.basicForm.deliveryWarehouseName = selection[0].name
         console.log('2222', selection[0].csFlag)
+        // 清空调出货位
+        this.materialInfo.forEach(item => {
+          item.deliveryAllocation = null
+          item.deliveryAllocationName = null
+        })
         if (selection[0].csFlag == 'N') {
           this.isDCCk = true
         } else {
@@ -1069,6 +1088,7 @@ export default {
       this.referCondition.type = type
       this.referCondition.isPage = isPage
       this.referCondition.title = title
+      this.referCondition.pkOrg = ''
       this.referCondition.stordocId = stordocId
       this.$refs.refer.init(this.referCondition)
     },