002201 2 anos atrás
pai
commit
8d6a7f7cc5

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

@@ -31,7 +31,7 @@ export function REMOVE(data) {
   });
 }
 
-export function item(data) {
+export function ITEM(data) {
   return request({
     url: `/pu/contract/${data}`,
     method: "GET",
@@ -45,7 +45,7 @@ export function generateCode() {
   });
 }
 
-export function itemTableList(params, name) {
+export function ITEMTABLELIST(params, name) {
   let url = "";
   if (name === "contractItemList") url = "/pu/contract/item/list";
   if (name === "contractClauseList") url = "/pu/contract/clause/list";

+ 39 - 19
src/components/FileUpload/index.vue

@@ -19,20 +19,38 @@
       <!-- 上传提示 -->
       <div class="el-upload__tip" slot="tip" v-if="showTip">
         请上传
-        <template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
-        <template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
+        <template v-if="fileSize">
+          大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
+        </template>
+        <template v-if="fileType">
+          格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
+        </template>
         的文件
       </div>
     </el-upload>
 
     <!-- 文件列表 -->
-    <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
-      <li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
-        <el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
+    <transition-group
+      class="upload-file-list el-upload-list el-upload-list--text"
+      name="el-fade-in-linear"
+      tag="ul"
+    >
+      <li
+        :key="file.url"
+        class="el-upload-list__item ele-upload-list__item-content"
+        v-for="(file, index) in fileList"
+      >
+        <el-link
+          :href="`${baseUrl}${file.url}`"
+          :underline="false"
+          target="_blank"
+        >
           <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
         </el-link>
         <div class="ele-upload-list__item-content-action">
-          <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
+          <el-link :underline="false" @click="handleDelete(index)" type="danger"
+            >删除</el-link
+          >
         </div>
       </li>
     </transition-group>
@@ -65,15 +83,15 @@ export default {
     // 是否显示提示
     isShowTip: {
       type: Boolean,
-      default: true
-    }
+      default: true,
+    },
   },
   data() {
     return {
       number: 0,
       uploadList: [],
       baseUrl: process.env.VUE_APP_BASE_API,
-      uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
+      uploadFileUrl: process.env.VUE_APP_BASE_API + "/pu/contract/upload", // 上传文件服务器地址
       headers: {
         Authorization: "Bearer " + getToken(),
       },
@@ -86,9 +104,9 @@ export default {
         if (val) {
           let temp = 1;
           // 首先将值转为数组
-          const list = Array.isArray(val) ? val : this.value.split(',');
+          const list = Array.isArray(val) ? val : this.value.split(",");
           // 然后将数组转为对象数组
-          this.fileList = list.map(item => {
+          this.fileList = list.map((item) => {
             if (typeof item === "string") {
               item = { name: item, url: item };
             }
@@ -101,8 +119,8 @@ export default {
         }
       },
       deep: true,
-      immediate: true
-    }
+      immediate: true,
+    },
   },
   computed: {
     // 是否显示提示
@@ -115,11 +133,13 @@ export default {
     handleBeforeUpload(file) {
       // 校检文件类型
       if (this.fileType) {
-        const fileName = file.name.split('.');
+        const fileName = file.name.split(".");
         const fileExt = fileName[fileName.length - 1];
         const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
         if (!isTypeOk) {
-          this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
+          this.$modal.msgError(
+            `文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
+          );
           return false;
         }
       }
@@ -142,7 +162,7 @@ export default {
     // 上传失败
     handleUploadError(err) {
       this.$modal.msgError("上传文件失败,请重试");
-      this.$modal.closeLoading()
+      this.$modal.closeLoading();
     },
     // 上传成功回调
     handleUploadSuccess(res, file) {
@@ -187,9 +207,9 @@ export default {
       for (let i in list) {
         strs += list[i].url + separator;
       }
-      return strs != '' ? strs.substr(0, strs.length - 1) : '';
-    }
-  }
+      return strs != "" ? strs.substr(0, strs.length - 1) : "";
+    },
+  },
 };
 </script>
 

+ 13 - 6
src/components/popover-select/components/index.vue

@@ -91,18 +91,25 @@ export default {
     },
     // click select row data
     handleSelect(row) {
-      [row].forEach((row) => {
-        this.$refs.multipleTable.toggleRowSelection(row);
-      });
+      const { multiple } = this.$props;
+      if (multiple) {
+        [row].forEach((row) => {
+          this.$refs.multipleTable.toggleRowSelection(row);
+        });
+      } else {
+        this.multipleSelection = [row];
+      }
     },
     // double click select row data and confirm
     handleDoubleClickSelect(row) {
-      const { multiple } = this.$props;
-      if (!multiple) this.confirm([row]);
+      this.confirm([row]);
     },
     // multiple select row data
     handleMultipleSelect(prop) {
-      this.multipleSelection = prop;
+      const { multiple } = this.$props;
+      if (multiple) {
+        this.multipleSelection = prop;
+      }
     },
     // confirm
     confirm(prop) {

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

@@ -17,10 +17,14 @@ export default {
       type: String,
       default: "TITLE",
     },
-    // 作为 value 唯一标识的键名,绑定值为对象类型时必填
+    // 作为 value 唯一标识的键名,绑定值
     valueKey: {
       type: String,
-      default: "id",
+      default: "name",
+    },
+    // 作为 value 唯一标识的键名,显示值
+    showKey: {
+      type: String,
     },
     // 默认查询参数
     queryParams: {
@@ -76,7 +80,8 @@ export default {
   },
   computed: {
     showValue() {
-      return this.data.length === 1 ? this.data[0][this.$props.valueKey] : "";
+      const { showKey, valueKey } = this.$props;
+      return this.data.length === 1 ? this.data[0][showKey || valueKey] : "";
     },
   },
   watch: {
@@ -122,7 +127,10 @@ export default {
         // 更新映射数据
         for (let key in dataMapping) {
           source[key] = prop[0][dataMapping[key]];
+          console.log(source[key]);
+          console.log(prop[0][dataMapping[key]]);
         }
+        console.log("prop", prop, source, this.$props);
         this.$emit("update:source", source);
       }
       //
@@ -191,7 +199,7 @@ export default {
             }"
             @close="handleDelete(index)"
           >
-            {{ item[valueKey] }}
+            {{ item[showKey || valueKey] }}
           </el-tag>
         </el-popover>
       </div>

+ 8 - 3
src/components/popover-tree-select/index.vue

@@ -17,10 +17,14 @@ export default {
       type: String,
       default: "TITLE",
     },
-    // 作为 value 唯一标识的键名,绑定值为对象类型时必填
+    // 作为 value 唯一标识的键名,绑定值
     valueKey: {
       type: String,
-      default: "id",
+      default: "name",
+    },
+    // 作为 value 唯一标识的键名,显示值
+    showKey: {
+      type: String,
     },
     // 默认查询参数
     queryParams: {
@@ -75,7 +79,8 @@ export default {
   },
   computed: {
     showValue() {
-      return this.data.length === 1 ? this.data[0][this.$props.valueKey] : "";
+      const { showKey, valueKey } = this.$props;
+      return this.data.length === 1 ? this.data[0][showKey || valueKey] : "";
     },
   },
   watch: {

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

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

+ 209 - 149
src/views/purchase/contract/add/index.vue

@@ -1,17 +1,11 @@
 <script>
-import { Columns, TabColumns } from "./column";
+import { Columns, TabColumns } from "../column";
 import { add, generateCode } from "@/api/business/purchase/contract";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
-
-const NewColumns = initColumns(Columns);
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns),
-}));
+import { initDicts, initRules, initParams } from "@/utils/init";
 
 export default {
-  name: "AddDrawer",
-  dicts: initDicts(NewColumns),
+  name: "AddDialog",
+  dicts: initDicts(Columns),
 
   components: {},
   data() {
@@ -19,10 +13,10 @@ export default {
       size: "mini",
       visible: false,
       loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
+      columns: Columns,
+      rules: initRules(Columns),
       params: {
-        ...initParams(NewColumns),
+        ...initParams(Columns),
         contractItemList: [],
         contractClauseList: [],
         contractExpenseList: [],
@@ -30,14 +24,14 @@ export default {
         contractApplyOrgList: [],
       },
 
-      tabColumns: NewTabColumns,
+      tabColumns: TabColumns,
       tabName: "contractItemList",
     };
   },
   computed: {},
   watch: {
     "params.contractType": function (newProp) {
-      this.tabColumns = NewTabColumns.filter((element) =>
+      this.tabColumns = TabColumns.filter((element) =>
         newProp === "1" ? element.key !== "contractItemList" : element
       );
       this.tabName = this.tabColumns[0].key;
@@ -45,14 +39,15 @@ export default {
   },
   methods: {
     beforeOpen() {
-      const { deptName, deptId, name, id, orgName, orgId } =
-        this.$store.state.user;
-      this.params.puOrg = orgId;
-      this.params.puOrgName = orgName;
-      this.params.buyer = id;
-      this.params.buyerName = name;
-      this.params.puDept = deptId;
-      this.params.puDeptName = deptName;
+      // console.log(this.$store.state.user);
+      // const { deptName, deptId, name, id, orgName, orgId } =
+      //   this.$store.state.user;
+      // this.params.puOrg = orgId;
+      // this.params.puOrgName = orgName;
+      // this.params.buyer = id;
+      // this.params.buyerName = name;
+      // this.params.puDept = deptId;
+      // this.params.puDeptName = deptName;
       this.fetchCode();
     },
     setVisible(prop) {
@@ -89,6 +84,8 @@ export default {
     },
     // 保存并新增
     async handleSubmit() {
+      console.log("this.params", this.params);
+      // return;
       try {
         const createById = this.params.buyer;
         const createByName = this.params.buyerName;
@@ -102,8 +99,9 @@ export default {
           ...this.params,
         });
         if (code === 200) {
-          this.$notify.success({ title: msg });
           this.setVisible(false);
+          this.$emit("after-submit");
+          this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
         }
@@ -114,9 +112,6 @@ export default {
       }
     },
 
-
-
-
     handleHide(PROP) {
       console.log(1233123123, PROP);
     },
@@ -124,131 +119,196 @@ export default {
   created() {
     console.log("ADD CREATED");
   },
-  mounted() { },
-  destroyed() { },
+  mounted() {},
+  destroyed() {},
 };
 </script>
 <template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
-    @close="$emit('close')">
-    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }" style="margin: 10px">
-        <div slot="header" style="
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-          ">
-          <h3>新增</h3>
-          <div style="text-align: right">
-            <el-button :size="size" @click="handleCancel">取 消</el-button>
-            <el-button :size="size" type="danger" @click="handleSava">保 存</el-button>
-            <el-button :size="size" type="info" @click="handleSubmit">
-              新 增
-            </el-button>
-          </div>
-        </div>
-        <el-row>
-          <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.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
-              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping" :source.sync="params">
-              </dr-popover-select>
-              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%"></el-input>
-              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
-              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
-              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
-                <template #prefix>
-                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
-                </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
-                </el-option>
-              </el-select>
-              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :picker-options="column.pickerOptions" style="width: 100%">
-              </el-date-picker>
-              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
-                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <!-- <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div> -->
-              </el-upload>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-card>
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-        position: 'relative',
-      }" style="margin: 10px">
-        <el-tabs v-model="tabName" 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">
-                <template slot-scope="scope">
-                  <span v-if="!cColumn.type">
-                    {{ scope.row[cColumn.key] }}</span>
-                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :size="size" style="width: 100%"></el-input>
-                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size" @hide="handleHide">
-                  </dr-popover-select>
-                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
-                    style="width: 100%"></el-input-number>
-                </template>
-              </el-table-column>
-              <el-table-column fixed="right" label="操作" width="120">
-                <template slot-scope="scope">
-                  <el-button @click.native.prevent="
+  <el-dialog :visible.sync="visible" title="新增" @open="beforeOpen">
+    <el-form
+      v-loading="loading"
+      :size="size"
+      label-position="right"
+      label-width="135px"
+      :model="params"
+      :rules="rules"
+    >
+      <el-row>
+        <el-col
+          v-for="(column, index) in columns"
+          :key="index"
+          :span="column.span || 12"
+        >
+          <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.optionsName]"
+                :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'"></file-upload>
+            <!-- <el-upload
+              v-if="column.inputType === 'Upload'"
+              drag
+              multiple
+              action="https://sy.derom.com/document-center/fastdfs/upload"
+              :disabled="column.disabled"
+              :file-list="params[column.key]"
+            >
+              <i class="el-icon-upload"></i>
+              <div class="el-upload__text">
+                将文件拖到此处,或<em>点击上传</em>
+              </div>
+            </el-upload> -->
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-tabs v-model="tabName" 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"
+            >
+              <template slot-scope="scope">
+                <span v-if="!cColumn.type"> {{ scope.row[cColumn.key] }}</span>
+                <el-input
+                  v-if="cColumn.inputType === 'Input'"
+                  v-model="scope.row[cColumn.key]"
+                  :placeholder="cColumn.placeholder"
+                  :clearable="cColumn.clearable"
+                  :disabled="cColumn.disabled"
+                  :size="size"
+                  style="width: 100%"
+                ></el-input>
+                <dr-popover-select
+                  v-if="cColumn.inputType === 'InputDialog'"
+                  v-model="scope.row[cColumn.key]"
+                  :placeholder="cColumn.placeholder"
+                  :clearable="cColumn.clearable"
+                  :disabled="cColumn.disabled"
+                  :readonly="cColumn.readonly"
+                  :title="cColumn.title"
+                  :type="cColumn.referName"
+                  :data-mapping="cColumn.dataMapping"
+                  :source.sync="scope.row"
+                  :size="size"
+                  @hide="handleHide"
+                >
+                </dr-popover-select>
+                <el-input-number
+                  v-if="cColumn.inputType === 'InputNumber'"
+                  v-model="scope.row[cColumn.key]"
+                  :controls-position="cColumn.controlsPosition"
+                  :placeholder="cColumn.placeholder"
+                  :clearable="cColumn.clearable"
+                  :disabled="cColumn.disabled"
+                  :size="size"
+                  style="width: 100%"
+                ></el-input-number>
+              </template>
+            </el-table-column>
+            <el-table-column fixed="right" label="操作" width="120">
+              <template slot="header" slot-scope="scope">
+                <el-button :size="size" @click="addTableRow(params[tabName])">
+                  增 行
+                </el-button>
+              </template>
+              <template slot-scope="scope">
+                <el-button
+                  @click.native.prevent="
                     delTableRow(params[tabName], scope.$index)
-                    " type="text" size="small">
-                    删行
-                  </el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-tab-pane>
-        </el-tabs>
-        <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
-        </el-row>
-      </el-card>
+                  "
+                  type="text"
+                  size="small"
+                >
+                  删行
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-tab-pane>
+      </el-tabs>
     </el-form>
-  </el-drawer>
+
+    <div slot="footer">
+      <el-button :size="size" @click="handleCancel">取 消</el-button>
+      <el-button :size="size" @click="handleSava">保 存</el-button>
+      <el-button :size="size" @click="handleSubmit"> 新 增 </el-button>
+    </div>
+  </el-dialog>
 </template>

+ 462 - 61
src/views/purchase/contract/column.js

@@ -1,66 +1,467 @@
-export const TableColumns = [
-  { key: "id", title: "id" },
-  { key: "puOrg", title: "采购组织" },
-  { key: "puOrgName", title: "采购组织名称" },
-  { key: "code", title: "合同编码" },
-  { key: "lastPuMoney", title: "上年度采购额" },
-  { key: "buyer", title: "采购员" },
-  { key: "buyerName", title: "采购员名称" },
-  { key: "supplier", title: "供应商" },
-  { key: "supplierName", title: "供应商名称" },
-  { key: "contractType", title: "合同类型" },
-  { key: "puMoneyYear", title: "本年度采购额" },
-  { key: "puDept", title: "采购部门" },
-  { key: "puDeptName", title: "采购部门名称" },
-  { key: "supplierTier", title: "供应商层级" },
-  { key: "contractName", title: "合同名称" },
-  { key: "grossRateAverage", title: "平均毛利率" },
-  { key: "approveFlow", title: "审批流程" },
-  { key: "consumableClass", title: "耗材类别" },
-  { key: "effectiveDate", title: "合同生效日期" },
-  { key: "brandGrossRate", title: "同类品牌及毛利率" },
-  { key: "contractFormat", title: "合同格式" },
-  { key: "productName", title: "产品类别&名称" },
-  { key: "endDate", title: "合同终止日期" },
-  { key: "invoiceTax", title: "发票税率" },
-  { key: "emergencyDegree", title: "紧急程度" },
-  { key: "project", title: "项目医院" },
-  { key: "signDate", title: "合同签订日期" },
-  { key: "deliveryType", title: "交货方式" },
-  { key: "source", title: "合同来源" },
-  { key: "contractPartyc", title: "合同丙方" },
-  { key: "contractPartycName", title: "合同丙方名称" },
-  { key: "guaranteePeriodEnd", title: "质保期限" },
-  { key: "freightMethods", title: "运费承担方式" },
-  { key: "isTarget", title: "是否有指标" },
-  { key: "contractTarget", title: "合同指标" },
-  { key: "exemptionPostageCondtion", title: "包邮条件" },
-  { key: "isRebate", title: "是否有返利" },
-  { key: "rebatePolicy", title: "返利政策" },
-  { key: "externalContract", title: "外部合同号" },
-  { key: "rollbackPolicy", title: "退换货政策" },
-  { key: "contractContent", title: "合同主要内容" },
-  { key: "refusalReasons", title: "拒绝理由" },
-  { key: "enquiryCode", title: "询价单号" },
-  { key: "externalFile", title: "对外附件" },
-  { key: "supplierFile", title: "供应商盖章合同附件" },
-  { key: "puFile", title: "采购商盖章合同附件" },
-  { key: "projectCode", title: "项目编号" },
-  { key: "projectName", title: "项目名称" },
-  { key: "area", title: "区域区域" },
-  { key: "consigneePhone", title: "收货人联系方式" },
-  { key: "paymentAgreement", title: "付款协议" },
-  { key: "taxPrice", title: "价税合计" },
-  { key: "currency", title: "币种" },
-  { key: "currencyName", title: "币种名称" },
-  { key: "guaranteePeriod", title: "质保期" },
-  { key: "tenantId", title: "租户号" },
-  { key: "revision", title: "乐观锁" },
-  { key: "createByName", title: "创建人" },
-  { key: "updateByName", title: "创建人名称" },
-  { key: "delFlag", title: "删除标记" },
+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: "purchase_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: "purchase_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: "purchase_contract_approve_flow",
+  },
+  {
+    key: "consumableClass",
+    title: "耗材类别",
+    inputType: "Select",
+    require: true,
+    referName: "purchase_contract_consumable_class",
+  },
+  {
+    key: "effectiveDate",
+    title: "合同生效日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "brandGrossRate",
+    title: "同类品牌及毛利率",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "contractFormat",
+    title: "合同格式",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "productName",
+    title: "产品类别&名称",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "endDate",
+    title: "合同终止日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "invoiceTax",
+    title: "发票税率",
+    inputType: "PopoverSelect",
+    referName: "ORG_PARAM",
+    dataMapping: {
+      invoiceTax: "mattaxesname",
+    },
+    require: true,
+  },
+  {
+    key: "emergencyDegree",
+    title: "紧急程度",
+    inputType: "Select",
+    require: true,
+    referName: "purchase_contract_emergency_degree",
+  },
+  { key: "project", title: "项目医院", inputType: "Input", require: true },
+  {
+    key: "signDate",
+    title: "合同签订日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "deliveryType",
+    title: "交货方式",
+    inputType: "Select",
+    referName: "purchase_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: "purchase_contract_freight_methods",
+  },
+  {
+    key: "signDate",
+    title: "合同创建时间",
+    inputType: "DatePicker",
+    disabled: true,
+  },
+  {
+    key: "isTarget",
+    title: "是否有指标",
+    inputType: "Select",
+    require: true,
+    referName: "purchase_contract_is_target",
+  },
+  {
+    key: "contractTarget",
+    title: "合同指标",
+    inputType: "Input",
+    require: true,
+    placeholder: '当【是否有指标】="有"时,必填',
+  },
+  {
+    key: "exemptionPostageCondtion",
+    title: "包邮条件",
+    inputType: "Input",
+    placeholder:
+      "当运费承担方式为供应商有条件承担时,该字段必填,填写要求,写明什么条件下供应商承担全部,什么条件下我方承担,什么条件下分别承担",
+    span: 12,
+  },
+  {
+    key: "isRebate",
+    title: "是否有返利",
+    inputType: "Select",
+    require: true,
+    referName: "purchase_contract_is_rebate",
+  },
+  {
+    key: "rebatePolicy",
+    title: "返利政策",
+    inputType: "Input",
+    placeholder: '当【是否有返利】="有"时,必填',
+    span: 18,
+  },
+  { key: "externalContract", title: "外部合同号", inputType: "Input" },
+  {
+    key: "rollbackPolicy",
+    title: "退换货政策",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "contractContent",
+    title: "合同主要内容",
+    inputType: "Textarea",
+    require: true,
+    span: 24,
+  },
+  { key: "refusalReasons", title: "拒绝理由", inputType: "Input", span: 24 },
+  { key: "enquiryCode", title: "询价单号", inputType: "Input" },
+  { key: "externalFile", title: "对外附件", inputType: "Upload", span: 24 },
+  { key: "puFile", title: "采购商盖章合同附件", inputType: "Upload", span: 24 },
+  {
+    key: "supplierFile",
+    title: "供应商盖章合同附件",
+    inputType: "Upload",
+    span: 24,
+  },
+  { key: "projectCode", title: "项目编号", inputType: "Input" },
+  { key: "projectName", title: "项目名称", inputType: "Input" },
+  { key: "area", title: "区域", inputType: "Input" },
+  { key: "consigneePhone", title: "收货人联系方式", inputType: "Input" },
+  {
+    key: "paymentAgreementName",
+    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 = [
+  {
+    show: {
+      contractType: [1, 2],
+    },
+    title: "物料基本信息",
+    key: "contractItemList",
+    tableColumns: [
+      { title: "物料编码", key: "material", width: 200 },
+      {
+        title: "物料名称",
+        key: "materialName",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "MATERIAL_PARAM",
+        dataMapping: {
+          material: "code",
+          materialName: "name",
+        },
+      },
+      {
+        title: "规格",
+        key: "specification",
+        width: 200,
+        referName: "MATERIAL_PARAM",
+        dataMapping: {
+          material: "code",
+          materialName: "name",
+        },
+      },
+      {
+        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: "MATERIAL_PARAM",
+        dataMapping: {
+          material: "code",
+          materialName: "name",
+        },
+      },
+      {
+        title: "税率%",
+        key: "tax",
+        inputType: "PopoverSelect",
+        referName: "MATERIAL_PARAM",
+        dataMapping: {
+          material: "code",
+          materialName: "name",
+        },
+
+        width: 200,
+      },
+      {
+        title: "采购数量",
+        key: "qty",
+        inputType: "InputNumber",
+
+        width: 200,
+      },
+      {
+        title: "含税单价",
+        key: "taxPrice",
+        inputType: "InputNumber",
+
+        width: 200,
+      },
+      { title: "含税金额合计", key: "taxMoney", width: 200 },
+      { title: "无税单价", key: "taxFreePrice" },
+      { title: "无税金额合计", key: "taxFreeMoney", width: 200 },
+      {
+        title: "注册证号及备案凭证号",
+        key: "registration",
+        inputType: "Input",
+        width: 200,
+      },
+      {
+        title: "收货客户",
+        key: "customerName",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "SUPPLIER_PARAM",
+        dataMapping: {
+          material: "code",
+          materialName: "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",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "MATERIAL_PARAM",
+        dataMapping: {
+          material: "code",
+          materialName: "name",
+        },
+      },
+      { 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 },
+      { title: "是否质保金", key: "isQuality", width: 200 },
+      {
+        title: "结算方式",
+        key: "paymentMeans",
+        inputType: "Input",
+        width: 200,
+      },
+      { title: "备注", key: "remark", inputType: "Input", width: 200 },
+      { title: "需进度确认", key: "schedule", inputType: "Select", width: 200 },
+    ],
+  },
+  {
+    title: "合同执行组织范围",
+    key: "contractApplyOrgList",
+    tableColumns: [
+      { title: "组织名称", key: "orgName", inputType: "Input" },
+      { title: "组织编码", key: "org", inputType: "Input" },
+    ],
+  },
+];

+ 200 - 74
src/views/purchase/contract/edit/index.vue

@@ -1,10 +1,6 @@
 <script>
-import { Columns, TabColumns } from "../add/column";
-import {
-  edit,
-  item,
-  itemTableList,
-} from "@/api/business/purchase/contract";
+import { Columns, TabColumns } from "../column";
+import { edit, item, itemTableList } from "@/api/business/purchase/contract";
 import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
 
 const NewColumns = initColumns(Columns);
@@ -16,9 +12,7 @@ const NewTabColumns = TabColumns.map((element) => ({
 export default {
   name: "EditDrawer",
   dicts: initDicts(NewColumns),
-  components: {
-    
-  },
+  components: {},
   data() {
     return {
       size: "mini",
@@ -140,67 +134,158 @@ export default {
   created() {
     console.log("ADD CREATED");
   },
-  mounted() { },
-  destroyed() { },
+  mounted() {},
+  destroyed() {},
 };
 </script>
 <template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
-    @close="$emit('close')">
-    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }" style="margin: 10px">
-        <div slot="header" style="
+  <el-drawer
+    direction="btt"
+    size="100%"
+    :with-header="false"
+    :visible.sync="visible"
+    @open="beforeOpen"
+    @close="$emit('close')"
+  >
+    <el-form
+      v-loading="loading"
+      :size="size"
+      label-position="right"
+      label-width="135px"
+      :model="params"
+      :rules="rules"
+    >
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+        }"
+        style="margin: 10px"
+      >
+        <div
+          slot="header"
+          style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          ">
+          "
+        >
           <h3>编辑</h3>
           <div style="text-align: right">
             <el-button :size="size" @click="handleCancel">取 消</el-button>
-            <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
+            <el-button :size="size" type="danger" @click="handleSava"
+              >更 新</el-button
+            >
           </div>
         </div>
         <el-row>
-          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
+          <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.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
-              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]" :source.sync="params"
-                :type="column.config.componentName" :data-mapping="column.config.dataMapping" :title="column.title"
-                :disabled="column.disabled" :readonly="column.readonly" :clearable="column.clearable"
-                :placeholder="column.placeholder">
+              <el-input
+                v-if="column.type === 'Input'"
+                v-model="params[column.key]"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              ></el-input>
+              <dr-popover-select
+                v-if="column.type === 'InputDialog'"
+                v-model="params[column.key]"
+                :source.sync="params"
+                :type="column.config.componentName"
+                :data-mapping="column.config.dataMapping"
+                :title="column.title"
+                :disabled="column.disabled"
+                :readonly="column.readonly"
+                :clearable="column.clearable"
+                :placeholder="column.placeholder"
+              >
               </dr-popover-select>
-              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%"></el-input>
-              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
-              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
-                  :value="item.value">
+              <el-input
+                v-if="column.type === 'Textarea'"
+                v-model="params[column.key]"
+                type="textarea"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              ></el-input>
+              <el-input-number
+                v-if="column.type === 'InputNumber'"
+                v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              ></el-input-number>
+              <el-select
+                v-if="column.type === 'Select'"
+                v-model="params[column.key]"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in dict.type[column.config.optionsName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
                 </el-option>
               </el-select>
-              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
+              <el-select
+                v-if="column.type === 'TagSelect'"
+                v-model="params[column.key]"
+                multiple
+                clearable
+                collapse-tags
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              >
                 <template #prefix>
-                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
+                  <el-icon
+                    class="el-icon-view"
+                    style="cursor: pointer"
+                    @click.stop="$message.info(234)"
+                  ></el-icon>
                 </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
                 </el-option>
               </el-select>
-              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :picker-options="column.pickerOptions" style="width: 100%">
+              <el-date-picker
+                v-if="column.type === 'DatePicker'"
+                v-model="params[column.key]"
+                :type="column.config.type"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                :picker-options="column.pickerOptions"
+                style="width: 100%"
+              >
               </el-date-picker>
-              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
-                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
+              <el-upload
+                v-if="column.type === 'Upload'"
+                :file-list="params[column.key]"
+                :disabled="column.disabled"
+                drag
+                action="https://sy.derom.com/document-center/fastdfs/upload"
+                multiple
+              >
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>
@@ -213,44 +298,83 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-        position: 'relative',
-      }" style="margin: 10px">
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+          position: 'relative',
+        }"
+        style="margin: 10px"
+      >
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+          <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">
+              <el-table-column
+                v-for="(cColumn, cIndex) in column.tableColumns"
+                :key="cIndex"
+                :prop="cColumn.key"
+                :label="cColumn.title"
+                :width="cColumn.width"
+              >
                 <template slot-scope="scope">
                   <span v-if="!cColumn.type">
-                    {{ scope.row[cColumn.key] }}</span>
-                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :size="size" style="width: 100%"></el-input>
-                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
+                    {{ scope.row[cColumn.key] }}</span
+                  >
+                  <el-input
+                    v-if="cColumn.type === 'Input'"
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    :size="size"
+                    style="width: 100%"
+                  ></el-input>
+                  <dr-popover-select
+                    v-if="cColumn.type === 'InputDialog'"
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly"
+                    :title="cColumn.title"
+                    :type="cColumn.config.componentName"
+                    :data-mapping="cColumn.config.dataMapping"
+                    :source.sync="scope.row"
+                    :size="size"
+                  >
                   </dr-popover-select>
-                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
-                    style="width: 100%"></el-input-number>
+                  <el-input-number
+                    v-if="cColumn.type === 'InputNumber'"
+                    v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    :size="size"
+                    style="width: 100%"
+                  ></el-input-number>
                 </template>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
-                  <el-button @click.native.prevent="
-                    delTableRow(params[tabName], scope.$index)
-                    " type="text" size="small">
+                  <el-button
+                    @click.native.prevent="
+                      delTableRow(params[tabName], scope.$index)
+                    "
+                    type="text"
+                    size="small"
+                  >
                     删行
                   </el-button>
                 </template>
@@ -259,7 +383,9 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
+          <el-button :size="size" @click="addTableRow(params[tabName])"
+            >增行</el-button
+          >
         </el-row>
       </el-card>
     </el-form>

+ 7 - 5
src/views/purchase/contract/index.vue

@@ -1,11 +1,11 @@
 <script>
-import { TableColumns, SearchColumns } from "./column";
+import { Columns as TableColumns, SearchColumns } from "./column";
 import { LIST, REMOVE } from "@/api/business/purchase/contract";
 import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
 export default {
   name: "PuchaseContract",
   components: {
-    // AddDrawer: () => import("./add/index.vue"),
+    AddDialog: () => import("./add/index.vue"),
     SeeDialog: () => import("./see/index.vue"),
     // EditDrawer: () => import("./edit/index.vue"),
   },
@@ -29,7 +29,6 @@ export default {
   methods: {
     //
     async fetchList(prop, page) {
-      console.log(prop, page, LIST);
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
@@ -91,7 +90,7 @@ export default {
     },
     // 打开新增drawer
     handleOpenAddDrawer() {
-      const { setVisible } = this.$refs.AddDrawerFef;
+      const { setVisible } = this.$refs.AddDialog;
       setVisible(true);
     },
     // 打开查看drawer
@@ -119,7 +118,10 @@ export default {
     :body-style="{ padding: 0 }"
   >
     <see-dialog ref="SeeDialog"></see-dialog>
-    <!-- <add-drawer ref="AddDrawerFef" @close="handleResetList"></add-drawer> -->
+    <add-dialog
+      ref="AddDialog"
+      @after-submit="handleResetList(params, page)"
+    ></add-dialog>
     <!-- <edit-drawer ref="EditDrawerFef" @close="handleResetList"></edit-drawer> -->
     <el-form
       :size="size"

+ 65 - 226
src/views/purchase/contract/see/index.vue

@@ -1,52 +1,31 @@
 <script>
-import { Columns, TabColumns } from "../add/column";
-import { item, itemTableList } from "@/api/business/purchase/contract";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
-
-const NewColumns = initColumns(Columns, { disabled: true, readonly: true });
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns, {
-    disabled: true,
-    readonly: true,
-  }),
-}));
+import { Columns, TabColumns } from "../column";
+import { initDicts, initParams } from "@/utils/init";
+import { ITEM, ITEMTABLELIST } from "@/api/business/purchase/contract";
 
 export default {
   name: "SeeDialog",
-  dicts: initDicts(NewColumns),
+  dicts: initDicts(Columns),
   data() {
     return {
+      size: "mini",
       visible: false,
       loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
+      columns: Columns,
       params: {
-        ...initParams(NewColumns),
+        ...initParams(Columns),
         contractItemList: [],
         contractClauseList: [],
         contractExpenseList: [],
-        contractAgreementList: [],
         contractApplyOrgList: [],
+        contractAgreementList: [],
       },
-
-      tabColumns: NewTabColumns,
+      tabColumns: TabColumns,
       tabName: "contractItemList",
     };
   },
   computed: {},
-  watch: {
-    "params.contractType": function (newProp) {
-      this.tabColumns = NewTabColumns.filter((element) =>
-        newProp === "1" ? element.key !== "contractItemList" : element
-      );
-      this.tabName = this.tabColumns[0].key;
-    },
-    tabName: function (newProp) {
-      const { id } = this.params;
-      this.fetchTable(id, newProp);
-    },
-  },
+  watch: {},
   methods: {
     setVisible(prop) {
       this.visible = prop;
@@ -55,10 +34,11 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code, msg, data } = await item(prop);
+        const { code, msg, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
           this.$notify.success({ title: msg });
+          this.fetchTable(this.params.id, this.tabName);
         } else {
           this.$notify.warning({ title: msg });
         }
@@ -72,7 +52,7 @@ export default {
     async fetchTable(prop, name) {
       try {
         this.loading = true;
-        const { code, msg, rows } = await itemTableList({ id: prop }, name);
+        const { code, msg, rows } = await ITEMTABLELIST({ id: prop }, name);
         if (code === 200) {
           this.params[name] = rows;
           this.$notify.success({ title: msg });
@@ -89,12 +69,13 @@ export default {
     handleCancel() {
       this.setVisible(false);
       this.params = initParams(Columns);
+      this.tabName = "contractItemList";
     },
     // 编辑操作
-    handleOpenEditDrawer(prop) {
-      this.setVisible(false);
-      this.$parent.$parent.handleOpenEditDrawer(prop);
-    },
+    // handleOpenEditDrawer(prop) {
+    //   this.setVisible(false);
+    //   this.$parent.$parent.handleOpenEditDrawer(prop);
+    // },
   },
   created() {},
   mounted() {},
@@ -102,197 +83,55 @@ export default {
 };
 </script>
 <template>
-  <el-dialog
-    :visible.sync="visible"
-    title="明细"
-    append-to-body
-    destroy-on-close
-  >
-    <!-- <el-form
-      v-loading="loading"
-      size="mini"
-      label-position="right"
-      label-width="135px"
-      :model="params"
-      :rules="rules"
-    >
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-        }"
-        style="margin: 10px"
+  <el-dialog :visible.sync="visible" title="明细" @close="handleCancel">
+    <el-descriptions :column="2" border>
+      <el-descriptions-item
+        v-if="params[column.key]"
+        v-for="(column, index) in columns"
+        :key="index"
+        :label="column.title"
       >
-        <div
-          slot="header"
-          style="
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-          "
-        >
-          <h3>查看</h3>
-          <div style="text-align: right">
-            <el-button size="mini" @click="handleOpenEditDrawer(params)"
-              >编 辑</el-button
-            >
-            <el-button size="mini" @click="handleCancel">取 消</el-button>
-          </div>
-        </div>
-        <el-row>
-          <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.type === 'Textarea'"
-                v-model="params[column.key]"
-                type="textarea"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                style="width: 100%"
-              ></el-input>
-              <el-input-number
-                v-else-if="column.type === 'InputNumber'"
-                v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                style="width: 100%"
-              ></el-input-number>
-              <el-select
-                v-else-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in dict.type[column.config.optionsName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
-                </el-option>
-              </el-select>
-              <el-date-picker
-                v-else-if="column.type === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.config.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              >
-              </el-date-picker>
-              <el-upload
-                v-else-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                drag
-                action="https://jsonplaceholder.typicode.com/posts/"
-                multiple
-              >
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div>
-              </el-upload>
-              <el-input
-                v-else
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                style="width: 100%"
-              ></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
+        <dict-tag
+          v-if="column.referName && column.inputType === 'Select'"
+          :size="size"
+          :value="params[column.key]"
+          :options="dict.type[column.referName]"
+        />
+        <span v-else>{{ params[column.key] }}</span>
+      </el-descriptions-item>
+    </el-descriptions>
+    <el-tabs
+      v-model="tabName"
+      style="width: 100%"
+      @tab-click="fetchTable(params.id, tabName)"
+    >
+      <el-tab-pane
+        v-for="(column, index) in tabColumns"
+        :key="index"
+        :name="column.key"
+        :label="column.title"
+        lazy
       >
-        <el-tabs v-model="tabName" 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
+            v-for="(cColumn, cIndex) in column.tableColumns"
+            :key="cIndex"
+            :prop="cColumn.key"
+            :label="cColumn.title"
+            :width="cColumn.width"
           >
-            <el-table :data="params[column.key]" style="width: 100%">
-              <el-table-column
-                v-for="(cColumn, cIndex) in column.tableColumns"
-                :key="cIndex"
-                :prop="cColumn.key"
-                :label="cColumn.title"
-                :width="cColumn.width"
-              >
-                <template slot-scope="scope">
-                  <el-tag v-if="cColumn.key === 'index'">
-                    {{ scope.$index + 1 }}
-                  </el-tag>
-                  <el-input
-                    v-if="cColumn.type === 'Input'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    size="mini"
-                    style="width: 100%"
-                  ></el-input>
-                  <el-input-number
-                    v-if="cColumn.type === 'InputNumber'"
-                    v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    size="mini"
-                    style="width: 100%"
-                  ></el-input-number>
-                  <el-input
-                    v-if="column.type === 'InputDialog'"
-                    v-model="params[column.key]"
-                    :placeholder="column.placeholder"
-                    :clearable="column.clearable"
-                    :disabled="column.disabled"
-                    :readonly="column.readonly"
-                    style="width: 100%; cursor: pointer"
-                    @click.native.stop="openAsyncInputDialog(column, params)"
-                  >
-                    <template #suffix>
-                      <el-icon class="el-icon-thumb"></el-icon>
-                    </template>
-                  </el-input>
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-tab-pane>
-        </el-tabs>
-      </el-card>
-    </el-form> -->
+            <template slot-scope="scope">
+              <dict-tag
+                v-if="cColumn.referName && cColumn.inputType === 'Select'"
+                :size="size"
+                :value="scope.row[cColumn.key]"
+                :options="dict.type[cColumn.referName]"
+              />
+              <span v-else>{{ scope.row[cColumn.key] }}</span>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-tab-pane>
+    </el-tabs>
   </el-dialog>
 </template>

+ 1 - 0
src/views/purchase/task/column.js

@@ -174,6 +174,7 @@ export const SearchColumns = [
     inputType: "PopoverSelect",
     multiple: true,
     valueKey: "id",
+    showKey: "name",
     referName: "CONTACTS_PARAM",
     readonly: true,
     dataMapping: {},

+ 1 - 6
src/views/purchase/task/documents-return/index.vue

@@ -49,12 +49,7 @@ export default {
 </script>
 
 <template>
-  <el-dialog
-    :visible.sync="visible"
-    title="请购退回"
-    append-to-body
-    destroy-on-close
-  >
+  <el-dialog :visible.sync="visible" title="请购退回">
     <el-alert
       title="请填写退单原因"
       type="info"

+ 1 - 6
src/views/purchase/task/first-direct/index.vue

@@ -74,12 +74,7 @@ export default {
 </script>
 
 <template>
-  <el-dialog
-    :visible.sync="visible"
-    append-to-body
-    destroy-on-close
-    title="首次协议直采"
-  >
+  <el-dialog :visible.sync="visible" title="首次协议直采">
     <div
       v-for="(item, index) in data"
       :key="index"

+ 2 - 0
src/views/purchase/task/index.vue

@@ -234,6 +234,7 @@ export default {
               :title="column.title"
               :type="column.referName"
               :multiple="column.multiple"
+              :show-key="column.showKey"
               :value-key="column.valueKey"
               :placeholder="column.placeholder"
               :data-mapping="column.dataMapping"
@@ -252,6 +253,7 @@ export default {
               :title="column.title"
               :type="column.referName"
               :multiple="column.multiple"
+              :show-key="column.showKey"
               :value-key="column.valueKey"
               :placeholder="column.placeholder"
               :data-mapping="column.dataMapping"

+ 1 - 2
src/views/purchase/task/modify-buyer/index.vue

@@ -47,8 +47,7 @@ export default {
   <el-dialog
     :visible.sync="visible"
     title="转派"
-    append-to-body
-    destroy-on-close
+
   >
     <el-alert
       title="转派后,采购任务将会从您的采购任务清单中删除,转移到转派目标人员的已受理采购任务清单中,您确定要转派吗?"

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

@@ -49,8 +49,6 @@ export default {
   <el-dialog
     :visible.sync="visible"
     title="明细"
-    append-to-body
-    destroy-on-close
   >
     <el-descriptions :column="2" border>
       <el-descriptions-item