002201 2 ani în urmă
părinte
comite
1a90fba42a

+ 8 - 0
src/api/business/purchase/contract.js

@@ -16,6 +16,14 @@ export function ADD(data) {
   });
 }
 
+export function EXPORT(data) {
+  return request({
+    url: "/pu/contract/export",
+    method: "POST",
+    data: data,
+  });
+}
+
 export function EDIT(data) {
   return request({
     url: "/pu/contract/edit",

+ 1 - 0
src/components/computed-input/index.vue

@@ -60,6 +60,7 @@ export default {
         this.$emit("input", computed(newProp));
       },
       deep: true,
+      immediate: true,
     },
   },
   methods: {},

+ 0 - 514
src/views/purchase/apply/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" },
-    ],
-  },
-];

+ 16 - 6
src/views/purchase/apply/add/index.vue

@@ -46,12 +46,13 @@ export default {
       this.$refs[prop].validate(async (valid) => {
         if (valid) {
           try {
+            this.params.id = undefined;
             const { code, msg } = await ADD({
               ...this.params,
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
+              this.$emit("success");
               this.$notify.success({ title: msg });
             } else {
               this.$notify.warning({ title: msg });
@@ -113,13 +114,22 @@ export default {
               style="width: 100%"
             >
             </dr-popover-select>
-            <el-switch
-              v-if="column.inputType === 'Switch'"
+            <el-select
+              v-if="column.inputType === 'Select'"
               v-model="params[column.key]"
-              active-value="1"
-              inactive-value="0"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
             >
-            </el-switch>
+              <el-option
+                v-for="item in dict.type[column.referName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
             <file-upload
               v-if="column.inputType === 'Upload'"
               v-model="params[column.key]"

+ 8 - 4
src/views/purchase/apply/column.js

@@ -128,7 +128,12 @@ export const TableColumns = [
     disabled: true,
     readonly: true,
   },
-  { key: "isEffective", title: "是否已推价格", inputType: "Switch" },
+  {
+    key: "isEffective",
+    title: "是否已推价格",
+    inputType: "Select",
+    referName: "sys_yes_no",
+  },
   {
     key: "effectiveDate",
     title: "生效日期",
@@ -210,8 +215,7 @@ export const SearchColumns = [
   {
     key: "isEffective",
     title: "是否已推价格",
-    inputType: "Switch",
-    activeValue: "1",
-    inactiveValue: "0",
+    inputType: "Select",
+    referName: "sys_yes_no",
   },
 ];

+ 0 - 268
src/views/purchase/apply/edit/index.vue

@@ -1,268 +0,0 @@
-<script>
-import { Columns, TabColumns } from "../add/column";
-import {
-  edit,
-  item,
-  itemTableList,
-} 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),
-}));
-
-export default {
-  name: "EditDrawer",
-  dicts: initDicts(NewColumns),
-  components: {
-   
-  },
-  data() {
-    return {
-      size: "mini",
-      visible: false,
-      loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
-      params: {
-        ...initParams(NewColumns),
-        contractItemList: [],
-        contractClauseList: [],
-        contractExpenseList: [],
-        contractAgreementList: [],
-        contractApplyOrgList: [],
-      },
-
-      tabColumns: NewTabColumns,
-      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);
-    },
-  },
-  methods: {
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // 查询详细
-    async fetchItem(prop) {
-      try {
-        this.loading = true;
-        const { code, msg, data } = await item(prop);
-        if (code === 200) {
-          this.params = data;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    // 查询详情关联TABLE
-    async fetchTable(prop, name) {
-      try {
-        this.loading = true;
-        const { code, msg, rows } = await itemTableList({ id: prop }, name);
-        if (code === 200) {
-          this.params[name] = rows;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    // 新增行
-    addTableRow(prop) {
-      const arr = this.tabColumns.find(
-        (element) => element.key === this.tabName
-      ).tableColumns;
-      prop.push(initParams(arr, "key", "value"));
-    },
-    // 删除行
-    delTableRow(prop, index) {
-      prop.splice(index, 1);
-    },
-    // 取消
-    handleCancel() {
-      this.setVisible(false);
-      this.params = initParams(this.columns, "key", "value");
-    },
-    // 保存
-    handleSava() {
-      this.setVisible(false);
-    },
-    // 保存并新增
-    async handleSubmit() {
-      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 edit({
-          createById,
-          createByName,
-          updateById,
-          updateByName,
-          ...this.params,
-        });
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.setVisible(false);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        // this.setVisible(false);
-      }
-    },
-    beforeOpen() { },
-  },
-  created() {
-    console.log("ADD CREATED");
-  },
-  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>
-          </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]" :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-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">
-                  </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="
-                    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>
-    </el-form>
-  </el-drawer>
-</template>

+ 23 - 9
src/views/purchase/apply/index.vue

@@ -1,13 +1,19 @@
 <script>
 import { TableColumns, SearchColumns } from "./column";
 import { LIST, REMOVE } from "@/api/business/purchase/apply";
-import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
+import {
+  initPage,
+  initDicts,
+  initLayout,
+  initPageSizes,
+  initParams,
+} from "@/utils/init";
 export default {
   name: "PuchaseApply",
+  dicts: [...initDicts(SearchColumns), ...initDicts(TableColumns)],
   components: {
     AddDialog: () => import("./add/index.vue"),
     SeeDialog: () => import("./see/index.vue"),
-    // Editdialog: () => import("./edit/index.vue"),
   },
   data() {
     return {
@@ -117,8 +123,7 @@ export default {
     :body-style="{ padding: 0 }"
   >
     <see-dialog ref="SeeDialog"></see-dialog>
-    <add-dialog ref="AddDialog" @submit-success="resetList"></add-dialog>
-    <!-- <edit-dialog ref="EditdialogFef" @close="resetList"></edit-dialog> -->
+    <add-dialog ref="AddDialog" @success="resetList"></add-dialog>
     <el-form
       :size="size"
       :model="params"
@@ -139,13 +144,22 @@ export default {
               :placeholder="column.placeholder"
               style="width: 100%"
             ></el-input>
-            <el-switch
-              v-if="column.inputType === 'Switch'"
+            <el-select
+              v-if="column.inputType === 'Select'"
               v-model="params[column.key]"
-              active-value="1"
-              inactive-value="0"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
             >
-            </el-switch>
+              <el-option
+                v-for="item in dict.type[column.referName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
             <dr-popover-select
               v-if="column.inputType === 'PopoverSelect'"
               v-model="params[column.key]"

+ 1 - 1
src/views/purchase/catalogue/edit/index.vue

@@ -51,7 +51,7 @@ export default {
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
+              this.$emit("success");
               this.$notify.success({ title: msg });
             } else {
               this.$notify.warning({ title: msg });

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

@@ -88,7 +88,7 @@ export default {
   >
     <!-- <see-drawer ref="SeeDrawerFef"></see-drawer> -->
     <!-- <add-drawer ref="AddDrawerFef" @close="resetList"></add-drawer> -->
-    <edit-dialog ref="Editdialog" @submit-success="resetList"></edit-dialog>
+    <edit-dialog ref="Editdialog" @success="resetList"></edit-dialog>
     <el-form
       :size="size"
       :model="params"

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

@@ -111,7 +111,7 @@ export default {
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
+              this.$emit("success");
               this.$notify.success({ title: msg });
             } else {
               this.$notify.warning({ title: msg });

+ 43 - 0
src/views/purchase/contract/delete/index.vue

@@ -0,0 +1,43 @@
+<script>
+import { REMOVE } from "@/api/business/purchase/contract";
+export default {
+  name: "DeleteDialog",
+  data() {
+    return {};
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.$confirm("是否删除数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+      })
+        .then(() => {
+          try {
+            const { code, msg } = REMOVE(prop);
+            if (code === 200) {
+              this.$emit("success");
+              this.$notify.success({ title: msg });
+            } else {
+              this.$notify.warning({ title: msg });
+            }
+          } catch (err) {
+            // catch
+          } finally {
+            // finally
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template></template>

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

@@ -134,7 +134,7 @@ export default {
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
+              this.$emit("success");
               this.$notify.success({ title: msg });
             } else {
               this.$notify.warning({ title: msg });
@@ -283,6 +283,14 @@ export default {
                     :placeholder="cColumn.placeholder"
                     style="width: 100%"
                   ></el-input>
+                  <dr-computed-input
+                    v-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]"

+ 34 - 0
src/views/purchase/contract/export/index.vue

@@ -0,0 +1,34 @@
+<script>
+export default {
+  name: "ExportDialog",
+  data() {
+    return {};
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.$confirm("是否确认导出所有数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+      })
+        .then(() => {
+          this.download(
+            "pu/contract/export",
+            { ...prop },
+            `contract_${new Date().getTime()}.xlsx`
+          );
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template></template>

+ 95 - 0
src/views/purchase/contract/import/index.vue

@@ -0,0 +1,95 @@
+<script>
+import { REMOVE } from "@/api/business/purchase/contract";
+export default {
+  name: "ImportDialog",
+  data() {
+    return {
+      visible: false,
+      upload: {
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: {
+          // Authorization: "Bearer " + getToken()
+        },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/system/user/importData",
+      },
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.visible = true;
+    },
+    //
+    hide() {
+      this.visible = false;
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      importTemplate().then((response) => {
+        this.download(response.msg);
+      });
+    },
+    // 文件上传中处理
+    progress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    success(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList();
+    },
+    //
+    confirm() {
+      this.$refs.upload.submit();
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-dialog title="导入" width="fit-content" :visible.sync="visible">
+    <el-upload
+      ref="upload"
+      :limit="1"
+      accept=".xlsx, .xls"
+      :headers="upload.headers"
+      :action="upload.url + '?updateSupport=' + upload.updateSupport"
+      :disabled="upload.isUploading"
+      :on-progress="progress"
+      :on-success="success"
+      :auto-upload="false"
+      drag
+    >
+      <i class="el-icon-upload"></i>
+      <div class="el-upload__text">
+        将文件拖到此处,或
+        <em>点击上传</em>
+      </div>
+      <div class="el-upload__tip" slot="tip">
+        <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+        <el-link type="info" style="font-size: 12px" @click="importTemplate"
+          >下载模板</el-link
+        >
+      </div>
+      <div class="el-upload__tip" style="color: red" slot="tip">
+        提示:仅允许导入“xls”或“xlsx”格式文件!
+      </div>
+    </el-upload>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="confirm">确 定</el-button>
+      <el-button @click="hide">取 消</el-button>
+    </div>
+  </el-dialog>
+</template>

+ 73 - 55
src/views/purchase/contract/index.vue

@@ -1,13 +1,17 @@
 <script>
-import { LIST, REMOVE } from "@/api/business/purchase/contract";
+import { LIST } from "@/api/business/purchase/contract";
 import { Columns as TableColumns, SearchColumns } from "./column";
-import { initPage, initParams, initLayout, initPageSizes } from "@/utils/init";
+import { initPage, initDicts, initParams } from "@/utils/init";
 export default {
   name: "PuchaseContract",
+  dicts: initDicts(TableColumns),
   components: {
-    AddDialog: () => import("./add/index.vue"),
-    SeeDialog: () => import("./see/index.vue"),
-    EditDialog: () => import("./edit/index.vue"),
+    AddModel: () => import("./add/index.vue"),
+    SeeModel: () => import("./see/index.vue"),
+    EditModel: () => import("./edit/index.vue"),
+    ExportModel: () => import("./export/index.vue"),
+    ImportModel: () => import("./import/index.vue"),
+    DeleteModel: () => import("./delete/index.vue"),
   },
   data() {
     return {
@@ -18,8 +22,6 @@ export default {
       tableData: [],
       tableColumns: TableColumns,
       page: initPage(),
-      layout: initLayout(),
-      pageSizes: initPageSizes(),
     };
   },
   computed: {},
@@ -60,24 +62,6 @@ export default {
       this.params = initParams(SearchColumns);
       this.queryList(this.params, this.page);
     },
-    // 删除操作
-    async deleteItem(prop) {
-      try {
-        this.loading = true;
-        const { id } = prop;
-        const { code, msg } = await REMOVE(id);
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.queryList(this.params, this.page);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
     // 页大小变
     sizeChange(prop) {
       this.page.pageSize = prop;
@@ -88,21 +72,38 @@ export default {
       this.page.pageNum = prop;
       this.queryList(this.params, this.page);
     },
-    // 打开新增drawer
-    async openAddDialog() {
-      const { open } = this.$refs.AddDialog;
+    //
+    async useAdd() {
+      const { open } = this.$refs.AddModel;
       await open();
     },
-    // 打开查看drawer
-    async openSeeDialog(prop) {
+    //
+    async useSee(prop) {
       const { id } = prop;
-      const { open } = this.$refs.SeeDialog;
+      const { open } = this.$refs.SeeModel;
       await open(id);
     },
-    // 打开编辑drawer
-    async openEditDialog(prop) {
+    //
+    async useEdit(prop) {
+      const { id } = prop;
+      const { open } = this.$refs.EditModel;
+      await open(id);
+    },
+    //
+    async useExport(prop) {
+      const { pageNum, pageSize } = this.page;
+      const { open } = this.$refs.ExportModel;
+      await open({ ...prop, pageNum, pageSize });
+    },
+    //
+    async useImport() {
+      const { open } = this.$refs.ImportModel;
+      await open();
+    },
+    //
+    async useDelete(prop) {
       const { id } = prop;
-      const { open } = this.$refs.EditDialog;
+      const { open } = this.$refs.DeleteModel;
       await open(id);
     },
   },
@@ -112,18 +113,30 @@ export default {
 <template>
   <el-card
     v-loading="loading"
-    style="width: calc(100% - 24px); height: 100%; margin: 10px"
+    style="
+      width: calc(100% - 20px);
+      height: 100%;
+      margin: 10px;
+      padding: 0 20px 20px 0;
+    "
     :body-style="{ padding: 0 }"
   >
-    <see-dialog ref="SeeDialog"></see-dialog>
-    <add-dialog ref="AddDialog" @submit-success="resetList"></add-dialog>
-    <edit-dialog ref="EditDialog" @submit-success="resetList"></edit-dialog>
+    <see-model ref="SeeModel"></see-model>
+    <add-model ref="AddModel" @success="resetList"></add-model>
+    <edit-model ref="EditModel" @success="queryList(params, page)"></edit-model>
+    <export-model ref="ExportModel"></export-model>
+    <import-model ref="ImportModel"></import-model>
+    <delete-model
+      ref="DeleteModel"
+      @success="queryList(params, page)"
+    ></delete-model>
     <el-form
       :size="size"
       :model="params"
       label-width="75px"
       label-position="right"
       style="padding: 20px 20px 0"
+      @submit.native.prevent
     >
       <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
         <el-col
@@ -135,6 +148,7 @@ export default {
             <el-input
               v-model="params[column.key]"
               :placeholder="column.placeholder"
+              @change="queryList(params, page)"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -156,15 +170,15 @@ export default {
         </el-col>
       </el-row>
     </el-form>
-    <el-row :gutter="24" style="padding: 0 20px">
-      <el-col :span="6">
-        <el-button :size="size" @click="openAddDialog"> 新 增 </el-button>
-      </el-col>
+    <el-row style="padding: 0 20px">
+      <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-row>
     <el-table
       :size="size"
       :data="tableData"
-      @row-dblclick="openSeeDialog"
+      @row-dblclick="useSee"
       style="width: 100%; margin: 20px 0 0 0"
     >
       <el-table-column
@@ -175,18 +189,27 @@ export default {
         :width="column.width || 180"
         :show-overflow-tooltip="column.showOverflowTooltip || true"
       >
+        <template slot-scope="scope">
+          <dict-tag
+            v-if="column.inputType === 'Select'"
+            :size="size"
+            :value="scope.row[column.key]"
+            :options="dict.type[column.referName]"
+          />
+          <span v-else>{{ scope.row[column.key] }}</span>
+        </template>
       </el-table-column>
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
           <el-button
-            @click.native.prevent="openEditDialog(scope.row)"
+            @click.native.prevent="useEdit(scope.row)"
             type="text"
             size="small"
           >
             编 辑
           </el-button>
           <el-button
-            @click.native.prevent="deleteItem(scope.row)"
+            @click.native.prevent="useDelete(scope.row)"
             type="text"
             size="small"
           >
@@ -195,16 +218,11 @@ export default {
         </template>
       </el-table-column>
     </el-table>
-    <el-pagination
-      @size-change="sizeChange"
-      @current-change="currentChange"
+    <pagination
       :total="page.total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      :layout="layout"
-      style="margin: 16px 0"
-    >
-    </el-pagination>
+      :page.sync="page.pageNum"
+      :limit.sync="page.pageSize"
+      @pagination="queryList(params, page)"
+    />
   </el-card>
 </template>

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

@@ -37,7 +37,7 @@ export default {
         });
         if (code === 200) {
           this.hide();
-          this.$emit("submit-success");
+          this.$emit("success");
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });

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

@@ -58,7 +58,7 @@ export default {
         const { code, msg } = await ADD(params);
         if (code === 200) {
           this.hide();
-          this.$emit("submit-success");
+          this.$emit("success");
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });

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

@@ -149,15 +149,15 @@ export default {
     <see-dialog ref="SeeDialog"></see-dialog>
     <first-direct-dialog
       ref="FirstDirectDialog"
-      @submit-success="resetList"
+      @success="resetList"
     ></first-direct-dialog>
     <doc-return-dialog
       ref="DocReturnDialog"
-      @submit-success="resetList"
+      @success="resetList"
     ></doc-return-dialog>
     <modify-buyer-dialog
       ref="ModifyBuyerDialog"
-      @submit-success="resetList"
+      @success="resetList"
     ></modify-buyer-dialog>
     <el-backtop target=".el-scrollbar__wrap"></el-backtop>
     <el-form
@@ -166,6 +166,7 @@ export default {
       label-width="auto"
       label-position="right"
       style="padding: 20px 20px 0"
+      @submit.native.prevent
     >
       <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
         <el-col

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

@@ -40,7 +40,7 @@ export default {
         ]);
         if (code === 200) {
           this.hide();
-          this.$emit("submit-success");
+          this.$emit("success");
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });

+ 2 - 2
vue.config.js

@@ -42,10 +42,10 @@ module.exports = {
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
         // target: `http://172.16.62.241:8000/drp-admin`, //笑寒本地
-        target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
+        // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
         // target: `http://172.16.13.47:8000/drp-admin`, //石杨本地
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
-        // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
+        target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",