瀏覽代碼

Merge remote-tracking branch 'origin/dev' into dev

001295 1 年之前
父節點
當前提交
e8abc49e62
共有 82 個文件被更改,包括 2340 次插入1526 次删除
  1. 1 1
      src/api/business/purchase/catalogue.js
  2. 16 0
      src/api/requisition/basic.js
  3. 1 1
      src/components/DictTag/index.vue
  4. 3 4
      src/components/FileUpload/index.vue
  5. 1 1
      src/components/Pagination/index.vue
  6. 0 1
      src/components/PopDialog/fourClass.vue
  7. 79 72
      src/components/popover-select-v2/index.vue
  8. 10 26
      src/components/popover-select/components/ADDRESS_PARAM.js
  9. 4 15
      src/components/popover-select/components/ALLOCATION_PARAM.js
  10. 5 15
      src/components/popover-select/components/BALATYPE_PARAM.js
  11. 4 8
      src/components/popover-select/components/CONTACTS_PARAM.js
  12. 13 16
      src/components/popover-select/components/CURRENCY_PARAM.js
  13. 4 8
      src/components/popover-select/components/CUSTOMERDEPT_PARAM.js
  14. 4 14
      src/components/popover-select/components/CUSTOMER_PARAM.js
  15. 4 8
      src/components/popover-select/components/CUSTOMER_PARAM_ZT.js
  16. 4 8
      src/components/popover-select/components/DEPT_PARAM.js
  17. 2 4
      src/components/popover-select/components/LINKMAN_PARAM.js
  18. 4 8
      src/components/popover-select/components/MANUFACTURER_PARAM.js
  19. 54 60
      src/components/popover-select/components/MATERIAL_PARAM.js
  20. 4 8
      src/components/popover-select/components/MK_SALESAREA_PARAM.js
  21. 2 4
      src/components/popover-select/components/MK_TARGET_CYCLE_PARAM.js
  22. 2 4
      src/components/popover-select/components/MK_TARGET_INDEX_PARAM.js
  23. 2 4
      src/components/popover-select/components/MK_TARGET_TEMPLATE_PARAM.js
  24. 4 14
      src/components/popover-select/components/OPERATING_PARAM.js
  25. 9 13
      src/components/popover-select/components/ORG_PARAM.js
  26. 4 8
      src/components/popover-select/components/PAYAGREEMENT_PARAM.js
  27. 5 15
      src/components/popover-select/components/PROCESSTYPE_PARAM.js
  28. 5 15
      src/components/popover-select/components/PROJECT_PARAM.js
  29. 5 15
      src/components/popover-select/components/PSNLICENSE_PARAM.js
  30. 5 15
      src/components/popover-select/components/RETREASON_PARAM.js
  31. 6 21
      src/components/popover-select/components/SUPPLIERCONTACTS_PARAM.js
  32. 5 8
      src/components/popover-select/components/SUPPLIER_PARAM.js
  33. 10 15
      src/components/popover-select/components/TAX_RATE_PARAM.js
  34. 5 16
      src/components/popover-select/components/UNIT_PARAM.js
  35. 8 18
      src/components/popover-select/components/WAREHOUSE_PARAM.js
  36. 16 12
      src/components/popover-tree-select/index.vue
  37. 54 7
      src/components/super-table/index.vue
  38. 1 1
      src/components/super-table/once/filters.vue
  39. 8 0
      src/utils/expression.js
  40. 4 1
      src/utils/request.js
  41. 33 21
      src/views/business/spd/task_management/visitingPlan/add.vue
  42. 41 1
      src/views/material/basicFile/columns.js
  43. 24 19
      src/views/material/basicFile/details.vue
  44. 2 2
      src/views/material/basicFile/index.vue
  45. 1 1
      src/views/material/basicFile/style/index.scss
  46. 14 13
      src/views/material/changeApply/add/column.js
  47. 110 108
      src/views/material/changeApply/add/index.vue
  48. 1 1
      src/views/material/changeApply/amendantRecord/index.vue
  49. 20 19
      src/views/material/changeApply/index.vue
  50. 3 0
      src/views/material/changeApply/see/index.vue
  51. 25 19
      src/views/material/requisition/add.vue
  52. 72 0
      src/views/material/requisition/columns.js
  53. 411 0
      src/views/material/requisition/index copy.vue
  54. 185 124
      src/views/material/requisition/index.vue
  55. 67 20
      src/views/purchase/DemandSummary/index.vue
  56. 63 8
      src/views/purchase/PurchaseDemandList/add.vue
  57. 39 3
      src/views/purchase/PurchaseDemandList/index.vue
  58. 75 50
      src/views/purchase/apply/add/columns.js
  59. 89 90
      src/views/purchase/apply/add/index.vue
  60. 18 21
      src/views/purchase/apply/columns.js
  61. 77 49
      src/views/purchase/apply/copy/columns.js
  62. 95 89
      src/views/purchase/apply/copy/index.vue
  63. 76 50
      src/views/purchase/apply/edit/columns.js
  64. 88 82
      src/views/purchase/apply/edit/index.vue
  65. 6 1
      src/views/purchase/apply/index.vue
  66. 107 87
      src/views/purchase/apply/see/columns.js
  67. 60 40
      src/views/purchase/catalogue/columns.js
  68. 7 13
      src/views/purchase/catalogue/export/index.vue
  69. 2 2
      src/views/purchase/catalogue/index.vue
  70. 2 2
      src/views/purchase/catalogue/see/columns.js
  71. 2 2
      src/views/purchase/contract/add/columns.js
  72. 93 66
      src/views/purchase/contract/columns.js
  73. 2 2
      src/views/purchase/contract/edit/columns.js
  74. 1 1
      src/views/purchase/contract/export/index.vue
  75. 1 0
      src/views/purchase/contract/index.vue
  76. 2 2
      src/views/purchase/contract/see/columns.js
  77. 15 15
      src/views/purchase/purchase-order/add/column.js
  78. 15 6
      src/views/purchase/purchase-order/index.vue
  79. 7 5
      src/views/purchase/task/xie-yi-zhi-cai/column.js
  80. 9 5
      src/views/purchase/task/xie-yi-zhi-cai/index.vue
  81. 1 1
      src/views/purchase/transferOrder/add.vue
  82. 2 2
      vue.config.js

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

@@ -50,7 +50,7 @@ export function EXIST(data) {
 
 export function EXPORT(data) {
   return request({
-    url: "/pu/price/catalogue/export",
+    url: "/pu/price/catalogue/exportByIds",
     method: "POST",
     data: data,
   });

+ 16 - 0
src/api/requisition/basic.js

@@ -35,6 +35,15 @@ export function editReq(data) {
   })
 }
 
+// 物料申请单-修改提交
+export function betchSubmit(data) {
+  return request({
+    url: `/system/apply/material/submit/${data}`,
+    method: 'post',
+    // data: data
+  })
+}
+
 // 物料申请单-删除
 export function delReq(id) {
   return request({
@@ -143,3 +152,10 @@ export function fileImport(data) {
     responseType: 'blob',
   })
 }
+
+export function toOA(userName, fdId) {
+  return request({
+    url: `/oaflow/redirectToOa/${userName}/${fdId}`,
+    method: 'get',
+  })
+}

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

@@ -35,7 +35,7 @@ export default {
       type: Array,
       default: null,
     },
-    value: [Number, String, Array],
+    value: [Number, String, Array,Boolean],
     size: String,
   },
   computed: {

+ 3 - 4
src/components/FileUpload/index.vue

@@ -1,7 +1,6 @@
 <template>
   <div class="upload-file">
     <el-upload
-      drag
       multiple
       :action="uploadFileUrl"
       :before-upload="handleBeforeUpload"
@@ -16,12 +15,12 @@
       ref="fileUpload"
     >
       <!-- 上传按钮 -->
-      <!-- <el-button size="mini" type="primary">选取文件</el-button> -->
-      <i class="el-icon-upload"></i>
+      <el-button size="mini" type="primary">选取文件</el-button>
+      <!-- <i class="el-icon-upload"></i>
       <div class="el-upload__text">
         将文件拖到此处,或
         <em>点击上传</em>
-      </div>
+      </div> -->
       <!-- 上传提示 -->
       <div class="el-upload__tip" slot="tip" v-if="showTip">
         请上传

+ 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,

+ 0 - 1
src/components/PopDialog/fourClass.vue

@@ -33,7 +33,6 @@
                   :highlight-current="true"
                   :current-node-key="checkId"
                   @node-click="clickTree"
-                  default-expand-all
                   :filter-node-method="filterNode"
                   ref="tree"
                 >

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

@@ -36,8 +36,15 @@ export default {
       type: Object,
       default: () => ({}),
     },
+    // 多选
+    checkbox: {
+      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,33 @@ export default {
     },
     // select
     useSelect(prop) {
-      this.selectData = prop[0];
+      this.selectData = prop;
     },
     // confirm
     useConfirm(prop) {
       this.hide();
       const {
-        $props: { source, valueKey, dataMapping },
+        $props: { source, checkbox, valueKey, dataMapping },
       } = this;
-      for (let key in dataMapping) {
-        source[key] = prop[dataMapping[key]];
+      if (checkbox) {
+        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 +196,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 +226,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="!checkbox"
+          :checkbox="checkbox"
+          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: {},
   },
 ];

+ 16 - 12
src/components/popover-tree-select/index.vue

@@ -208,6 +208,7 @@ export default {
       :close-on-click-modal="false"
       :close-on-press-escape="false"
       append-to-body
+      style="padding: 10px;"
     >
       <div slot="footer">
         <el-button
@@ -235,19 +236,22 @@ export default {
         <el-form-item>
           <el-button icon="el-icon-refresh" @click="useReset"></el-button>
         </el-form-item>
-        <el-tree
-          v-loading="loading"
-          :data="data"
-          :props="defaultProps"
-          :filter-node-method="useTreeFilter"
-          ref="tree"
-          accordion
-          node-key="id"
-          @node-click="useSelect"
-        >
-        </el-tree>
+        <div style="height: 400px;overflow: auto;">
+          <el-tree          
+            v-loading="loading"
+            :data="data"
+            :props="defaultProps"
+            :filter-node-method="useTreeFilter"
+            ref="tree"
+            accordion
+            node-key="id"
+            @node-click="useSelect"
+          >
+          </el-tree>
+        </div>
       </el-form>
     </el-dialog>
   </div>
 </template>
-<style scoped></style>
+<style scoped>
+</style>

+ 54 - 7
src/components/super-table/index.vue

@@ -52,6 +52,10 @@ export default {
       type: Function,
       default: () => {},
     },
+    //
+    storageKey: {
+      type: String,
+    },
   },
   components: {
     ElDictTag: () => import("@/components/DictTag/index.vue"),
@@ -72,11 +76,15 @@ export default {
     IconFilter: () => import("./once/filters.vue"),
   },
   data() {
-    const { columns } = this.$props;
-    const innerColumns = columns.map(({ item, attr }) => ({
-      attr,
-      item: { ...item, hidden: true },
-    }));
+    const { columns, storageKey } = this.$props;
+    const localColumns = localStorage.getItem(storageKey);
+    const innerColumns =
+      storageKey && localColumns
+        ? JSON.parse(localColumns)
+        : columns.map(({ item, attr }) => ({
+            attr,
+            item: { hidden: true, ...item },
+          }));
     return {
       innerColumns: innerColumns,
       rowKey: "id",
@@ -160,12 +168,32 @@ export default {
         );
       }
     },
+    // 宽度
+    onWidth(newProp, oldProp, column) {
+      this.innerColumns = this.innerColumns.map(({ item, attr }) => ({
+        attr,
+        item: {
+          ...item,
+          width: item.key === column.property ? newProp : item.width,
+        },
+      }));
+      if (this.$props.storageKey) {
+        localStorage.setItem(
+          this.$props.storageKey,
+          JSON.stringify(this.innerColumns)
+        );
+      }
+    },
     // 冻结
     onHide(prop) {
-      console.log("new", prop[0].item.title);
-      console.log("old", this.innerColumns[0].item.title);
       this.$nextTick(() => {
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     // 排序
@@ -174,18 +202,36 @@ export default {
       this.$nextTick(() => {
         this.$refs.superTable.sort(key, sort);
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     // 冻结
     onFreeze() {
       this.$nextTick(() => {
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     // 过滤
     onFilter() {
       this.$nextTick(() => {
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     onFilters(value) {
@@ -234,6 +280,7 @@ export default {
       :highlight-current-row="radio"
       @row-click="onRowClick"
       @selection-change="onSelectionChange"
+      @header-dragend="onWidth"
       v-bind="$attrs"
       v-on="$listeners"
       style="flex: 1"

+ 1 - 1
src/components/super-table/once/filters.vue

@@ -3,7 +3,7 @@
     v-if="innerValue !== false || filterData.length"
     :visible-arrow="false"
     width="auto"
-    trigger="hover"
+    trigger="click"
     placement="bottom"
     popper-class="p-0"
     class="icon-filter"

+ 8 - 0
src/utils/expression.js

@@ -0,0 +1,8 @@
+import CONFIG from "@/config";
+
+// 无税单价
+export function iunitprice(tax = 0, price = 0) {
+  return ((Number(price) / (Number(tax) / 100 + 1)) * 1).toFixed(
+    CONFIG.precision
+  );
+}

+ 4 - 1
src/utils/request.js

@@ -31,6 +31,8 @@ service.interceptors.request.use(
     // 是否存在列表查询
     const isQueryList =
       config.url.includes("/list") || config.url.includes("/query");
+    //是否存在其他登录方式
+    const isSSO = config.url.includes("/login/sso");
     if (getToken() && !isToken) {
       config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
     }
@@ -44,6 +46,7 @@ service.interceptors.request.use(
     if (
       !isRepeatSubmit &&
       !isQueryList &&
+      !isSSO &&
       (config.method === "post" || config.method === "put")
     ) {
       const requestObj = {
@@ -114,7 +117,7 @@ service.interceptors.response.use(
             url: res.config.url,
             data: res.config.data,
             method: res.config.method,
-            params: { ...res.config.params, DName: "蒙奇·D·伟涛" },
+            params: { ...res.config.params },
           });
         }
       } catch (err) {

+ 33 - 21
src/views/business/spd/task_management/visitingPlan/add.vue

@@ -121,7 +121,7 @@
             <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
             <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
             <el-button type="primary" size="mini" @click="delItems" v-if="sonPageStu == 'edit'">批量删除</el-button>
-            <el-button type="primary" size="mini" @click="edit" v-if="sonPageStu == 'check'">编辑</el-button>
+            <el-button type="primary" size="mini" @click="edit" v-if="sonPageStu == 'check' && basicForm.state == '0'">编辑</el-button>
           </div>
         </div>
 
@@ -145,7 +145,8 @@
                   type="date"
                   size="mini"
                   value-format="yyyy-MM-dd"
-                  placeholder="选择日期">
+                  placeholder="选择日期"
+                >
                 </el-date-picker>
               </el-form-item>
             </template>
@@ -154,7 +155,7 @@
           <el-table-column show-overflow-tooltip label="客户" prop="customerName" min-width="230" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'customerName'" :rules="{ required: true, message: '请选择客户', trigger: 'blur' }">
-                <el-select clearable size="mini" v-model="scope.row.customerName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'CUSTOMER_PARAM_ZT', true, '客户')" style="width: 200px">
+                <el-select clearable size="mini" v-model="scope.row.customerName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'CUSTOMER_PARAM_ZT', true, '客户', {charger: basicForm.charger})" style="width: 200px">
                   <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.code" />
                 </el-select>
               </el-form-item>
@@ -164,7 +165,7 @@
           <el-table-column show-overflow-tooltip label="联系人" prop="contactName" min-width="230" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'contactName'" :rules="{ required: true, message: '请选择联系人', trigger: 'blur' }">
-                <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '联系人', {customer:scope.row.customer})" style="width: 200px">
+                <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '联系人', {customer: scope.row.customer, charger: basicForm.charger})" style="width: 200px">
                   <el-option v-for="item in linkOptions" :key="item.id" :label="item.name" :value="item.code" />
                 </el-select>
               </el-form-item>
@@ -190,10 +191,12 @@
             </template>
           </el-table-column>
 
-          <el-table-column :readonly="sonDisable" show-overflow-tooltip label="商机" prop="boName" min-width="200">
+          <el-table-column show-overflow-tooltip label="商机" prop="boName" min-width="330">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'boName'">
-                <el-input clearable :readonly="sonDisable" size="mini" v-model="scope.row.boName"/>
+                <el-select clearable size="mini" v-model="scope.row.boName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'BO_PARAM', true, '商机', {charger: basicForm.charger, customer: scope.row.customer})" style="width: 300px">
+                  <el-option v-for="item in boOptions" :key="item.id" :label="item.name" :value="item.code" />
+                </el-select>
               </el-form-item>
             </template>
           </el-table-column>
@@ -284,13 +287,9 @@ export default {
         isPage: true,
         title: '',
       },
-      // referCondition: {
-      //   type: '',
-      //   isPage: true,
-      //   title: '',
-      // },
       tableIndex: null,
       ids: [],
+      boOptions: [],
       linkOptions: [],
       manOptions: [],
       personOptions: [],
@@ -327,8 +326,11 @@ export default {
       this.basicForm.planCode = ''
       this.basicForm.createBy = ''
       this.basicForm.createTime = ''
+      //复制之后执行人和部门变为当前账号所有者
+      this.basicForm.charger = this.$store.state.user.id,
       this.basicForm.chargerName = this.$store.state.user.nickName
       this.basicForm.dept = this.$store.state.user.deptId
+      this.basicForm.deptName = this.$store.state.user.deptName
       if (this.basicForm.chargerName) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.chargerName) }
       if (this.basicForm.marketingAreaName) { this.reBackRefer('MK_SALESAREA_PARAM', this.basicForm.marketingAreaName) }
       if (this.basicForm.deptName) { this.reBackRefer('DEPT_PARAM', this.basicForm.deptName) }
@@ -513,20 +515,23 @@ export default {
     // 回显参照框
     reBackRefer(type, id, title) {
       getRefer({type: type, id: id}).then(res => {
+        if (type == 'CONTACTS_PARAM') {
+          this.personOptions = res.rows
+        }
         if(type == 'MK_SALESAREA_PARAM') {
           this.salesAreaOptions = res.rows
         }
+        if (type == 'DEPT_PARAM') {
+          this.deptOptions = res.rows
+        }
         if (type == 'CUSTOMER_PARAM_ZT') {
           this.customerOptions = res.rows
         }
-        if (type == 'CONTACTS_PARAM') {
-          this.personOptions = res.rows
-        }
         if (type == 'LINKMAN_PARAM') {
           this.linkOptions = res.rows
         }
-        if (type == 'DEPT_PARAM') {
-          this.deptOptions = res.rows
+        if(type == 'BO_PARAM') {
+          this.boOptions = res.rows
         }
       })
     },
@@ -547,11 +552,6 @@ export default {
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {
-      if(this.referCondition.type == 'CUSTOMER_PARAM_ZT') {
-        this.customerOptions = selection
-        this.basicForm.mkBoPlanItemList[this.tableIndex].customer = selection[0].id
-        this.basicForm.mkBoPlanItemList[this.tableIndex].customerName = selection[0].name
-      }
       if(this.referCondition.type == 'CONTACTS_PARAM') {
         this.personOptions = selection
         this.basicForm.charger = selection[0].id
@@ -567,11 +567,23 @@ export default {
         this.basicForm.dept = selection[0].id
         this.basicForm.deptName = selection[0].name
       }
+      if(this.referCondition.type == 'CUSTOMER_PARAM_ZT') {
+        this.customerOptions = selection
+        this.basicForm.mkBoPlanItemList[this.tableIndex].customer = selection[0].id
+        this.basicForm.mkBoPlanItemList[this.tableIndex].customerName = selection[0].name
+      }
       if(this.referCondition.type == 'LINKMAN_PARAM') {
         this.linkOptions = selection
         this.basicForm.mkBoPlanItemList[this.tableIndex].contact = selection[0].id
         this.basicForm.mkBoPlanItemList[this.tableIndex].contactName = selection[0].name
       }
+      if(this.referCondition.type == 'BO_PARAM') {
+        this.linkOptions = selection
+        this.basicForm.mkBoPlanItemList[this.tableIndex].bo = selection[0].id
+        this.basicForm.mkBoPlanItemList[this.tableIndex].boName = selection[0].name
+        this.basicForm.mkBoPlanItemList[this.tableIndex].customer = selection[0].customer
+        this.basicForm.mkBoPlanItemList[this.tableIndex].customerName = selection[0].customerName
+      }
     },
     //获取当前时间
     getCurrentTime() {

+ 41 - 1
src/views/material/basicFile/columns.js

@@ -25,6 +25,21 @@ export const SearchColumns = [
     },
   },
   {
+    item: {
+      key: "classifyIdName",
+      title: "物料分类",
+    },
+    attr: {
+      is: "el-popover-tree-select",
+      referName: "MATERIALCLASSIFY_PARAM",
+      valueKey: "name",
+      clearable:true,
+      dataMapping: {
+        classifyId: "id",
+      },
+    },
+  },
+  {
     item:{
       key: "isEnable",
       title: "启用状态",  
@@ -37,6 +52,31 @@ export const SearchColumns = [
   },
   {
     item:{
+      key: "puPersonnelIdName",
+      title: "采购员",
+    },
+    attr: {
+      clearable:true,
+      is: "el-popover-select-v2",
+      referName: "CONTACTS_PARAM",
+      valueKey: "name",
+      dataMapping: {
+        puPersonnelId: "code",
+      },
+    },
+  },
+  {
+    item:{
+      key: "registrant",
+      title: "注册人/上市许可持有人",
+    },
+    attr: {
+      clearable:true,
+      is: "el-input",
+    },
+  },
+  {
+    item:{
       key: "isSync",
       title: "是否同步NC",  
     },
@@ -108,7 +148,7 @@ export const OtherDictColumns = [
   {
     item:{
       key:"expiryUnitId",
-      title:'效期管理',
+      title:'效期单位',
     },
     attr:{
       is: "el-select",

+ 24 - 19
src/views/material/basicFile/details.vue

@@ -517,8 +517,8 @@
     <el-dialog title="操作提示" :visible.sync="optionDialog.show" width="30%" center>
       <span>是否确认{{ optionDialog.op }}?</span>
       <span slot="footer">
-        <el-button @click="handleOptionCancal">取 消</el-button>
         <el-button type="primary" @click="handleComfirmOption('cancal')">确 定</el-button>
+        <el-button @click="handleOptionCancal">取 消</el-button>
       </span>
     </el-dialog>
 
@@ -696,6 +696,7 @@
             v-loading="MoreDataDialog.loading" 
             style="width: 100%"
             @row-click="handleCurentRow" 
+            @row-dblclick="handleDbClick"
             highlight-current-row
           >
             <el-table-column type="index" label="序号" width="55" align="center"/>
@@ -715,8 +716,8 @@
 
         <!-- 按钮 -->
         <el-row class="more-button">
-          <el-button round size="small" @click="handleConcalRefer">取消</el-button>
           <el-button round size="small" type="primary" @click="handleConfirmRefer">确认</el-button>
+          <el-button round size="small" @click="handleConcalRefer">取消</el-button>
         </el-row>
       </div>
     </el-dialog>
@@ -2064,6 +2065,10 @@
         console.log(row, '修改-更多数据表格——选择行');
         this.MoreDataDialog.value = row;
       },
+      handleDbClick(row){
+        this.MoreDataDialog.value = row;
+        this.handleConfirmRefer();
+      },
       // 参照弹窗确认
       handleConfirmRefer() {
 
@@ -2501,28 +2506,28 @@
         deep: true,
       },
       // 通过一级分类判断业务线是否必填
-      "basicData.value.oneClass": {
-        handler(nVal, oVal) {
+      // "basicData.value.oneClass": {
+      //   handler(nVal, oVal) {
 
-          this.basicData.form = this.basicData.form.map(formItem => {
+      //     this.basicData.form = this.basicData.form.map(formItem => {
 
-            if (formItem.prop === "businessLine" && nVal) {
+      //       if (formItem.prop === "businessLine" && nVal) {
 
-              if ( nVal.includes('介入耗材&5') || nVal.includes('骨科耗材&2') ||
-                  nVal.includes('普通耗材&3') || nVal.includes('医用设备&1') ||
-                  nVal.includes('体外诊断&4')) {
+      //         if ( nVal.includes('介入耗材&5') || nVal.includes('骨科耗材&2') ||
+      //             nVal.includes('普通耗材&3') || nVal.includes('医用设备&1') ||
+      //             nVal.includes('体外诊断&4')) {
 
-                    formItem.required  = true
-              } else {
-                formItem.required  = false
-              }
+      //               formItem.required  = true
+      //         } else {
+      //           formItem.required  = false
+      //         }
 
-            }
-            return formItem;
-          })
-        },
-        deep: true,
-      },
+      //       }
+      //       return formItem;
+      //     })
+      //   },
+      //   deep: true,
+      // },
       // 物料分类改变同时改变一二三级分类
       "basicData.value.classifyId": {
 

+ 2 - 2
src/views/material/basicFile/index.vue

@@ -6,7 +6,6 @@
     <!-- 主体列表 -->
     <el-card class="material-list" v-loading="loading">
 
-      
     <div style="margin: 0 0 10px 0;">
       <!-- 查询条件 -->
       <el-super-search
@@ -606,7 +605,7 @@
           vm.queryForm = vm.$store.state.query.queryVlue;
           // 清空选中数据
           vm.checkedList = [];
-          vm.$refs.materialTable.clearSelection();
+          vm.$refs.materialTable &&vm.$refs.materialTable.clearSelection();
         }
         vm.getTagList('material');
         vm.getMaterialList('material');
@@ -634,6 +633,7 @@
     .el-card__body {
       height: 100%;
       box-sizing: border-box;
+      padding: 10px;
 
       .el-table {
         overflow: auto;

+ 1 - 1
src/views/material/basicFile/style/index.scss

@@ -9,7 +9,7 @@
   }
 
   .el-card{
-    overflow: auto;
+    // overflow: auto;
     box-sizing: border-box;
   }
 

+ 14 - 13
src/views/material/changeApply/add/column.js

@@ -129,20 +129,8 @@ export default function useColumns(){
             require: true,
           },
           attr:{
-            is: "el-input",
-            disabled:true,
-          },
-         
-        },
-        {
-          item:{
-            key:'materialName',
-            title:'物料名称',
-            require: true,
-          },
-          attr:{
             is: "el-popover-select-v2",
-            valueKey: "name",
+            valueKey: "code",
             referName: "MATERIAL_PARAM",
             dataMapping: {
               materialId: "id",
@@ -172,6 +160,19 @@ export default function useColumns(){
               medicalDevices:'medicalInstruments',
             },
 
+            
+          },
+         
+        },
+        {
+          item:{
+            key:'materialName',
+            title:'物料名称',
+            require: true,
+          },
+          attr:{
+            is: "el-input",
+            // disabled:true,
           },
          
         },

+ 110 - 108
src/views/material/changeApply/add/index.vue

@@ -298,123 +298,125 @@ export default {
           :name="item.key"
           lazy
         >
-          <el-super-table
-            v-model="materialInfo[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"
-              >
-              </component>
-            </template>
-            <!-- 判断是否禁用 -->
-            <template slot="drug" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                :disabled="!(scope.row.medicineMaterial ==='0') "
-              >
-              <el-option
-                  v-for="item in dict.type[scope.attr.dictName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
+          <div style="height: 420px;display:flex">
+            <el-super-table
+              v-model="materialInfo[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"
                 >
-                </el-option>
-              </component>
-            </template>
-
-            <template slot="registrationNo" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                :disabled="!(scope.row.medicineMaterial ==='0') "
-              >
-              </component>
-            </template>
-
-            <template slot="medicalDevices" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                :disabled="!(scope.row.medicineMaterial ==='0') "
-              >
-              <el-option
-                  v-for="item in dict.type[scope.attr.dictName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
+                </component>
+              </template>
+              <!-- 判断是否禁用 -->
+              <template slot="drug" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
+                  :size="$attrs.size"
+                  :source.sync="scope.row"
+                  :disabled="!(scope.row.medicineMaterial ==='0') "
+                >
+                <el-option
+                    v-for="item in dict.type[scope.attr.dictName]"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </component>
+              </template>
+  
+              <template slot="registrationNo" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
+                  :size="$attrs.size"
+                  :source.sync="scope.row"
+                  :disabled="!(scope.row.medicineMaterial ==='0') "
                 >
-                </el-option>
-              </component>
-            </template>
-            <template slot="maintenanceType" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                :disabled="!(scope.row.medicineMaterial ==='0') "
-              >
-              <el-option
-                  v-for="item in dict.type[scope.attr.dictName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
+                </component>
+              </template>
+  
+              <template slot="medicalDevices" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
+                  :size="$attrs.size"
+                  :source.sync="scope.row"
+                  :disabled="!(scope.row.medicineMaterial ==='0') "
                 >
-                </el-option>
-              </component>
-            </template>
-            <template slot="dosageFromName" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                :disabled="!(scope.row.medicineMaterial ==='0') "
-              >
-              </component>
-            </template>
-            
-
-            <el-table-column fixed="right" label="操作" width="120" align="center">
-              <template slot="header" slot-scope="scope">
-                <el-button
-                  type="text"
+                <el-option
+                    v-for="item in dict.type[scope.attr.dictName]"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </component>
+              </template>
+              <template slot="maintenanceType" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
                   :size="$attrs.size"
-                  @click="useRowAdd(tabName)"
+                  :source.sync="scope.row"
+                  :disabled="!(scope.row.medicineMaterial ==='0') "
                 >
-                  增行
-                </el-button>
+                <el-option
+                    v-for="item in dict.type[scope.attr.dictName]"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </component>
               </template>
-              <template slot-scope="scope">
-                <el-button
-                  type="text"
+              <template slot="dosageFromName" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
                   :size="$attrs.size"
-                  @click.native.prevent="useRowRemove(tabName, scope)"
+                  :source.sync="scope.row"
+                  :disabled="!(scope.row.medicineMaterial ==='0') "
                 >
-                删除
-                </el-button>
-                <AmendantRecord
-                  v-if=" tabName ==='materialBasic' && addType === 'edit' && scope.row.id"
-                  v-model="scope.row"
-                ></AmendantRecord>
+                </component>
               </template>
-            </el-table-column>
-          </el-super-table>
+              
+  
+              <el-table-column fixed="right" label="操作" width="120" align="center">
+                <template slot="header" slot-scope="scope">
+                  <el-button
+                    type="text"
+                    :size="$attrs.size"
+                    @click="useRowAdd(tabName)"
+                  >
+                    增行
+                  </el-button>
+                </template>
+                <template slot-scope="scope">
+                  <el-button
+                    type="text"
+                    :size="$attrs.size"
+                    @click.native.prevent="useRowRemove(tabName, scope)"
+                  >
+                  删除
+                  </el-button>
+                  <AmendantRecord
+                    v-if=" tabName ==='materialBasic' && addType === 'edit' && scope.row.id"
+                    v-model="scope.row"
+                  ></AmendantRecord>
+                </template>
+              </el-table-column>
+            </el-super-table>
+          </div>
         </el-tab-pane>
       </el-tabs>
 

+ 1 - 1
src/views/material/changeApply/amendantRecord/index.vue

@@ -85,7 +85,7 @@ export default {
       :size="size"
     >
 
-      <div style="padding: 10px;">
+      <div style="padding: 10px;height: 600px;display: flex;">
 
         <el-super-table
           v-model="tableData"

+ 20 - 19
src/views/material/changeApply/index.vue

@@ -45,25 +45,26 @@
         </el-col>
       </el-row>
 
-
-      <el-super-table
-        v-model="tableList"
-        :dict="dict"
-        :columns="TableColumns"
-        :size="size"
-        pagination
-        :page="page"
-        @pagination="useQuery(params, page)"
-        @row-dblclick="useSee"
-      >
-        <el-table-column fixed="right" label="操作" width="150" align="center">
-          <template slot-scope="scope">
-            <el-button type="text" size="small" @click="useSee(scope.row)">查看</el-button>
-            <el-button @click="handleEdit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
-            <el-button type="text" size="small" @click="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-super-table>
+      <div style="height: 600px; display:flex;">
+        <el-super-table
+          v-model="tableList"
+          :dict="dict"
+          :columns="TableColumns"
+          :size="size"
+          pagination
+          :page="page"
+          @pagination="useQuery(params, page)"
+          @row-dblclick="useSee"
+        >
+          <el-table-column fixed="right" label="操作" width="150" align="center">
+            <template slot-scope="scope">
+              <el-button type="text" size="small" @click="useSee(scope.row)">查看</el-button>
+              <el-button @click="handleEdit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
+              <el-button type="text" size="small" @click="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-super-table>
+      </div>
     </div>
 </el-card>
 

+ 3 - 0
src/views/material/changeApply/see/index.vue

@@ -246,6 +246,7 @@ export default {
             :name="item.key"
             lazy
           >
+          <div style="height: 420px;display:flex">
             <el-super-table
               v-model="materialInfo[item.key]"
               :dict="dict"
@@ -274,6 +275,8 @@ export default {
                 </template>
               </el-table-column>
             </el-super-table>
+          </div>
+           
           </el-tab-pane>
         </el-tabs>
      

+ 25 - 19
src/views/material/requisition/add.vue

@@ -1,8 +1,25 @@
 <template>
   <div class="requisition_add">
+
+    <el-row type="flex" justify="end" style="margin-bottom: 16px;">
+      <el-col :span="1.5">
+        <el-button type="primary" :size="size" plain @click="save"
+                   v-if="pageStu == 'add' || pageStu == 'edit' || pageStu ==='copy' ">保存
+        </el-button>
+      </el-col>
+      <el-col :span="1.5" style="margin: 0 10px;">
+        <el-button type="primary" :size="size" plain @click="submit"
+                   v-if="pageStu == 'check' && (row.status == '0' || row.status == '3')">提交
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" :size="size" plain @click="back">返回</el-button>
+      </el-col>
+    </el-row>
+    
     <el-tabs type="border-card" v-model="tabValue" @tab-click="handleClick">
       <el-tab-pane label="基本信息" name="first">
-        <div style="width: 100%;height: 680px;overflow-y: auto; overflow-x: hidden;">
+        <div style="width: 100%;height: 580px;overflow-y: auto; overflow-x: hidden;">
           <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="170px">
             <el-row :gutter="20">
               <el-col :span="8">
@@ -519,8 +536,8 @@
         <span>物料类别</span>
         </el-row> -->
         <el-row style="margin-bottom: 12px;">
-          <el-button :disabled="disable" type="primary" size="small" plain @click="addLine">新增</el-button>
-          <el-button :disabled="disable" type="primary" size="small" plain @click="handleDelete">删除</el-button>
+          <el-button :disabled="disable" type="primary" :size="size" plain @click="addLine">新增</el-button>
+          <el-button :disabled="disable" type="primary" :size="size" plain @click="handleDelete">删除</el-button>
           <!-- <el-button :disabled="disable || isControl" type="primary" size="small" plain @click="testsave">暂存</el-button> -->
         </el-row>
         <el-row>
@@ -611,21 +628,7 @@
       </el-tab-pane>
     </el-tabs>
 
-    <div class="btn_group">
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="save"
-                   v-if="pageStu == 'add' || pageStu == 'edit' || pageStu ==='copy' ">保存
-        </el-button>
-      </el-col>
-      <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="small" plain @click="submit"
-                   v-if="pageStu == 'check' && (row.status == '0' || row.status == '3')">提交
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="back">返回</el-button>
-      </el-col>
-    </div>
+    
 
     <factory ref="factory" @doSubmit="acceptFactory" :selectData="selectData2" :single="true"/>
 
@@ -708,6 +711,7 @@
     },
     data() {
       return {
+        size:'mini',
         testOptions: [],
         factoryOptions: [],
         unitOptions: [],
@@ -1241,6 +1245,8 @@
 
               this.basicForm.diCode = '';
 
+              this.basicForm.healthCode = '';
+
               this.basicForm.status = '0';
 
               this.basicForm.sysMaterialMedcineApply.id = '';
@@ -1653,7 +1659,7 @@
 
 <style lang="scss" scoped>
   .requisition_add {
-    height: calc(100vh - 84px);
+    // height: calc(100vh - 84px);
     padding: 12px;
     box-sizing: border-box;
     overflow-y: auto;

+ 72 - 0
src/views/material/requisition/columns.js

@@ -0,0 +1,72 @@
+
+
+ export const TableColumns = [
+    { item: { key: "orgName", title: "所属组织" ,width:150,}, attr: {} },
+    { item: { key: "billCode", title: "单据编码" }, attr: {} },
+   
+    { item: { key: "status", title: "单据状态",width:120, }, 
+      attr: {
+        
+        is: "el-dict-tag",
+        dictName: "documents_status", // 字典名
+      } 
+    },
+    {
+      item: { key: "createName", title: "申请人",width:150, },
+      attr: { },
+    },
+    { item: { key: "createTime", title: "申请时间",width:150, }, attr: {} },
+    { 
+      item: { key: "name", title: "物料名称" }, 
+      attr: {} 
+    },
+    // { 
+    //   item: { key: "materialCode", title: "物料编码" }, 
+    //   attr: {
+   
+    //   } 
+    // },
+    { item: { key: "createName", title: "创建人" ,width:150, }, attr: {} },
+    { item: { key: "createTime", title: "创建时间" ,width:150,}, attr: {} },
+    {
+      item: { key: "updateName", title: "最后修改人" ,width:150, },
+      attr: {  },
+    },
+    { item: { key: "updateTime", title: "最后修改时间" ,width:150,}, attr: {} },
+   
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, fixed: false },
+  }));
+
+ export const SearchColumns = [
+    {
+      item: { key: "billCode", title: "单据编码" },
+      attr: {
+        is: "el-input",
+        clearable:true,
+      },
+    },
+    {
+      item: { key: "name", title: "物料名称" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "MATERIAL_PARAM",
+        valueKey: "name",
+        clearable:true,
+      },
+    },
+    {
+      item: { key: "status", title: "单据状态" },
+      attr: {
+        is: "el-select",
+        dictName: "documents_status",
+        clearable: true,
+      },
+    },
+  
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, span: item.span || 6 },
+  }));
+

+ 411 - 0
src/views/material/requisition/index copy.vue

@@ -0,0 +1,411 @@
+<template>
+  <div class="requisition" v-loading="failLoad">
+    <div class="applyList" v-if="isList">
+      <el-row :gutter="10" class="mb10">
+        <el-col :span="1.5">
+          <span style="font-size: 14px;margin-right: 5px;">单据编码</span>
+          <el-input
+            v-model="queryParams.billCode"
+            size="small"
+            placeholder="请输入单据编码查询"
+            clearable
+            style="width: 240px"
+          />
+        </el-col>
+
+        <el-col :span="1.5">
+          <span style="font-size: 14px;margin-right: 5px;">物料名称</span>
+          <el-input
+            v-model="queryParams.name"
+            size="small"
+            placeholder="请输入物料名称查询"
+            clearable
+            style="width: 240px"
+          />
+        </el-col>
+
+        <el-col :span="1.5">
+          <span style="font-size: 14px;margin-right: 5px;">单据状态</span>
+          <el-select
+            v-model="queryParams.status"
+            size="small"
+            placeholder="请选择单据状态"
+            clearable
+            style="width: 240px">
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain @click="getList(queryParams)">查询</el-button>
+        </el-col>
+        <!-- <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>高级查询</el-button>
+        </el-col> -->
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain @click="reset">重置</el-button>
+        </el-col>
+
+      </el-row>
+
+      <el-row :gutter="10" class="mb10">
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button size="small" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain
+                     @click="download('/system/apply/material/download',{},'申请单模板.xlsx')">模板下载
+          </el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button size="small" @click="handleImport">批量导入</el-button>
+        </el-col>
+        <!-- 导入弹窗 -->
+        <el-dialog 
+          title="批量导入" 
+          :visible.sync="importData.show" 
+          width="35%" 
+          center
+          :before-close="handlefileDialogColse"
+        >
+          <div class="mb-import">
+            <el-upload 
+              accept=".xls, .xlsx" 
+              ref="upload" 
+              action="#" 
+              :on-remove="handleFileRemove"
+              :file-list="importData.list" 
+              :auto-upload="false" 
+              :on-change="handleChangeFile" 
+              :limit="1"
+              style="text-align: center;"
+            >
+              <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+              <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
+            </el-upload>
+
+          </div>
+          <span slot="footer">
+        <el-button @click="handleImportData('cancal')">取 消</el-button>
+        <el-button type="primary" @click="handleImportData('confirm')">确 定</el-button>
+      </span>
+        </el-dialog>
+        <!-- <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>导入</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>导出</el-button>
+        </el-col> -->
+        <!-- <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>批量提交</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>批量删除</el-button>
+        </el-col> -->
+      </el-row>
+
+      <el-card>
+        <el-table
+          :data="tableList"
+          class="request-table"
+          fit
+          max-height="680"
+          @selection-change="handleSelectionChange"
+          @select="handleSelect"
+        >
+          <el-table-column type="selection" width="45"></el-table-column>
+          <el-table-column label="序号" align="center" type="index" width="50"/>
+          <el-table-column label="所属组织" align="center" width="200" prop="orgName"/>
+          <el-table-column label="单据编码" align="center" width="200" prop="billCode"/>
+          <el-table-column label="申请人" align="center" prop="createName"/>
+          <el-table-column label="申请时间" align="center" width="150" prop="createTime"/>
+          <el-table-column label="单据状态" align="center" prop="status" :formatter="statusJug"/>
+          <!-- <el-table-column label="物料编码" align="center" width="150" prop="materialCode" /> -->
+          <el-table-column label="物料名称" align="center" width="150" prop="name"/>
+          <el-table-column label="创建人" align="center" prop="createName"/>
+          <el-table-column label="创建时间" align="center" width="150" prop="createTime"/>
+          <el-table-column label="最后修改人" align="center" width="120" prop="updateName"/>
+          <el-table-column label="最后修改时间" align="center" width="150" prop="updateTime"/>
+          <el-table-column
+            fixed="right"
+            label="操作"
+            align="center"
+            width="180"
+          >
+            <template slot-scope="scope">
+              <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
+              <el-button @click="edit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text"
+                         size="small">编辑
+              </el-button>
+              <!-- <el-button @click="commit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">提交</el-button> -->
+              <el-button type="text" size="small" @click="deleteRow(scope.row)"
+                         v-if="scope.row.status == 0 || scope.row.status == 3">删除
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :page-sizes="[5, 10, 15, 20]"
+          :page-size=queryParams.pageSize
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+          style="text-align: center;">
+        </el-pagination>
+      </el-card>
+    </div>
+
+    <component :is="isComponent" v-model="isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"
+               v-if="!isList"/>
+  </div>
+</template>
+
+<script>
+  import addReq from './add.vue';
+  import {getReqList, delReq, importData, fileImport} from '@/api/requisition/basic';
+  import {saveAs} from "file-saver";
+  import { blobValidate } from "@/utils/ruoyi";
+
+  export default {
+    name: 'requisition',
+    components: {
+      addReq
+    },
+    data() {
+      return {
+        failLoad: false,
+        tableList: [],
+        queryParams: {
+          billCode: '',
+          name: '',
+          status: '',
+          pageNum: 1,
+          pageSize: 10
+        },
+        options: [{
+          value: 0, label: '未提交'
+        }, {
+          value: 1, label: '审批中'
+        }, {
+          value: 2, label: '已完成'
+        }, {
+          value: 3, label: '已驳回'
+        },],
+        total: 0,
+        // isComponent
+        isComponent: 'addReq',
+        isList: true,
+        // 页面状态
+        page: '',
+        rowDetail: {},
+        disable: false,
+        checkedList: [],
+        importData: {
+          show: false,
+          list: []
+        },
+      }
+    },
+    created() {
+
+    },
+    mounted() {
+      this.getList(this.queryParams)
+    },
+    methods: {
+      reset() {
+        this.queryParams.billCode = ''
+        this.queryParams.name = ''
+        this.queryParams.status = ''
+        this.queryParams.pageNum = 1
+        this.getList(this.queryParams)
+      },
+      newAdd() {
+        this.isList = false
+        this.isComponent = 'addReq'
+        this.page = 'add'
+        this.disable = false
+      },
+      // 复制
+      handleCopy() {
+        this.isList = false;
+        this.isComponent = 'addReq';
+        this.page = 'copy';
+        this.rowDetail = this.checkedList[0];
+        this.disable = false;
+      },
+      // 导入
+      handleImport() {
+        this.importData.show = true
+      },
+      // 删除文件
+      handleFileRemove(file, fileList) {
+        console.log('删除文件', file, 'file', fileList, 'fileList');
+        this.importData.list = fileList;
+      },
+      // 文件发生改变
+      handleChangeFile(file, fileList) {
+        this.importData.list = fileList;
+      },
+      // 导入弹窗操作
+      handleImportData(type) {
+        switch (type) {
+          // 取消
+          case 'cancal':
+            this.importData.list = [];
+            this.importData.show = false;
+            break;
+          // 确认
+          case 'confirm':
+            if (this.importData.list.length) {
+
+              let formData = new FormData();
+
+              formData.append('file', this.importData.list[0].raw);
+              importData(formData).then(res => {
+                if (res.code == 200) {
+                  this.importData.show = false;
+                  this.importData.list = [];
+                  if (res.data.flag) {
+                    this.failLoad = true;
+                    console.log(res.data.datas)
+                    let param = {failDatas: res.data.datas}
+                    if (null != param) {
+
+                      fileImport(param).then(res => {
+                        console.log('res',res)
+                        const isBlob = blobValidate(res);
+                        if (isBlob) {
+                          const blob = new Blob([res]);
+                          saveAs(blob, '导入失败的物料申请单数据.xlsx');
+                        }
+                        this.failLoad = false;
+                      })
+                    }
+                  }
+                  this.$message({
+                    message: res.data.msg,
+                    type: res.data.flag ? 'warning' : 'success'
+                  });
+                } else {
+                  this.$message({
+                    message: res.msg,
+                    type: res.code == 200 ? 'success' : 'warning'
+                  });
+                }
+              })
+            } else {
+              this.$message({
+                message: '请上传文件之后在确认!',
+                type: 'warning'
+              });
+            }
+            break;
+        }
+      },
+      handlefileDialogColse(done){
+        this.importData.list = [];
+        done();
+      },
+      // Select框
+      handleSelect(selection, row) {
+
+        this.checkedList = selection;
+
+        console.log(this.checkedList, 'this.checkedList');
+
+      },
+      getList(val) {
+        console.log('val', val)
+        getReqList(val).then(res => {
+          if (res.code === 200) {
+            this.tableList = res.rows
+            this.total = res.total
+          }
+        })
+        this.checkedList = [];
+      },
+      // 表格内状态栏判断值
+      statusJug(row) {
+        if (row.status == 0) {
+          return '未提交'
+        } else if (row.status == 1) {
+          return '审批中'
+        } else if (row.status == 2) {
+          return '已完成'
+        } else if (row.status == 3) {
+          return '已驳回'
+        }
+      },
+      //
+      handleSelectionChange() {
+
+      },
+      check(row) {
+        console.log('查看详情', row)
+        this.isList = false
+        this.isComponent = 'addReq'
+        this.page = 'check'
+        this.rowDetail = row
+        this.disable = true
+      },
+      edit(row) {
+        console.log('修改先加载详情', row)
+        this.isList = false
+        this.isComponent = 'addReq'
+        this.page = 'edit'
+        this.rowDetail = row
+        this.disable = false
+      },
+      commit(row) {
+        console.log('row', row)
+      },
+      deleteRow(row) {
+        this.$confirm('是否删除此条数据?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          delReq(row.id).then(res => {
+            if (res.code === 200) {
+              this.$message({
+                message: res.msg,
+                type: 'success'
+              });
+              this.getList(this.queryParams)
+            }
+          })
+        }).catch(() => {
+        })
+      },
+      handleSizeChange(val) {
+        console.log(`每页 ${val} 条`);
+        this.queryParams.pageSize = val
+        this.getList(this.queryParams)
+      },
+      handleCurrentChange(val) {
+        console.log(`当前页: ${val}`);
+        this.queryParams.pageNum = val
+        this.getList(this.queryParams)
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  .requisition {
+    height: calc(100vh - 84px);
+    padding: 12px;
+    box-sizing: border-box;
+  }
+</style>

+ 185 - 124
src/views/material/requisition/index.vue

@@ -1,82 +1,57 @@
 <template>
   <div class="requisition" v-loading="failLoad">
     <div class="applyList" v-if="isList">
-      <el-row :gutter="10" class="mb10">
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">单据编码</span>
-          <el-input
-            v-model="queryParams.billCode"
-            size="small"
-            placeholder="请输入单据编码查询"
-            clearable
-            style="width: 240px"
-          />
-        </el-col>
-
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">物料名称</span>
-          <el-input
-            v-model="queryParams.name"
-            size="small"
-            placeholder="请输入物料名称查询"
-            clearable
-            style="width: 240px"
-          />
-        </el-col>
-
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">单据状态</span>
-          <el-select
-            v-model="queryParams.status"
-            size="small"
-            placeholder="请选择单据状态"
-            clearable
-            style="width: 240px">
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value">
-            </el-option>
-          </el-select>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain @click="getList(queryParams)">查询</el-button>
-        </el-col>
-        <!-- <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>高级查询</el-button>
-        </el-col> -->
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain @click="reset">重置</el-button>
-        </el-col>
+     
+      <el-card>
 
-      </el-row>
+      <el-super-search
+        v-model="params"
+        :size="size"
+        :dict="dict"
+        :columns="SearchColumns"
+        @reset="reset"
+        @submit="getList"
+      ></el-super-search>
 
-      <el-row :gutter="10" class="mb10">
+      <el-row :gutter="10" class="mb10" type="flex" justify="end" style="margin-top: 15px;">
         <el-col :span="1.5">
-          <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
+          <el-button type="primary" :size="size" plain @click="newAdd">新增</el-button>
         </el-col>
         <el-col :span="1.5">
-          <el-button size="small" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
+          <el-button :size="size" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
         </el-col>
         <el-col :span="1.5">
-          <el-button type="primary" size="small" plain
+          <el-button type="primary" :size="size" plain
                      @click="download('/system/apply/material/download',{},'申请单模板.xlsx')">模板下载
           </el-button>
         </el-col>
         <el-col :span="1.5">
-          <el-button size="small" @click="handleImport">批量导入</el-button>
+          <el-button :size="size" @click="handleImport">批量导入</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button :size="size" @click="handleBatchSubmit">批量提交</el-button>
         </el-col>
         <!-- 导入弹窗 -->
-        <el-dialog title="批量导入" :visible.sync="importData.show" width="35%" center
-                   :before-close="handlefileDialogColse">
+        <el-dialog 
+          title="批量导入" 
+          :visible.sync="importData.show" 
+          width="35%" 
+          center
+          :before-close="handlefileDialogColse"
+        >
           <div class="mb-import">
-            <el-upload class="upload-demo" accept=".xls, .xlsx" ref="upload" action="#" :on-remove="handleFileRemove"
-                       :file-list="importData.list" :auto-upload="false" :on-change="handleChangeFile" :limit="1">
+            <el-upload 
+              accept=".xls, .xlsx" 
+              ref="upload" 
+              action="#" 
+              :on-remove="handleFileRemove"
+              :file-list="importData.list" 
+              :auto-upload="false" 
+              :on-change="handleChangeFile" 
+              :limit="1"
+              style="text-align: center;"
+            >
               <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
-              <el-button style="margin-left: 10px;" size="small" type="success" @click="handleDownTemplate">下载模板
-              </el-button>
               <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
             </el-upload>
 
@@ -86,42 +61,24 @@
         <el-button type="primary" @click="handleImportData('confirm')">确 定</el-button>
       </span>
         </el-dialog>
-        <!-- <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>导入</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>导出</el-button>
-        </el-col> -->
-        <!-- <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>批量提交</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>批量删除</el-button>
-        </el-col> -->
       </el-row>
 
-      <el-card>
-        <el-table
-          :data="tableList"
-          class="request-table"
-          fit
-          max-height="680"
+      <div style="height: 600px;display: flex;">
+        <el-super-table
+          v-model="tableList"
+          :dict="dict"
+          :columns="TableColumns"
+          :size="size"
+          pagination
+          index
+          checkbox
+          convenitentOperation
+          :page="pageStatus"
+          @pagination="getList"
+          @row-dblclick="check"
           @selection-change="handleSelectionChange"
           @select="handleSelect"
         >
-          <el-table-column type="selection" width="45"></el-table-column>
-          <el-table-column label="序号" align="center" type="index" width="50"/>
-          <el-table-column label="所属组织" align="center" width="200" prop="orgName"/>
-          <el-table-column label="单据编码" align="center" width="200" prop="billCode"/>
-          <el-table-column label="申请人" align="center" prop="createName"/>
-          <el-table-column label="申请时间" align="center" width="150" prop="createTime"/>
-          <el-table-column label="单据状态" align="center" prop="status" :formatter="statusJug"/>
-          <!-- <el-table-column label="物料编码" align="center" width="150" prop="materialCode" /> -->
-          <el-table-column label="物料名称" align="center" width="150" prop="name"/>
-          <el-table-column label="创建人" align="center" prop="createName"/>
-          <el-table-column label="创建时间" align="center" width="150" prop="createTime"/>
-          <el-table-column label="最后修改人" align="center" width="120" prop="updateName"/>
-          <el-table-column label="最后修改时间" align="center" width="150" prop="updateTime"/>
           <el-table-column
             fixed="right"
             label="操作"
@@ -129,50 +86,77 @@
             width="180"
           >
             <template slot-scope="scope">
-              <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
-              <el-button @click="edit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text"
-                         size="small">编辑
-              </el-button>
-              <!-- <el-button @click="commit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">提交</el-button> -->
-              <el-button type="text" size="small" @click="deleteRow(scope.row)"
-                         v-if="scope.row.status == 0 || scope.row.status == 3">删除
-              </el-button>
+              <el-button 
+                type="text" 
+                :size="size" 
+                @click="check(scope.row)"
+              >查看</el-button>
+              <el-button 
+                @click="edit(scope.row)" 
+                v-if="scope.row.status == 0 || scope.row.status == 3" 
+                type="text"
+                :size="size"
+              >编辑</el-button>
+              <el-button 
+                @click="jumpFlow(scope.row)" 
+                v-if="scope.row.oaId && scope.row.oaId !=''" 
+                type="text"
+                :size="size"
+              >流程跳转</el-button>
+              <el-button 
+                type="text" 
+                :size="size"
+                @click="deleteRow(scope.row)"
+                v-if="scope.row.status == 0 || scope.row.status == 3"
+              >删除</el-button>
             </template>
           </el-table-column>
-        </el-table>
+        </el-super-table>
+      </div>
+       
 
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :page-sizes="[5, 10, 15, 20]"
-          :page-size=queryParams.pageSize
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="total"
-          style="text-align: center;">
-        </el-pagination>
       </el-card>
     </div>
 
-    <component :is="isComponent" v-model="isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"
-               v-if="!isList"/>
+    <component 
+      :is="isComponent" 
+      v-model="isList" 
+      :pageStu="page" 
+      :disable="disable" 
+      :row="rowDetail" 
+      @refresh="getList"
+      v-if="!isList
+    "/>
   </div>
 </template>
 
 <script>
   import addReq from './add.vue';
-  import {getReqList, delReq, importData, fileImport} from '@/api/requisition/basic';
+  import {getReqList, delReq, importData, fileImport,betchSubmit,toOA} from '@/api/requisition/basic';
   import {saveAs} from "file-saver";
   import { blobValidate } from "@/utils/ruoyi";
+  import { SearchColumns, TableColumns } from './columns';
+  import { initDicts } from "@/utils/init.js";
+
 
   export default {
     name: 'requisition',
+    dicts:[...initDicts([...SearchColumns,...TableColumns])],
     components: {
-      addReq
+      addReq,
+      ElSuperTable: () => import("@/components/super-table/index.vue"),
+      ElSuperSearch: () => import("@/components/super-search/index.vue"),
     },
     data() {
+      const params = this.$init.params(SearchColumns);
       return {
         failLoad: false,
         tableList: [],
+        size:'mini',
+        params:params,
+        SearchColumns:SearchColumns,
+        TableColumns:TableColumns,
+        pageStatus: { pageNum: 1, pageSize: 10, total: 0 },
         queryParams: {
           billCode: '',
           name: '',
@@ -211,11 +195,82 @@
       this.getList(this.queryParams)
     },
     methods: {
+      // 批量提交
+      async handleBatchSubmit(){
+          let filterList = this.checkedList.filter(item => !(item.status == '0' || item.status == '3') )
+          
+          if(!filterList.length &&  this.checkedList.length){  
+
+            try {
+
+              this.failLoad = true;
+              
+              let ids = this.checkedList.map( item => Number(item.id));
+              
+              let {code,msg} = await betchSubmit(ids);
+
+              if(code == 200){
+                this.reset();
+              }
+
+              this.$notify({
+                title: code == 200 ? msg : 'error',
+                type: code == 200 ? 'success' :'error',
+                message: code == 200 ?'' :msg,
+              });
+
+              // if(code == 200){
+              //   this.$notify.success({
+              //     title: msg,
+              //   });
+              // }else{
+              //   this.$notify.error({
+              //     title: '错误',
+              //     message: msg,
+              //   });
+              // }
+
+            } catch (error) {
+              
+            }finally{
+              this.failLoad = false;
+            }
+
+          }else{
+            this.$notify.warning({
+              title: '警告',
+              message: '存在不符合提交条件数据或未选择数据!',
+            });
+          }
+      },
+
+      async jumpFlow (row){
+
+        const {name} = this.$store.state.user;
+
+        try {
+
+          let {code,msg,oaUrl} = await toOA(name,row.id);
+
+          if(code == 200){
+            window.open(oaUrl)
+          }
+          
+        } catch (error) {
+          
+        }finally{
+
+        }
+      },
+
       reset() {
-        this.queryParams.billCode = ''
-        this.queryParams.name = ''
-        this.queryParams.status = ''
-        this.queryParams.pageNum = 1
+        // this.queryParams.billCode = ''
+        // this.queryParams.name = ''
+        // this.queryParams.status = ''
+        // this.queryParams.pageNum = 1
+        this.pageStatus.pageNum = 1;
+        this.pageStatus.pageSize = 10;
+        this.params = this.$init.params(SearchColumns);
         this.getList(this.queryParams)
       },
       newAdd() {
@@ -301,6 +356,10 @@
             break;
         }
       },
+      handlefileDialogColse(done){
+        this.importData.list = [];
+        done();
+      },
       // Select框
       handleSelect(selection, row) {
 
@@ -311,10 +370,12 @@
       },
       getList(val) {
         console.log('val', val)
-        getReqList(val).then(res => {
+        
+        getReqList({...this.params,...this.pageStatus}).then(res => {
           if (res.code === 200) {
-            this.tableList = res.rows
-            this.total = res.total
+            this.tableList = res.rows;
+            // this.total = res.total;
+            this.pageStatus.total = res.total;
           }
         })
         this.checkedList = [];
@@ -332,8 +393,8 @@
         }
       },
       //
-      handleSelectionChange() {
-
+      handleSelectionChange(selection) {
+        this.checkedList = selection;
       },
       check(row) {
         console.log('查看详情', row)
@@ -388,7 +449,7 @@
 
 <style scoped lang="scss">
   .requisition {
-    height: calc(100vh - 84px);
+    // height: calc(100vh - 84px);
     padding: 12px;
     box-sizing: border-box;
   }

+ 67 - 20
src/views/purchase/DemandSummary/index.vue

@@ -28,7 +28,7 @@
                 @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
                 style="width: 200px"
                 >
-                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.name" />
+                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
               </el-form-item>
             </el-col>
@@ -123,27 +123,14 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-              <!-- <el-col :span="1.5">
-                <el-form-item label="转请购时间">
-                  <el-select v-model="queryParams.ywlx" size="mini" style="width: 200px" clearable>
-                    <el-option
-                      v-for="item in options"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value">
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col> -->
             </el-row>
 
             <el-row :gutter="10">
               <el-col :span="1.5">
                 <el-form-item label="物料编码">
-                  <el-input clearable size="mini" v-model="queryParams.names" @clear="queryParams.materialCode = ''" @focus="chooseMaterial" style="width: 200px">
+                  <el-input clearable size="mini" v-model="queryParams.names" @clear="clearMaterial" style="width: 200px" @paste.native="pasteMe($event)">
                     <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
                   </el-input>
-                  <el-input v-show="false" v-model="queryParams.materialCode"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="1.5">
@@ -191,6 +178,31 @@
                   </el-date-picker>
                 </el-form-item>
               </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="是否客户指定">
+                  <el-select clearable v-model="queryParams.isCustomerSpecified" size="mini" style="width: 200px">
+                    <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="1.5">
+                <el-form-item label="是否紧急需求">
+                  <el-select clearable v-model="queryParams.isUrgency" size="mini" style="width: 200px">
+                    <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
             </el-row>
           </div>
           </CollapseTransition>
@@ -354,6 +366,8 @@ import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import popDialog from '@/components/PopDialog/index.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
+// 用于物料参照框数据
+import {getRefer} from '@/api/purchase/basic.js'
 import {getSummaryList, auditSummary, confirmSummary , cancelSummary , shutDownSummary, editSummaryList, exportList, exportItems } from '@/api/purchase/DemandSummary.js'
 export default {
   name: 'demandSummary',
@@ -444,11 +458,13 @@ export default {
         customer: '',
         lastWarehouse: '',
         lastAllocation: '',
-        materialCode: '',
+        materialCodeList: [],
         names: '',
         purchaseOrg: '',
         demandDate: '',
         approverFinishTime: '',
+        isCustomerSpecified: '',
+        isUrgency: '',
         pageNum: 1,
         pageSize: 10
       },
@@ -542,11 +558,13 @@ export default {
         customer: '',
         lastWarehouse: '',
         lastAllocation: '',
-        materialCode: '',
+        materialCodeList: [],
         names: '',
         purchaseOrg: '',
         demandDate: '',
         approverFinishTime: '',
+        isCustomerSpecified: '',
+        isUrgency: '',
         pageNum: 1,
         pageSize: 10
       }
@@ -774,7 +792,7 @@ export default {
     },
     selectionsToInput2(selection) {
       this.classOptions.push(selection)
-      this.queryParams.materialClassifyFour = selection.name
+      this.queryParams.materialClassifyFour = selection.id
     },
     // 搜索区物料编码
     chooseMaterial() {
@@ -782,8 +800,37 @@ export default {
     },
     selectMaterial(selection) {
       console.log('选择的物料', selection)
-      this.queryParams.materialCode = selection[0].code
-      this.queryParams.names = selection[0].name
+      this.queryParams.materialCodeList = selection.map(item => {return item.code})
+      console.log(this.queryParams.materialCodeList)
+      this.queryParams.names = (selection.map(item => {return item.name})).join(',')
+    },
+    // 清空物料搜索框
+    clearMaterial() {
+      this.queryParams.names = ''
+      this.queryParams.materialCodeList = []
+    },
+    // 粘贴来的数据
+    async pasteMe(e) {
+      this.$modal.loading("正在粘贴数据...");
+      e.preventDefault() //阻止默认粘贴事件
+      let source = e.clipboardData.getData("Text");
+      // 首先对源头进行解析
+      let rows = source.split("\r\n"); // 拆成一个数组
+      // 数组去除空字符串
+      rows = rows.filter(item => {
+        return item && item.trim()
+      })
+      await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
+        this.$modal.closeLoading();
+        if (res.code === 200) {
+          let rowList = res.rows
+          console.log('粘贴的', rowList)
+          this.queryParams.materialCodeList = rowList.map(item => {return item.code})
+          this.queryParams.names = (rowList.map(item => {return item.name})).join(',')
+        }
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
     },
         // 明细行选择业务部门参照带出业务部门数据
     chooseSon(index, type, isPage, title) {

+ 63 - 8
src/views/purchase/PurchaseDemandList/add.vue

@@ -43,8 +43,8 @@
         </el-col>
 
         <el-col :span="1.5">
-          <el-form-item label="需求计划">
-            <el-select :disabled="sonDisable" v-model="basicForm.planType" size="mini" style="width: 200px">
+          <el-form-item label="需求计划" prop="planType" :rules="{ required: true, message: '请选择需求计划', trigger: 'blur' }">
+            <el-select :disabled="sonDisable" v-model="basicForm.planType" size="mini" style="width: 200px" @change="changeplanType()">
               <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
               </el-option>
             </el-select>
@@ -55,7 +55,7 @@
           <el-form-item label="需求日期" prop="demandDate" :rules="{ required: true, message: '请选择需求日期', trigger: 'blur' }">
             <el-date-picker
               v-model="basicForm.demandDate"
-              :disabled="sonDisable"
+              disabled
               clearable
               type="date"
               value-format="yyyy-MM-dd"
@@ -424,7 +424,7 @@
       </el-table>
     </el-form>
       <div class="btn_group">
-        <el-button type="primary" size="mini"  @click="jumpOA" v-if="sonPageStu == 'check' && (row.status == '1' || row.status == '2') && basicForm.flowId">审批</el-button>
+        <el-button type="primary" size="mini"  @click="jumpOA" v-if="sonPageStu == 'check' && (row.status == '1' || row.status == '2') && basicForm.flowId">流程跳转</el-button>
         <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
         <el-button type="primary" size="mini"  @click="editPage" v-if="sonPageStu == 'check' && row.status == '0'">编辑</el-button>
         <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
@@ -571,9 +571,8 @@ export default {
         demandPersonalName: '',
         demandDept: '',
         demandDeptName: '',
-        planType: '1',
+        planType: 'ZJH',
         demandDate: '',
-        createTime: '',
         source: '4',
         billType: 'ZQBH',
         isCustomerSpecified: 'N',
@@ -610,7 +609,7 @@ export default {
       customerOptions: [],
       pickerOptionsEnd: {
         disabledDate: (time) => {
-          return time.getTime() < Date.now() - 1 * 24 * 60 * 60 * 1000
+          return time.getTime() < new Date(this.basicForm.demandDate).getTime() - 8.64e7
         }
       },
       isBDXQ: false,
@@ -753,6 +752,8 @@ export default {
     } else if(this.pageStu == 'edit') {
       this.getDetails(this.row)
     } else if (this.pageStu == 'add') {
+      // 新增时判断需求日期
+      this.dafaultDate()
       this.loading = false
       this.basicForm.demandPersonal = this.$store.state.user.name
       this.basicForm.demandPersonalName = this.$store.state.user.nickName
@@ -763,6 +764,58 @@ export default {
     }
   },
   methods: {
+    // 默认需求日期根据当天星期几判断
+    dafaultDate() {
+      // 获取当前时间
+      let date = new Date()
+      //获取当前时间的年份转为字符串
+      let year = date.getFullYear().toString()  
+      //获取月份,由于月份从0开始,此处要加1,判断是否小于10,如果是在字符串前面拼接'0'
+      let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : (date.getMonth() + 1).toString()  //'04'
+      //获取天,判断是否小于10,如果是在字符串前面拼接'0'
+      let da = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate().toString()  //'12'
+      let today = year + '-' + month + '-' + da
+      console.log('今天日期',today)
+      let weekDay = date.getDay()
+      console.log('今天星期几', weekDay)
+      // 改变需求计划的判断写这里面了
+      if (this.basicForm.planType == 'JJXQ') {
+        this.basicForm.demandDate = today
+      } else {
+        if (weekDay == 0) {this.basicForm.demandDate = this.getNextDate(today, 2)} 
+        else if (weekDay == 1) {this.basicForm.demandDate = this.getNextDate(today, 1)}
+        else if (weekDay == 2) {this.basicForm.demandDate = today}
+        else if (weekDay == 3) {this.basicForm.demandDate = this.getNextDate(today, 6)}
+        else if (weekDay == 4) {this.basicForm.demandDate = this.getNextDate(today, 5)}
+        else if (weekDay == 5) {this.basicForm.demandDate = this.getNextDate(today, 4)}
+        else if (weekDay == 6) {this.basicForm.demandDate = this.getNextDate(today, 3)}
+        // console.log(this.getNextDate(today, 2))
+      }
+    },
+    // 获取某天日期的下一天,默认为第二天 默认输出格式为yyyy-mm-dd
+    getNextDate(date, day = 1, format = '{y}-{m}-{d}') {
+      if (date) {
+        date = date.match(/\d+/g).join('-'); // 格式为2022年09月19日处理
+        const nDate = new Date(date);
+        nDate.setDate(nDate.getDate() + day);
+ 
+        const formatObj = {
+          y: nDate.getFullYear(),
+          m: nDate.getMonth() + 1,
+          d: nDate.getDate(),
+        };
+        return format.replace(/{([ymd])+}/g, (result, key) => {
+          const value = formatObj[key];
+          return value.toString().padStart(2, '0');
+        });
+      } else {
+        console.log('date格式不正确');
+      }
+    },
+    // 改变需求计划改变需求日期
+    changeplanType() {
+      this.dafaultDate()
+    },
     // 无限滚动加载配置
     load() {
       if (this.loadDisabled) return;
@@ -856,6 +909,8 @@ export default {
       this.basicForm.demandPersonalName = this.$store.state.user.nickName
       this.basicForm.demandDept = this.$store.state.user.deptId
       this.basicForm.demandDeptName = this.$store.state.user.deptName
+      // 复制时判断需求日期
+      this.dafaultDate()
       if (this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
       if (this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
       this.basicForm.puDemandItemList.forEach(item => {
@@ -1703,7 +1758,7 @@ export default {
         ]; 
       }
     },
-    // 审批
+    // 流程跳转
     jumpOA() {
       toOA(this.$store.state.user.name, this.basicForm.flowId).then(res => {
         if(res.code === 200) {

+ 39 - 3
src/views/purchase/PurchaseDemandList/index.vue

@@ -115,6 +115,14 @@
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
+              <el-form-item label="需求计划">
+                <el-select clearable v-model="queryParams.planType" size="mini" style="width: 200px">
+                  <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
               <el-form-item label="备注">
                 <el-input
                   v-model.trim="queryParams.remark"
@@ -179,6 +187,7 @@
           <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
           <el-table-column show-overflow-tooltip label="需求单号" align="center" width="170" prop="code"/>
           <el-table-column show-overflow-tooltip label="需求日期" align="center" width="120" prop="demandDate"/>
+          <el-table-column show-overflow-tooltip label="需求计划" align="center" width="120" prop="planType" :formatter="formatterPlanType"/>
           <el-table-column show-overflow-tooltip label="审批结束日期" align="center" width="120" prop="approverFinishTime"/>
           <el-table-column show-overflow-tooltip label="单据状态" align="center" prop="satus" :formatter="formatterStatus"/>
           <el-table-column show-overflow-tooltip label="业务类型" align="center" width="120" prop="billType" :formatter="formatterBillType"/>
@@ -252,6 +261,13 @@
     <!-- 模板下载新增参数 -->
     <el-dialog title="需求模板下载" :visible.sync="download.open" @close="clearDownload" width="400px">
       <el-row style="margin-bottom: 20px;">
+        <span style="margin-right: 10px;">需求计划</span>
+        <el-select size="mini" v-model="download.planType">
+          <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
+          </el-option>
+        </el-select>
+      </el-row>
+      <el-row style="margin-bottom: 20px;">
         <span style="margin-right: 10px;">需求客户</span>
         <el-select clearable size="mini" v-model="download.customer" @clear="download.customer = ''" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')">
           <el-option v-for="item in mBcustomer" :key="item.id" :label="item.name" :value="item.code" />
@@ -310,7 +326,7 @@ export default {
     Refers,
     TreeRefers
   },
-  dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business', 'sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
+  dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business', 'sys_reserve_ratio', 'sys_period_unit', 'sys_price_type', 'sys_plan_type'],
   data() {
     return {
       loading: true,
@@ -332,6 +348,7 @@ export default {
       // 模板下载参数
       download: {
         open: false,
+        planType: 'ZJH',
         customer: '',
         warehouse: '',
         warehouseId: '',
@@ -354,6 +371,7 @@ export default {
         isProcess: '',
         demandPersonal: '',
         source: '',
+        planType: '',
         billType: '',
         demandDept: '',
         demandDate: '',
@@ -388,6 +406,16 @@ export default {
   },
   methods: {
     // 格式化表格内容
+    formatterPlanType(row) {
+      switch(row.planType){
+        case 'ZJH':
+          return '周计划'
+        case 'YJH':
+          return '月计划'
+        case 'JJXQ':
+          return '紧急计划'
+      }
+    },
     formatterStatus(row) {
       switch(row.status){
         case '0':
@@ -444,6 +472,7 @@ export default {
         isProcess: '',
         demandPersonal: '',
         source: '',
+        planType: '',
         billType: '',
         demandDept: '',
         demandDate: '',
@@ -473,8 +502,9 @@ export default {
       console.log('选中数组', this.ids.join())
     },
     mbDownload() {
+      this.$modal.loading("正在下载模板,请稍后...");
       downLoadDemand(this.download).then(res => {
-        console.log('下载的文件流', res)
+        this.$modal.closeLoading();
         const blob = new Blob([res], {
           type: "application/vnd.ms-excel;charset=UTF-8",
         });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
@@ -484,12 +514,14 @@ export default {
         // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
         // var name = fileName.split(";")[0]; //切割成文件名
         downloadElement.href = href;  //下载地址
-        downloadElement.download = '模板'; // 下载后文件名
+        downloadElement.download = '采购需求单模板'+ this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
         document.body.appendChild(downloadElement);
         downloadElement.click(); // 点击下载
         document.body.removeChild(downloadElement); // 下载完成移除元素
         window.URL.revokeObjectURL(href); // 释放blob对象
         this.download.open = false
+      }).catch(err => {
+        this.$modal.closeLoading();
       })
     },
     // 关闭模板下载弹窗清空参数
@@ -497,6 +529,7 @@ export default {
       // 模板下载参数
       this.download =  {
         open: false,
+        planType: 'ZJH',
         customer: '',
         warehouse: '',
         warehouseId: '',
@@ -517,9 +550,11 @@ export default {
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {
       this.upload.isUploading = true;
+      this.$modal.loading("正在导入数据,请稍后...");
     },
     // 文件上传成功处理
     handleFileSuccess(response, file, fileList) {
+      this.$modal.closeLoading();
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
@@ -527,6 +562,7 @@ export default {
       this.getList(this.queryParams);
     },
     errorFile(err) {
+      this.$modal.closeLoading();
       this.$modal.notifyError("文件已变动,请重新上传");
     },
     // 提交上传文件

+ 75 - 50
src/views/purchase/apply/add/columns.js

@@ -1,4 +1,5 @@
 import CONFIG from "@/config";
+import { iunitprice } from "@/utils/expression";
 
 export default function useColumns() {
   const TableColumns = [
@@ -68,15 +69,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 +118,7 @@ export default function useColumns() {
           item: { key: "materialName", title: "物料名称", require: true },
           attr: {
             is: "el-popover-select-v2",
+            checkbox: true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -144,7 +143,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 +152,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 +169,8 @@ export default function useColumns() {
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
+            value: 1,
+            disabled: true,
           },
         },
         {
@@ -179,6 +180,7 @@ export default function useColumns() {
             valueKey: "ntaxrate",
             referName: "TAX_RATE_PARAM",
             dataMapping: { tax: "ntaxrate" },
+            disabled: true,
           },
         },
         {
@@ -193,10 +195,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
-              prop.price = ((taxPrice / (tax / 100 + 1)) * 1).toFixed(
-                CONFIG.precision
-              );
-              return prop.price;
+              return (prop.price = iunitprice(tax, taxPrice));
             },
           },
         },
@@ -251,12 +250,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 +271,7 @@ export default function useColumns() {
           attr: {
             is: "el-select",
             dictName: "is_effective",
+            disabled: true,
           },
         },
         {
@@ -284,7 +292,7 @@ export default function useColumns() {
         },
 
         {
-          item: { width:100,key: "isChannel", title: "是否渠道变更" },
+          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
@@ -292,68 +300,80 @@ export default function useColumns() {
           },
         },
         {
-          item: { width:100,key: "brandReplacement", title: "是否品牌替换" },
+          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
             value: "N",
           },
-        },{
-          item: { width:100,key: "priceDiffer", title: "单价差" },
+        },
+        {
+          item: { width: 100, key: "priceDiffer", title: "单价差" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { taxPrice = 0, recentlyPrice = 0 } = prop;
+              return (prop.priceDiffer = (
+                Number(taxPrice) - Number(recentlyPrice)
+              ));
             },
           },
         },
 
         {
-          item: { width:100,key: "increase", title: "涨幅" },
+          item: { width: 100, key: "increase", title: "涨幅(%)" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, recentlyPrice = 0 } = prop;
+              return (prop.increase = recentlyPrice
+                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
+                    2
+                  )
+                : "0.00");
             },
           },
         },
 
         {
-          item: { width:100,key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
         {
-          item: { width:100,key: "yAffectedAmount", title: "预计年影响量" },
+          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yAffectedAmount = (
+                Number(priceDiffer) * Number(yPurchaseQuantity)
+              ));
             },
           },
         },
 
         {
-          item: { width:150,key: "supplierName", title: "供应商名称" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice", title: "中标价" },
+          item: { width: 150, key: "supplierName", title: "供应商名称" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice", title: "中标价" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice", title: "单价" },
+        },
+        {
+          item: { width: 150, key: "unitPrice", title: "单价" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit", title: "利润比" },
+        },
+        {
+          item: { width: 150, key: "profit", title: "利润比" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -361,22 +381,25 @@ export default function useColumns() {
         },
 
         {
-          item: { width:150,key: "supplierName1", title: "供应商名称1" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice1", title: "中标价1" },
+          item: { width: 150, key: "supplierName1", title: "供应商名称1" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice1", title: "中标价1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice1", title: "单价1" },
+        },
+        {
+          item: { width: 150, key: "unitPrice1", title: "单价1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit1", title: "利润比1" },
+        },
+        {
+          item: { width: 150, key: "profit1", title: "利润比1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -384,28 +407,30 @@ export default function useColumns() {
         },
 
         {
-          item: { width:150,key: "supplierName2", title: "供应商名称2" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice2", title: "中标价2" },
+          item: { width: 150, key: "supplierName2", title: "供应商名称2" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice2", title: "中标价2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice2", title: "单价2" },
+        },
+        {
+          item: { width: 150, key: "unitPrice2", title: "单价2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit2", title: "利润比2" },
+        },
+        {
+          item: { width: 150, key: "profit2", title: "利润比2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
         },
-
         { item: { key: "createByName", title: "创建人名称" }, attr: {} },
         { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
       ],

+ 89 - 90
src/views/purchase/apply/add/index.vue

@@ -57,43 +57,58 @@ 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;
+      const { nickName: createByName } = this.$store.state.user;
+      if (selectData.length) {
+        this.params[this.tabName].splice(-1);
+      }
+      for (const item of selectData) {
+        this.loading = true;
+        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 });
+        this.loading = false;
+        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),
+          createByName: createByName,
+          updateByName: createByName,
+          id: null,
+        });
+      }
     },
     //
     async onOpen() {
@@ -103,15 +118,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 +135,7 @@ export default {
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
     //
-    async onRowAdd(prop) {
+    async onRowAdd(prop, pushParams = {}) {
       const {
         $notify,
         TabColumns,
@@ -142,6 +153,7 @@ export default {
       this.params[prop].push({
         delFlag: "0",
         ...this.$init.params(TableColumns),
+        ...pushParams,
       });
     },
     //
@@ -214,20 +226,10 @@ export default {
         ref="superForm"
         label-width="auto"
         label-position="right"
-        style="padding: 20px"
+        style="padding: 18px"
       >
-        <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-tabs v-model="tabName" style="padding: 0 18px 18px">
         <el-tab-pane
           v-for="({ item, TableColumns: columns }, index) in TabColumns"
           :key="index"
@@ -235,48 +237,45 @@ export default {
           :name="item.key"
           lazy
         >
-          <el-super-table
-            v-model="params[item.key]"
-            :dict="dict"
-            :ref="tabName"
-            :columns="columns"
-            :size="$attrs.size"
-            style="padding: 20px 10px;height: 400px;"
-          >
-            <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>
   </el-button>
 </template>
 
-<style scoped>
-::v-deep .el-table__row.is-hidden {
-  display: none;
-}
-</style>
+<style scoped></style>

+ 18 - 21
src/views/purchase/apply/columns.js

@@ -2,35 +2,34 @@ import CONFIG from "@/config";
 
 export default function useColumns() {
   const TableColumns = [
-    { item: { key: "priceCode", title: "价格编码" ,  width:150 }, attr: {} },
+    { item: { key: "priceCode", title: "价格编码", width: 150 }, attr: {} },
     {
-      item: { key: "status", title: "状态" ,  width:100},
-      attr: { is: "el-dict-tag", dictName: "sys_status",  width:100 },
+      item: { key: "status", title: "状态", width: 100 },
+      attr: { is: "el-dict-tag", dictName: "sys_status", width: 100 },
     },
-    { item: { key: "supplierName", title: "供应商" ,  width:150}, attr: {} },
-    { item: { key: "currencyName", title: "币种" ,  width:100}, attr: {} },
+    { item: { key: "supplierName", title: "供应商", width: 150 }, attr: {} },
+    { item: { key: "currencyName", title: "币种", width: 100 }, attr: {} },
     {
-      item: { key: "explainStr", title: "价格合理性说明" ,  width:100},
+      item: { key: "explainStr", title: "价格合理性说明", width: 100 },
       attr: {},
     },
-    { item: { key: "buyerName", title: "采购员",  width:100 }, attr: {} },
-    { item: { key: "puDeptName", title: "采购部门" ,  width:100}, attr: {} },
+    { item: { key: "buyerName", title: "采购员", width: 100 }, attr: {} },
+    { item: { key: "puDeptName", title: "采购部门", width: 100 }, attr: {} },
     {
-      item: { key: "file", title: "附件", filter: false,  width:100 },
+      item: { key: "file", title: "附件", filter: false, width: 100 },
       attr: { is: "el-file-preview" },
     },
-    { item: { key: "createByName", title: "创建人",  width:100 }, attr: {} },
+    { item: { key: "createByName", title: "创建人", width: 100 }, attr: {} },
     {
-      item: { key: "isEffective", title: "是否已推价格" ,  width:100},
-      attr: { is: "el-dict-tag", dictName: "is_effective" ,  width:100},
+      item: { key: "isEffective", title: "是否已推价格", width: 100 },
+      attr: { is: "el-dict-tag", dictName: "is_effective", width: 100 },
     },
     {
-      item: { key: "effectiveDate", title: "生效日期" ,  width:100},
+      item: { key: "effectiveDate", title: "生效日期", width: 100 },
       attr: {},
     },
-    { item: { key: "source", title: "来源单据号",  width:100 }, attr: {} },
     {
-      item: { key: "sourceType", title: "来源单据类型" ,  width:100},
+      item: { key: "sourceType", title: "来源单据类型", width: 100 },
       attr: {},
     },
   ].map(({ item, attr }) => ({
@@ -44,19 +43,17 @@ export default function useColumns() {
     },
   }));
   const SearchColumns = [
-    
-    { 
-      item:{
+    {
+      item: {
         key: "priceCode",
-        title: "价格编码", 
+        title: "价格编码",
       },
       attr: {
-        clearable:true,
+        clearable: true,
         is: "el-input",
       },
     },
     {
-      
       item: { key: "supplierName", title: "供应商" },
       attr: {
         is: "el-popover-select-v2",

+ 77 - 49
src/views/purchase/apply/copy/columns.js

@@ -1,4 +1,5 @@
 import CONFIG from "@/config";
+import { iunitprice } from "@/utils/expression";
 
 export default function useColumns() {
   const TableColumns = [
@@ -68,15 +69,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 +118,7 @@ export default function useColumns() {
           item: { key: "materialName", title: "物料名称", require: true },
           attr: {
             is: "el-popover-select-v2",
+            checkbox: true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -132,6 +131,7 @@ export default function useColumns() {
               specification: "specification",
               manufacturer: "manufacturerId",
               manufacturerName: "manufacturerIdName",
+              tax: "materialRateName",
             },
           },
         },
@@ -143,7 +143,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",
@@ -152,7 +152,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "puUnitName", title: "采购单位" },
+          item: { key: "puUnitName", title: "采购单位", hidden: false },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "name",
@@ -169,6 +169,8 @@ export default function useColumns() {
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
+            value: 1,
+            disabled: true,
           },
         },
         {
@@ -178,6 +180,7 @@ export default function useColumns() {
             valueKey: "ntaxrate",
             referName: "TAX_RATE_PARAM",
             dataMapping: { tax: "ntaxrate" },
+            disabled: true,
           },
         },
         {
@@ -192,10 +195,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
-              prop.price = ((taxPrice / (tax / 100 + 1)) * 1).toFixed(
-                CONFIG.precision
-              );
-              return prop.price;
+              return (prop.price = iunitprice(tax, taxPrice));
             },
           },
         },
@@ -250,12 +250,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,
           },
         },
         {
@@ -263,6 +271,7 @@ export default function useColumns() {
           attr: {
             is: "el-select",
             dictName: "is_effective",
+            disabled: true,
           },
         },
         {
@@ -281,8 +290,9 @@ export default function useColumns() {
             value: "N",
           },
         },
+
         {
-          item: { width:100,key: "isChannel", title: "是否渠道变更" },
+          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
@@ -290,68 +300,80 @@ export default function useColumns() {
           },
         },
         {
-          item: { width:100,key: "brandReplacement", title: "是否品牌替换" },
+          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
             value: "N",
           },
-        },{
-          item: { width:100,key: "priceDiffer", title: "单价差" },
+        },
+        {
+          item: { width: 100, key: "priceDiffer", title: "单价差" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { taxPrice = 0, recentlyPrice = 0 } = prop;
+              return (prop.priceDiffer = (
+                Number(taxPrice) - Number(recentlyPrice)
+              ));
             },
           },
         },
 
         {
-          item: { width:100,key: "increase", title: "涨幅" },
+          item: { width: 100, key: "increase", title: "涨幅(%)" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, recentlyPrice = 0 } = prop;
+              return (prop.increase = recentlyPrice
+                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
+                    2
+                  )
+                : "0.00");
             },
           },
         },
 
         {
-          item: { width:100,key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
         {
-          item: { width:100,key: "yAffectedAmount", title: "预计年影响量" },
+          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yAffectedAmount = (
+                Number(priceDiffer) * Number(yPurchaseQuantity)
+              ));
             },
           },
         },
 
         {
-          item: { width:150,key: "supplierName", title: "供应商名称" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice", title: "中标价" },
+          item: { width: 150, key: "supplierName", title: "供应商名称" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice", title: "中标价" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice", title: "单价" },
+        },
+        {
+          item: { width: 150, key: "unitPrice", title: "单价" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit", title: "利润比" },
+        },
+        {
+          item: { width: 150, key: "profit", title: "利润比" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -359,22 +381,25 @@ export default function useColumns() {
         },
 
         {
-          item: { width:150,key: "supplierName1", title: "供应商名称1" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice1", title: "中标价1" },
+          item: { width: 150, key: "supplierName1", title: "供应商名称1" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice1", title: "中标价1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice1", title: "单价1" },
+        },
+        {
+          item: { width: 150, key: "unitPrice1", title: "单价1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit1", title: "利润比1" },
+        },
+        {
+          item: { width: 150, key: "profit1", title: "利润比1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -382,22 +407,25 @@ export default function useColumns() {
         },
 
         {
-          item: { width:150,key: "supplierName2", title: "供应商名称2" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice2", title: "中标价2" },
+          item: { width: 150, key: "supplierName2", title: "供应商名称2" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice2", title: "中标价2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice2", title: "单价2" },
+        },
+        {
+          item: { width: 150, key: "unitPrice2", title: "单价2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit2", title: "利润比2" },
+        },
+        {
+          item: { width: 150, key: "profit2", title: "利润比2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,

+ 95 - 89
src/views/purchase/apply/copy/index.vue

@@ -18,7 +18,7 @@ const fetchExist = async (prop) => {
 };
 
 export default {
-  name: "AddDrawer",
+  name: "CopyDrawer",
   props: {
     dict: {
       type: Object,
@@ -73,43 +73,58 @@ 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;
+      const { nickName: createByName } = this.$store.state.user;
+      if (selectData.length) {
+        this.params[this.tabName].splice(-1);
+      }
+      for (const item of selectData) {
+        this.loading = true;
+        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 });
+        this.loading = false;
+        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),
+          createByName: createByName,
+          updateByName: createByName,
+          id: null,
+        });
+      }
     },
     //
     async fetchItem(prop) {
@@ -127,13 +142,13 @@ export default {
             ...this.$init.params(TableColumns),
             ...item,
           }));
-          return true;
         } else {
-          return false;
+          this.visible = false;
         }
       } catch (err) {
         // catch
         console.error(err);
+        this.visible = false;
       } finally {
         // finally
         this.loading = false;
@@ -141,10 +156,10 @@ export default {
     },
     //
     async onOpen() {
+      this.visible = true;
       const {
         selectData: [{ id }],
       } = this.$props;
-      this.visible = await this.fetchItem(id);
       this.params.id = null;
       this.params.createBy = null;
       this.params.priceCode = null;
@@ -159,6 +174,7 @@ export default {
         updateByName: null,
         delFlag: 0,
       }));
+      await this.fetchItem(id);
     },
     //
     async onHide() {
@@ -167,7 +183,7 @@ export default {
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
     //
-    async onRowAdd(prop) {
+    async onRowAdd(prop, pushParams = {}) {
       const {
         $notify,
         TabColumns,
@@ -185,6 +201,7 @@ export default {
       this.params[prop].push({
         delFlag: "0",
         ...this.$init.params(TableColumns),
+        ...pushParams,
       });
     },
     //
@@ -199,6 +216,7 @@ export default {
         if (valid) {
           try {
             this.loading = true;
+            this.params.priceApplyOrgs = [];
             const { msg, code } = await SAVE(this.params);
             if (code === 200) {
               this.onHide();
@@ -263,20 +281,10 @@ export default {
         ref="superForm"
         label-width="auto"
         label-position="right"
-        style="padding: 20px"
+        style="padding: 18px"
       >
-        <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-tabs v-model="tabName" style="padding: 0 18px 18px">
         <el-tab-pane
           v-for="({ item, TableColumns: columns }, index) in TabColumns"
           :key="index"
@@ -284,47 +292,45 @@ 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>
   </el-button>
 </template>
 
-<style scoped>
-::v-deep .el-table__row.is-hidden {
-  display: none;
-}
-</style>
+<style scoped></style>

+ 76 - 50
src/views/purchase/apply/edit/columns.js

@@ -1,4 +1,5 @@
 import CONFIG from "@/config";
+import { iunitprice } from "@/utils/expression";
 
 export default function useColumns() {
   const TableColumns = [
@@ -68,15 +69,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 +118,7 @@ export default function useColumns() {
           item: { key: "materialName", title: "物料名称", require: true },
           attr: {
             is: "el-popover-select-v2",
+            checkbox: true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -132,6 +131,7 @@ export default function useColumns() {
               specification: "specification",
               manufacturer: "manufacturerId",
               manufacturerName: "manufacturerIdName",
+              tax: "materialRateName",
             },
           },
         },
@@ -143,7 +143,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",
@@ -152,7 +152,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "puUnitName", title: "采购单位" },
+          item: { key: "puUnitName", title: "采购单位", hidden: false },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "name",
@@ -169,6 +169,8 @@ export default function useColumns() {
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
+            value: 1,
+            disabled: true,
           },
         },
         {
@@ -178,6 +180,7 @@ export default function useColumns() {
             valueKey: "ntaxrate",
             referName: "TAX_RATE_PARAM",
             dataMapping: { tax: "ntaxrate" },
+            disabled: true,
           },
         },
         {
@@ -192,10 +195,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
-              prop.price = ((taxPrice / (tax / 100 + 1)) * 1).toFixed(
-                CONFIG.precision
-              );
-              return prop.price;
+              return (prop.price = iunitprice(tax, taxPrice));
             },
           },
         },
@@ -250,12 +250,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,
           },
         },
         {
@@ -263,6 +271,7 @@ export default function useColumns() {
           attr: {
             is: "el-select",
             dictName: "is_effective",
+            disabled: true,
           },
         },
         {
@@ -283,7 +292,7 @@ export default function useColumns() {
         },
 
         {
-          item: { width:100,key: "isChannel", title: "是否渠道变更" },
+          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
@@ -291,68 +300,80 @@ export default function useColumns() {
           },
         },
         {
-          item: { width:100,key: "brandReplacement", title: "是否品牌替换" },
+          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
             value: "N",
           },
-        },{
-          item: { width:100,key: "priceDiffer", title: "单价差" },
+        },
+        {
+          item: { width: 100, key: "priceDiffer", title: "单价差" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { taxPrice = 0, recentlyPrice = 0 } = prop;
+              return (prop.priceDiffer = (
+                Number(taxPrice) - Number(recentlyPrice)
+              ));
             },
           },
         },
 
         {
-          item: { width:100,key: "increase", title: "涨幅" },
+          item: { width: 100, key: "increase", title: "涨幅(%)" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, recentlyPrice = 0 } = prop;
+              return (prop.increase = recentlyPrice
+                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
+                    2
+                  )
+                : "0.00");
             },
           },
         },
 
         {
-          item: { width:100,key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
         {
-          item: { width:100,key: "yAffectedAmount", title: "预计年影响量" },
+          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yAffectedAmount = (
+                Number(priceDiffer) * Number(yPurchaseQuantity)
+              ));
             },
           },
         },
 
         {
-          item: { width:150,key: "supplierName", title: "供应商名称" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice", title: "中标价" },
+          item: { width: 150, key: "supplierName", title: "供应商名称" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice", title: "中标价" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice", title: "单价" },
+        },
+        {
+          item: { width: 150, key: "unitPrice", title: "单价" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit", title: "利润比" },
+        },
+        {
+          item: { width: 150, key: "profit", title: "利润比" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -360,22 +381,25 @@ export default function useColumns() {
         },
 
         {
-          item: { width:150,key: "supplierName1", title: "供应商名称1" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice1", title: "中标价1" },
+          item: { width: 150, key: "supplierName1", title: "供应商名称1" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice1", title: "中标价1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice1", title: "单价1" },
+        },
+        {
+          item: { width: 150, key: "unitPrice1", title: "单价1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit1", title: "利润比1" },
+        },
+        {
+          item: { width: 150, key: "profit1", title: "利润比1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -383,28 +407,30 @@ export default function useColumns() {
         },
 
         {
-          item: { width:150,key: "supplierName2", title: "供应商名称2" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice2", title: "中标价2" },
+          item: { width: 150, key: "supplierName2", title: "供应商名称2" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice2", title: "中标价2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice2", title: "单价2" },
+        },
+        {
+          item: { width: 150, key: "unitPrice2", title: "单价2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit2", title: "利润比2" },
+        },
+        {
+          item: { width: 150, key: "profit2", title: "利润比2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
         },
-
         { item: { key: "createByName", title: "创建人名称" }, attr: {} },
         { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
       ],

+ 88 - 82
src/views/purchase/apply/edit/index.vue

@@ -96,43 +96,58 @@ 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;
+      const { nickName: createByName } = this.$store.state.user;
+      if (selectData.length) {
+        this.params[this.tabName].splice(-1);
+      }
+      for (const item of selectData) {
+        this.loading = true;
+        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 });
+        this.loading = false;
+        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),
+          createByName: createByName,
+          updateByName: createByName,
+          id: null,
+        });
+      }
     },
     //
     async fetchItem(prop) {
@@ -176,7 +191,7 @@ export default {
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
     //
-    async onRowAdd(prop) {
+    async onRowAdd(prop, pushParams = {}) {
       const {
         $notify,
         TabColumns,
@@ -194,6 +209,7 @@ export default {
       this.params[prop].push({
         delFlag: "0",
         ...this.$init.params(TableColumns),
+        ...pushParams,
       });
     },
     //
@@ -280,61 +296,51 @@ export default {
         ref="superForm"
         label-width="auto"
         label-position="right"
-        style="padding: 20px"
+        style="padding: 18px"
       >
-        <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-tabs v-model="tabName" style="padding: 0 18px 18px">
         <el-tab-pane
           v-for="({ item, TableColumns: columns }, index) in TabColumns"
           :key="index"
           :label="item.title"
           :name="item.key"
           lazy
-        >
-          <el-super-table
-            v-model="priceApply[item.key]"
-            :dict="dict"
-            :ref="tabName"
-            :columns="columns"
-            :size="$attrs.size"
-            style="padding: 20px 10px;height: 400px;"
-          >
-            <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="priceApply[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>

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

@@ -103,7 +103,11 @@ export default {
     ></el-super-search>
     <el-row class="my-4" style="text-align: right">
       <el-button-group>
-        <add-button :size="size" :dict="dict" @success="useQuery(params, page)"></add-button>
+        <add-button
+          :size="size"
+          :dict="dict"
+          @success="useQuery(params, page)"
+        ></add-button>
         <copy-button
           :size="size"
           :dict="dict"
@@ -152,6 +156,7 @@ export default {
       checkbox
       pagination
       convenitentOperation
+      storage-key="PuchaseApplySuperTable1"
       @row-dblclick="useSee"
       @row-select="useSelect"
       @pagination="useQuery(params, page)"

+ 107 - 87
src/views/purchase/apply/see/columns.js

@@ -3,62 +3,58 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { width:100,key: "priceCode", title: "价格编码" },
+      item: { width: 100, key: "priceCode", title: "价格编码" },
       attr: {},
     },
     {
-      item: { width:100,key: "supplierName", title: "供应商" },
+      item: { width: 100, key: "supplierName", title: "供应商" },
       attr: {},
     },
     {
-      item: { width:100,key: "puOrgName", title: "采购组织" },
+      item: { width: 100, key: "puOrgName", title: "采购组织" },
       attr: {},
     },
     {
-      item: { width:100,key: "currencyName", title: "币种" },
+      item: { width: 100, key: "currencyName", title: "币种" },
       attr: {},
     },
     {
-      item: { width:100,key: "explainStr", title: "价格合理性说明" },
+      item: { width: 100, key: "explainStr", title: "价格合理性说明" },
       attr: {},
     },
     {
-      item: { width:100,key: "buyerName", title: "采购员" },
+      item: { width: 100, key: "buyerName", title: "采购员" },
       attr: {},
     },
     {
-      item: { width:100,key: "puDeptName", title: "采购部门" },
+      item: { width: 100, key: "puDeptName", title: "采购部门" },
       attr: {},
     },
     {
-      item: { width:100,key: "createByName", title: "创建人" },
+      item: { width: 100, key: "createByName", title: "创建人" },
       attr: {},
     },
     {
-      item: { width:100,key: "source", title: "来源单据号" },
-      attr: {},
-    },
-    {
-      item: { width:100,key: "isEffective", title: "是否已推价格" },
+      item: { key: "isEffective", title: "是否已推价格" },
       attr: {
         is: "el-dict-tag",
         dictName: "is_effective",
       },
     },
     {
-      item: { width:100,key: "effectiveDate", title: "生效日期" },
+      item: { width: 100, key: "effectiveDate", title: "生效日期" },
       attr: {},
     },
     {
-      item: { width:100,key: "file", title: "附件" },
+      item: { width: 100, key: "file", title: "附件" },
       attr: { is: "el-file-preview" },
     },
     {
-      item: { width:100,key: "sourceType", title: "来源单据类型" },
+      item: { width: 100, key: "sourceType", title: "来源单据类型" },
       attr: {},
     },
     {
-      item: { width:100,key: "status", title: "单据状态" },
+      item: { width: 100, key: "status", title: "单据状态" },
       attr: {
         is: "el-dict-tag",
         dictName: "sys_status",
@@ -70,104 +66,114 @@ export default function useColumns() {
     {
       item: {
         title: "物料信息表",
-        width:100,key: "priceApplyItems",
+        width: 100,
+        key: "priceApplyItems",
       },
       attr: {
         value: [],
       },
       TableColumns: [
         {
-          item: { width:100,key: "materialName", title: "物料名称" },
+          item: { width: 100, key: "materialName", title: "物料名称" },
+          attr: {},
+        },
+        {
+          item: { width: 100, key: "materialCode", title: "物料编码" },
           attr: {},
         },
-        { item: { width:100,key: "materialCode", title: "物料编码" }, attr: {} },
-        { item: { width:100,key: "manufacturerName", title: "生产厂家" }, attr: {} },
-        { item: { width:100,key: "specification", title: "规格" }, attr: {} },
-        { item: { width:100,key: "model", title: "型号" }, attr: {} },
         {
-          item: { width:100,key: "unitName", title: "单位" },
+          item: { width: 100, key: "manufacturerName", title: "生产厂家" },
           attr: {},
         },
+        { item: { width: 100, key: "specification", title: "规格" }, attr: {} },
+        { item: { width: 100, key: "model", title: "型号" }, attr: {} },
         {
-          item: { width:100,key: "puUnitName", title: "采购单位" },
+          item: { width: 100, key: "unitName", title: "单位" },
           attr: {},
         },
         {
-          item: { width:100,key: "conversionRate", title: "采购换算率" },
+          item: { width: 100, key: "puUnitName", title: "采购单位" },
+          attr: {},
+        },
+        {
+          item: { width: 100, key: "conversionRate", title: "采购换算率" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
         {
-          item: { width:100,key: "tax", title: "税率%" },
+          item: { width: 100, key: "tax", title: "税率%" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
         {
-          item: { width:100,key: "taxPrice", title: "含税单价" },
+          item: { width: 100, key: "taxPrice", title: "含税单价" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
         {
-          item: { width:100,key: "price", title: "无税单价" },
+          item: { width: 100, key: "price", title: "无税单价" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
         {
-          item: { width:100,key: "currencyName", title: "币种" },
+          item: { width: 100, key: "currencyName", title: "币种" },
+          attr: {},
+        },
+        {
+          item: { width: 100, key: "periodBegin", title: "价格有效期(起)" },
           attr: {},
         },
         {
-          item: { width:100,key: "periodBegin", title: "价格有效期(起)" },
+          item: { width: 100, key: "periodEnd", title: "价格有效期(止)" },
           attr: {},
         },
         {
-          item: { width:100,key: "periodEnd", title: "价格有效期(止)" },
+          item: { width: 100, key: "customerName", title: "客户" },
           attr: {},
         },
         {
-          item: { width:100,key: "customerName", title: "客户" },
+          item: { width: 100, key: "recentlyPrice", title: "最近价格" },
           attr: {},
         },
-        { item: { width:100,key: "recentlyPrice", title: "最近价格" }, attr: {} },
         {
-          item: { width:100,key: "isApprovalFirst", title: "首次报批" },
+          item: { width: 100, key: "isApprovalFirst", title: "首次报批" },
           attr: {
             is: "el-dict-tag",
             dictName: "is_effective",
           },
         },
         {
-          item: { width:100,key: "isPriceAdjustment", title: "价格调整" },
+          item: { width: 100, key: "isPriceAdjustment", title: "价格调整" },
           attr: {
             is: "el-dict-tag",
             dictName: "is_effective",
           },
         },
         {
-          item: { width:100,key: "priceType", title: "价格类型" },
+          item: { width: 100, key: "priceType", title: "价格类型" },
           attr: {
             is: "el-dict-tag",
             dictName: "sys_price_type",
           },
         },
         {
-          item: { width:100,key: "isDistributionPrice", title: "配送价" },
+          item: { width: 100, key: "isDistributionPrice", title: "配送价" },
           attr: {
             is: "el-dict-tag",
             dictName: "is_effective",
@@ -175,148 +181,162 @@ export default function useColumns() {
         },
 
         {
-          item: { width:100,key: "isChannel", title: "是否渠道变更" },
+          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
           attr: {
             is: "el-dict-tag",
             dictName: "is_effective",
           },
         },
         {
-          item: { width:100,key: "brandReplacement", title: "是否品牌替换" },
+          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
           attr: {
             is: "el-dict-tag",
             dictName: "is_effective",
           },
-        },{
-          item: { width:100,key: "priceDiffer", title: "单价差" },
+        },
+        {
+          item: { width: 100, key: "priceDiffer", title: "单价差" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
 
         {
-          item: { width:100,key: "increase", title: "涨幅" },
+          item: { width: 100, key: "increase", title: "涨幅" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
 
         {
-          item: { width:100,key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
         {
-          item: { width:100,key: "yAffectedAmount", title: "预计年影响量" },
+          item: { width: 100, key: "yAffectedAmount", title: "预计年影响量" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
 
         {
-          item: { width:100,key: "supplierName", title: "供应商名称" },
+          item: { width: 100, key: "supplierName", title: "供应商名称" },
           attr: {},
-        },{
-          item: { width:100,key: "bidPrice", title: "中标价" },
+        },
+        {
+          item: { width: 100, key: "bidPrice", title: "中标价" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
-        },{
-          item: { width:100,key: "unitPrice", title: "单价" },
+        },
+        {
+          item: { width: 100, key: "unitPrice", title: "单价" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
-        },{
-          item: { width:100,key: "profit", title: "利润比" },
+        },
+        {
+          item: { width: 100, key: "profit", title: "利润比" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
 
         {
-          item: { width:100,key: "supplierName1", title: "供应商名称1" },
+          item: { width: 100, key: "supplierName1", title: "供应商名称1" },
           attr: {},
-        },{
-          item: { width:100,key: "bidPrice1", title: "中标价1" },
+        },
+        {
+          item: { width: 100, key: "bidPrice1", title: "中标价1" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
-        },{
-          item: { width:100,key: "unitPrice1", title: "单价1" },
+        },
+        {
+          item: { width: 100, key: "unitPrice1", title: "单价1" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
-        },{
-          item: { width:100,key: "profit1", title: "利润比1" },
+        },
+        {
+          item: { width: 100, key: "profit1", title: "利润比1" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
 
         {
-          item: { width:100,key: "supplierName2", title: "供应商名称2" },
+          item: { width: 100, key: "supplierName2", title: "供应商名称2" },
           attr: {},
-        },{
-          item: { width:100,key: "bidPrice2", title: "中标价2" },
+        },
+        {
+          item: { width: 100, key: "bidPrice2", title: "中标价2" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
-        },{
-          item: { width:100,key: "unitPrice2", title: "单价2" },
+        },
+        {
+          item: { width: 100, key: "unitPrice2", title: "单价2" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
-        },{
-          item: { width:100,key: "profit2", title: "利润比2" },
+        },
+        {
+          item: { width: 100, key: "profit2", title: "利润比2" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
 
-
-
-        { item: { width:100,key: "createByName", title: "创建人名称" }, attr: {} },
-        { item: { width:100,key: "updateByName", title: "更新人名称" }, attr: {} },
+        {
+          item: { width: 100, key: "createByName", title: "创建人名称" },
+          attr: {},
+        },
+        {
+          item: { width: 100, key: "updateByName", title: "更新人名称" },
+          attr: {},
+        },
       ],
     },
   ];

+ 60 - 40
src/views/purchase/catalogue/columns.js

@@ -3,67 +3,79 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { width:100,key: "puOrgName", title: "采购组织" },
+      item: { width: 100, key: "puOrgName", title: "采购组织" },
       attr: {},
     },
-    { item: { width:150,key: "materialName", title: "物料" }, attr: {} },
-    { item: { width:150,key: "materialCode", title: "物料编码" }, attr: {} },
-    { item: { width:100,key: "materialClassifyName", title: "物料一级分类" }, attr: {} },
-    { item: { width:100,key: "manufacturerName", title: "生产厂家名称" }, attr: {} },
-    { item: { width:100,key: "model", title: "物料型号" }, attr: {} },
-    { item: { width:100,key: "specification", title: "物料规格" }, attr: {} },
+    { item: { width: 150, key: "materialName", title: "物料" }, attr: {} },
+    { item: { width: 150, key: "materialCode", title: "物料编码" }, attr: {} },
     {
-      item: { width:100,key: "supplierName", title: "供应商名称" },
+      item: { width: 100, key: "materialClassifyName", title: "物料一级分类" },
       attr: {},
     },
-    { item: { width:100,key: "customerName", title: "客户" }, attr: {} },
     {
-      item: { width:100,key: "taxPrice", title: "主含税单价" },
+      item: { width: 100, key: "manufacturerName", title: "生产厂家名称" },
+      attr: {},
+    },
+    { item: { width: 100, key: "model", title: "物料型号" }, attr: {} },
+    { item: { width: 100, key: "specification", title: "物料规格" }, attr: {} },
+    {
+      item: { width: 100, key: "supplierName", title: "供应商名称" },
+      attr: {},
+    },
+    { item: { width: 100, key: "customerName", title: "客户" }, attr: {} },
+    {
+      item: { width: 100, key: "taxPrice", title: "主含税单价" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { taxPrice = 0 } = prop;
+          return taxPrice * 1;
         },
       },
     },
-    { item: { width:100,key: "unitName", title: "主单位" }, attr: {} },
-    { item: { width:100,key: "effectiveDate", title: "价格生效日期" }, attr: {} },
-    { item: { width:100,key: "endDate", title: "价格失效日期" }, attr: {} },
-    { item: { width:100,key: "buyerName", title: "采购员" }, attr: {} },
-    { item: { width:100,key: "applyCode", title: "来源单据" }, attr: {} },
+    { item: { width: 100, key: "unitName", title: "主单位" }, attr: {} },
+    {
+      item: { width: 100, key: "effectiveDate", title: "价格生效日期" },
+      attr: {},
+    },
+    { item: { width: 100, key: "endDate", title: "价格失效日期" }, attr: {} },
+    { item: { width: 100, key: "buyerName", title: "采购员" }, attr: {} },
+    { item: { width: 100, key: "applyCode", title: "来源单据" }, attr: {} },
     {
-      item: { width:100,key: "convertRate", title: "换算率" },
+      item: { width: 100, key: "convertRate", title: "换算率" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { convertRate = 0 } = prop;
+          return convertRate * 1;
         },
       },
     },
     {
-      item: { width:100,key: "status", title: "有效状态" },
+      item: { width: 100, key: "status", title: "有效状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { width:100,key: "enableStatus", title: "启用状态" },
+      item: { width: 100, key: "enableStatus", title: "启用状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { width:100,key: "materialStatus", title: "物料启用状态" },
+      item: { width: 100, key: "materialStatus", title: "物料启用状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { width:100,key: "isDistribution", title: "配送价" },
+      item: { width: 100, key: "isDistribution", title: "配送价" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { width:100,key: "priceType", title: "价格类型" },
+      item: { width: 100, key: "priceType", title: "价格类型" },
       attr: { is: "el-dict-tag", dictName: "sys_price_type" },
     },
-    { item: { width:100,key: "expiryEarly", title: "效期预警" }, attr: {} },
-    { item: { width:100,key: "priority", title: "含税/无税优先" }, attr: {} },
-    { item: { width:100,key: "createByName", title: "创建人" }, attr: {} },
-    { item: { width:100,key: "updateByName", title: "更新人名称" }, attr: {} },
+    { item: { width: 100, key: "expiryEarly", title: "效期预警" }, attr: {} },
+    { item: { width: 100, key: "priority", title: "含税/无税优先" }, attr: {} },
+    { item: { width: 100, key: "createByName", title: "创建人" }, attr: {} },
+    {
+      item: { width: 100, key: "updateByName", title: "更新人名称" },
+      attr: {},
+    },
   ].map(({ item, attr }) => ({
     attr,
     item: {
@@ -77,11 +89,11 @@ export default function useColumns() {
 
   const SearchColumns = [
     {
-      item: { width:100,key: "puOrgName", title: "采购组织" },
+      item: { width: 100, key: "puOrgName", title: "采购组织" },
       attr: {
         is: "el-popover-select-v2",
         referName: "ORG_PARAM",
-        valuewidth:100,key: "name",
+        valueKey: "name",
         dataMapping: {
           puOrg: "id",
           puOrgName: "name",
@@ -89,15 +101,23 @@ export default function useColumns() {
       },
     },
     {
-      item: { width:100,key: "manufacturer", title: "生产厂家" },
-      attr: { is: "el-input" },
+      item: { width: 100, key: "manufacturerName", title: "生产厂家" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "MANUFACTURER_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          manufacturer: "id",
+          manufacturerName: "name",
+        },
+      },
     },
     {
-      item: { width:100,key: "supplierName", title: "供应商" },
+      item: { width: 100, key: "supplierName", title: "供应商" },
       attr: {
         is: "el-popover-select-v2",
         referName: "SUPPLIER_PARAM",
-        valuewidth:100,key: "name",
+        valueKey: "name",
         dataMapping: {
           supplier: "id",
           supplierName: "name",
@@ -105,15 +125,15 @@ export default function useColumns() {
       },
     },
     {
-      item: { width:100,key: "applyCode", title: "来源单据" },
+      item: { width: 100, key: "applyCode", title: "来源单据" },
       attr: { is: "el-input" },
     },
     {
-      item: { width:100,key: "materialCode", title: "物料编码" },
+      item: { width: 100, key: "materialCode", title: "物料编码" },
       attr: {
         is: "el-popover-select-v2",
         referName: "MATERIAL_PARAM",
-        valuewidth:100,key: "code",
+        valueKey: "code",
         dataMapping: {
           material: "id",
           materialCode: "code",
@@ -121,11 +141,11 @@ export default function useColumns() {
       },
     },
     {
-      item: { width:100,key: "status", title: "有效状态" },
+      item: { width: 100, key: "status", title: "有效状态" },
       attr: { is: "el-select", dictName: "is_effective" },
     },
     {
-      item: { width:100,key: "enableStatus", title: "启用状态" },
+      item: { width: 100, key: "enableStatus", title: "启用状态" },
       attr: { is: "el-select", dictName: "is_effective" },
     },
   ];

+ 7 - 13
src/views/purchase/catalogue/export/index.vue

@@ -2,12 +2,8 @@
 export default {
   name: "ExportDialog",
   props: {
-    data: {
-      type: Object,
-      require: true,
-    },
-    page: {
-      type: Object,
+    selectData: {
+      type: Array,
       require: true,
     },
   },
@@ -29,14 +25,12 @@ export default {
             instance.confirmButtonText = "下载中...";
             try {
               // try
-              const {
-                data,
-                page: { pageNum, pageSize },
-              } = this.$props;
+              const { selectData } = this.$props;
+              const ids = selectData.map((item) => item.id);
               await this.download(
-                "pu/price/catalogue/export",
-                { ...data, pageNum, pageSize },
-                `catalogue_${new Date().getTime()}.xlsx`
+                "/pu/price/catalogue/exportByIds",
+                { ids: ids },
+                `价格目录_${new Date().getTime()}.xlsx`
               );
               await done();
             } catch (err) {

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

@@ -132,8 +132,7 @@ export default {
       <el-button-group>
         <exp-button
           :size="size"
-          :page="page"
-          :data="params"
+          :select-data="selectData"
           @success="useQuery(params, page)"
         ></exp-button>
       </el-button-group>
@@ -148,6 +147,7 @@ export default {
       checkbox
       pagination
       convenitentOperation
+      storage-key="PuchaseCatalogueSuperTable1"
       @row-dblclick="useSee"
       @selection-change="useSelect"
       @pagination="useQuery(params, page)"

+ 2 - 2
src/views/purchase/catalogue/see/columns.js

@@ -22,7 +22,7 @@ export default function useColumns() {
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          return (prop * 1);
         },
       },
     },
@@ -36,7 +36,7 @@ export default function useColumns() {
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          return (prop * 1);
         },
       },
     },

+ 2 - 2
src/views/purchase/contract/add/columns.js

@@ -414,7 +414,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { qty = 0, taxPrice = 0 } = prop;
-              prop.taxMoney = (qty * taxPrice * 1).toFixed(CONFIG.precision);
+              prop.taxMoney = (qty * taxPrice * 1);
               return prop.taxMoney;
             },
           },
@@ -440,7 +440,7 @@ export default function useColumns() {
                 qty *
                 (taxPrice / (tax / 100 + 1)) *
                 1
-              ).toFixed(CONFIG.precision);
+              );
               return prop.taxFreeMoney;
             },
           },

+ 93 - 66
src/views/purchase/contract/columns.js

@@ -2,240 +2,266 @@ import CONFIG from "@/config";
 
 export default function useColumns() {
   const TableColumns = [
-    { item: { width:100,key: "puOrgName", title: "采购组织" }, attr: {} },
-    { item: { width:100,key: "code", title: "合同编码" }, attr: {} },
+    { item: { width: 100, key: "puOrgName", title: "采购组织" }, attr: {} },
+    { item: { width: 100, key: "code", title: "合同编码" }, attr: {} },
     {
-      item: { width:100,key: "status", title: "状态" },
+      item: { width: 100, key: "status", title: "状态" },
       attr: { is: "el-dict-tag", dictName: "documents_status" },
     },
     {
-      item: { width:100,key: "lastPuMoney", title: "上年度采购额" },
+      item: { width: 100, key: "lastPuMoney", title: "上年度采购额" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { lastPuMoney = 0 } = prop;
+          return (lastPuMoney * 1);
         },
       },
     },
-    { item: { width:100,key: "buyerName", title: "采购员" }, attr: {} },
-    { item: { width:100,key: "supplierName", title: "供应商" }, attr: {} },
+    { item: { width: 100, key: "buyerName", title: "采购员" }, attr: {} },
+    { item: { width: 100, key: "supplierName", title: "供应商" }, attr: {} },
     {
-      item: { width:100,key: "contractType", title: "合同类型" },
+      item: { width: 100, key: "contractType", title: "合同类型" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_contract_type",
       },
     },
     {
-      item: { width:100,key: "puMoneyYear", title: "本年度采购额" },
+      item: { width: 100, key: "puMoneyYear", title: "本年度采购额" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { puMoneyYear = 0 } = prop;
+          return (puMoneyYear * 1);
         },
       },
     },
-    { item: { width:100,key: "puDeptName", title: "采购部门" }, attr: {} },
+    { item: { width: 100, key: "puDeptName", title: "采购部门" }, attr: {} },
     {
-      item: { width:100,key: "supplierTier", title: "供应商层级" },
+      item: { width: 100, key: "supplierTier", title: "供应商层级" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_supplier_tier",
       },
     },
     {
-      item: { width:100,key: "contractName", title: "合同名称" },
+      item: { width: 100, key: "contractName", title: "合同名称" },
       attr: {},
     },
     {
-      item: { width:100,key: "grossRateAverage", title: "平均毛利率 (%)" },
+      item: { width: 100, key: "grossRateAverage", title: "平均毛利率 (%)" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { grossRateAverage = 0 } = prop;
+          return (grossRateAverage * 1).toFixed(2);
         },
       },
     },
     {
-      item: { width:100,key: "approveFlow", title: "审批流程" },
+      item: { width: 100, key: "approveFlow", title: "审批流程" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_approve_flow",
       },
     },
     {
-      item: { width:100,key: "consumableClass", title: "耗材类别" },
+      item: { width: 100, key: "consumableClass", title: "耗材类别" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_consumable_class",
       },
     },
     {
-      item: { width:100,key: "effectiveDate", title: "合同生效日期" },
+      item: { width: 100, key: "effectiveDate", title: "合同生效日期" },
       attr: {},
     },
     {
-      item: { width:100,key: "brandGrossRate", title: "同类品牌及毛利率 (%)" },
+      item: {
+        width: 100,
+        key: "brandGrossRate",
+        title: "同类品牌及毛利率 (%)",
+      },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { brandGrossRate = 2 } = prop;
+          return (brandGrossRate * 1).toFixed(2);
         },
       },
     },
     {
-      item: { width:100,key: "contractFormat", title: "合同格式" },
+      item: { width: 100, key: "contractFormat", title: "合同格式" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_contract_format",
       },
     },
     {
-      item: { width:100,key: "productName", title: "产品类别&名称" },
+      item: { width: 100, key: "productName", title: "产品类别&名称" },
       attr: {},
     },
-    { item: { width:100,key: "endDate", title: "合同终止日期" }, attr: {} },
+    { item: { width: 100, key: "endDate", title: "合同终止日期" }, attr: {} },
     {
-      item: { width:100,key: "invoiceTax", title: "发票税率 (%)" },
+      item: { width: 100, key: "invoiceTax", title: "发票税率 (%)" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { invoiceTax } = prop;
+          return (invoiceTax * 1).toFixed(2);
         },
       },
     },
     {
-      item: { width:100,key: "emergencyDegree", title: "紧急程度" },
+      item: { width: 100, key: "emergencyDegree", title: "紧急程度" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_emergency_degree",
       },
     },
-    { item: { width:100,key: "project", title: "项目医院" }, attr: {} },
+    { item: { width: 100, key: "project", title: "项目医院" }, attr: {} },
     {
-      item: { width:100,key: "deliveryType", title: "交货方式" },
+      item: { width: 100, key: "deliveryType", title: "交货方式" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_delivery_type",
       },
     },
-    { item: { width:100,key: "source", title: "合同来源" }, attr: {} },
+    { item: { width: 100, key: "source", title: "合同来源" }, attr: {} },
     {
-      item: { width:100,key: "contractPartycName", title: "合同丙方" },
+      item: { width: 100, key: "contractPartycName", title: "合同丙方" },
       attr: {},
     },
     {
-      item: { width:100,key: "guaranteePeriodEnd", title: "质保期限" },
+      item: { width: 100, key: "guaranteePeriodEnd", title: "质保期限" },
       attr: {},
     },
     {
-      item: { width:100,key: "freightMethods", title: "运费承担方式" },
+      item: { width: 100, key: "freightMethods", title: "运费承担方式" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_freight_methods",
       },
     },
     {
-      item: { width:100,key: "signDate", title: "合同创建时间" },
+      item: { width: 100, key: "signDate", title: "合同创建时间" },
       attr: {},
     },
     {
-      item: { width:100,key: "isTarget", title: "是否有指标" },
+      item: { width: 100, key: "isTarget", title: "是否有指标" },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     {
-      item: { width:100,key: "contractTarget", title: "合同指标" },
+      item: { width: 100, key: "contractTarget", title: "合同指标" },
       attr: {},
     },
     {
-      item: { width:100,key: "exemptionPostageCondtion", title: "包邮条件" },
+      item: { width: 100, key: "exemptionPostageCondtion", title: "包邮条件" },
       attr: {},
     },
     {
-      item: { width:100,key: "isRebate", title: "是否有返利" },
+      item: { width: 100, key: "isRebate", title: "是否有返利" },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     {
-      item: { width:100,key: "rebatePolicy", title: "返利政策" },
+      item: { width: 100, key: "rebatePolicy", title: "返利政策" },
       attr: {},
     },
     {
-      item: { width:100,key: "externalContract", title: "外部合同号" },
+      item: { width: 100, key: "externalContract", title: "外部合同号" },
       attr: {},
     },
     {
-      item: { width:100,key: "rollbackPolicy", title: "退换货政策" },
+      item: { width: 100, key: "rollbackPolicy", title: "退换货政策" },
       attr: {},
     },
-    { item: { width:100,key: "enquiryCode", title: "询价单号" }, attr: {} },
+    { item: { width: 100, key: "enquiryCode", title: "询价单号" }, attr: {} },
     {
-      item: { width:100,key: "contractContent", title: "合同主要内容" },
+      item: { width: 100, key: "contractContent", title: "合同主要内容" },
       attr: {},
     },
     {
-      item: { width:100,key: "refusalReasons", title: "拒绝理由" },
+      item: { width: 100, key: "refusalReasons", title: "拒绝理由" },
       attr: {},
     },
     {
-      item: { width:100,key: "pigeonhole", title: "是否归档" },
+      item: { width: 100, key: "pigeonhole", title: "是否归档" },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     {
-      item: { width:100,key: "pigeonholeFile", title: "归档附件" },
+      item: {
+        width: 100,
+        key: "pigeonholeFile",
+        title: "归档附件",
+        filterabled: false,
+      },
       attr: { is: "el-file-preview" },
     },
     {
-      item: { width:100,key: "externalFile", title: "对外附件" },
+      item: {
+        width: 100,
+        key: "externalFile",
+        title: "对外附件",
+        filterabled: false,
+      },
       attr: { is: "el-file-preview" },
     },
     {
-      item: { width:100,key: "puFile", title: "采购商盖章合同附件" },
+      item: {
+        width: 100,
+        key: "puFile",
+        title: "采购商盖章合同附件",
+        filterabled: false,
+      },
       attr: { is: "el-file-preview" },
     },
     {
-      item: { width:100,key: "supplierFile", title: "供应商盖章合同附件" },
+      item: {
+        width: 100,
+        key: "supplierFile",
+        title: "供应商盖章合同附件",
+        filterabled: false,
+      },
       attr: { is: "el-file-preview" },
     },
-    { item: { width:100,key: "projectCode", title: "项目编号" }, attr: {} },
-    { item: { width:100,key: "projectName", title: "项目名称" }, attr: {} },
-    { item: { width:100,key: "area", title: "区域" }, attr: {} },
+    { item: { width: 100, key: "projectCode", title: "项目编号" }, attr: {} },
+    { item: { width: 100, key: "projectName", title: "项目名称" }, attr: {} },
+    { item: { width: 100, key: "area", title: "区域" }, attr: {} },
     {
-      item: { width:100,key: "consigneePhone", title: "收货人联系方式" },
+      item: { width: 100, key: "consigneePhone", title: "收货人联系方式" },
       attr: {},
     },
     {
-      item: { width:100,key: "paymentAgreement", title: "付款协议" },
+      item: { width: 100, key: "paymentAgreement", title: "付款协议" },
       attr: {},
     },
     {
-      item: { width:100,key: "taxPrice", title: "价税合计" },
+      item: { width: 100, key: "taxPrice", title: "价税合计" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return prop ? (prop * 1).toFixed(CONFIG.precision) : "0.000000";
+          const { taxPrice = 0 } = prop;
+          return (taxPrice * 1);
         },
       },
     },
-    { item: { width:100,key: "currencyName", title: "币种" }, attr: {} },
+    { item: { width: 100, key: "currencyName", title: "币种" }, attr: {} },
     {
-      item: { width:100,key: "guaranteePeriod", title: "质保期" },
+      item: { width: 100, key: "guaranteePeriod", title: "质保期" },
       attr: {},
     },
   ].map(({ item, attr }) => ({
     attr,
     item: {
-      ...item,
       sortabled: true,
       fixedabled: true,
       filterabled: true,
       hiddenabled: true,
+      ...item,
     },
   }));
 
   const SearchColumns = [
     {
       item: {
-        width:100,key: "contractName",
+        width: 100,
+        key: "contractName",
         title: "合同名称",
       },
       attr: {
@@ -243,7 +269,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { width:100,key: "status", title: "状态" },
+      item: { width: 100, key: "status", title: "状态" },
       attr: {
         is: "el-select",
         dictName: "documents_status",
@@ -251,7 +277,8 @@ export default function useColumns() {
     },
     {
       item: {
-        width:100,key: "pigeonhole",
+        width: 100,
+        key: "pigeonhole",
         title: "是否归档",
       },
       attr: {

+ 2 - 2
src/views/purchase/contract/edit/columns.js

@@ -413,7 +413,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { qty = 0, taxPrice = 0 } = prop;
-              prop.taxMoney = (qty * taxPrice * 1).toFixed(CONFIG.precision);
+              prop.taxMoney = (qty * taxPrice * 1);
               return prop.taxMoney;
             },
           },
@@ -439,7 +439,7 @@ export default function useColumns() {
                 qty *
                 (taxPrice / (tax / 100 + 1)) *
                 1
-              ).toFixed(CONFIG.precision);
+              );
               return prop.taxFreeMoney;
             },
           },

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

@@ -38,7 +38,7 @@ export default {
               await this.download(
                 "pu/contract/export",
                 { ...data, pageNum, pageSize },
-                `contract_${new Date().getTime()}.xlsx`
+                `采购合同_${new Date().getTime()}.xlsx`
               );
               await done();
             } catch (err) {

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

@@ -182,6 +182,7 @@ export default {
       checkbox
       pagination
       convenitentOperation
+      storage-key="PuchaseContractSuperTable1"
       @row-dblclick="useSee"
       @selection-change="useSelect"
       @pagination="useQuery(params, page)"

+ 2 - 2
src/views/purchase/contract/see/columns.js

@@ -411,7 +411,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { qty = 0, taxPrice = 0 } = prop;
-              prop.taxMoney = (qty * taxPrice * 1).toFixed(CONFIG.precision);
+              prop.taxMoney = (qty * taxPrice * 1);
               return prop.taxMoney;
             },
           },
@@ -437,7 +437,7 @@ export default function useColumns() {
                 qty *
                 (taxPrice / (tax / 100 + 1)) *
                 1
-              ).toFixed(CONFIG.precision);
+              );
               return prop.taxFreeMoney;
             },
           },

+ 15 - 15
src/views/purchase/purchase-order/add/column.js

@@ -156,7 +156,7 @@ export const Columns = [
     title: "价税合计", 
     inputType: "InputNumber",
     controlsPosition: "right", 
-    precision:2,
+    // precision:2,
     isShow:true, 
     disabled:true,
   },
@@ -165,7 +165,7 @@ export const Columns = [
     title: "原始总金额", 
     inputType: "InputNumber",
     controlsPosition: "right", 
-    precision:2,
+    // precision:2,
     isShow:true, 
     disabled:true,
   },
@@ -174,7 +174,7 @@ export const Columns = [
     title: "无税金额", 
     inputType: "InputNumber",  
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true, 
     disabled:true,
   },
@@ -236,7 +236,7 @@ export const Columns = [
     title: "订单使用返利金额", 
     inputType: "InputNumber",
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true, 
     require: true,
   },
@@ -245,7 +245,7 @@ export const Columns = [
     title: "订单抵扣余款金额", 
     inputType: "InputNumber",
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true, 
     require: true,
   },
@@ -371,7 +371,7 @@ export const Columns = [
     title: "累计付款申请金额", 
     inputType: "InputNumber", 
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true,
     disabled:true,
   },
@@ -380,7 +380,7 @@ export const Columns = [
     title: "累计付款金额", 
     inputType: "InputNumber", 
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true,
   },
   { 
@@ -388,7 +388,7 @@ export const Columns = [
     title: "发票金额", 
     inputType: "InputNumber",
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true,
    },
   {
@@ -669,7 +669,7 @@ export const TabColumns = [
         title: "含税单价", 
         inputType: "InputNumber",
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         require: true,
         disabled:true,
         width: 180,
@@ -679,7 +679,7 @@ export const TabColumns = [
         title: "价税合计", 
         inputType: "InputNumber",
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
        },
@@ -689,7 +689,7 @@ export const TabColumns = [
         // inputType: "Input",
         inputType: "InputNumber",
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
       },
@@ -698,7 +698,7 @@ export const TabColumns = [
         title: "折扣金额", 
         inputType: "InputNumber",
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
        },
@@ -723,7 +723,7 @@ export const TabColumns = [
         title: "无税单价",
         inputType: "InputNumber",
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
       },
@@ -732,7 +732,7 @@ export const TabColumns = [
         title: "无税金额", 
         inputType: "InputNumber", 
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
       },
@@ -835,7 +835,7 @@ export const TabColumns = [
         title: "原始金额", 
         inputType: "InputNumber", 
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
       },

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

@@ -304,9 +304,12 @@ export default {
     },
     fetchSubmit(puOrderIds){
 
-      try {
+      this.handleConfirmTips(async()=>{
+      
+        try {
 
-        this.handleConfirmTips(async()=>{
+
+          this.loading = true;
 
           let { code } = await orderApi.submit({ puOrderIds});
 
@@ -316,8 +319,12 @@ export default {
 
           }
 
+        }  catch (error) {} 
+        finally{
+          this.loading = false;
+        }
         })
-      } catch (error) {} 
+     
     },
 
     // 判断“整单退回”按钮
@@ -662,7 +669,10 @@ export default {
           :disabled="judgeIsLineReturn()"
         >行退回</el-button>
       </el-row>
-      <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px;height: 1000px;">
+      <el-tabs 
+        v-model="tabName" 
+        @tab-click="handleTabClick" 
+        style="width: 100%;padding: 20px 10px;">
         <el-tab-pane 
           v-for="(column, index) in tabColumns" 
           :key="index" 
@@ -670,10 +680,9 @@ export default {
           :name="column.key"
         >
           <el-super-table
-            style="padding: 20px 10px;height: 800px;"
+            style="height: 300px;"
             v-model="tabTableDatas[column.key]"
             :ref="column.key"
-            max-height="500"
             :dict="dict"
             :columns="column.tableColumns"
             :selectable="setTabSelectable"

+ 7 - 5
src/views/purchase/task/xie-yi-zhi-cai/column.js

@@ -18,8 +18,10 @@ export const TableColumns = [
     attr: {},
   },
   {
-    item: { key: "supplierName", title: "供应商" },
-    attr: {},
+    item: { key: "supplierName", title: "供应商", filterabled:true, },
+    attr: {
+     
+    },
   },
   {
     item: { key: "customerName", title: "客户" },
@@ -42,7 +44,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop * 1).toFixed(CONFIG.precision);
+        return (prop * 1);
       },
     },
   },
@@ -51,7 +53,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop * 1).toFixed(CONFIG.precision);
+        return (prop * 1);
       },
     },
   },
@@ -60,7 +62,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop * 1).toFixed(CONFIG.precision);
+        return (prop * 1);
       },
     },
   },

+ 9 - 5
src/views/purchase/task/xie-yi-zhi-cai/index.vue

@@ -57,6 +57,7 @@ export default {
             orderPriceVos: item.orderPriceVos.map((cItem) => ({
               ...item,
               ...cItem,
+              purchaseQuantity: item.orderPriceVos.length === 1 ? (item.puQty - item.executeQty) : undefined
             })),
           }));
           return true;
@@ -119,19 +120,21 @@ export default {
     >
       <template slot="title">
         <span>{{ title }}</span>
+
         <el-button
+          type="primary"
           :size="$attrs.size"
           :loading="loading"
-          @click="visible = false"
-          >取 消</el-button
+          @click="submit(data)"
+          >确 认</el-button
         >
         <el-button
-          type="primary"
           :size="$attrs.size"
           :loading="loading"
-          @click="submit(data)"
-          >确 认</el-button
+          @click="visible = false"
+          >取 消</el-button
         >
+        
       </template>
       <div v-for="(item, index) in data" :key="index" class="m-4">
         <h3 class="mb-4">
@@ -147,6 +150,7 @@ export default {
           :columns="tableColumns"
           :size="$attrs.size"
           :dict="dict"
+          
         >
           <template slot="purchaseQuantity" slot-scope="scope">
             <component

+ 1 - 1
src/views/purchase/transferOrder/add.vue

@@ -1338,7 +1338,7 @@
             (row.status == '1' || row.status == '2') &&
             row.oaId
           "
-          >审批</el-button
+          >流程跳转</el-button
         >
         <el-button
           type="primary"

+ 2 - 2
vue.config.js

@@ -37,7 +37,7 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://172.16.100.107:8080/drp-admin`, //测试
-      //  target: `http://test-sy.derom.com/drp-admin`, //测试
+       target: `http://test-sy.derom.com/drp-admin`, //测试
         // target: `http://release-sy.derom.com/drp-admin`, //预发
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
@@ -47,7 +47,7 @@ module.exports = {
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.21:8000/drp-admin`, //CKF本地
         // target: `http://172.16.13.43:8000/drp-admin`, //lz's localhost
-       target: `http://172.16.63.126:8000/drp-admin`, //wjie
+      //  target: `http://172.16.63.126:8000/drp-admin`, //wjie
          // target: `http://127.0.0.1:8000/drp-admin`,
         changeOrigin: true,
         pathRewrite: {