002201 1 年間 前
コミット
77675ede34
38 ファイル変更555 行追加567 行削除
  1. 1 1
      src/components/Pagination/index.vue
  2. 80 72
      src/components/popover-select-v2/index.vue
  3. 10 26
      src/components/popover-select/components/ADDRESS_PARAM.js
  4. 4 15
      src/components/popover-select/components/ALLOCATION_PARAM.js
  5. 5 15
      src/components/popover-select/components/BALATYPE_PARAM.js
  6. 4 8
      src/components/popover-select/components/CONTACTS_PARAM.js
  7. 13 16
      src/components/popover-select/components/CURRENCY_PARAM.js
  8. 4 8
      src/components/popover-select/components/CUSTOMERDEPT_PARAM.js
  9. 4 14
      src/components/popover-select/components/CUSTOMER_PARAM.js
  10. 4 8
      src/components/popover-select/components/CUSTOMER_PARAM_ZT.js
  11. 4 8
      src/components/popover-select/components/DEPT_PARAM.js
  12. 2 4
      src/components/popover-select/components/LINKMAN_PARAM.js
  13. 4 8
      src/components/popover-select/components/MANUFACTURER_PARAM.js
  14. 54 60
      src/components/popover-select/components/MATERIAL_PARAM.js
  15. 4 8
      src/components/popover-select/components/MK_SALESAREA_PARAM.js
  16. 2 4
      src/components/popover-select/components/MK_TARGET_CYCLE_PARAM.js
  17. 2 4
      src/components/popover-select/components/MK_TARGET_INDEX_PARAM.js
  18. 2 4
      src/components/popover-select/components/MK_TARGET_TEMPLATE_PARAM.js
  19. 4 14
      src/components/popover-select/components/OPERATING_PARAM.js
  20. 9 13
      src/components/popover-select/components/ORG_PARAM.js
  21. 4 8
      src/components/popover-select/components/PAYAGREEMENT_PARAM.js
  22. 5 15
      src/components/popover-select/components/PROCESSTYPE_PARAM.js
  23. 5 15
      src/components/popover-select/components/PROJECT_PARAM.js
  24. 5 15
      src/components/popover-select/components/PSNLICENSE_PARAM.js
  25. 5 15
      src/components/popover-select/components/RETREASON_PARAM.js
  26. 6 21
      src/components/popover-select/components/SUPPLIERCONTACTS_PARAM.js
  27. 5 8
      src/components/popover-select/components/SUPPLIER_PARAM.js
  28. 10 15
      src/components/popover-select/components/TAX_RATE_PARAM.js
  29. 5 16
      src/components/popover-select/components/UNIT_PARAM.js
  30. 8 18
      src/components/popover-select/components/WAREHOUSE_PARAM.js
  31. 1 3
      src/components/super-table/index.vue
  32. 193 7
      src/views/purchase/apply/add/columns.js
  33. 80 82
      src/views/purchase/apply/add/index.vue
  34. 0 1
      src/views/purchase/apply/columns.js
  35. 2 4
      src/views/purchase/apply/copy/columns.js
  36. 2 4
      src/views/purchase/apply/edit/columns.js
  37. 3 6
      src/views/purchase/apply/edit/index.vue
  38. 0 4
      src/views/purchase/apply/see/columns.js

+ 1 - 1
src/components/Pagination/index.vue

@@ -42,7 +42,7 @@ export default {
     // 移动端页码按钮的数量端默认值5
     pagerCount: {
       type: Number,
-      default: document.body.clientWidth < 992 ? 5 : 7,
+      default: 5,
     },
     layout: {
       type: String,

+ 80 - 72
src/components/popover-select-v2/index.vue

@@ -36,8 +36,15 @@ export default {
       type: Object,
       default: () => ({}),
     },
+    // 多选
+    multiple: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  components: {
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
   },
-  components: {},
   data() {
     return {
       size: "mini",
@@ -64,9 +71,7 @@ export default {
     },
     TableColumns() {
       const { referName } = this.$props;
-      return require(`../popover-select/components/${referName}`).default.filter(
-        (document) => document.key
-      );
+      return require(`../popover-select/components/${referName}`).default;
     },
   },
   watch: {
@@ -149,20 +154,34 @@ export default {
     },
     // select
     useSelect(prop) {
-      this.selectData = prop[0];
+      this.selectData = prop;
+      console.log(" this.selectData ", this.selectData);
     },
     // confirm
     useConfirm(prop) {
       this.hide();
       const {
-        $props: { source, valueKey, dataMapping },
+        $props: { source, multiple, valueKey, dataMapping },
       } = this;
-      for (let key in dataMapping) {
-        source[key] = prop[dataMapping[key]];
+      if (multiple) {
+        this.$emit(
+          "change",
+          this.selectData.map((item) => {
+            for (let key in dataMapping) {
+              item[key] = item[dataMapping[key]];
+            }
+            return item;
+          }),
+          this.$props
+        );
+      } else {
+        for (let key in dataMapping) {
+          source[key] = prop[0][dataMapping[key]];
+        }
+        this.innerValue = prop[0][valueKey];
+        this.$emit("update:source", source);
+        this.$emit("change", prop[0], this.$props);
       }
-      this.innerValue = prop[valueKey];
-      this.$emit("update:source", source);
-      this.$emit("change", prop, this.$props);
     },
   },
   created() {},
@@ -178,7 +197,7 @@ export default {
       v-model="innerValue"
       :value-key="valueKey"
       :fetch-suggestions="useAutocomplete"
-      @select="useConfirm"
+      @select="useConfirm([$event])"
       style="width: 100%"
     >
       <i class="el-icon-search" slot="suffix" @click="open"> </i>
@@ -208,77 +227,66 @@ export default {
     <el-dialog
       :width="width"
       :visible.sync="visible"
+      :show-close="false"
       :close-on-click-modal="false"
       :close-on-press-escape="false"
       append-to-body
     >
-      <div slot="footer">
-        <el-button
-          type="primary"
-          :size="$attrs.size"
-          :loading="loading"
-          @click="useConfirm(selectData)"
-          >确 认</el-button
-        >
-        <el-button :size="$attrs.size" :loading="loading" @click="hide"
-          >取 消</el-button
+      <div slot="title" style="display: flex; justify-content: space-between">
+        <el-form
+          :size="size"
+          :inline="true"
+          :model="model"
+          @submit.native.prevent
+          style="display: flex; flex-direction: column"
         >
+          <div>
+            <el-form-item prop="search">
+              <el-input
+                v-model="model.search"
+                @change="useQuery"
+                @keydown.enter="useQuery"
+              >
+              </el-input>
+            </el-form-item>
+            <el-form-item>
+              <el-button icon="el-icon-refresh" @click="useReset"></el-button>
+            </el-form-item>
+          </div>
+        </el-form>
+        <div>
+          <el-button
+            type="primary"
+            :size="$attrs.size"
+            :loading="loading"
+            @click="useConfirm(selectData)"
+          >
+            确认
+          </el-button>
+          <el-button :size="$attrs.size" :loading="loading" @click="hide">
+            取消
+          </el-button>
+        </div>
       </div>
-      <el-form
+      <div
         v-loading="loading"
-        :size="size"
-        :inline="true"
-        :model="model"
-        @submit.native.prevent
+        style="height: 40vh; display: flex; margin-top: -30px"
       >
-        <el-form-item prop="search">
-          <el-input
-            v-model="model.search"
-            @change="useQuery"
-            @keydown.enter="useQuery"
-          >
-          </el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-button icon="el-icon-refresh" @click="useReset"></el-button>
-        </el-form-item>
-        <el-table
-          :data="data"
+        <el-super-table
+          v-model="data"
           :size="size"
-          height="45vh"
+          :page="page"
+          :columns="TableColumns"
+          :radio="!multiple"
+          :checkbox="multiple"
+          pagination
           highlight-current-row
-          @row-dblclick="useConfirm"
-          @row-click="useSelect([$event])"
-        >
-          <el-table-column
-            v-for="(column, index) in TableColumns"
-            :key="index"
-            :prop="column.key"
-            :label="column.title"
-            :width="column.width || 'auto'"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <dr-computed-input
-                v-if="column.type === 'ComputedInput'"
-                v-model="scope.row[column.key]"
-                :source="scope.row"
-                :formatter="column.formatter"
-                :placeholder="column.placeholder"
-                style="width: 100%"
-              ></dr-computed-input>
-              <span v-else> {{ scope.row[column.key] }}</span>
-            </template>
-          </el-table-column>
-        </el-table>
-        <pagination
-          v-show="!loading"
-          :total="page.total"
-          :page.sync="page.pageNum"
-          :limit.sync="page.pageSize"
           @pagination="useQuery"
-        />
-      </el-form>
+          @row-select="useSelect"
+          @row-dblclick="useConfirm([$event])"
+        >
+        </el-super-table>
+      </div>
     </el-dialog>
   </div>
 </template>

+ 10 - 26
src/components/popover-select/components/ADDRESS_PARAM.js

@@ -1,39 +1,23 @@
 // 收货地址
 export default [
-  // {
-  //   key: "id",
-  //   title: "ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码", width: "auto" },
+    attr: {},
   },
   {
-    key: "name",
-    title: "仓库",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "仓库", width: "auto" },
+    attr: {},
   },
   {
-    key: "address",
-    title: "地址",
-    type: "Input",
-    search: true,
+    item: { key: "address", title: "地址", width: "auto" },
+    attr: {},
   },
   {
-    key: "contactsName",
-    title: "联系人",
-    type: "Input",
-    search: true,
+    item: { key: "contactsName", title: "联系人", width: "auto" },
+    attr: {},
   },
   {
-    key: "contactsPhone",
-    title: "电话",
-    type: "Input",
-    search: true,
+    item: { key: "contactsPhone", title: "电话", width: "auto" },
+    attr: {},
   },
 ];

+ 4 - 15
src/components/popover-select/components/ALLOCATION_PARAM.js

@@ -1,22 +1,11 @@
 // 货位
 export default [
-  // 树
-  // {
-  //   key: "id",
-  //   title: "ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码", width: "auto" },
+    attr: {},
   },
   {
-    key: "name",
-    title: "货位",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "货位" , width: "auto"},
+    attr: {},
   },
 ];

+ 5 - 15
src/components/popover-select/components/BALATYPE_PARAM.js

@@ -1,21 +1,11 @@
 // 结算方式
 export default [
-  // {
-  //   key: "id",
-  //   title: "结算方式ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
   },
   {
-    key: "name",
-    title: "结算方式",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "结算方式" , width: "auto"},
+    attr: {},
   },
-];
+];

+ 4 - 8
src/components/popover-select/components/CONTACTS_PARAM.js

@@ -1,15 +1,11 @@
 // 客户部门
 export default [
   {
-    key: "code",
-    title: "人员编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
   },
   {
-    key: "name",
-    title: "人员名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
 ];

+ 13 - 16
src/components/popover-select/components/CURRENCY_PARAM.js

@@ -1,30 +1,27 @@
+// 币种
 export default [
   {
-    key: "name",
-    title: "币种",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "币种", width: "auto" },
+    attr: {},
   },
   {
-    key: "code",
-    title: "币种简称",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "币种简称" , width: "auto"},
+    attr: {},
   },
   {
-    key: "",
-    title: "单价精度",
+    item: { key: "", title: "单价精度" , width: "auto"},
+    attr: {},
   },
   {
-    key: "",
-    title: "单价舍入规则",
+    item: { key: "", title: "单价舍入规则" , width: "auto"},
+    attr: {},
   },
   {
-    key: "",
-    title: "金额精度",
+    item: { key: "", title: "金额精度" , width: "auto"},
+    attr: {},
   },
   {
-    key: "",
-    title: "金额舍入规则",
+    item: { key: "", title: "金额舍入规则", width: "auto" },
+    attr: {},
   },
 ];

+ 4 - 8
src/components/popover-select/components/CUSTOMERDEPT_PARAM.js

@@ -1,15 +1,11 @@
 // 客户部门
 export default [
-  // {
-  //   key: "id",
-  //   title: "客户ID",
-  // },
   {
-    key: "code",
-    title: "客户编码",
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
   },
   {
-    key: "name",
-    title: "客户名称",
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
 ];

+ 4 - 14
src/components/popover-select/components/CUSTOMER_PARAM.js

@@ -1,21 +1,11 @@
 // 收货客户
 export default [
-  // {
-  //   key: "id",
-  //   title: "收货客户ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "收货客户编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
   },
   {
-    key: "name",
-    title: "收货客户名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
 ];

+ 4 - 8
src/components/popover-select/components/CUSTOMER_PARAM_ZT.js

@@ -1,15 +1,11 @@
 // 收货客户
 export default [
   {
-    key: "code",
-    title: "客户编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
   },
   {
-    key: "name",
-    title: "客户名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
 ];

+ 4 - 8
src/components/popover-select/components/DEPT_PARAM.js

@@ -1,14 +1,10 @@
 export default [
   {
-    key: "code",
-    title: "组织编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
   },
   {
-    key: "name",
-    title: "组织名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
 ];

+ 2 - 4
src/components/popover-select/components/LINKMAN_PARAM.js

@@ -1,9 +1,7 @@
 // 收货客户
 export default [
   {
-    key: "name",
-    title: "名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
   },
 ];

+ 4 - 8
src/components/popover-select/components/MANUFACTURER_PARAM.js

@@ -1,15 +1,11 @@
 // 生产厂家
 export default [
   {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码", width: "auto" },
+    attr: {},
   },
   {
-    key: "name",
-    title: "名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
   },
 ];

+ 54 - 60
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -1,96 +1,90 @@
 export default [
   {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码", width: "auto" },
+    attr: {},
   },
   {
-    key: "name",
-    title: "名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
   },
   {
-    key: "specification",
-    title: "规格",
-    type: "Input",
-    search: true,
+    item: { key: "specification", title: "规格", width: "auto" },
+    attr: {},
   },
   {
-    key: "manufacturerIdName",
-    title: "生产厂家",
-    type: "Input",
-    search: true,
+    item: { key: "manufacturerIdName", title: "生产厂家", width: "auto" },
+    attr: {},
   },
   {
-    key: "unitIdName",
-    title: "单位",
-    type: "Input",
-    search: true,
+    item: { key: "unitIdName", title: "单位", width: "auto" },
+    attr: {},
   },
   {
-    key: "registrationNo",
-    title: "注册证号",
-    type: "ComputedInput",
-    formatter: (prop) => {
-      return prop.materialMedcine.registrationNo;
+    item: { key: "registrationNo", title: "注册证号", width: "auto" },
+    attr: {
+      formatter: (prop) => {
+        return prop.materialMedcine.registrationNo;
+      },
     },
   },
   {
-    key: "isDrug",
-    title: "物料药品属性",
-    type: "ComputedInput",
-    formatter: (prop) => {
-      return prop.materialMedcine.isDrug == "0" ? "Y" : "N";
+    item: { key: "isDrug", title: "物料药品属性", width: "auto" },
+    attr: {
+      formatter: (prop) => {
+        return prop.materialMedcine.isDrug == "0" ? "Y" : "N";
+      },
     },
   },
   {
-    key: "isDrugNumber",
-    title: "药品",
-    type: "ComputedInput",
-    formatter: (prop) => {
-      return prop.materialMedcine.isDrug;
+    item: { key: "isDrugNumber", title: "药品", width: "auto" },
+    attr: {
+      formatter: (prop) => {
+        return prop.materialMedcine.isDrugNumber;
+      },
     },
   },
   {
-    key: "oriRegistrationNo",
-    title: "注册证号/备案凭证编号",
-    type: "ComputedInput",
-    formatter: (prop) => {
-      return prop.materialMedcine.oriRegistrationNo;
+    item: {
+      key: "oriRegistrationNo",
+      title: "注册证号/备案凭证编号",
+      width: "auto",
+    },
+    attr: {
+      formatter: (prop) => {
+        return prop.materialMedcine.oriRegistrationNo;
+      },
     },
   },
   {
-    key: "dosageFrom",
-    title: "剂型",
-    type: "ComputedInput",
-    formatter: (prop) => {
-      return prop.materialMedcine.dosageFrom;
+    item: { key: "dosageFrom", title: "剂型", width: "auto" },
+    attr: {
+      formatter: (prop) => {
+        return prop.materialMedcine.dosageFrom;
+      },
     },
   },
   {
-    key: "dosageFromName",
-    title: "剂型名称",
-    type: "ComputedInput",
-    formatter: (prop) => {
-      return prop.materialMedcine.dosageFromName;
+    item: { key: "dosageFromName", title: "剂型名称", width: "auto" },
+    attr: {
+      formatter: (prop) => {
+        return prop.materialMedcine.dosageFromName;
+      },
     },
   },
   {
-    key: "curingType",
-    title: "养护类型",
-    type: "ComputedInput",
-    formatter: (prop) => {
-      return prop.materialMedcine.curingType;
+    item: { key: "curingType", title: "养护类型", width: "auto" },
+    attr: {
+      formatter: (prop) => {
+        return prop.materialMedcine.curingType;
+      },
     },
   },
   {
-    key: "medicalInstruments",
-    title: "医疗器械",
-    type: "ComputedInput",
-    formatter: (prop) => {
-      return prop.materialMedcine.medicalInstruments;
+    item: { key: "medicalInstruments", title: "医疗器械", width: "auto" },
+    attr: {
+      formatter: (prop) => {
+        return prop.materialMedcine.medicalInstruments;
+      },
     },
   },
 ];

+ 4 - 8
src/components/popover-select/components/MK_SALESAREA_PARAM.js

@@ -1,15 +1,11 @@
 // 销售区域
 export default [
   {
-    key: "code",
-    title: "区域编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
   },
   {
-    key: "name",
-    title: "区域名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
 ];

+ 2 - 4
src/components/popover-select/components/MK_TARGET_CYCLE_PARAM.js

@@ -1,9 +1,7 @@
 // 目标周期
 export default [
   {
-    key: "name",
-    title: "周期名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
 ];

+ 2 - 4
src/components/popover-select/components/MK_TARGET_INDEX_PARAM.js

@@ -1,9 +1,7 @@
 // 目标指标
 export default [
   {
-    key: "name",
-    title: "指标名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
   },
 ];

+ 2 - 4
src/components/popover-select/components/MK_TARGET_TEMPLATE_PARAM.js

@@ -1,9 +1,7 @@
 // 目标摸吧
 export default [
   {
-    key: "name",
-    title: "模板名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
 ];

+ 4 - 14
src/components/popover-select/components/OPERATING_PARAM.js

@@ -1,21 +1,11 @@
 // 经营性项目
 export default [
-  // {
-  //   key: "id",
-  //   title: "经营性项目ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "经营性项目编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码", width: "auto" },
+    attr: {},
   },
   {
-    key: "name",
-    title: "经营性项目名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
 ];

+ 9 - 13
src/components/popover-select/components/ORG_PARAM.js

@@ -1,14 +1,10 @@
 export default [
-    {
-      key: "code",
-      title: "组织编码",
-      type: "Input",
-      search: true,
-    },
-    {
-      key: "name",
-      title: "组织名称",
-      type: "Input",
-      search: true,
-    },
-  ]
+  {
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
+  },
+  {
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
+  },
+];

+ 4 - 8
src/components/popover-select/components/PAYAGREEMENT_PARAM.js

@@ -1,14 +1,10 @@
 export default [
   {
-    key: "code",
-    title: "付款协议编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
   },
   {
-    key: "name",
-    title: "付款协议名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
 ];

+ 5 - 15
src/components/popover-select/components/PROCESSTYPE_PARAM.js

@@ -1,21 +1,11 @@
 // 处理方式
 export default [
-  // {
-  //   key: "id",
-  //   title: "ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码", width: "auto" },
+    attr: {},
   },
   {
-    key: "name",
-    title: "处理方式",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
-];
+];

+ 5 - 15
src/components/popover-select/components/PROJECT_PARAM.js

@@ -1,21 +1,11 @@
 // 在建工程项目
 export default [
-  // {
-  //   key: "id",
-  //   title: "在建工程项目ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "在建工程项目编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码", width: "auto" },
+    attr: {},
   },
   {
-    key: "name",
-    title: "在建工程项目名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
-];
+];

+ 5 - 15
src/components/popover-select/components/PSNLICENSE_PARAM.js

@@ -1,21 +1,11 @@
 // 人员证照参照
 export default [
-  // {
-  //   key: "id",
-  //   title: "ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
   },
   {
-    key: "name",
-    title: "名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
-];
+];

+ 5 - 15
src/components/popover-select/components/RETREASON_PARAM.js

@@ -1,21 +1,11 @@
 // 退换原因
 export default [
-  // {
-  //   key: "id",
-  //   title: "退换原因ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "退换原因编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
   },
   {
-    key: "name",
-    title: "退换原因",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
   },
-];
+];

+ 6 - 21
src/components/popover-select/components/SUPPLIERCONTACTS_PARAM.js

@@ -1,27 +1,12 @@
 // 供应商联系人
 export default [
-  // {
-  //   key: "id",
-  //   title: "ID",
-  //   type: "Input",
-  //   search: true,
-  // },
-  // {
-  //   key: "code",
-  //   title: "编码",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "name",
-    title: "名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
   {
-    key: "cell",
-    title: "电话",
-    type: "Input",
-    search: true,
+    item: { key: "cell", title: "电话" , width: "auto"},
+    attr: {},
   },
-];
+
+];

+ 5 - 8
src/components/popover-select/components/SUPPLIER_PARAM.js

@@ -1,14 +1,11 @@
+// 供应商
 export default [
   {
-    key: "code",
-    title: "供应商编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码", width: "auto" },
+    attr: {},
   },
   {
-    key: "name",
-    title: "供应商名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
   },
 ];

+ 10 - 15
src/components/popover-select/components/TAX_RATE_PARAM.js

@@ -1,24 +1,19 @@
+// 税率
 export default [
   {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码", width: "auto" },
+    attr: {},
   },
   {
-    key: "name",
-    title: "名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
   },
   {
-    key: "ntaxrate",
-    title: "税率",
-    type: "ComputedInput",
-    formatter: (prop) => {
-      const { ntaxrate } = prop;
-      // console.log(ntaxrate, ntaxrate.toFixed(6));
-      return ntaxrate === "0E-8" ? "0.000000" : (ntaxrate * 1).toFixed(6);
+    item: { key: "ntaxrate", title: "税率%", width: "auto" },
+    attr: {
+      formatter: (prop) => {
+        return Number(prop.ntaxrate === "0E-8" ? 0 : prop.ntaxrate).toFixed(6);
+      },
     },
   },
 ];

+ 5 - 16
src/components/popover-select/components/UNIT_PARAM.js

@@ -1,22 +1,11 @@
-// 
+// 
 export default [
-  // 树
-  // {
-  //   key: "id",
-  //   title: "ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
   },
   {
-    key: "name",
-    title: "货位",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称" , width: "auto"},
+    attr: {},
   },
 ];

+ 8 - 18
src/components/popover-select/components/WAREHOUSE_PARAM.js

@@ -1,29 +1,19 @@
 // 收货仓库
 export default [
-  // {
-  //   key: "id",
-  //   title: "仓库ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "仓库编码",
-    type: "Input",
-    search: true,
+    item: { key: "code", title: "编码", width: "auto" },
+    attr: {},
   },
   {
-    key: "name",
-    title: "仓库名称",
-    type: "Input",
-    search: true,
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
   },
   {
-    key: "",
-    title: "备注",
+    item: { key: "", title: "备注", width: "auto" },
+    attr: {},
   },
   {
-    key: "",
-    title: "助记码",
+    item: { key: "", title: "助记码", width: "auto" },
+    attr: {},
   },
 ];

+ 1 - 3
src/components/super-table/index.vue

@@ -75,7 +75,7 @@ export default {
     const { columns } = this.$props;
     const innerColumns = columns.map(({ item, attr }) => ({
       attr,
-      item: { ...item, hidden: true },
+      item: { hidden: true, ...item },
     }));
     return {
       innerColumns: innerColumns,
@@ -162,8 +162,6 @@ export default {
     },
     // 冻结
     onHide(prop) {
-      console.log("new", prop[0].item.title);
-      console.log("old", this.innerColumns[0].item.title);
       this.$nextTick(() => {
         this.$refs.superTable.doLayout();
       });

+ 193 - 7
src/views/purchase/apply/add/columns.js

@@ -68,15 +68,12 @@ export default function useColumns() {
       attr: { is: "el-input", disabled: true, readonly: true },
     },
     {
-      item: { key: "source", title: "来源单据号" },
-      attr: { is: "el-input", disabled: true, readonly: true },
-    },
-    {
       item: { key: "isEffective", title: "是否已推价格" },
       attr: {
         is: "el-select",
         dictName: "is_effective",
         value: "N",
+        disabled: true,
       },
     },
     {
@@ -120,6 +117,7 @@ export default function useColumns() {
           item: { key: "materialName", title: "物料名称", require: true },
           attr: {
             is: "el-popover-select-v2",
+            multiple: true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -144,7 +142,7 @@ export default function useColumns() {
         { item: { key: "specification", title: "规格" }, attr: {} },
         { item: { key: "model", title: "型号" }, attr: {} },
         {
-          item: { key: "unitName", title: "单位" },
+          item: { key: "unitName", title: "单位", hidden: false },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "name",
@@ -153,7 +151,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "puUnitName", title: "采购单位" },
+          item: { key: "puUnitName", title: "采购单位", hidden: false },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "name",
@@ -170,6 +168,8 @@ export default function useColumns() {
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
+            value: 1,
+            disabled: true,
           },
         },
         {
@@ -179,6 +179,7 @@ export default function useColumns() {
             valueKey: "ntaxrate",
             referName: "TAX_RATE_PARAM",
             dataMapping: { tax: "ntaxrate" },
+            disabled: true,
           },
         },
         {
@@ -251,12 +252,20 @@ export default function useColumns() {
             },
           },
         },
-        { item: { key: "recentlyPrice", title: "最近价格" }, attr: {} },
+        {
+          item: { key: "recentlyPrice", title: "最近价格" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+            disabled: true,
+          },
+        },
         {
           item: { key: "isApprovalFirst", title: "首次报批" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
+            disabled: true,
           },
         },
         {
@@ -264,6 +273,7 @@ export default function useColumns() {
           attr: {
             is: "el-select",
             dictName: "is_effective",
+            disabled: true,
           },
         },
         {
@@ -282,6 +292,182 @@ export default function useColumns() {
             value: "N",
           },
         },
+        {
+          item: { key: "isChannel", title: "是否渠道变更" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        {
+          item: {
+            key: "brandReplacement",
+            title: "是否品牌替换",
+          },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        {
+          item: {
+            key: "priceDiffer",
+            title: "单价差",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "increase",
+            title: "涨幅",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "yPurchaseQuantity",
+            title: "预计年采购数量",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "yAffectedAmount",
+            title: "预计年影响金额",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "supplierName",
+            title: "供应商名称",
+          },
+          attr: {
+            is: "el-input",
+          },
+        },
+        {
+          item: {
+            key: "bidPrice",
+            title: "中标价",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "unitPrice",
+            title: "单价",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "profit",
+            title: "利润比",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "supplierName1",
+            title: "供应商名称1",
+          },
+          attr: {
+            is: "el-input",
+          },
+        },
+        {
+          item: {
+            key: "bidPrice1",
+            title: "中标价1",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "unitPrice1",
+            title: "单价1",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "profit1",
+            title: "利润比1",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "supplierName2",
+            title: "供应商名称2",
+          },
+          attr: {
+            is: "el-input",
+          },
+        },
+        {
+          item: {
+            key: "bidPrice2",
+            title: "中标价2",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "unitPrice2",
+            title: "单价2",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: {
+            key: "profit2",
+            title: "利润比2",
+          },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
         { item: { key: "createByName", title: "创建人名称" }, attr: {} },
         { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
       ],

+ 80 - 82
src/views/purchase/apply/add/index.vue

@@ -57,43 +57,52 @@ export default {
   watch: {},
   methods: {
     //
-    changeMaterialName(prop) {
-      const { row } = prop;
-      const { puOrg, customer, supplier } = this.params;
-      const { tax: taxName, unitName, code: materialCode } = row;
-      // task 1
-      tax(taxName).then((res) => {
-        const { ntaxrate } = res;
-        row.tax = ntaxrate === "0E-8" ? "0.000000" : (ntaxrate * 1).toFixed(6);
-      });
-      // task 2
-      unit(unitName).then((res) => {
-        const { id, code, name } = res;
-        row.unit = id;
-        row.unitCode = code;
-        row.unitName = name;
-        row.puUnit = id;
-        row.puUnitCode = code;
-        row.puUnitName = name;
-      });
-      // task 3
-      currency("人民币").then((res) => {
-        const { id, code, name } = res;
-        row.currency = id;
-        row.currencyCode = code;
-        row.currencyName = name;
-      });
-      // task 4
-      fetchExist({ puOrg, customer, supplier, materialCode }).then((res) => {
-        const { recentlyPrice, isApprovalFirst, isPriceAdjustment } = res;
-        row.recentlyPrice = recentlyPrice;
-        if (isApprovalFirst) {
-          row.isApprovalFirst = isApprovalFirst == 0 ? "Y" : "N";
-        }
-        if (isPriceAdjustment) {
-          row.isPriceAdjustment = isPriceAdjustment == 0 ? "Y" : "N";
-        }
-      });
+    async changeMaterialName(prop) {
+      const { selectData } = prop;
+      const {
+        puOrg,
+        customer,
+        supplier,
+        currency,
+        currencyCode,
+        currencyName,
+      } = this.params;
+      if (selectData.length) {
+        this.params[this.tabName].splice(-1);
+      }
+      for (const item of selectData) {
+        const { tax: taxName, unitName, code: materialCode } = item;
+        // task 1
+        const { ntaxrate } = await tax(taxName);
+        // task 2
+        const {
+          id: puUnit,
+          code: puUnitCode,
+          name: puUnitName,
+        } = await unit(unitName);
+        // task 3
+        const {
+          recentlyPrice = "0",
+          isApprovalFirst = "N",
+          isPriceAdjustment = "N",
+        } = await fetchExist({ puOrg, customer, supplier, materialCode });
+        await this.onRowAdd(this.tabName, {
+          ...item,
+          currency: currency,
+          currencyCode: currencyCode,
+          currencyName: currencyName,
+          unit: puUnit,
+          unitCode: puUnitCode,
+          unitName: puUnitName,
+          puUnit: puUnit,
+          puUnitCode: puUnitCode,
+          puUnitName: puUnitName,
+          recentlyPrice,
+          isApprovalFirst,
+          isPriceAdjustment,
+          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate).toFixed(6),
+        });
+      }
     },
     //
     async onOpen() {
@@ -103,15 +112,11 @@ export default {
         deptName: puDeptName,
         name: buyer,
         nickName: buyerName,
-        orgId: puOrg,
-        orgName: puOrgName,
       } = this.$store.state.user;
       const { id, code, name } = await currency("人民币");
       this.params.currency = id;
       this.params.currencyCode = code;
       this.params.currencyName = name;
-      this.params.puOrg = puOrg;
-      this.params.puOrgName = puOrgName;
       this.params.buyer = buyer;
       this.params.buyerName = buyerName;
       this.params.puDept = puDept;
@@ -124,7 +129,7 @@ export default {
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
     //
-    async onRowAdd(prop) {
+    async onRowAdd(prop, pushParams = {}) {
       const {
         $notify,
         TabColumns,
@@ -142,6 +147,7 @@ export default {
       this.params[prop].push({
         delFlag: "0",
         ...this.$init.params(TableColumns),
+        ...pushParams,
       });
     },
     //
@@ -216,16 +222,6 @@ export default {
         label-position="right"
         style="padding: 20px"
       >
-        <template slot="puOrgName" slot-scope="scope">
-          <component
-            v-bind="scope.attr"
-            v-model="scope.row[scope.item.key]"
-            :size="$attrs.size"
-            :source.sync="scope.row"
-            @change="changePuOrgName({ ...scope, select: $event })"
-          >
-          </component
-        ></template>
       </el-super-form>
       <el-tabs v-model="tabName" style="padding: 0 20px 20px">
         <el-tab-pane
@@ -235,39 +231,41 @@ export default {
           :name="item.key"
           lazy
         >
-          <el-super-table
-            v-model="params[item.key]"
-            :dict="dict"
-            :ref="tabName"
-            :columns="columns"
-            :size="$attrs.size"
-          >
-            <template slot="materialName" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                @change="changeMaterialName(scope)"
-              >
-              </component>
-            </template>
-            <el-table-column fixed="right" label="操作" width="100">
-              <template slot="header" slot-scope="scope">
-                <el-button :size="$attrs.size" @click="onRowAdd(tabName)">
-                  新增
-                </el-button>
-              </template>
-              <template slot-scope="scope">
-                <el-button
+          <div v-loading="loading" style="height: 600px; display: flex">
+            <el-super-table
+              v-model="params[item.key]"
+              :dict="dict"
+              :ref="tabName"
+              :columns="columns"
+              :size="$attrs.size"
+            >
+              <template slot="materialName" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
                   :size="$attrs.size"
-                  @click.native.prevent="onRowRemove(tabName, scope)"
+                  :source.sync="scope.row"
+                  @change="changeMaterialName({ ...scope, selectData: $event })"
                 >
-                  删除
-                </el-button>
+                </component>
               </template>
-            </el-table-column>
-          </el-super-table>
+              <el-table-column fixed="right" label="操作" width="100">
+                <template slot="header" slot-scope="scope">
+                  <el-button :size="$attrs.size" @click="onRowAdd(tabName)">
+                    新增
+                  </el-button>
+                </template>
+                <template slot-scope="scope">
+                  <el-button
+                    :size="$attrs.size"
+                    @click.native.prevent="onRowRemove(tabName, scope)"
+                  >
+                    删除
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-super-table>
+          </div>
         </el-tab-pane>
       </el-tabs>
     </el-drawer>

+ 0 - 1
src/views/purchase/apply/columns.js

@@ -28,7 +28,6 @@ export default function useColumns() {
       item: { key: "effectiveDate", title: "生效日期" },
       attr: {},
     },
-    { item: { key: "source", title: "来源单据号" }, attr: {} },
     {
       item: { key: "sourceType", title: "来源单据类型" },
       attr: {},

+ 2 - 4
src/views/purchase/apply/copy/columns.js

@@ -68,15 +68,12 @@ export default function useColumns() {
       attr: { is: "el-input", disabled: true, readonly: true },
     },
     {
-      item: { key: "source", title: "来源单据号" },
-      attr: { is: "el-input", disabled: true, readonly: true },
-    },
-    {
       item: { key: "isEffective", title: "是否已推价格" },
       attr: {
         is: "el-select",
         dictName: "is_effective",
         value: "N",
+        disabled: true,
       },
     },
     {
@@ -132,6 +129,7 @@ export default function useColumns() {
               specification: "specification",
               manufacturer: "manufacturerId",
               manufacturerName: "manufacturerIdName",
+              tax: "materialRateName",
             },
           },
         },

+ 2 - 4
src/views/purchase/apply/edit/columns.js

@@ -68,15 +68,12 @@ export default function useColumns() {
       attr: { is: "el-input", disabled: true, readonly: true },
     },
     {
-      item: { key: "source", title: "来源单据号" },
-      attr: { is: "el-input", disabled: true, readonly: true },
-    },
-    {
       item: { key: "isEffective", title: "是否已推价格" },
       attr: {
         is: "el-select",
         dictName: "is_effective",
         value: "N",
+        disabled: true,
       },
     },
     {
@@ -132,6 +129,7 @@ export default function useColumns() {
               specification: "specification",
               manufacturer: "manufacturerId",
               manufacturerName: "manufacturerIdName",
+              tax: "materialRateName",
             },
           },
         },

+ 3 - 6
src/views/purchase/apply/edit/index.vue

@@ -97,6 +97,7 @@ export default {
   methods: {
     //
     changeMaterialName(prop) {
+      console.log(prop, "prop");
       const { row } = prop;
       const { puOrg, customer, supplier } = this.params;
       const { tax: taxName, unitName, code: materialCode } = row;
@@ -126,12 +127,8 @@ export default {
       fetchExist({ puOrg, customer, supplier, materialCode }).then((res) => {
         const { recentlyPrice, isApprovalFirst, isPriceAdjustment } = res;
         row.recentlyPrice = recentlyPrice;
-        if (isApprovalFirst) {
-          row.isApprovalFirst = isApprovalFirst == 0 ? "Y" : "N";
-        }
-        if (isPriceAdjustment) {
-          row.isPriceAdjustment = isPriceAdjustment == 0 ? "Y" : "N";
-        }
+        row.isApprovalFirst = isApprovalFirst;
+        row.isPriceAdjustment = isPriceAdjustment;
       });
     },
     //

+ 0 - 4
src/views/purchase/apply/see/columns.js

@@ -35,10 +35,6 @@ export default function useColumns() {
       attr: {},
     },
     {
-      item: { key: "source", title: "来源单据号" },
-      attr: {},
-    },
-    {
       item: { key: "isEffective", title: "是否已推价格" },
       attr: {
         is: "el-dict-tag",