002201 2 ani în urmă
părinte
comite
3d409d218a

+ 1 - 1
src/api/business/purchase/contract.js

@@ -79,7 +79,7 @@ export function TABLELIST(params, name) {
 
 export function TABLEADD(data, name) {
   return request({
-    url: `${switchUrl(name)}`,
+    url: `${switchUrl(name)}/add`,
     method: "POST",
     data: data,
   });

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

@@ -167,8 +167,10 @@ export default {
     },
     // cancel
     useCancel(prop) {
-      const { multiple } = this.$props;
-      this.useUpdate(multiple ? prop : prop[0]);
+      if (prop.length) {
+        const { multiple } = this.$props;
+        this.useUpdate(multiple ? prop : prop[0]);
+      }
       this.hide();
     },
     // confirm

+ 531 - 0
src/views/purchase/contract/add/column.js

@@ -0,0 +1,531 @@
+export const Columns = [
+  {
+    key: "puOrgName",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    referName: "ORG_PARAM",
+    dataMapping: {
+      puOrg: "code",
+      puOrgName: "name",
+    },
+    require: true,
+  },
+  { key: "code", title: "合同编码", inputType: "Input" },
+  {
+    key: "lastPuMoney",
+    title: "上年度采购额",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "buyerName",
+    title: "采购员",
+    inputType: "PopoverSelect",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {
+      buyer: "code",
+      buyerName: "name",
+      puDept: "deptId",
+      puDeptName: "deptName",
+    },
+    require: true,
+  },
+  {
+    key: "supplierName",
+    title: "供应商",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      supplier: "code",
+      supplierName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "contractType",
+    title: "合同类型",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_contract_type",
+  },
+  {
+    key: "puMoneyYear",
+    title: "本年度采购额",
+    inputType: "InputNumber",
+    require: true,
+  },
+  {
+    key: "puDeptName",
+    title: "采购部门",
+    inputType: "PopoverSelect",
+    referName: "DEPT_PARAM",
+    dataMapping: {
+      puDept: "code",
+      puDeptName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "supplierTier",
+    title: "供应商层级",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_supplier_tier",
+  },
+  { key: "contractName", title: "合同名称", inputType: "Input", require: true },
+  {
+    key: "grossRateAverage",
+    title: "平均毛利率",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "approveFlow",
+    title: "审批流程",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_approve_flow",
+  },
+  {
+    key: "consumableClass",
+    title: "耗材类别",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_consumable_class",
+  },
+  {
+    key: "effectiveDate",
+    title: "合同生效日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "brandGrossRate",
+    title: "同类品牌及毛利率",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "contractFormat",
+    title: "合同格式",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_contract_format",
+  },
+  {
+    key: "productName",
+    title: "产品类别&名称",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "endDate",
+    title: "合同终止日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "invoiceTax",
+    title: "发票税率",
+    inputType: "PopoverSelect",
+    referName: "TAX_RATE_PARAM",
+    dataMapping: {
+      invoiceTax: "ntaxrate",
+    },
+    require: true,
+  },
+  {
+    key: "emergencyDegree",
+    title: "紧急程度",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_emergency_degree",
+  },
+  { key: "project", title: "项目医院", inputType: "Input", require: true },
+  {
+    key: "signDate",
+    title: "合同签订日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "deliveryType",
+    title: "交货方式",
+    inputType: "Select",
+    referName: "puarchase_contract_delivery_type",
+  },
+  {
+    key: "source",
+    title: "合同来源",
+    inputType: "Input",
+    value: "自制",
+    disabled: true,
+  },
+  {
+    key: "contractPartycName",
+    title: "合同丙方",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      contractPartyc: "code",
+      contractPartycName: "name",
+    },
+  },
+  {
+    key: "guaranteePeriodEnd",
+    title: "质保期限",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "freightMethods",
+    title: "运费承担方式",
+    inputType: "Select",
+    referName: "puarchase_contract_freight_methods",
+  },
+  {
+    key: "signDate",
+    title: "合同创建时间",
+    inputType: "DatePicker",
+    disabled: true,
+  },
+  {
+    key: "isTarget",
+    title: "是否有指标",
+    inputType: "Select",
+    require: true,
+    referName: "sys_yes_no",
+  },
+  {
+    key: "contractTarget",
+    title: "合同指标",
+    inputType: "Input",
+    require: true,
+    placeholder: '当【是否有指标】="有"时,必填',
+  },
+  {
+    key: "exemptionPostageCondtion",
+    title: "包邮条件",
+    inputType: "Input",
+    placeholder:
+      "当运费承担方式为供应商有条件承担时,该字段必填,填写要求,写明什么条件下供应商承担全部,什么条件下我方承担,什么条件下分别承担",
+    span: 12,
+  },
+  {
+    key: "isRebate",
+    title: "是否有返利",
+    inputType: "Select",
+    require: true,
+    referName: "sys_yes_no",
+  },
+  {
+    key: "rebatePolicy",
+    title: "返利政策",
+    inputType: "Input",
+    placeholder: '当【是否有返利】="有"时,必填',
+    span: 18,
+  },
+  { key: "externalContract", title: "外部合同号", inputType: "Input" },
+  {
+    key: "rollbackPolicy",
+    title: "退换货政策",
+    inputType: "Input",
+    require: true,
+  },
+  { key: "enquiryCode", title: "询价单号", inputType: "Input" },
+  {
+    key: "contractContent",
+    title: "合同主要内容",
+    inputType: "Textarea",
+    require: true,
+    span: 24,
+  },
+  { key: "refusalReasons", title: "拒绝理由", inputType: "Input", span: 24 },
+
+  {
+    key: "externalFile",
+    title: "对外附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  {
+    key: "puFile",
+    title: "采购商盖章合同附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  {
+    key: "supplierFile",
+    title: "供应商盖章合同附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  { key: "projectCode", title: "项目编号", inputType: "Input" },
+  { key: "projectName", title: "项目名称", inputType: "Input" },
+  { key: "area", title: "区域", inputType: "Input" },
+  { key: "consigneePhone", title: "收货人联系方式", inputType: "Input" },
+  {
+    key: "paymentAgreement",
+    title: "付款协议",
+    inputType: "PopoverSelect",
+    referName: "PAYAGREEMENT_PARAM",
+    dataMapping: {
+      paymentAgreement: "code",
+      paymentAgreementName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "taxPrice",
+    title: "价税合计",
+    inputType: "InputNumber",
+  },
+  {
+    key: "currencyName",
+    title: "币种",
+    inputType: "PopoverSelect",
+    referName: "CURRENCY_PARAM",
+    dataMapping: {
+      currency: "code",
+      currencyName: "name",
+    },
+    require: true,
+  },
+  { key: "guaranteePeriod", title: "质保期", inputType: "Input" },
+];
+
+export const SearchColumns = [
+  { key: "contractName", title: "合同名称", search: true, inputType: "Input" },
+];
+
+export const TabColumns = [
+  {
+    title: "物料基本信息",
+    key: "contractItemList",
+    tableColumns: [
+      {
+        title: "物料名称",
+        key: "materialName",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "MATERIAL_PARAM",
+        dataMapping: {
+          material: "code",
+          materialName: "name",
+          puUnit: "unitIdName",
+          registration: "registrationNo",
+          specification: "specification",
+          manufacturer: "manufacturerIdName",
+        },
+      },
+      { title: "物料编码", key: "material", width: 200 },
+      {
+        title: "规格",
+        key: "specification",
+        width: 200,
+      },
+      // {
+      //   title: "品牌",
+      //   key: "brand",
+      //   inputType: "PopoverSelect",
+      //   width: 200,
+      //   referName: "MATERIAL_PARAM",
+      //   dataMapping: {
+      //     material: "code",
+      //     materialName: "name",
+      //   },
+      // },
+      {
+        title: "生产厂家",
+        key: "manufacturer",
+        inputType: "Input",
+        width: 200,
+      },
+      {
+        title: "采购单位",
+        key: "puUnit",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "UNIT_PARAM",
+        dataMapping: {
+          puUnit: "name",
+        },
+      },
+      {
+        title: "税率%",
+        key: "tax",
+        inputType: "PopoverSelect",
+        referName: "TAX_RATE_PARAM",
+        dataMapping: {
+          tax: "ntaxrate",
+        },
+        width: 200,
+      },
+      {
+        title: "采购数量",
+        key: "qty",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "含税单价",
+        key: "taxPrice",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "含税金额合计",
+        key: "taxMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxPrice } = prop;
+          const taxMoney = (qty * taxPrice).toFixed(8);
+          return taxMoney === "NaN" ? null : taxMoney;
+        },
+      },
+      {
+        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;
+        },
+      },
+      {
+        title: "无税金额合计",
+        key: "taxFreeMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxFreePrice } = prop;
+          const taxFreeMoney = (qty * taxFreePrice).toFixed(8);
+          return taxFreeMoney === "NaN" ? null : taxFreeMoney;
+        },
+      },
+      {
+        title: "注册证号及备案凭证号",
+        key: "registration",
+        inputType: "Input",
+        width: 200,
+      },
+      {
+        title: "收货客户",
+        key: "customerName",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "CUSTOMER_PARAM",
+        dataMapping: {
+          customer: "code",
+          customerName: "name",
+        },
+      },
+      { title: "备注", key: "remark", inputType: "Input", width: 200 },
+    ],
+  },
+  {
+    title: "合同条款",
+    key: "contractClauseList",
+    tableColumns: [
+      { title: "条款编码", key: "code", inputType: "Input" },
+      { title: "条款名称", key: "name", inputType: "Input" },
+      { title: "条款内容", key: "content", inputType: "Input" },
+      { title: "变量序号", key: "variableRowno" },
+      { title: "变量内容", key: "variableContent", inputType: "Input" },
+      { title: "备注", key: "remark", inputType: "Input" },
+    ],
+  },
+  {
+    title: "合同费用",
+    key: "contractExpenseList",
+    tableColumns: [
+      { title: "费用编码", key: "code", inputType: "Input" },
+      { title: "费用名称", key: "name", inputType: "Input" },
+      {
+        title: "费用金额",
+        key: "money",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      { title: "备注", key: "remark", inputType: "Input" },
+    ],
+  },
+  {
+    title: "付款协议信息",
+    key: "contractAgreementList",
+    tableColumns: [
+      {
+        title: "付款阶段",
+        key: "satge",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "付款起点",
+        key: "origin",
+        width: 200,
+        inputType: "Select",
+        referName: "puarchase_contract_origin",
+      },
+      { title: "账期天数", key: "paymetDays", inputType: "Input", width: 200 },
+      { title: "付款比例%", key: "ratio", inputType: "Input", width: 200 },
+      { title: "付款金额", key: "money", inputType: "Input", width: 200 },
+      {
+        title: "是否预付款",
+        key: "isAdvance",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
+      {
+        title: "是否质保金",
+        key: "isQuality",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
+      {
+        title: "结算方式",
+        key: "paymentMeans",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "BALATYPE_PARAM",
+        dataMapping: {
+          paymentMeans: "name",
+        },
+      },
+      { title: "备注", key: "remark", inputType: "Input", width: 200 },
+      {
+        title: "需进度确认",
+        key: "schedule",
+        inputType: "Select",
+        referName: "sys_yes_no",
+        width: 200,
+      },
+    ],
+  },
+  {
+    title: "合同执行组织范围",
+    key: "contractApplyOrgList",
+    tableColumns: [
+      {
+        title: "组织名称",
+        key: "orgName",
+        inputType: "PopoverSelect",
+        referName: "ORG_PARAM",
+        dataMapping: {
+          org: "code",
+          orgName: "name",
+        },
+      },
+      { title: "组织编码", key: "org" },
+    ],
+  },
+];

+ 4 - 45
src/views/purchase/contract/add/index.vue

@@ -1,12 +1,7 @@
 <script>
-import { Columns, TabColumns } from "../column";
+import { Columns, TabColumns } from "./column";
 import { REFER } from "@/components/popover-select/api";
-import {
-  ADD,
-  CODE,
-  TABLEADD,
-  TABLEROMOVE,
-} from "@/api/business/purchase/contract";
+import { ADD, CODE } from "@/api/business/purchase/contract";
 import { initDicts, initRules, initParams } from "@/utils/init";
 
 export default {
@@ -117,37 +112,8 @@ export default {
       this.params[prop].push(initParams(tab.tableColumns));
     },
     //
-    async rowDelete(prop, { row: { id }, $index }) {
-      if (id) {
-        try {
-          this.loading = true;
-          const { code } = await TABLEROMOVE(id, prop);
-          if (code === 200) {
-            this.fetchTable(this.params.code, prop);
-          }
-        } catch (err) {
-          // catch
-        } finally {
-          // finally
-          this.loading = false;
-        }
-      } else {
-        this.params[prop].splice($index, 1);
-      }
-    },
-    //
-    async rowSubmit(prop, { row }) {
-      try {
-        this.loading = true;
-        const { code } = this.params;
-        await TABLEADD({ ...row, contractId: code }, prop);
-      } catch (err) {
-        // catch
-        console.error(err);
-      } finally {
-        // finally
-        this.loading = false;
-      }
+    async rowDelete(prop, { $index }) {
+      this.params[prop].splice($index, 1);
     },
     //
     submit(prop) {
@@ -378,13 +344,6 @@ export default {
                 <template slot-scope="scope">
                   <el-button
                     circle
-                    icon="el-icon-check"
-                    :size="size"
-                    @click.native.prevent="rowSubmit(tabName, scope)"
-                  >
-                  </el-button>
-                  <el-button
-                    circle
                     icon="el-icon-minus"
                     :size="size"
                     @click.native.prevent="rowDelete(tabName, scope)"

+ 7 - 41
src/views/purchase/contract/edit/index.vue

@@ -53,23 +53,9 @@ export default {
           this.tabColumns = TabColumns;
         }
         this.tabName = this.tabColumns[0].key;
-        this.fetchTable(this.params.code, this.tabName);
       },
       immediate: true,
     },
-    // "params.contractItemList": {
-    //   handler: function (newProp, oldProp) {
-    //     console.log(newProp, oldProp);
-    //     if (newProp.length === oldProp.length) {
-    //       const index = newProp.findIndex(
-    //         (item, index) =>
-    //           JSON.stringify(item) === JSON.stringify(oldProp[index])
-    //       );
-    //       console.log(index);
-    //     }
-    //   },
-    //   deep: true,
-    // },
   },
   methods: {
     //
@@ -99,25 +85,8 @@ export default {
       }
     },
     //
-    async fetchTable(prop, name) {
-      try {
-        this.loading = true;
-        const { code, rows } = await TABLELIST({ contractId: prop }, name);
-        if (code === 200) {
-          this.params[name] = rows.map((item) => ({
-            ...item,
-            status: "success",
-          }));
-        }
-      } catch (err) {
-        // catch
-      } finally {
-        // finally
-        this.loading = false;
-      }
-    },
-    //
     async fetchRefer(prop, type, source) {
+      console.log("prop", prop);
       const { rateCode } = prop;
       if (type === "MATERIAL_PARAM") {
         try {
@@ -150,7 +119,7 @@ export default {
           this.loading = true;
           const { code } = await TABLEROMOVE(id, prop);
           if (code === 200) {
-            this.fetchTable(this.params.code, prop);
+            this.fetchItem(this.params.id);
           }
         } catch (err) {
           // catch
@@ -166,13 +135,14 @@ export default {
     async rowSubmit(prop, { row }) {
       try {
         this.loading = true;
+        const { id } = this.params;
         const { contractId } = row;
         if (contractId) {
           await TABLEEDIT(row, prop);
         } else {
-          const { code } = this.params;
-          await TABLEADD({ ...row, contractId: code }, prop);
+          await TABLEADD({ ...row, contractId: id }, prop);
         }
+        await this.fetchItem(id);
       } catch (err) {
         // catch
       } finally {
@@ -309,12 +279,7 @@ export default {
         </el-col>
       </el-row>
       <el-form-item label-width="0">
-        <el-tabs
-          v-model="tabName"
-          tab-position="left"
-          style="width: 100%"
-          @tab-click="fetchTable(params.code, tabName)"
-        >
+        <el-tabs v-model="tabName" tab-position="left" style="width: 100%">
           <el-tab-pane
             v-for="(column, index) in tabColumns"
             :key="index"
@@ -344,6 +309,7 @@ export default {
                     :clearable="cColumn.clearable"
                     :placeholder="cColumn.placeholder"
                     style="width: 100%"
+                    @change="fetchRefer"
                   ></el-input>
                   <dr-computed-input
                     v-else-if="cColumn.inputType === 'ComputedInput'"

+ 9 - 1
src/views/purchase/contract/index.vue

@@ -11,6 +11,7 @@ export default {
     EditModel: () => import("./edit/index.vue"),
     ExportModel: () => import("./export/index.vue"),
     ImportModel: () => import("./import/index.vue"),
+    RecordModel: () => import("./record/index.vue"),
     DeleteModel: () => import("./delete/index.vue"),
   },
   data() {
@@ -94,6 +95,11 @@ export default {
       const { open } = this.$refs.ImportModel;
       await open();
     },
+    // 期初补录
+    async useRecord() {
+      const { open } = this.$refs.RecordModel;
+      await open();
+    },
   },
 };
 </script>
@@ -111,6 +117,7 @@ export default {
   >
     <see-model ref="SeeModel"></see-model>
     <add-model ref="AddModel" @success="useReset"></add-model>
+    <record-model ref="RecordModel" @success="useReset"></record-model>
     <edit-model ref="EditModel" @success="useQuery(params, page)"></edit-model>
     <export-model ref="ExportModel"></export-model>
     <import-model ref="ImportModel"></import-model>
@@ -149,7 +156,8 @@ export default {
       <el-button :size="size" @click="useReset"> 重 置 </el-button>
       <el-button :size="size" @click="useAdd"> 新 增 </el-button>
       <el-button :size="size" @click="useExport(params)"> 导 出 </el-button>
-      <el-button :size="size" @click="useImport"> 导 入 </el-button>
+      <el-button :size="size" @click="useRecord"> 期初补录 </el-button>
+      <!-- <el-button :size="size" @click="useImport"> 导 入 </el-button> -->
     </el-row>
     <el-table
       :size="size"

+ 531 - 0
src/views/purchase/contract/record/column.js

@@ -0,0 +1,531 @@
+export const Columns = [
+  {
+    key: "puOrgName",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    referName: "ORG_PARAM",
+    dataMapping: {
+      puOrg: "code",
+      puOrgName: "name",
+    },
+    require: true,
+  },
+  { key: "code", title: "合同编码", inputType: "Input" },
+  {
+    key: "lastPuMoney",
+    title: "上年度采购额",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "buyerName",
+    title: "采购员",
+    inputType: "PopoverSelect",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {
+      buyer: "code",
+      buyerName: "name",
+      puDept: "deptId",
+      puDeptName: "deptName",
+    },
+    require: true,
+  },
+  {
+    key: "supplierName",
+    title: "供应商",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      supplier: "code",
+      supplierName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "contractType",
+    title: "合同类型",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_contract_type",
+  },
+  {
+    key: "puMoneyYear",
+    title: "本年度采购额",
+    inputType: "InputNumber",
+    require: true,
+  },
+  {
+    key: "puDeptName",
+    title: "采购部门",
+    inputType: "PopoverSelect",
+    referName: "DEPT_PARAM",
+    dataMapping: {
+      puDept: "code",
+      puDeptName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "supplierTier",
+    title: "供应商层级",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_supplier_tier",
+  },
+  { key: "contractName", title: "合同名称", inputType: "Input", require: true },
+  {
+    key: "grossRateAverage",
+    title: "平均毛利率",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "approveFlow",
+    title: "审批流程",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_approve_flow",
+  },
+  {
+    key: "consumableClass",
+    title: "耗材类别",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_consumable_class",
+  },
+  {
+    key: "effectiveDate",
+    title: "合同生效日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "brandGrossRate",
+    title: "同类品牌及毛利率",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "contractFormat",
+    title: "合同格式",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_contract_format",
+  },
+  {
+    key: "productName",
+    title: "产品类别&名称",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "endDate",
+    title: "合同终止日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "invoiceTax",
+    title: "发票税率",
+    inputType: "PopoverSelect",
+    referName: "TAX_RATE_PARAM",
+    dataMapping: {
+      invoiceTax: "ntaxrate",
+    },
+    require: true,
+  },
+  {
+    key: "emergencyDegree",
+    title: "紧急程度",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_emergency_degree",
+  },
+  { key: "project", title: "项目医院", inputType: "Input", require: true },
+  {
+    key: "signDate",
+    title: "合同签订日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "deliveryType",
+    title: "交货方式",
+    inputType: "Select",
+    referName: "puarchase_contract_delivery_type",
+  },
+  {
+    key: "source",
+    title: "合同来源",
+    inputType: "Input",
+    value: "期初补录",
+    disabled: true,
+  },
+  {
+    key: "contractPartycName",
+    title: "合同丙方",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      contractPartyc: "code",
+      contractPartycName: "name",
+    },
+  },
+  {
+    key: "guaranteePeriodEnd",
+    title: "质保期限",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "freightMethods",
+    title: "运费承担方式",
+    inputType: "Select",
+    referName: "puarchase_contract_freight_methods",
+  },
+  {
+    key: "signDate",
+    title: "合同创建时间",
+    inputType: "DatePicker",
+    disabled: true,
+  },
+  {
+    key: "isTarget",
+    title: "是否有指标",
+    inputType: "Select",
+    require: true,
+    referName: "sys_yes_no",
+  },
+  {
+    key: "contractTarget",
+    title: "合同指标",
+    inputType: "Input",
+    require: true,
+    placeholder: '当【是否有指标】="有"时,必填',
+  },
+  {
+    key: "exemptionPostageCondtion",
+    title: "包邮条件",
+    inputType: "Input",
+    placeholder:
+      "当运费承担方式为供应商有条件承担时,该字段必填,填写要求,写明什么条件下供应商承担全部,什么条件下我方承担,什么条件下分别承担",
+    span: 12,
+  },
+  {
+    key: "isRebate",
+    title: "是否有返利",
+    inputType: "Select",
+    require: true,
+    referName: "sys_yes_no",
+  },
+  {
+    key: "rebatePolicy",
+    title: "返利政策",
+    inputType: "Input",
+    placeholder: '当【是否有返利】="有"时,必填',
+    span: 18,
+  },
+  { key: "externalContract", title: "外部合同号", inputType: "Input" },
+  {
+    key: "rollbackPolicy",
+    title: "退换货政策",
+    inputType: "Input",
+    require: true,
+  },
+  { key: "enquiryCode", title: "询价单号", inputType: "Input" },
+  {
+    key: "contractContent",
+    title: "合同主要内容",
+    inputType: "Textarea",
+    require: true,
+    span: 24,
+  },
+  { key: "refusalReasons", title: "拒绝理由", inputType: "Input", span: 24 },
+
+  {
+    key: "externalFile",
+    title: "对外附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  {
+    key: "puFile",
+    title: "采购商盖章合同附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  {
+    key: "supplierFile",
+    title: "供应商盖章合同附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  { key: "projectCode", title: "项目编号", inputType: "Input" },
+  { key: "projectName", title: "项目名称", inputType: "Input" },
+  { key: "area", title: "区域", inputType: "Input" },
+  { key: "consigneePhone", title: "收货人联系方式", inputType: "Input" },
+  {
+    key: "paymentAgreement",
+    title: "付款协议",
+    inputType: "PopoverSelect",
+    referName: "PAYAGREEMENT_PARAM",
+    dataMapping: {
+      paymentAgreement: "code",
+      paymentAgreementName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "taxPrice",
+    title: "价税合计",
+    inputType: "InputNumber",
+  },
+  {
+    key: "currencyName",
+    title: "币种",
+    inputType: "PopoverSelect",
+    referName: "CURRENCY_PARAM",
+    dataMapping: {
+      currency: "code",
+      currencyName: "name",
+    },
+    require: true,
+  },
+  { key: "guaranteePeriod", title: "质保期", inputType: "Input" },
+];
+
+export const SearchColumns = [
+  { key: "contractName", title: "合同名称", search: true, inputType: "Input" },
+];
+
+export const TabColumns = [
+  {
+    title: "物料基本信息",
+    key: "contractItemList",
+    tableColumns: [
+      {
+        title: "物料名称",
+        key: "materialName",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "MATERIAL_PARAM",
+        dataMapping: {
+          material: "code",
+          materialName: "name",
+          puUnit: "unitIdName",
+          registration: "registrationNo",
+          specification: "specification",
+          manufacturer: "manufacturerIdName",
+        },
+      },
+      { title: "物料编码", key: "material", width: 200 },
+      {
+        title: "规格",
+        key: "specification",
+        width: 200,
+      },
+      // {
+      //   title: "品牌",
+      //   key: "brand",
+      //   inputType: "PopoverSelect",
+      //   width: 200,
+      //   referName: "MATERIAL_PARAM",
+      //   dataMapping: {
+      //     material: "code",
+      //     materialName: "name",
+      //   },
+      // },
+      {
+        title: "生产厂家",
+        key: "manufacturer",
+        inputType: "Input",
+        width: 200,
+      },
+      {
+        title: "采购单位",
+        key: "puUnit",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "UNIT_PARAM",
+        dataMapping: {
+          puUnit: "name",
+        },
+      },
+      {
+        title: "税率%",
+        key: "tax",
+        inputType: "PopoverSelect",
+        referName: "TAX_RATE_PARAM",
+        dataMapping: {
+          tax: "ntaxrate",
+        },
+        width: 200,
+      },
+      {
+        title: "采购数量",
+        key: "qty",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "含税单价",
+        key: "taxPrice",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "含税金额合计",
+        key: "taxMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxPrice } = prop;
+          const taxMoney = (qty * taxPrice).toFixed(8);
+          return taxMoney === "NaN" ? null : taxMoney;
+        },
+      },
+      {
+        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;
+        },
+      },
+      {
+        title: "无税金额合计",
+        key: "taxFreeMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxFreePrice } = prop;
+          const taxFreeMoney = (qty * taxFreePrice).toFixed(8);
+          return taxFreeMoney === "NaN" ? null : taxFreeMoney;
+        },
+      },
+      {
+        title: "注册证号及备案凭证号",
+        key: "registration",
+        inputType: "Input",
+        width: 200,
+      },
+      {
+        title: "收货客户",
+        key: "customerName",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "CUSTOMER_PARAM",
+        dataMapping: {
+          customer: "code",
+          customerName: "name",
+        },
+      },
+      { title: "备注", key: "remark", inputType: "Input", width: 200 },
+    ],
+  },
+  {
+    title: "合同条款",
+    key: "contractClauseList",
+    tableColumns: [
+      { title: "条款编码", key: "code", inputType: "Input" },
+      { title: "条款名称", key: "name", inputType: "Input" },
+      { title: "条款内容", key: "content", inputType: "Input" },
+      { title: "变量序号", key: "variableRowno" },
+      { title: "变量内容", key: "variableContent", inputType: "Input" },
+      { title: "备注", key: "remark", inputType: "Input" },
+    ],
+  },
+  {
+    title: "合同费用",
+    key: "contractExpenseList",
+    tableColumns: [
+      { title: "费用编码", key: "code", inputType: "Input" },
+      { title: "费用名称", key: "name", inputType: "Input" },
+      {
+        title: "费用金额",
+        key: "money",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      { title: "备注", key: "remark", inputType: "Input" },
+    ],
+  },
+  {
+    title: "付款协议信息",
+    key: "contractAgreementList",
+    tableColumns: [
+      {
+        title: "付款阶段",
+        key: "satge",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "付款起点",
+        key: "origin",
+        width: 200,
+        inputType: "Select",
+        referName: "puarchase_contract_origin",
+      },
+      { title: "账期天数", key: "paymetDays", inputType: "Input", width: 200 },
+      { title: "付款比例%", key: "ratio", inputType: "Input", width: 200 },
+      { title: "付款金额", key: "money", inputType: "Input", width: 200 },
+      {
+        title: "是否预付款",
+        key: "isAdvance",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
+      {
+        title: "是否质保金",
+        key: "isQuality",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
+      {
+        title: "结算方式",
+        key: "paymentMeans",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "BALATYPE_PARAM",
+        dataMapping: {
+          paymentMeans: "name",
+        },
+      },
+      { title: "备注", key: "remark", inputType: "Input", width: 200 },
+      {
+        title: "需进度确认",
+        key: "schedule",
+        inputType: "Select",
+        referName: "sys_yes_no",
+        width: 200,
+      },
+    ],
+  },
+  {
+    title: "合同执行组织范围",
+    key: "contractApplyOrgList",
+    tableColumns: [
+      {
+        title: "组织名称",
+        key: "orgName",
+        inputType: "PopoverSelect",
+        referName: "ORG_PARAM",
+        dataMapping: {
+          org: "code",
+          orgName: "name",
+        },
+      },
+      { title: "组织编码", key: "org" },
+    ],
+  },
+];

+ 364 - 0
src/views/purchase/contract/record/index.vue

@@ -0,0 +1,364 @@
+<script>
+import { Columns, TabColumns } from "./column";
+import { REFER } from "@/components/popover-select/api";
+import { ADD, CODE } from "@/api/business/purchase/contract";
+import { initDicts, initRules, initParams } from "@/utils/init";
+
+export default {
+  name: "RecordDialog",
+  dicts: Array.from(
+    new Set([
+      ...initDicts(Columns),
+      ...initDicts(
+        TabColumns.map((item) => item.tableColumns)
+          .flat()
+          .filter((item) => item.inputType === "Select")
+      ),
+    ])
+  ),
+  components: {},
+  data() {
+    return {
+      size: "mini",
+      visible: false,
+      loading: false,
+      columns: Columns,
+      rules: initRules(Columns),
+      params: {
+        ...initParams(Columns),
+        contractItemList: [],
+        contractClauseList: [],
+        contractExpenseList: [],
+        contractAgreementList: [],
+        contractApplyOrgList: [],
+      },
+      tabColumns: TabColumns,
+      tabName: "contractItemList",
+    };
+  },
+  computed: {},
+  watch: {
+    "params.contractType": function (newProp) {
+      this.tabColumns = TabColumns.filter((element) =>
+        newProp === "1" ? element.key !== "contractItemList" : element
+      );
+      this.tabName = this.tabColumns[0].key;
+    },
+  },
+  methods: {
+    //
+    open() {
+      const {
+        deptId: puDept,
+        deptName: puDeptName,
+        name: buyer,
+        nickName: buyerName,
+        orgId: puOrg,
+        orgName: puOrgName,
+      } = this.$store.state.user;
+      this.params.puOrg = puOrg;
+      this.params.puOrgName = puOrgName;
+      this.params.buyer = buyer;
+      this.params.buyerName = buyerName;
+      this.params.puDept = puDept;
+      this.params.puDeptName = puDeptName;
+      this.fetchCode();
+      this.visible = true;
+    },
+    //
+    hide() {
+      this.visible = false;
+      this.params = initParams(this.columns);
+      this.tabName = this.tabColumns[0].key;
+    },
+    //
+    async fetchCode() {
+      try {
+        this.loading = true;
+        const code = await CODE();
+        this.params.code = code;
+      } catch (err) {
+        // catch
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //
+    async fetchRefer(prop, type, source) {
+      const { rateCode } = prop;
+      if (type === "MATERIAL_PARAM") {
+        try {
+          this.loading = true;
+          const { code, rows } = await REFER({
+            search: rateCode,
+            type: "TAX_RATE_PARAM",
+          });
+          if (code === 200) {
+            const [{ ntaxrate }] = rows;
+            source.tax = ntaxrate === "0E-8" ? "0.00000000" : ntaxrate;
+          }
+        } catch (err) {
+          // catch
+        } finally {
+          // finally
+          this.loading = false;
+        }
+      }
+    },
+    //
+    rowAdd(prop) {
+      const tab = this.tabColumns.find((element) => element.key === prop);
+      this.params[prop].push(initParams(tab.tableColumns));
+    },
+    //
+    async rowDelete(prop, { $index }) {
+      this.params[prop].splice($index, 1);
+    },
+    //
+    submit(prop) {
+      this.$refs[prop].validate(async (valid) => {
+        if (valid) {
+          try {
+            const createById = this.params.buyer;
+            const createByName = this.params.buyerName;
+            const updateById = this.$store.state.user.id;
+            const updateByName = this.$store.state.user.name;
+            const { code, msg } = await ADD({
+              createById,
+              createByName,
+              updateById,
+              updateByName,
+              ...this.params,
+            });
+            if (code === 200) {
+              this.hide();
+              this.$emit("success");
+            } else {
+              this.$notify.warning({ title: msg });
+            }
+          } catch (err) {
+            //
+          } finally {
+            //
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+  },
+  created() {
+    console.log(this);
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-dialog :visible.sync="visible" title="期初补录" fullscreen @close="hide">
+    <el-form
+      ref="ruleForm"
+      v-loading="loading"
+      :size="size"
+      :rules="rules"
+      :model="params"
+      label-width="auto"
+      label-position="right"
+    >
+      <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
+        <el-col
+          v-for="(column, index) in columns"
+          :key="index"
+          :span="column.span || 6"
+        >
+          <el-form-item :prop="column.key" :label="column.title">
+            <el-input
+              v-if="column.inputType === 'Input'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            ></el-input>
+            <dr-popover-select
+              v-if="column.inputType === 'PopoverSelect'"
+              v-model="params[column.key]"
+              :source.sync="params"
+              :title="column.title"
+              :type="column.referName"
+              :disabled="column.disabled"
+              :readonly="column.readonly"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :data-mapping="column.dataMapping"
+            >
+            </dr-popover-select>
+            <el-input
+              v-if="column.inputType === 'Textarea'"
+              v-model="params[column.key]"
+              type="textarea"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            ></el-input>
+            <el-input-number
+              v-if="column.inputType === 'InputNumber'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :controls-position="column.controlsPosition"
+              style="width: 100%"
+            ></el-input-number>
+            <el-select
+              v-if="column.inputType === 'Select'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in dict.type[column.referName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            <el-date-picker
+              v-if="column.inputType === 'DatePicker'"
+              v-model="params[column.key]"
+              :type="column.type"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :picker-options="column.pickerOptions"
+              style="width: 100%"
+            >
+            </el-date-picker>
+            <file-upload
+              v-if="column.inputType === 'Upload'"
+              v-model="params[column.key]"
+              :file-type="column.fileType"
+            ></file-upload>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-form-item label-width="0">
+        <el-tabs v-model="tabName" tab-position="left" style="width: 100%">
+          <el-tab-pane
+            v-for="(column, index) in tabColumns"
+            :key="index"
+            :label="column.title"
+            :name="column.key"
+          >
+            <el-table :data="params[column.key]" style="width: 100%">
+              <el-table-column label="序号">
+                <template slot-scope="scope">
+                  {{ scope.$index + 1 }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-for="(cColumn, cIndex) in column.tableColumns"
+                :key="cIndex"
+                :prop="cColumn.key"
+                :label="cColumn.title"
+                :width="cColumn.width"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <el-input
+                    v-if="cColumn.inputType === 'Input'"
+                    v-model="scope.row[cColumn.key]"
+                    :size="size"
+                    :disabled="cColumn.disabled"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  ></el-input>
+                  <dr-computed-input
+                    v-else-if="cColumn.inputType === 'ComputedInput'"
+                    v-model="scope.row[cColumn.key]"
+                    :source="scope.row"
+                    :computed="cColumn.computed"
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  ></dr-computed-input>
+                  <dr-popover-select
+                    v-else-if="cColumn.inputType === 'PopoverSelect'"
+                    v-model="scope.row[cColumn.key]"
+                    :size="size"
+                    :title="cColumn.title"
+                    :source.sync="scope.row"
+                    :type="cColumn.referName"
+                    :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    :data-mapping="cColumn.dataMapping"
+                    @change="fetchRefer"
+                  >
+                  </dr-popover-select>
+                  <el-input-number
+                    v-else-if="cColumn.inputType === 'InputNumber'"
+                    v-model="scope.row[cColumn.key]"
+                    :size="size"
+                    :disabled="cColumn.disabled"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    :controls-position="cColumn.controlsPosition"
+                    style="width: 100%"
+                  ></el-input-number>
+                  <el-select
+                    v-else-if="cColumn.inputType === 'Select'"
+                    v-model="scope.row[cColumn.key]"
+                    :disabled="cColumn.disabled"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  >
+                    <el-option
+                      v-for="item in dict.type[cColumn.referName]"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </el-select>
+                  <span v-else> {{ scope.row[cColumn.key] }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="100">
+                <template slot="header" slot-scope="scope">
+                  <el-button
+                    circle
+                    icon="el-icon-plus"
+                    :size="size"
+                    @click="rowAdd(tabName)"
+                  >
+                  </el-button>
+                </template>
+                <template slot-scope="scope">
+                  <el-button
+                    circle
+                    icon="el-icon-minus"
+                    :size="size"
+                    @click.native.prevent="rowDelete(tabName, scope)"
+                  >
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
+      </el-form-item>
+      <el-form-item label-width="0" style="text-align: right">
+        <el-button :size="size" @click="hide">取 消</el-button>
+        <el-button :size="size" @click="submit('ruleForm')"> 新 增 </el-button>
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>

+ 6 - 28
src/views/purchase/contract/see/index.vue

@@ -49,29 +49,11 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code,data } = await ITEM(prop);
+        const { code, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
-          
+
           this.tabName = this.tabColumns[0].key;
-          this.fetchTable(this.params.code, this.tabName);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    //
-    async fetchTable(prop, name) {
-      try {
-        this.loading = true;
-        const { code,rows } = await TABLELIST({ contractId: prop }, name);
-        if (code === 200) {
-          this.params[name] = rows;
-          
         } else {
           this.$notify.warning({ title: msg });
         }
@@ -95,13 +77,14 @@ export default {
 };
 </script>
 <template>
-  <el-dialog :visible.sync="visible" title="明细" @close="hide">
-    <el-descriptions :column="2" border>
+  <el-dialog :visible.sync="visible" title="明细" fullscreen @close="hide">
+    <el-descriptions :column="4" border>
       <el-descriptions-item
         v-if="params[column.key]"
         v-for="(column, index) in columns"
         :key="index"
         :label="column.title"
+        :labelStyle="{ width: '100px' }"
       >
         <dict-tag
           v-if="column.inputType === 'Select'"
@@ -128,12 +111,7 @@ export default {
         <span v-else>{{ params[column.key] }}</span>
       </el-descriptions-item>
     </el-descriptions>
-    <el-tabs
-      v-model="tabName"
-      tab-position="left"
-      style="width: 100%"
-      @tab-click="fetchTable(params.code, tabName)"
-    >
+    <el-tabs v-model="tabName" tab-position="top" style="width: 100%">
       <el-tab-pane
         v-for="(column, index) in tabColumns"
         :key="index"

+ 9 - 6
src/views/purchase/task/column.js

@@ -1,5 +1,11 @@
 export const TableColumns = [
   { key: "code", title: "订单生成单号", width: 250 },
+  {
+    key: "status",
+    title: "状态",
+    inputType: "Select",
+    referName: "purchase_task_status",
+  },
   { key: "demandCode", title: "需求单号", width: 250 },
   { key: "materialCode", title: "物料编码" },
   { key: "materialName", title: "物料名称" },
@@ -7,6 +13,8 @@ export const TableColumns = [
   { key: "materialDesc", title: "物料描述" },
   { key: "manufacturerName", title: "生产厂家" },
   { key: "puQty", title: "采购数量" },
+  { key: "executeQty", title: "已执行数量" },
+  { key: "residueQty", title: "未执行数量" },
   {
     key: "priceType",
     title: "价格类型",
@@ -15,12 +23,7 @@ export const TableColumns = [
   },
   { key: "puUnitName", title: "采购单位" },
   // { key: "id", title: "主键" },
-  {
-    key: "status",
-    title: "状态",
-    inputType: "Select",
-    referName: "purchase_task_status",
-  },
+
   // { key: "manufacturer", title: "生产厂家" },
   // { key: "buyer", title: "采购员" },
   { key: "buyerName", title: "采购员" },

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

@@ -12,8 +12,6 @@ export const TableColumns = [
   { key: "tax", title: "税率" },
   { key: "taxFreePrice", title: "无税单价" },
   { key: "taxPrice", title: "主含税单价" },
-  { key: "executeQty", title: "已执行数量" },
-  { key: "residueQty", title: "未执行数量" },
   {
     key: "purchaseQuantity",
     title: "本次采购数量",
@@ -29,6 +27,11 @@ export const TableColumns = [
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
     width: 200,
+    pickerOptions: {
+      disabledDate(time) {
+        return time.getTime() < Date.now();
+      },
+    },
   },
   { key: "note", title: "备注", inputType: "Textarea", width: 200 },
 ];

+ 2 - 3
src/views/purchase/task/first-direct/index.vue

@@ -30,10 +30,9 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code,data } = await FIRSTDIRECT(prop);
+        const { code, data } = await FIRSTDIRECT(prop);
         if (code === 200) {
           this.data = data;
-          
         } else {
           this.hide();
           this.$notify.warning({ title: msg });
@@ -59,7 +58,7 @@ export default {
         if (code === 200) {
           this.hide();
           this.$emit("success");
-          
+          this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
         }

+ 15 - 11
src/views/purchase/task/index.vue

@@ -32,6 +32,13 @@ export default {
     this.useQuery(this.params, this.page);
   },
   methods: {
+    // selectable
+    selectable(row) {
+      const { status } = row;
+      if (status === "1") return false;
+      else if (status === "3") return false;
+      else return true;
+    },
     //
     async fetchList(prop, page) {
       try {
@@ -72,16 +79,7 @@ export default {
     },
     // 选 择
     useSelect(prop) {
-      if (prop && prop.length) {
-        // const lastIndex = prop.length - 1;
-        // const { status } = prop[lastIndex];
-        // if (status === "1") {
-        //   this.selectData.splice(lastIndex, 1);
-        // } else {
-        this.selectData = prop;
-        // }
-      }
-      console.log(this.selectData);
+      this.selectData = prop;
     },
     // 行 关
     async useClose(prop) {
@@ -273,7 +271,13 @@ export default {
       @row-dblclick="useSee"
       @selection-change="useSelect"
     >
-      <el-table-column fixed width="55" align="center" type="selection">
+      <el-table-column
+        fixed
+        width="55"
+        align="center"
+        type="selection"
+        :selectable="selectable"
+      >
       </el-table-column>
       <el-table-column
         v-for="(column, index) in tableColumns"