瀏覽代碼

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

001295 1 年之前
父節點
當前提交
da475c5c89
共有 70 個文件被更改,包括 4223 次插入2026 次删除
  1. 8 0
      src/api/changeApply/basic.js
  2. 7 0
      src/api/purchase/purchaseDemand.js
  3. 2 1
      src/assets/styles/sidebar.scss
  4. 13 5
      src/components/PopDialog/index.vue
  5. 0 1
      src/components/popover-select-v2/index.vue
  6. 15 0
      src/components/popover-select/components/MANUFACTURER_PARAM.js
  7. 48 0
      src/components/popover-select/components/MATERIAL_PARAM.js
  8. 2 2
      src/components/popover-tree-select/index.vue
  9. 14 2
      src/components/super-form/index.vue
  10. 111 101
      src/components/super-search/index.vue
  11. 66 58
      src/components/super-table/index.vue
  12. 8 17
      src/components/super-table/once/filters.vue
  13. 25 14
      src/components/super-table/once/freeze.vue
  14. 1 1
      src/components/super-table/once/hide.vue
  15. 25 14
      src/components/super-table/once/sort.vue
  16. 2 1
      src/layout/index.vue
  17. 26 0
      src/main.js
  18. 1 1
      src/utils/request.js
  19. 47 9
      src/views/business/spd/goal_management/AnnualSaleGoal.vue
  20. 55 11
      src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue
  21. 47 9
      src/views/business/spd/goal_management/MonthGoalMerge.vue
  22. 49 10
      src/views/business/spd/goal_management/MonthReturnGoal.vue
  23. 58 17
      src/views/business/spd/goal_management/MonthReturnMerge.vue
  24. 47 9
      src/views/business/spd/goal_management/MonthSaleGoal.vue
  25. 7 7
      src/views/material/basicFile/details.vue
  26. 6 13
      src/views/material/basicFile/index.vue
  27. 0 825
      src/views/material/changeApply/add.vue
  28. 399 0
      src/views/material/changeApply/add/column.js
  29. 432 0
      src/views/material/changeApply/add/index.vue
  30. 7 0
      src/views/material/changeApply/amendantRecord/column.js
  31. 102 0
      src/views/material/changeApply/amendantRecord/index.vue
  32. 128 0
      src/views/material/changeApply/batchImport/index.vue
  33. 77 0
      src/views/material/changeApply/columns.js
  34. 15 0
      src/views/material/changeApply/dicts.js
  35. 142 239
      src/views/material/changeApply/index.vue
  36. 289 0
      src/views/material/changeApply/see/index.vue
  37. 9 8
      src/views/purchase/DemandSummary/add.vue
  38. 6 5
      src/views/purchase/DemandSummary/index.vue
  39. 6 5
      src/views/purchase/MaterialClassDivision/index.vue
  40. 305 142
      src/views/purchase/PurchaseDemandList/add.vue
  41. 4 5
      src/views/purchase/PurchaseDemandList/index.vue
  42. 1 1
      src/views/purchase/apply/add/columns.js
  43. 44 187
      src/views/purchase/apply/add/index.vue
  44. 8 2
      src/views/purchase/apply/columns.js
  45. 291 0
      src/views/purchase/apply/copy/columns.js
  46. 322 0
      src/views/purchase/apply/copy/index.vue
  47. 291 0
      src/views/purchase/apply/edit/columns.js
  48. 339 0
      src/views/purchase/apply/edit/index.vue
  49. 19 17
      src/views/purchase/apply/index.vue
  50. 11 8
      src/views/purchase/catalogue/columns.js
  51. 15 8
      src/views/purchase/catalogue/index.vue
  52. 29 29
      src/views/purchase/contract/add/index.vue
  53. 7 1
      src/views/purchase/contract/columns.js
  54. 35 31
      src/views/purchase/contract/edit/columns.js
  55. 22 24
      src/views/purchase/contract/edit/index.vue
  56. 21 22
      src/views/purchase/contract/index.vue
  57. 6 5
      src/views/purchase/deliveryAddress/index.vue
  58. 6 0
      src/views/purchase/purchase-order/add/index.vue
  59. 6 0
      src/views/purchase/purchase-order/edit/index.vue
  60. 26 16
      src/views/purchase/purchase-order/index.vue
  61. 6 0
      src/views/purchase/purchase-order/see/index.vue
  62. 7 1
      src/views/purchase/task/columns.js
  63. 19 28
      src/views/purchase/task/index.vue
  64. 0 0
      src/views/purchase/task/see/columns.js
  65. 13 2
      src/views/purchase/task/see/index.vue
  66. 23 11
      src/views/purchase/task/xie-yi-zhi-cai/column.js
  67. 31 84
      src/views/purchase/task/xie-yi-zhi-cai/index.vue
  68. 9 12
      src/views/purchase/transferOrder/add.vue
  69. 5 4
      src/views/purchase/transferOrder/index.vue
  70. 0 1
      vue.config.js

+ 8 - 0
src/api/changeApply/basic.js

@@ -62,3 +62,11 @@ export function getProductFactory(data) {
     data: data
   })
 }
+// 获取生产厂家列表信息
+export function getRecordList(params) {
+  return request({
+    url: `/material/record/list`,
+    method: 'get',
+    params: params
+  })
+}

+ 7 - 0
src/api/purchase/purchaseDemand.js

@@ -78,4 +78,11 @@ export function queryMan(id) {
     url: `/material/division/queryBuyer?materialId=${id}`,
     method: 'get',
   })
+}
+// 跳转OA
+export function toOA(userName, fdId) {
+  return request({
+    url: `/oaflow/redirectToOa/${userName}/${fdId}`,
+    method: 'get',
+  })
 }

+ 2 - 1
src/assets/styles/sidebar.scss

@@ -4,7 +4,7 @@
     min-height: 100%;
     transition: margin-left .28s;
     margin-left: $base-sidebar-width;
-    margin-left: 0;
+    // margin-left: 0;
     position: relative;
   }
 
@@ -110,6 +110,7 @@
 
   .hideSidebar {
     .sidebar-container {
+      // display: none;
       width: 54px !important;
     }
 

+ 13 - 5
src/components/PopDialog/index.vue

@@ -21,7 +21,7 @@
           </el-header>
           <el-main>
             <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable" @row-click="rowSelect"
-              @select="handleSelectionChange" height="calc(100% - 40px)" style="width: 100%">
+              @select="handleSelectionChange" :selection="selectedRows" @selection-change="watchSel"  height="calc(100% - 40px)" style="width: 100%">
               <el-table-column type="selection" header-align="center" align="center" width="50">
               </el-table-column>
               <el-table-column prop="code" header-align="center" align="center" sortable="custom" min-width="90"
@@ -67,6 +67,7 @@ export default {
       orders: [],
       loading: false,
       visible: false,
+      selectedRows:[]
     };
   },
   props: {
@@ -79,7 +80,7 @@ export default {
     // 是否启用单选
     single: {
       type: Boolean,
-      default: false
+      default: true
     }
   },
   methods: {
@@ -136,14 +137,21 @@ export default {
       this.searchForm.pageNo = 1;
       this.refreshList();
     },
+    watchSel(rows) {
+      console.log('监听得到选中吗', rows)
+      this.dataListAllSelections = rows
+    },
     // 表格选中数据
-    rowSelect(row, column, event) {
-      this.$refs.contractTable.clearSelection();
+    rowSelect(row) {
+      // this.$refs.contractTable.clearSelection();
+      // this.$refs.contractTable.toggleRowSelection(row);
+      // this.dataListAllSelections = this.single ? [row] : selection
       this.$refs.contractTable.toggleRowSelection(row);
-      this.dataListAllSelections = this.single ? [row] : selection
     },
     // 选中数据
     handleSelectionChange(selection, row) {
+      console.log('selection',selection)
+      console.log('row',[row])
       if (this.single && selection.length > 1) {
         this.$refs.contractTable.clearSelection();
         this.$refs.contractTable.toggleRowSelection(row);

+ 0 - 1
src/components/popover-select-v2/index.vue

@@ -223,7 +223,6 @@ export default {
         <el-button :size="$attrs.size" :loading="loading" @click="hide"
           >取 消</el-button
         >
-        
       </div>
       <el-form
         v-loading="loading"

+ 15 - 0
src/components/popover-select/components/MANUFACTURER_PARAM.js

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

+ 48 - 0
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -45,4 +45,52 @@ export default [
       return prop.materialMedcine.isDrug == "0" ? "Y" : "N";
     },
   },
+  {
+    key: "isDrugNumber",
+    title: "药品",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.isDrug;
+    },
+  },
+  {
+    key: "oriRegistrationNo",
+    title: "注册证号/备案凭证编号",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.oriRegistrationNo;
+    },
+  },
+  {
+    key: "dosageFrom",
+    title: "剂型",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.dosageFrom;
+    },
+  },
+  {
+    key: "dosageFromName",
+    title: "剂型名称",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.dosageFromName;
+    },
+  },
+  {
+    key: "curingType",
+    title: "养护类型",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.curingType;
+    },
+  },
+  {
+    key: "medicalInstruments",
+    title: "医疗器械",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.medicalInstruments;
+    },
+  },
 ];

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

@@ -154,9 +154,9 @@ export default {
         $props: { source, valueKey, dataMapping },
       } = this;
       for (let key in dataMapping) {
-        source[key] = prop[dataMapping[key]];
+        source[key] = prop[0][dataMapping[key]];
       }
-      this.innerValue = prop[valueKey];
+      this.innerValue = prop[0][valueKey];
       this.$emit("update:source", source);
       this.$emit("change", prop, this.$props);
     },

+ 14 - 2
src/components/super-form/index.vue

@@ -45,9 +45,21 @@ export default {
     },
   },
   watch: {},
-  methods: {},
+  methods: {
+    // 继承el-table的Method
+    extendMethod() {
+      const refMethod = Object.entries(this.$refs["superForm"]);
+      for (const [key, value] of refMethod) {
+        if (!(key.includes("$") || key.includes("_"))) {
+          this[key] = value;
+        }
+      }
+    },
+  },
   created() {},
-  mounted() {},
+  mounted() {
+    this.extendMethod();
+  },
   destroyed() {},
 };
 </script>

+ 111 - 101
src/components/super-search/index.vue

@@ -53,6 +53,20 @@ export default {
       },
       set() {},
     },
+    height: {
+      get() {
+        const maxMultiples = Math.ceil(
+          this.innerColumns
+            .map(({ item }) => item.span)
+            .reduce((prev, curr) => {
+              return prev + curr;
+            }) / 24
+        );
+        const multiples = this.visible ? maxMultiples : 1;
+        return multiples * 47 + "px";
+      },
+      set() {},
+    },
   },
   watch: {},
   methods: {
@@ -76,112 +90,108 @@ export default {
     label-position="right"
     @submit.native.prevent
   >
-    <el-row :gutter="20">
-      <el-col :span="20">
-        <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
-          <el-col
-            v-for="({ item, attr }, index) in showColumns"
-            :key="index"
-            :span="item.span"
-          >
-            <el-form-item :prop="item.key" :label="item.title">
-              <component
-                v-if="attr.is === 'el-input'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                @keyup.enter.native="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-select'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-                <template>
-                  <el-option
-                    v-for="item in dict.type[attr.dictName]"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </template>
-              </component>
-              <component
-                v-if="attr.is === 'el-date-picker'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-select-v2'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-multiple-select-v2'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-tree-select'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-multiple-tree-select'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-col>
-      <el-col :span="4" style="text-align: right">
-        <el-button
-          :size="$attrs.size"
-          type="primary"
-          icon="el-icon-search"
-          @click="$emit('submit')"
+    <el-row
+      :gutter="24"
+      :style="{ height }"
+      style="overflow: hidden; transition: 250ms; display: flex"
+      class="px-3"
+    >
+      <el-row :gutter="20" style="flex: 1; display: flex; flex-wrap: wrap">
+        <el-col
+          v-for="({ item, attr }, index) in showColumns"
+          :key="index"
+          :span="item.span"
         >
-          搜 索
+          <el-form-item :prop="item.key" :label="item.title">
+            <component
+              v-if="attr.is === 'el-input'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              @keyup.enter.native="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-select'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+              <template>
+                <el-option
+                  v-for="item in dict.type[attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </template>
+            </component>
+            <component
+              v-if="attr.is === 'el-date-picker'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-select-v2'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-multiple-select-v2'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-tree-select'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-multiple-tree-select'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row style="width: fit-content; text-align: right" class="ml-5">
+        <el-button :size="$attrs.size" type="primary" @click="$emit('submit')">
+          搜索
         </el-button>
-        <el-button
-          :size="$attrs.size"
-          icon="el-icon-refresh"
-          @click="$emit('reset')"
-        >
-          重 置
+        <el-button :size="$attrs.size" @click="$emit('reset')">
+          重置
         </el-button>
-      </el-col>
+        <!-- <el-button :size="$attrs.size" @click="visible = !visible">
+          {{ visible ? "展开" : "收起" }}
+        </el-button> -->
+      </el-row>
     </el-row>
-    <el-divider class="m-0">
+    <el-divider class="m-0" style="cursor: pointer" @click="visible = !visible">
       <i
-        v-if="innerColumns.length > 4"
-        :class="visible ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
-        style="cursor: pointer"
-        @click="onVisible"
+        class="el-icon-d-arrow-left"
+        style="transition: 250ms"
+        :style="{ transform: `rotate(${visible ? 90 : -90}deg)` }"
       ></i>
     </el-divider>
   </el-form>

+ 66 - 58
src/components/super-table/index.vue

@@ -42,13 +42,8 @@ export default {
       type: Boolean,
       default: false,
     },
-    // 是否列显示
-    hiddenColumns: {
-      type: Boolean,
-      default: false,
-    },
-    // 是否列过滤
-    filterColumns: {
+    // 是否列操作
+    convenitentOperation: {
       type: Boolean,
       default: false,
     },
@@ -64,13 +59,17 @@ export default {
     ElFilePreview: () => import("@/components/file-preview/index.vue"),
     ElComputedInput: () => import("@/components/computed-input/index.vue"),
     ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+    ElPopoverMultipleSelectV2: () =>
+      import("@/components/popover-select-v2/multiple.vue"),
     ElComputedInputV2: () => import("@/components/computed-input-v2/index.vue"),
+    ElPopoverTreeSelect: () =>
+      import("@/components/popover-tree-select/index.vue"),
     ButtonHide: () => import("./hide.vue"),
     ButtonFreeze: () => import("./freeze.vue"),
     IconHide: () => import("./once/hide.vue"),
     IconSort: () => import("./once/sort.vue"),
-    IconFilter: () => import("./once/filter.vue"),
     IconFreeze: () => import("./once/freeze.vue"),
+    IconFilter: () => import("./once/filters.vue"),
   },
   data() {
     const { columns } = this.$props;
@@ -145,25 +144,20 @@ export default {
     //
     onSelectionChange(value) {
       this.selectData = value;
+      this.$emit("row-select", this.selectData);
     },
     //
     onRowClick(row, column, event) {
       const { radio, checkbox } = this.$props;
       // 单选
       if (radio) {
-        this.selectData = [row];
-        this.innerValue = this.innerValue.map((item) => ({
-          ...item,
-          isChecked: item.id === row.id ? true : false,
-        }));
-        this.$emit("row-select", this.selectData);
+        this.$emit("row-select", [row]);
       }
       // 多选
       if (checkbox) {
         this.$refs.superTable.toggleRowSelection(
           this.innerValue.find((item) => item.id === row.id)
         );
-        this.$emit("row-select", this.selectData);
       }
     },
     // 冻结
@@ -209,9 +203,20 @@ export default {
       }));
       return dataList;
     },
+    // 继承el-table的Method
+    extendMethod() {
+      const refMethod = Object.entries(this.$refs["superTable"]);
+      for (const [key, value] of refMethod) {
+        if (!(key.includes("$") || key.includes("_"))) {
+          this[key] = value;
+        }
+      }
+    },
   },
   created() {},
-  mounted() {},
+  mounted() {
+    this.extendMethod();
+  },
   destroyed() {},
 };
 </script>
@@ -221,12 +226,15 @@ export default {
     <el-table
       ref="superTable"
       border
+      height="auto"
       :row-key="rowKey"
       :data="innerValue"
+      :highlight-current-row="radio"
       @row-click="onRowClick"
       @selection-change="onSelectionChange"
       v-bind="$attrs"
       v-on="$listeners"
+      style="flex: 1"
     >
       <!-- 序号 -->
       <el-table-column
@@ -277,42 +285,29 @@ export default {
             >
               {{ item.title }}
             </span>
-            <icon-sort
-              v-model="item.sort"
-              class="icon-sort"
-              @sort="onSort(item)"
-              :style="{
-                color: item.sort ? '#1890ff' : '',
-                display: item.sort ? 'inline-block' : '',
-              }"
-            ></icon-sort>
-            <icon-freeze
-              v-model="item.fixed"
-              class="icon-freeze"
-              @freeze="onFreeze"
-              :style="{
-                color: item.fixed ? '#1890ff' : '',
-                display: item.fixed ? 'inline-block' : '',
-              }"
-            ></icon-freeze>
-            <icon-filter
-              v-if="filterColumns"
-              v-model="item.filter"
-              class="icon-filter"
-              :filters="onFilters({ item, attr })"
-              @filter="onFilter"
-              :style="{
-                color: item.filter && item.filter.length ? '#1890ff' : '',
-                display:
-                  item.filter && item.filter.length ? 'inline-block' : '',
-              }"
-            ></icon-filter>
-            <icon-hide
-              v-if="hiddenColumns"
-              v-model="item.hidden"
-              class="icon-hide"
-              @hide="onHide"
-            ></icon-hide>
+            <template>
+              <icon-sort
+                v-if="item.sortabled"
+                v-model="item.sort"
+                @sort="onSort(item)"
+              ></icon-sort>
+              <icon-freeze
+                v-if="item.fixedabled"
+                v-model="item.fixed"
+                @freeze="onFreeze"
+              ></icon-freeze>
+              <icon-filter
+                v-if="item.filterabled"
+                v-model="item.filter"
+                :filters="onFilters({ item, attr })"
+                @filter="onFilter"
+              ></icon-filter>
+              <icon-hide
+                v-if="item.hiddenabled"
+                v-model="item.hidden"
+                @hide="onHide"
+              ></icon-hide>
+            </template>
           </template>
         </template>
         <template slot-scope="scope">
@@ -334,6 +329,14 @@ export default {
               >
               </component>
               <component
+                v-else-if="attr.is === 'el-popover-multiple-select-v2'"
+                v-bind="attr"
+                v-model="scope.row[item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+              >
+              </component>
+              <component
                 v-else-if="attr.is === 'el-select'"
                 v-bind="attr"
                 v-model="scope.row[item.key]"
@@ -373,13 +376,13 @@ export default {
     </el-table>
     <div
       style="
-        height: auto;
+        height: 50px;
         display: flex;
         justify-content: space-between;
         align-items: center;
       "
     >
-      <div>
+      <div class="mr-4">
         <template v-if="checkbox">
           <el-button
             v-if="selectState"
@@ -398,7 +401,7 @@ export default {
             {{ selectData.length ? ` :${selectData.length}` : "" }}
           </el-button>
         </template>
-        <template v-if="hiddenColumns">
+        <template v-if="convenitentOperation">
           <button-hide v-model="innerColumns" @hide="onHide"></button-hide>
           <button-freeze
             v-model="showColumns"
@@ -413,7 +416,7 @@ export default {
         :page.sync="page.pageNum"
         :limit.sync="page.pageSize"
         @pagination="$emit('pagination', { ...$event })"
-        style="height: 32px; padding: 0 !important"
+        style="height: 32px; padding: 0 !important; flex: 1; overflow-x: auto"
       />
     </div>
   </div>
@@ -422,9 +425,14 @@ export default {
 <style lang="scss" scoped>
 .el-super-table {
   position: relative;
-}
-.el-super-table .el-table__header .cell {
+  flex: 1;
   display: flex;
+  flex-direction: column;
+  overflow: auto;
+}
+::v-deep.el-super-table .el-table__header .cell {
+  word-break: keep-all;
+  white-space: nowrap;
   .icon-sort {
     display: none;
   }

+ 8 - 17
src/components/super-table/once/filter.vue → src/components/super-table/once/filters.vue

@@ -1,17 +1,23 @@
 <template>
   <el-popover
-    v-if="filterData.length"
+    v-if="innerValue !== false || filterData.length"
     :visible-arrow="false"
     width="auto"
     trigger="hover"
     placement="bottom"
     popper-class="p-0"
+    class="icon-filter"
+    :style="{
+      color: innerValue && innerValue.length ? '#1890ff' : '',
+      display: innerValue && innerValue.length ? 'inline-block' : '',
+    }"
   >
     <template>
       <el-checkbox-group
         v-model="selectData"
         class="pt-3 px-3"
         @change="onCheck"
+        style="max-height: 300px; overflow-y: auto"
       >
         <el-checkbox
           v-for="item in filterData"
@@ -41,21 +47,12 @@
         </div>
       </div>
     </template>
-    <!-- <el-tooltip
-      slot="reference"
-      :disabled="disabled"
-      effect="dark"
-      content="筛选"
-      placement="top"
-    > -->
     <i
       slot="reference"
       class="el-icon-search pl-1"
       style="cursor: pointer; font-weight: 600; transition: 500ms"
-      :style="{ color: color }"
       @click="onOpen"
     ></i>
-    <!-- </el-tooltip> -->
   </el-popover>
 </template>
 
@@ -71,7 +68,7 @@ export default {
   },
   props: {
     value: {
-      type: Array,
+      type: [Array, Boolean],
       require: true,
     },
     filters: {
@@ -110,12 +107,6 @@ export default {
       },
       set() {},
     },
-    color: {
-      get() {
-        return this.$props.value && this.$props.value.length ? "#1890ff" : "";
-      },
-      set() {},
-    },
   },
   watch: {},
   methods: {

+ 25 - 14
src/components/super-table/once/freeze.vue

@@ -1,18 +1,29 @@
 <template>
-  <!-- <el-tooltip effect="dark" content="冻结" placement="top"> -->
-  <i
-    v-if="innerValue"
-    class="el-icon-lock pl-1"
-    style="color: #1890ff; cursor: pointer; font-weight: 600; transition: 500ms"
-    @click="onFreeze"
-  ></i>
-  <i
-    v-else
-    class="el-icon-unlock pl-1"
-    style="cursor: pointer; font-weight: 600; transition: 500ms"
-    @click="onFreeze"
-  ></i>
-  <!-- </el-tooltip> -->
+  <span
+    class="icon-freeze"
+    :style="{
+      color: innerValue ? '#1890ff' : '',
+      display: innerValue ? 'inline-block' : '',
+    }"
+  >
+    <i
+      v-if="innerValue"
+      class="el-icon-lock pl-1"
+      style="
+        color: #1890ff;
+        cursor: pointer;
+        font-weight: 600;
+        transition: 500ms;
+      "
+      @click="onFreeze"
+    ></i>
+    <i
+      v-else
+      class="el-icon-unlock pl-1"
+      style="cursor: pointer; font-weight: 600; transition: 500ms"
+      @click="onFreeze"
+    ></i>
+  </span>
 </template>
 
 <script>

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

@@ -1,7 +1,7 @@
 <template>
   <i
     v-if="innerValue"
-    class="el-icon-circle-close pl-1"
+    class="el-icon-circle-close pl-1 icon-hide"
     style="cursor: pointer; font-weight: 600; transition: 500ms"
     @click="onHide"
   ></i>

+ 25 - 14
src/components/super-table/once/sort.vue

@@ -1,18 +1,29 @@
 <template>
-  <!-- <el-tooltip effect="dark" content="排序" placement="top"> -->
-  <i
-    v-if="innerValue === 'descending'"
-    class="el-icon-bottom pl-1"
-    style="color: #1890ff; cursor: pointer; font-weight: 600; transition: 500ms"
-    @click="onSort(null)"
-  ></i>
-  <i
-    v-else
-    class="el-icon-top pl-1"
-    style="cursor: pointer; font-weight: 600; transition: 500ms"
-    @click="onSort('descending')"
-  ></i>
-  <!-- </el-tooltip> -->
+  <span
+    class="icon-sort"
+    :style="{
+      color: innerValue ? '#1890ff' : '',
+      display: innerValue ? 'inline-block' : '',
+    }"
+  >
+    <i
+      v-if="innerValue === 'descending'"
+      class="el-icon-bottom pl-1"
+      style="
+        color: #1890ff;
+        cursor: pointer;
+        font-weight: 600;
+        transition: 500ms;
+      "
+      @click="onSort(null)"
+    ></i>
+    <i
+      v-else
+      class="el-icon-top pl-1"
+      style="cursor: pointer; font-weight: 600; transition: 500ms"
+      @click="onSort('descending')"
+    ></i>
+  </span>
 </template>
 
 <script>

+ 2 - 1
src/layout/index.vue

@@ -10,10 +10,11 @@
         class="drawer-bg"
         @click="handleClickOutside"
       />
-      <sidebar v-if="!sidebar.hide" class="sidebar-container" />
+      <sidebar v-if="dev" class="sidebar-container" />
       <div
         :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }"
         class="main-container"
+        :style="`margin-left:${dev ? '54':'0'}px`"
       >
         <div :class="{ 'fixed-header': fixedHeader }">
           <!-- <navbar /> -->

+ 26 - 0
src/main.js

@@ -95,6 +95,32 @@ Vue.use(VueMeta);
 Vue.use(Print); //注册
 DictData.install();
 
+// el-table无限滚动解决页面渲染卡死
+Vue.directive("myscroll", {
+  bind(el, bind, vnode) {
+    const self = vnode.context;
+    let target = el.querySelector('.el-table__body-wrapper');
+    target.addEventListener("scroll", () => {
+      // 检测触底
+      if (target.scrollTop + target.clientHeight >= target.scrollHeight) {
+        if (self.over >= self.basicForm.puDemandItemList) {
+          return;
+        }
+        self.over +=15
+      }
+    })
+  }
+})
+Vue.mixin({
+  data() {
+    return {
+      // scrollTop: 0,
+      // tableHeight: 300
+      start: 0,
+      over: 15
+    }
+  }
+})
 /**
  * If you don't want to use mock-server
  * you want to use MockJs for mock api

+ 1 - 1
src/utils/request.js

@@ -17,7 +17,7 @@ const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   baseURL: process.env.VUE_APP_BASE_API,
   // 超时
-  timeout: 10000,
+  timeout: 300000,
 });
 
 // request拦截器

+ 47 - 9
src/views/business/spd/goal_management/AnnualSaleGoal.vue

@@ -84,7 +84,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['goal_management:annualSaleGoal:add']"
         >新增
         </el-button>
       </el-col>
@@ -96,21 +95,41 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['goal_management:annualSaleGoal:remove']"
         >删除
         </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="primary"
           plain
-          icon="el-icon-download"
+          icon="el-icon-grape"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['goal_management:annualSaleGoal:export']"
-        >导出
+          :disabled="multiple"
+        >提交
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="primary" size="mini" plain icon="el-icon-upload">
+            导入<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+            <el-dropdown-item command="import">导入</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="warning" plain icon="el-icon-download" size="mini">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="export">导出</el-dropdown-item>
+            <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -138,7 +157,6 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['goal_management:annualSaleGoal:edit']"
           >修改
           </el-button>
           <el-button
@@ -146,7 +164,6 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['goal_management:annualSaleGoal:remove']"
           >删除
           </el-button>
         </template>
@@ -787,6 +804,11 @@ export default {
         ...this.queryParams
       }, `annualSaleGoal_${new Date().getTime()}.xlsx`)
     },
+    handleExportDetails() {
+      this.download('goal_management/annualSaleGoalDetails/export', {
+        ...this.queryParams
+      }, `annualSaleGoalMerge_${new Date().getTime()}.xlsx`)
+    },
     handleClose(done) {
       this.$confirm('确认关闭?')
         .then(_ => {
@@ -893,6 +915,22 @@ export default {
         }
       }
       return true
+    },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        this.handleExportDetails()
+      }
     }
   }
 };

+ 55 - 11
src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue

@@ -92,33 +92,54 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['goal_management:annualSaleGoalMerge:add']"
         >新增
         </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="danger"
+          type="primary"
           plain
           icon="el-icon-delete"
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['goal_management:annualSaleGoalMerge:remove']"
         >删除
         </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="primary"
           plain
-          icon="el-icon-download"
+          icon="el-icon-grape"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['goal_management:annualSaleGoalMerge:export']"
-        >导出
+          :disabled="multiple"
+        >提交
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="primary" size="mini" plain icon="el-icon-upload">
+            导入<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+            <el-dropdown-item command="import">导入</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="warning" plain icon="el-icon-download" size="mini">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="export">导出</el-dropdown-item>
+            <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+            <el-dropdown-item command="exportZoneSum">导出区域目标汇总</el-dropdown-item>
+            <el-dropdown-item command="exportCustomSum">导出客户目标汇总</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -147,7 +168,6 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['goal_management:annualSaleGoalMerge:edit']"
           >修改
           </el-button>
           <el-button
@@ -155,7 +175,6 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['goal_management:annualSaleGoalMerge:remove']"
           >删除
           </el-button>
         </template>
@@ -764,7 +783,7 @@ export default {
         oneLevelClassify: null,
         twoLevelClassifyCode: null,
         twoLevelClassify: null,
-        totalGoal: null,
+        goalSum: null,
         januaryGoal: null,
         februaryGoal: null,
         marchGoal: null,
@@ -1023,6 +1042,11 @@ export default {
         ...this.queryParams
       }, `annualSaleGoalMerge_${new Date().getTime()}.xlsx`)
     },
+    handleExportDetails() {
+      this.download('goal_management/annualSaleMergeDetails/export', {
+        ...this.queryParams
+      }, `annualSaleMergeDetails_${new Date().getTime()}.xlsx`)
+    },
     // 树形参照
     chooseTreeReferForQuery(type, isPage, title) {
       this.referCondition.type = type
@@ -1275,6 +1299,26 @@ export default {
         this.queryParams.endTime = null
       }
     },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        this.handleExportDetails()
+      } else if (command === 'exportZoneSum') {
+        console.log('导出区域目标汇总')
+      } else if (command === 'exportCustomSum') {
+        console.log('导出客户目标汇总')
+      }
+    }
   }
 };
 </script>

+ 47 - 9
src/views/business/spd/goal_management/MonthGoalMerge.vue

@@ -108,7 +108,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['goal_management:monthGoalMerge:add']"
         >新增
         </el-button>
       </el-col>
@@ -120,21 +119,41 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['goal_management:monthGoalMerge:remove']"
         >删除
         </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="primary"
           plain
-          icon="el-icon-download"
+          icon="el-icon-grape"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['goal_management:monthGoalMerge:export']"
-        >导出
+          :disabled="multiple"
+        >提交
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="primary" size="mini" plain icon="el-icon-upload">
+            导入<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+            <el-dropdown-item command="import">导入</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="warning" plain icon="el-icon-download" size="mini">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="export">导出</el-dropdown-item>
+            <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -162,7 +181,6 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['goal_management:monthGoalMerge:edit']"
           >修改
           </el-button>
           <el-button
@@ -170,7 +188,6 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['goal_management:monthGoalMerge:remove']"
           >删除
           </el-button>
         </template>
@@ -799,6 +816,11 @@ export default {
         ...this.queryParams
       }, `monthGoalMerge${new Date().getTime()}.xlsx`)
     },
+    handleExportDetails() {
+      this.download('goal_management/monthGoalMergeDetails/export', {
+        ...this.queryParams
+      }, `monthSaleMergeDetails_${new Date().getTime()}.xlsx`)
+    },
     // 树形参照
     chooseTreeReferForQuery(type, isPage, title) {
       this.referCondition.type = type
@@ -1061,6 +1083,22 @@ export default {
         this.queryParams.beginTime = null
         this.queryParams.endTime = null
       }
+    },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        this.handleExportDetails()
+      }
     }
   }
 };

+ 49 - 10
src/views/business/spd/goal_management/MonthReturnGoal.vue

@@ -82,7 +82,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['mk:monthReturnGoal:add']"
         >新增
         </el-button>
       </el-col>
@@ -94,21 +93,41 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['mk:monthReturnGoal:remove']"
         >删除
         </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="primary"
           plain
-          icon="el-icon-download"
+          icon="el-icon-grape"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['mk:monthReturnGoal:export']"
-        >导出
+          :disabled="multiple"
+        >提交
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="primary" size="mini" plain icon="el-icon-upload">
+            导入<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+            <el-dropdown-item command="import">导入</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="warning" plain icon="el-icon-download" size="mini">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="export">导出</el-dropdown-item>
+            <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-table v-loading="loading" :data="monthReturnGoalList" @selection-change="handleSelectionChange">
@@ -135,7 +154,6 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['mk:monthReturnGoal:edit']"
           >修改
           </el-button>
           <el-button
@@ -143,7 +161,6 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['mk:monthReturnGoal:remove']"
           >删除
           </el-button>
         </template>
@@ -433,6 +450,7 @@ export default {
         saleOrg: null,
         saleZone: null,
         custom: null,
+        dept: null,
         creator: null,
         monthly: null,
         goalSum: null
@@ -640,10 +658,15 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('goal_management/monthReturnGoal/export', {
+      this.download('mk/monthReturnGoal/export', {
         ...this.queryParams
       }, `monthReturnGoal_${new Date().getTime()}.xlsx`)
     },
+    handleExportDetails() {
+      this.download('mk/monthReturnGoalDetails/export', {
+        ...this.queryParams
+      }, `monthReturnGoalDetails_${new Date().getTime()}.xlsx`)
+    },
     handleClose(done) {
       this.$confirm('确认关闭?')
         .then(_ => {
@@ -703,6 +726,22 @@ export default {
         }
       }
       return true
+    },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        this.handleExportDetails()
+      }
     }
   }
 }

+ 58 - 17
src/views/business/spd/goal_management/MonthReturnMerge.vue

@@ -83,7 +83,6 @@
         icon="el-icon-plus"
         size="mini"
         @click="handleAdd"
-        v-hasPermi="['mk:monthReturnMerge:add']"
       >新增
       </el-button>
     </el-col>
@@ -95,21 +94,41 @@
         size="mini"
         :disabled="multiple"
         @click="handleDelete"
-        v-hasPermi="['mk:monthReturnMerge:remove']"
       >删除
       </el-button>
     </el-col>
     <el-col :span="1.5">
       <el-button
-        type="warning"
+        type="primary"
         plain
-        icon="el-icon-download"
+        icon="el-icon-grape"
         size="mini"
-        @click="handleExport"
-        v-hasPermi="['mk:monthReturnMerge:export']"
-      >导出
+        :disabled="multiple"
+      >提交
       </el-button>
     </el-col>
+    <el-col :span="1.5">
+      <el-dropdown @command="handleCommand">
+        <el-button type="primary" size="mini" plain icon="el-icon-upload">
+          导入<i class="el-icon-arrow-down el-icon--right"></i>
+        </el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+          <el-dropdown-item command="import">导入</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </el-col>
+    <el-col :span="1.5">
+      <el-dropdown @command="handleCommand">
+        <el-button type="warning" plain icon="el-icon-download" size="mini">
+          导出<i class="el-icon-arrow-down el-icon--right"></i>
+        </el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item command="export">导出</el-dropdown-item>
+          <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </el-col>
     <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
   </el-row>
   <el-table v-loading="loading" :data="monthReturnMergeList" @selection-change="handleSelectionChange">
@@ -130,14 +149,13 @@
     <el-table-column label="目标类型" align="center" prop="goalCategory" width="180"/>
     <el-table-column label="目标值合计" align="center" prop="goalSum" width="180"/>
     <el-table-column label="单据状态" align="center" prop="documentStatus" width="180"/>
-    <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
+    <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
       <template slot-scope="scope">
         <el-button
           size="mini"
           type="text"
           icon="el-icon-edit"
           @click="handleUpdate(scope.row)"
-          v-hasPermi="['mk:monthReturnMerge:edit']"
         >修改
         </el-button>
         <el-button
@@ -145,7 +163,6 @@
           type="text"
           icon="el-icon-delete"
           @click="handleDelete(scope.row)"
-          v-hasPermi="['mk:monthReturnMerge:remove']"
         >删除
         </el-button>
       </template>
@@ -359,6 +376,7 @@
           <el-table-column label="序号" type="index" width="55" align="center" fixed />
           <el-table-column label="销售组织" align="center" prop="saleOrg" width="180" />
           <el-table-column label="区域" align="center" prop="saleZone" width="180" />
+          <el-table-column label="部门" align="center" prop="dept" width="180" />
           <el-table-column label="制单人" align="center" prop="creator" width="180" />
           <el-table-column label="月份" align="center" prop="monthly" width="180" />
           <el-table-column label="目标值" align="center" prop="goalSum" width="180" />
@@ -386,6 +404,7 @@ import {
 // 参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import ElPopoverSelectV2 from "@/components/popover-select-v2"
+import log from "../../../monitor/job/log";
 
 export default {
   name: "MonthReturnMerge",
@@ -673,7 +692,12 @@ export default {
     handleExport() {
       this.download('mk/monthReturnMerge/export', {
         ...this.queryParams
-      }, `monthReturnMerge${new Date().getTime()}.xlsx`)
+      }, `monthReturnMerge_${new Date().getTime()}.xlsx`)
+    },
+    handleExportDetails() {
+      this.download('mk/monthReturnMergeDetails/export', {
+        ...this.queryParams
+      }, `monthReturnMergeDetails_${new Date().getTime()}.xlsx`)
     },
     // 关闭抽屉
     handleClose(done) {
@@ -697,8 +721,8 @@ export default {
       let query = { classify: classify, classifyValue: classifyValue }
       mergeMonthReturnMergeDetails(query).then(response => {
         console.log(response)
-        /*this.monthReturnMergeDetailsList = response.data
-        this.computeTotal()*/
+        this.monthReturnMergeDetailsList = response.data.monthReturnMergeDetails
+        this.computeTotal()
       })
     },
     // 计算主表合计
@@ -738,14 +762,15 @@ export default {
       }
     },
     getNewTwoArray() {
-      let arr = JSON.parse(JSON.parse(this.monthReturnMergeDetailsList))
+      let arr = JSON.parse(JSON.stringify(this.monthReturnMergeDetailsList))
+      console.log(arr);
       if (this.activeName === 'monthReturnMergeDetails') {
-        this.zoneGoalSumList = null
+        return this.zoneGoalSumList = []
       }
-      // 根据销售组织,销售区域,制单人,月份进行合并,并相加goalSum
+      // 根据**进行合并,并相加goalSum
       const mergeAndSumTotalGoal = (array) => {
         return Array.from(array.reduce((map, obj) => {
-          const key = `${obj.saleOrg}-${obj.saleZone}-${obj.creator}-${obj.monthly}`
+          const key = `${obj.saleOrg}-${obj.saleZone}-${obj.custom}-${obj.dept}-${obj.creator}-${obj.monthly}`
           if (map.has(key)) {
             const existingObj = map.get(key)
             existingObj.goalSum += obj.goalSum
@@ -756,6 +781,22 @@ export default {
         }, new Map()).values())
       }
       this.zoneGoalSumList = mergeAndSumTotalGoal(arr)
+    },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        this.handleExportDetails()
+      }
     }
   }
 }

+ 47 - 9
src/views/business/spd/goal_management/MonthSaleGoal.vue

@@ -83,7 +83,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['goal_management:monthSaleGoal:add']"
         >新增
         </el-button>
       </el-col>
@@ -95,21 +94,41 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['goal_management:monthSaleGoal:remove']"
         >删除
         </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="primary"
           plain
-          icon="el-icon-download"
+          icon="el-icon-grape"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['goal_management:monthSaleGoal:export']"
-        >导出
+          :disabled="multiple"
+        >提交
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="primary" size="mini" plain icon="el-icon-upload">
+            导入<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+            <el-dropdown-item command="import">导入</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="warning" plain icon="el-icon-download" size="mini">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="export">导出</el-dropdown-item>
+            <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -137,7 +156,6 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['goal_management:monthSaleGoal:edit']"
           >修改
           </el-button>
           <el-button
@@ -145,7 +163,6 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['goal_management:monthSaleGoal:remove']"
           >删除
           </el-button>
         </template>
@@ -724,6 +741,11 @@ export default {
         ...this.queryParams
       }, `monthSaleGoal_${new Date().getTime()}.xlsx`)
     },
+    handleExportDetails() {
+      this.download('goal_management/monthSaleGoalDetails/export', {
+        ...this.queryParams
+      }, `monthSaleGoalDetails_${new Date().getTime()}.xlsx`)
+    },
     handleClose(done) {
       this.$confirm('确认关闭?')
         .then(_ => {
@@ -820,6 +842,22 @@ export default {
         this.queryParams.beginTime = null
         this.queryParams.endTime = null
       }
+    },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        this.handleExportDetails()
+      }
     }
   }
 }

+ 7 - 7
src/views/material/basicFile/details.vue

@@ -2,8 +2,10 @@
 <template>
   <div class="material-details" v-loading="loading">
     <!-- 操作栏 -->
-    <!-- 基本信息栏 -->
-    <div style="display: flex;justify-content: end;">
+  
+    <el-card>
+      <!-- 基本信息栏 -->
+      <div style="display: flex;justify-content: end;">
       <div v-if="activeMainTab == 'material'">
   
         <!-- 基本信息修改状态下—— 保存、保存新增、更新导入、取消 -->
@@ -111,8 +113,6 @@
       </el-row>
 
     </div>
-
-    <el-card>
     
       <div class="md-content">
         <el-form :inline="true" label-position="right" :model="basicData.value">
@@ -148,7 +148,7 @@
                 >
 
                   <el-row :gutter="10">
-                    <el-col :span="8" v-for="f in basicData.form" style="text-align: right;">
+                    <el-col :span="6" v-for="f in basicData.form" style="text-align: right;">
                       <template v-if="f.show">
 
                         <!-- 多选框 -->
@@ -296,7 +296,7 @@
                     >
 
                       <el-row :gutter="10">
-                        <el-col :span="8" v-for="m in medcineData.form" style="text-align: right;">
+                        <el-col :span="6" v-for="m in medcineData.form" style="text-align: right;">
 
                           <!-- 需要根据基本信息中的是否医药物料字段判断是否可以填写 -->
                           <template v-if="m.show">
@@ -2590,7 +2590,7 @@
     box-sizing: border-box;
 
     .el-card__body {
-      height: calc(100vh - 80px);
+      height: calc(100vh - 40px);
       // height: 100%;
       box-sizing: border-box;
       padding: 12px;

+ 6 - 13
src/views/material/basicFile/index.vue

@@ -3,9 +3,11 @@
 <template>
   <div class="material-basic" v-loading="failLoad">
 
-    <!-- 操作栏 -->
-    <div>
-    
+    <!-- 主体列表 -->
+    <el-card class="material-list" v-loading="loading">
+
+      <!-- 操作栏 -->
+    <div style="margin: 0 0 10px 0;">
       <!-- 查询条件 -->
       <el-row :gutter="10">
         <el-col :span="1.5">
@@ -39,12 +41,7 @@
         </el-col>
 
       </el-row>
-
-     
     </div>
-
-    <!-- 主体列表 -->
-    <el-card class="material-list" v-loading="loading">
       <el-row 
         :gutter="10" 
         class="mb10"
@@ -568,8 +565,7 @@
 
 <style lang="scss">
   .material-list {
-    // height: calc(100% - 100px);
-    // height: calc(100% - 70px);
+    height: calc(100vh - 70px);
 
 
     .el-card__body {
@@ -577,12 +573,9 @@
       box-sizing: border-box;
 
       .el-table {
-        // height: calc(100% - 35px);
         overflow: auto;
 
         .el-table__body-wrapper {
-          // height: calc(100% - 150px);
-          // height: calc(100% - 70px);
           overflow-y: auto !important;
           overflow-x: auto !important;
         }

+ 0 - 825
src/views/material/changeApply/add.vue

@@ -1,825 +0,0 @@
-<template>
-  <div class="apply_add">
-    <el-tabs type="border-card" v-model="tabValue" @tab-click="handleClick">
-      <el-tab-pane label="基本信息" name="first">
-        <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="170px">
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="单据编码" prop="code">
-                <el-input disabled v-model="basicForm.code"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="所属组织" prop="orgId">
-                <el-input disabled v-model="basicForm.orgId"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="物料编码" prop="materialCode">
-                <el-input readonly :disabled="disable" v-model="basicForm.materialCode">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="物料名称" prop="materialName">
-                <el-input :disabled="disable" v-model="basicForm.materialName"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="医药物料" prop="medicineMaterial">
-                <el-select v-model="basicForm.medicineMaterial" placeholder="医药物料" clearable :disabled="disable"
-                           @change="controlMedic">
-                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="生产许可证" prop="remark">
-                <el-input :disabled="disable" v-model="basicForm.productionPermit"></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="规格" prop="specification">
-                <el-input :disabled="disable" v-model="basicForm.specification"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="型号" prop="model">
-                <el-input :disabled="disable" v-model="basicForm.model"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="生产厂家/代理人" prop="factory">
-                <el-select ref="factoryOrman" v-model="basicForm.factory" placeholder="生产厂家/代理人" clearable
-                           :disabled="disable" @focus="chooseFactory">
-                  <el-option v-for="item in factoryOptions" :key="item.id" :label="item.name" :value="item.id"/>
-                </el-select>
-                <!-- <el-input :disabled="disable" v-model="basicForm.factory">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
-                </el-input> -->
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="注册人/上市许可持有人" prop="registrant">
-                <el-input :disabled="disable" v-model="basicForm.registrant"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="存储条件" prop="storageConditions">
-                <el-select v-model="basicForm.storageConditions" placeholder="存储条件" clearable :disabled="disable">
-                  <el-option v-for="dict in dict.type.sys_storage_condition" :key="dict.value" :label="dict.label"
-                             :value="dict.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="运输条件" prop="transportCondition">
-                <el-select v-model="basicForm.transportCondition" placeholder="运输条件" clearable :disabled="disable">
-                  <el-option v-for="dict in dict.type.sys_conditions_carriage" :key="dict.value" :label="dict.label"
-                             :value="dict.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <!--            <el-col :span="8">-->
-            <!--              <el-form-item label="交货周期" prop="leadTime">-->
-            <!--                <el-input type="number" min="0" :disabled="disable" v-model="basicForm.leadTime"></el-input>-->
-            <!--              </el-form-item>-->
-            <!--            </el-col>-->
-            <!--            <el-col :span="8">-->
-            <!--              <el-form-item label="业务线" prop="businessLine"-->
-            <!--                            :rules="{ required: isOneClass, message: '骨科、介入、检验、普耗、设备类物料产线必须输入对应的业务线', trigger: 'blur' }">-->
-            <!--                <el-select ref="lines" v-model="basicForm.businessLine" placeholder="请选择" clearable :disabled="disable"-->
-            <!--                           @focus="chooseLine">-->
-            <!--                  <el-option v-for="item in lineOptions" :key="item.id" :label="item.name" :value="item.id"/>-->
-            <!--                </el-select>-->
-            <!--              </el-form-item>-->
-            <!--            </el-col>-->
-            <!--            <el-col :span="8">-->
-            <!--              <el-form-item label="物料分类" prop="materialClassifyId">-->
-            <!--                <el-input readonly :disabled="disable" v-model="basicForm.fourClass">-->
-            <!--                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseFourClass"></el-button>-->
-            <!--                </el-input>-->
-            <!--                <el-input v-show="false" readonly :disabled="disable" v-model="basicForm.materialClassifyId"></el-input>-->
-            <!--              </el-form-item>-->
-            <!--            </el-col>-->
-            <el-col :span="8">
-              <el-form-item label="DI码" prop="remark">
-                <el-input :disabled="disable" v-model="basicForm.diCode"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="备注" prop="remark">
-                <el-input :disabled="disable" v-model="basicForm.remark"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="一级分类" prop="oneClass">
-                <el-input readonly disabled v-model="basicForm.oneClass"></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="二级分类" prop="twoClass">
-                <el-input readonly disabled v-model="basicForm.twoClass"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="三级分类" prop="threeClass">
-                <el-input readonly disabled v-model="basicForm.threeClass"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="四级分类" prop="fourClass">
-                <el-input readonly disabled v-model="basicForm.fourClass">
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-      </el-tab-pane>
-
-      <el-tab-pane label="医药属性" name="second">
-        <el-form :model="basicForm2" ref="basic2" label-width="160px">
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="药品" prop="drug"
-                            :rules="{ required: !isControl, message: '请选择是否药品', trigger: 'blur' }">
-                <el-select v-model="basicForm2.drug" placeholder="请选择" clearable :disabled="disable || isControl">
-                  <el-option v-for="dict in dict.type.sys_medicine" :key="dict.value" :label="dict.label"
-                             :value="dict.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="注册证号/备案凭证编号" prop="registrationNo">
-                <el-input :disabled="disable || isControl" v-model="basicForm2.registrationNo"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="医疗器械" prop="medicalDevices">
-                <el-select v-model="basicForm2.medicalDevices" placeholder="请选择" clearable
-                           :disabled="disable || isControl">
-                  <el-option v-for="dict in dict.type.medical_instruments" :key="dict.value" :label="dict.label"
-                             :value="dict.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="养护类型" prop="maintenanceType">
-                <el-select v-model="basicForm2.maintenanceType" placeholder="请选择" clearable
-                           :disabled="disable || isControl">
-                  <el-option v-for="dict in dict.type.curing_type" :key="dict.value" :label="dict.label"
-                             :value="dict.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="剂型" prop="dosageFrom"
-                            :rules="{ required: !isControl, message: '请选择剂型', trigger: 'blur' }">
-                <el-select ref="doses" v-model="basicForm2.dosageFrom" placeholder="请选择" clearable
-                           :disabled="disable || isControl" @focus="chooseDose">
-                  <el-option v-for="item in doseOptions" :key="item.id" :label="item.name" :value="item.id"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <!-- <el-row style="margin-bottom: 12px;">
-          <span>物料类别</span>
-        </el-row>
-        <el-row style="margin-bottom: 12px;">
-          <el-button type="primary" size="small" plain @click="addLine">新增</el-button>
-          <el-button type="primary" size="small" plain @click="handleDelete">删除</el-button>
-          <el-button type="primary" size="small" plain @click="testsave">暂存</el-button>
-        </el-row> -->
-        <!-- <el-row>
-          <el-col :span="12">
-            <el-table
-            :data="basicForm2.medicineTypeChanges"
-            class="request-table"
-            @selection-change="handleSelectionChange"
-            >
-              <el-table-column type="selection" width="55" />
-              <el-table-column label="序号" align="center" prop="sort">
-                <template slot-scope="scope">
-                  <el-input v-model="scope.row.sort"></el-input>
-                </template>
-              </el-table-column>
-              <el-table-column label="物料类别" align="center" prop="medicineCode">
-                <template slot-scope="scope">
-                  <el-input v-model="scope.row.medicineCode"></el-input>
-                </template>
-              </el-table-column>
-              <el-table-column label="类别名称" align="center" prop="medicineName">
-                <template slot-scope="scope">
-                  <el-input v-model="scope.row.medicineName"></el-input>
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-col>
-        </el-row> -->
-      </el-tab-pane>
-
-      <el-tab-pane label="修改记录" name="third">
-        <el-table :data="basicForm.changeRecords" class="request-table">
-          <el-table-column label="字段名称" align="center" prop="pageCondtion"/>
-          <el-table-column label="变更前" align="center" prop="beforeChangeValue"/>
-          <el-table-column label="变更后" align="center" prop="afterChangeValue"/>
-        </el-table>
-      </el-tab-pane>
-
-      <el-tab-pane label="单据信息" name="fourth">
-        <el-form :model="basicForm" ref="info" label-width="160px">
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="申请人" prop="createByName">
-                <el-input disabled v-model="basicForm.createByName"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="申请时间" prop="createTime">
-                <el-input disabled v-model="basicForm.createTime"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="创建人" prop="createByName">
-                <el-input disabled v-model="basicForm.createByName"></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="创建时间" prop="createTime">
-                <el-input disabled v-model="basicForm.createTime"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="最后修改人" prop="updateByName">
-                <el-input disabled v-model="basicForm.updateByName"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="最后修改时间" prop="updateTime">
-                <el-input disabled v-model="basicForm.updateTime"></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <!-- <el-col :span="8">
-              <el-form-item label="最后审核人" prop="approver">
-                <el-input disabled v-model="basicForm.approver"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="最后审核时间" prop="approvalTime">
-                <el-input disabled v-model="basicForm.approvalTime"></el-input>
-              </el-form-item>
-            </el-col> -->
-            <el-col :span="8">
-              <el-form-item label="单据状态" prop="status">
-                <el-select v-model="basicForm.status" size="small" disabled>
-                  <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value">
-                  </el-option>
-                </el-select>
-                <!-- <el-input disabled v-model="basicForm.status"></el-input> -->
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-      </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'">保存
-        </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>
-
-    <popDialog ref="contractSelect" @doSubmit="selectionsToInput" :selectData="selectData" :single="true"/>
-
-    <factory ref="factory" @doSubmit="acceptFactory" :selectData="selectData2" :single="true"/>
-
-    <fourClass ref="fourClass" @doSubmit="acceptFourClass" :selectData="selectData3" :single="true"/>
-
-    <dose ref="dose" @doSubmit="acceptDose" :selectData="selectData9" :single="true"/>
-    <serviceline ref="line" @doSubmit="acceptLine" :selectData="selectData8" :single="true"/>
-  </div>
-</template>
-
-<script>
-  import popDialog from '@/components/PopDialog/index.vue'
-  import factory from '@/components/PopDialog/productFactory.vue'
-  import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList} from '@/api/changeApply/basic'
-  import {getDose, getLine} from '@/api/requisition/basic'
-  // 生产厂商/代理人调用用于回显
-  import {getProductFactory} from '@/api/changeApply/basic'
-  // 四级分类
-  import fourClass from '@/components/PopDialog/fourClass.vue'
-  import dose from '@/components/PopDialog/dose.vue'
-  import serviceline from '@/components/PopDialog/serviceline.vue'
-  // 调用物料分类详情接口用于数据回显
-  import {getDetail} from '@/api/classify/basic';
-
-  export default {
-    name: 'applyAdd',
-    dicts: ['sys_storage_condition', 'sys_conditions_carriage', 'sys_medicine', 'medical_instruments', 'curing_type'],
-    components: {
-      popDialog,
-      factory,
-      dose,
-      serviceline,
-      fourClass
-    },
-    props: ['pageStu', 'row', 'disable'],
-    model: {
-      prop: 'isList',
-      event: 'jugislist'
-    },
-    data() {
-      return {
-        factoryOptions: [],
-        // 剂型
-        doseOptions: [],
-        selectData9: [],
-        selectData8: [],
-        tabValue: 'first',
-        isControl: true,
-        // 业务线
-        lineOptions: [],
-        isOneClass: false,
-        basicForm: {
-          code: '',
-          orgId: '德荣集团',
-          // 物料id
-          materialId: '',
-          materialCode: '',
-          materialName: '',
-          materialClassifyId: '',
-          medicineMaterial: '2',
-          oneClass: '',
-          twoClass: '',
-          threeClass: '',
-          fourClass: '',
-          specification: '',
-          model: '',
-          factory: '',
-          registrant: '',
-          storageConditions: '',
-          transportCondition: '',
-          leadTime: '',
-          remark: '',
-          // 修改记录
-          changeRecords: [],
-          // 单据信息字段
-          createBy: '',
-          applicationTime: '',
-          createTime: '',
-          updateBy: '',
-          updateTime: '',
-          approver: '',
-          approvalTime: '',
-          status: '',
-          // 业务线
-          businessLine: '',
-          // 生产许可证/经营许可证/备案号
-          productionPermit: '',
-          // di码
-          diCode: ''
-        },
-        options: [{
-          value: '0',
-          label: '是'
-        }, {
-          value: '2',
-          label: '否'
-        }],
-        statusOptions: [{
-          value: '0', label: '未提交'
-        }, {
-          value: '1', label: '审批中'
-        }, {
-          value: '2', label: '已完成'
-        }, {
-          value: '3', label: '已驳回'
-        },],
-        basicRules: {
-          materialCode: [{required: true, message: '请选择物料编码', trigger: 'blur'}],
-          materialName: [{required: true, message: '请填写物料名称', trigger: 'blur'}],
-          specification: [{required: true, message: '请填写规格', trigger: 'blur'}],
-          // materialClassifyId: [{required: true, message: '请选择物料分类', trigger: 'blur'}],
-          // model: [{required: true, message: '请填写型号', trigger: 'blur'}],
-          factory: [{required: true, message: '请选择生产厂家/代理人', trigger: 'blur'}],
-          registrant: [{required: true, message: '请填写注册人/上市许可持有人', trigger: 'blur'}],
-          storageConditions: [{required: true, message: '请选择存储条件', trigger: 'blur'}],
-          // transportCondition: [{required: true, message: '请选择运输条件', trigger: 'blur'}],
-          // leadTime: [{required: true, message: '请填写交货周期', trigger: 'blur'}],
-        },
-        basicForm2: {
-          drug: '',
-          registrationNo: '',
-          medicalDevices: '',
-          maintenanceType: '',
-          // 剂型
-          dosageFrom: ''
-          // 医药属性子表
-          // medicineTypeChanges:[
-          // ],
-        },
-        // tableList: [],
-        // 子表选中
-        ids: [],
-        // 弹窗
-        name: '',
-        selectData: [],
-        selectData2: [],
-        selectData3: []
-      }
-    },
-    // watch: {
-    //   value: {
-    //     handler (newVal) {
-    //       this.selectData = []
-    //       if (newVal) {
-    //         newVal.split(',').forEach((id) => { // 回显拿数据
-    //           this.contractService.queryById(id).then(({data}) => {
-    //             if (data && data.id !== '') {
-    //               this.selectData.push(data)
-    //             }
-    //           })
-    //         })
-    //       }
-    //     },
-    //     immediate: true,
-    //     deep: false
-    //   },
-    //   selectData: {
-    //     handler (newVal) {
-    //       this.name = newVal.map(contract => contract.contractName).join(',')
-    //     },
-    //     immediate: false,
-    //     deep: false
-    //   }
-    // },
-    mounted() {
-      this.$nextTick(() => {
-        // console.log('页面状态',this.pageStu)
-        if (this.pageStu == 'check') {
-          // alert('详情页面:')
-          console.log('页面状态', this.pageStu)
-          console.log('数据', this.row)
-          this.getDetails(this.row)
-          // 生产厂家代理人用于回显
-          if (this.row.factory) {
-            this.getFactoryDetails(this.row.factory)
-          }
-        } else if (this.pageStu == 'edit') {
-          // alert('修改页面')
-          console.log('页面状态', this.pageStu)
-          console.log('数据', this.row)
-          this.getDetails(this.row)
-          // 控制医药属性是否能够填写
-          if (this.row.medicineMaterial == '0') {
-            this.isControl = false
-          } else {
-            this.isControl = true
-          }
-          // 生产厂家代理人用于回显
-          if (this.row.factory) {
-            this.getFactoryDetails(this.row.factory)
-          }
-        } else if (this.pageStu == 'add') {
-          // alert('新增页面')
-          console.log('页面状态', this.pageStu)
-        }
-      })
-    },
-    methods: {
-      // 剂型显示列表
-      chooseDose() {
-        this.$refs.doses.blur()
-        this.$refs.dose.init()
-      },
-      // 选择剂型-树形
-      acceptDose(selections) {
-        this.doseOptions.push(selections)
-        this.basicForm2.dosageFrom = selections.id
-        this.getDoseDetails(selections.id)
-      },
-      // 剂型回显
-      getDoseDetails(id) {
-        getDose({id: id}).then(res => {
-          console.log('剂型', res)
-          if (res.code === 200) {
-            this.doseOptions = res.data.tableBody
-          }
-        })
-      },
-      // 生产厂家/代理人用于回显
-      getFactoryDetails(id) {
-        getProductFactory({id: id}).then(res => {
-          if (res.code === 200) {
-            this.factoryOptions = res.data.tableBody
-          }
-        })
-      },
-      // 选择是否医药物料时控制医药属性
-      controlMedic(val) {
-        console.log('val', val)
-        if (val == '0') {
-          this.isControl = false
-          // 初始化剂型为其他
-          this.basicForm2.dosageFrom = '0001A11000000000BX7Z'
-          this.getDoseDetails(this.basicForm2.dosageFrom)
-        } else {
-          this.basicForm2.drug = ''
-          this.basicForm2.registrationNo = ''
-          this.basicForm2.medicalDevices = ''
-          this.basicForm2.maintenanceType = ''
-          this.isControl = true
-        }
-      },
-      handleClick(tab, event) {
-        console.log(tab, event);
-        console.log('页面状态', this.pageStu)
-      },
-      // 如果是详情进入,则调用详情接口
-      getDetails(row) {
-        getChangeDetails(row.id).then(res => {
-          if (res.code === 200) {
-            this.basicForm = res.data
-            if (res.data.medicineChange) {
-              this.basicForm2 = res.data.medicineChange
-            }
-            // 剂型回显
-            if (res.data.medicineChange && res.data.medicineChange.dosageFrom) {
-              this.getDoseDetails(res.data.medicineChange.dosageFrom)
-            }
-            // 业务线回显
-            if (res.data.businessLine) {
-              this.getLineDetails(res.data.businessLine)
-            }
-          }
-        })
-      },
-      save() {
-        // alert('保存传status:0')
-        let sparams = {...this.basicForm, ...{status: 0}}
-        sparams.medicineChange = this.basicForm2
-        console.log('保存参数', sparams)
-        this.$refs['basic'].validate((valid) => {
-          if (valid) {
-            this.$refs['basic2'].validate(valid => {
-              if (valid) {
-                this.$modal.loading("保存中...");
-                addChangeList(sparams).then(res => {
-                  if (res.code === 200) {
-                    this.$message({
-                      message: res.msg,
-                      type: 'success'
-                    });
-                    this.$modal.closeLoading();
-                    this.back()
-                  }
-                }).catch(err => {
-                this.$modal.closeLoading();
-                })
-              }
-            })
-          }
-        })
-      },
-      submit() {
-        // alert('提交传status:1')
-        let sparams = {...this.basicForm, ...{status: 1}}
-        sparams.medicineChange = this.basicForm2
-        console.log('提交参数', sparams)
-        this.$refs['basic'].validate((valid) => {
-          if (valid) {
-            this.$refs['basic2'].validate(valid => {
-              if (valid) {
-                this.$modal.loading("提交中...");
-                editChangeList(sparams).then(res => {
-                  if (res.code === 200) {
-                    this.$message({
-                      message: res.msg,
-                      type: 'success'
-                    });
-                    this.$modal.closeLoading();
-                    this.back()
-                  }
-                }).catch(err => {
-                this.$modal.closeLoading();
-                })
-              }
-            })
-          }
-        })
-      },
-      back() {
-        this.$emit('jugislist', true)
-        // let queryParams = {
-        //   pageNum: 1,
-        //   pageSize: 10
-        // }
-        this.$emit('refresh')
-      },
-      // 子表增删行
-      // handleSelectionChange(val) {
-      //   this.ids = val
-      //   console.log('this.ids',this.ids)
-      // },
-      // addLine() {
-      //   //添加行数
-      //   let newValue = {
-      //     sort:'',
-      //     medicineCode: '',
-      //     medicineName: '',
-      //   };
-      //   this.basicForm2.medicineTypeChanges.push(newValue);
-      // },
-      // handleDelete(index) {
-      //   if(this.ids.length == 0) {
-      //     this.$message({
-      //       message: '请选择删除条目',
-      //       type: 'warning'
-      //     });
-      //   } else {
-      //     // console.log('index',index)
-      //     // this.basicForm2.medicineTypeChanges.splice(index, 1);
-      //     this.basicForm2.medicineTypeChanges = this.basicForm2.medicineTypeChanges.filter(item =>
-      //      !this.ids.some(ele =>
-      //      ele.sort == item.sort))
-      //   }
-      // },
-      // testsave() {
-      //   console.log('暂存表格:', this.basicForm2.medicineTypeChanges)
-      //   console.log('暂存表单1', this.basicForm)
-      //   let params = {...this.basicForm, ...this.basicForm2}
-      //   console.log('暂存总表单', params)
-      // },
-      // 设置选中
-      selectionsToInput(selections) {
-        console.log('父组件拿到的:', selections)
-        this.selectData = selections
-        this.$emit('getInfo', this.selectData)
-        getMaterialDetails(selections[0].id).then(res => {
-          console.log('res', res)
-          if (res.code === 200) {
-            let data = res.data.data
-            // 物料id
-            this.basicForm.materialId = data.id
-            // 物料分类Id
-            // this.basicForm.materialClassifyId = data.classifyId
-            this.basicForm.materialCode = data.code
-            this.basicForm.materialName = data.name
-            this.basicForm.medicineMaterial = data.isMedicine
-            this.basicForm.oneClass = data.oneClass
-            this.basicForm.twoClass = data.twoClass
-            this.basicForm.threeClass = data.threeClass
-            this.basicForm.fourClass = data.fourClass
-            this.basicForm.specification = data.specification
-            this.basicForm.model = data.model
-            this.basicForm.factory = data.manufacturerId
-            this.basicForm.registrant = data.registrant
-            this.basicForm.storageConditions = data.storageCondition
-            this.basicForm.transportCondition = data.transportationCondition
-            this.basicForm.leadTime = data.deliveryPeriod
-            this.basicForm.diCode = data.diCode
-            this.basicForm.businessLine = data.businessLine
-            this.basicForm.productionPermit = data.productionPermit
-            if (data.manufacturerId) {
-              this.getFactoryDetails(data.manufacturerId)
-            }
-            if (data.businessLine) {
-              this.getLineDetails(data.businessLine)
-            }
-            if (data.medcines.length !== 0) {
-              this.basicForm2.drug = data.medcines[0].isDrug
-              this.basicForm2.registrationNo = data.medcines[0].registrationNo
-              this.basicForm2.medicalDevices = data.medcines[0].medicalInstruments
-              this.basicForm2.maintenanceType = data.medcines[0].curingType
-              this.basicForm2.dosageFrom = data.medcines[0].dosageFrom
-              if (data.medcines[0].dosageFrom) {
-                this.getDoseDetails(data.medcines[0].dosageFrom)
-              }
-            }
-            // 控制医药属性是否能够填写
-            if (this.basicForm.medicineMaterial == '0') {
-              this.isControl = false
-            } else {
-              this.isControl = true
-            }
-          }
-        })
-      },
-      // selectionsToInput2 (selections) {
-      //   console.log('选择的数据',selections)
-      //   this.basicForm.factory = selections[0].manufactureName
-      // },
-      // 显示列表
-      test01() {
-        console.log('测试点击')
-        this.$refs.contractSelect.init()
-      },
-      // test02() {
-      //   console.log('测试弹窗2');
-      //   this.$refs.contractSelect2.init()
-      // },
-      // 选择生产厂家/代理人
-      acceptFactory(selections) {
-        console.log('选择的数据', selections)
-        this.factoryOptions = selections
-        this.basicForm.factory = selections[0].id
-        this.getFactoryDetails(selections[0].id)
-      },
-      // 生产厂家/代理人显示列表
-      chooseFactory() {
-        this.$refs.factoryOrman.blur()
-        this.$refs.factory.init()
-      },
-      // 选择四级分类
-      acceptFourClass(selections) {
-        console.log('收到的四级分类', selections)
-        this.basicForm.materialClassifyId = selections.id
-        this.getTreeDetails(selections.id)
-      },
-      // 四级分类显示列表
-      chooseFourClass() {
-        this.$refs.fourClass.init(basicForm.materialClassifyId)
-      },
-      // 选择四级分类后需要根据id再次查询一下123级分类
-      getTreeDetails(id) {
-        getDetail(id).then(res => {
-          if (res.code === 200) {
-            this.basicForm.oneClass = res.data.oneClass
-            this.basicForm.twoClass = res.data.twoClass
-            this.basicForm.threeClass = res.data.threeClass
-            this.basicForm.fourClass = res.data.fourClass
-            const classjudge = res.data.oneClass
-            if (classjudge.includes('介入耗材&5') || classjudge.includes('骨科耗材&2') || classjudge.includes('普通耗材&3') || classjudge.includes('医用设备&1') || classjudge.includes('体外诊断&4')) {
-              this.isOneClass = true
-            } else {
-              this.isOneClass = false
-            }
-          }
-        })
-      },
-      // 选择业务线
-      acceptLine(selections) {
-        this.lineOptions = selections
-        this.basicForm.businessLine = selections[0].id
-        this.getLineDetails(selections[0].id)
-      },
-      // 业务线显示列表
-      chooseLine() {
-        this.$refs.lines.blur()
-        this.$refs.line.init()
-      },
-      // 业务线回显
-      getLineDetails(id) {
-        getLine({id: id}).then(res => {
-          console.log('业务线', res)
-          if (res.code === 200) {
-            this.lineOptions = res.data.tableBody
-          }
-        })
-      },
-    }
-  }
-</script>
-
-<style lang="scss" scoped>
-  .apply_add {
-    height: calc(100vh - 84px);
-    padding: 12px;
-    box-sizing: border-box;
-    overflow-y: auto;
-  }
-
-  .btn_group {
-    width: 100%;
-    margin: 20px 0;
-    display: flex;
-    justify-content: center;
-  }
-</style>

+ 399 - 0
src/views/material/changeApply/add/column.js

@@ -0,0 +1,399 @@
+export default function useColumns(){
+
+  const TableColumns = [
+    {
+      item:{
+        key:'code',
+        title:'单据编码',
+      },
+      attr:{
+        is: "el-input",
+        disabled:true,
+      },
+    },
+    {
+      item:{
+        key:'orgName',
+        title:'所属组织',
+      },
+      attr:{
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "ORG_PARAM",
+        dataMapping: {
+          orgId:'id'
+        },
+        disabled:true,
+      },
+    },
+    {
+      item:{
+        key:'status',
+        title:'单据状态',
+      },
+      attr:{
+        is: "el-select",
+        dictName: "documents_status", // 字典名
+        disabled:true,
+      },
+    },
+    // {
+    //   item:{
+    //     key:'approver',
+    //     title:'申请人',
+    //   },
+    //   attr:{
+    //     is: "el-input",
+    //     disabled:true,
+    //   },
+      
+    // },
+    {
+      item:{
+        key:'applicationTime',
+        title:'申请时间',
+      },
+      attr:{
+        is: "el-date-picker",
+        valueFormat: "yyyy-MM-dd HH:mm:ss",
+        disabled:true,
+      },
+  
+    },
+    {
+      item:{
+        key:'createByName',
+        title:'创建人',
+      },
+      attr:{
+        is: "el-input",
+        disabled:true,
+      },
+  
+    },
+    {
+      item:{
+        key:'createTime',
+        title:'创建时间',
+      },
+      attr:{
+        is: "el-date-picker",
+        valueFormat: "yyyy-MM-dd HH:mm:ss",
+        disabled:true,
+      },
+  
+    },
+    {
+      item:{
+        key:'updateByName',
+        title:'最后修改人',
+      },
+      attr:{
+        is: "el-input",
+        disabled:true,
+      },
+  
+    },
+    {
+      item:{
+        key:'updateTime',
+        title:'最后修改时间',
+      },
+      attr:{
+        is: "el-date-picker",
+        valueFormat: "yyyy-MM-dd HH:mm:ss",
+        disabled:true,
+      },
+  
+    },
+    
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, span: item.span || 6 },
+  }));
+  
+  const TabColumns = [
+    {
+      item:{
+        key:'materialBasic',
+        title:'物料信息',
+      },
+      attr:{
+        value:[]
+      },
+      TableColumns:[
+        {
+          item:{
+            key:'materialCode',
+            title:'物料编码',
+            require: true,
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+         
+        },
+        {
+          item:{
+            key:'materialName',
+            title:'物料名称',
+            require: true,
+          },
+          attr:{
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "MATERIAL_PARAM",
+            dataMapping: {
+              materialId: "id",
+              materialCode: "code",
+              materialName: "name",
+              diCode:'diCode',
+              remark:'remark',
+              model: "model",
+              materialClassifyId:'classifyId',
+              productionPermit:'productionPermit',
+              specification: "specification",
+              storageConditions:'storageCondition',
+              transportCondition:'transportationCondition',
+              medicineMaterial:'isMedicine',
+              factory:'manufacturerId',
+              factoryName:'manufacturerIdName',
+              registrant:'registrant',
+              oneClass:'oneClass',
+              twoClass:'twoClass',
+              threeClass:'threeClass',
+              fourClass:'fourClass',
+              drug:'isDrugNumber',
+              registrationNo:'oriRegistrationNo',
+              dosageFrom:'dosageFrom',
+              dosageFromName:'dosageFromName',
+              maintenanceType:'curingType',
+              medicalDevices:'medicalInstruments',
+            },
+
+          },
+         
+        },
+        {
+          item:{
+            key:'medicineMaterial',
+            title:'医药物料',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_number_yes_no", // 字典名
+          },
+         
+        },
+        {
+          item:{
+            key:'productionPermit',
+            title:'生产许可证',
+          },
+          attr:{
+            is: "el-input",
+          },
+          
+        },
+        {
+          item:{
+            key:'specification',
+            title:'规格',
+            require: true,
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'model',
+            title:'型号',
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'factoryName',
+            title:'生产厂家/代理人',
+            require: true,
+          },
+          attr:{
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "MANUFACTURER_PARAM",
+            dataMapping: {
+              factory:'id'
+            }
+          },
+          
+        },
+        {
+          item:{
+            key:'registrant',
+            title:'注册人/上市许可持有人',
+            require: true,
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'storageConditions',
+            title:'存储条件',
+            require: true,
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_storage_condition", // 字典名
+          },
+          
+        },
+        {
+          item:{
+            key:'transportCondition',
+            title:'运输条件',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_conditions_carriage", // 字典名
+          },
+         
+        },
+        {
+          item:{
+            key:'diCode',
+            title:'DI码',
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'remark',
+            title:'备注',
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'oneClass',
+            title:'一级分类',
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+          
+        },
+        {
+          item:{
+            key:'twoClass',
+            title:'二级分类',
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+         
+        },
+        {
+          item:{
+            key:'threeClass',
+            title:'三级分类',
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+          
+        },
+        {
+          item:{
+            key:'fourClass',
+            title:'四级分类',
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+         
+        },
+        {
+          item:{
+            key:'drug',
+            title:'药品',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_medicine", // 字典名
+          },
+         
+        },
+        {
+          item:{
+            key:'registrationNo',
+            title:'注册证号/备案凭证编号',
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'medicalDevices',
+            title:'医疗器械',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "medical_instruments", // 字典名
+          },
+          
+        },
+        {
+          item:{
+            key:'maintenanceType',
+            title:'养护类型',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "curing_type", // 字典名
+          },
+         
+        },
+        {
+          item:{
+            key:'dosageFromName',
+            title:'剂型',
+          },
+          attr:{
+            is: "el-popover-tree-select",
+            referName: "DOSAGEFORM_PARAM",
+            valueKey: "name",
+            dataMapping: {
+              dosageFrom:'id'
+            }
+          },
+          
+        },
+  
+      ]
+    }, 
+  ]
+
+  return {TableColumns,TabColumns}
+}
+

+ 432 - 0
src/views/material/changeApply/add/index.vue

@@ -0,0 +1,432 @@
+<!-- 批量新增 -->
+<script>
+import useColumns from "./column";
+import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList} from '@/api/changeApply/basic';
+
+
+export default {
+  name: "AddChangeOrders",
+  props: {
+    dict: {
+      type: Object,
+    },
+    addType: {
+      type: String,
+      default: "add",
+    },
+  },
+  components: {
+    AmendantRecord: () => import("../amendantRecord/index.vue"),
+    ElSuperForm: () => import("@/components/super-form/index.vue"),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+    ElPopoverTreeSelect: () =>
+      import("@/components/popover-tree-select/index.vue"),
+  },
+
+  data() {
+
+    const {
+      TabColumns,
+      TableColumns,
+      TabColumns: [
+        {
+          item: { key: tabName },
+        },
+      ],
+    } = useColumns();
+
+    const rules = this.$init.rules([...TabColumns, ...TableColumns]);
+    const params = this.$init.params([...TabColumns, ...TableColumns]);
+    return {
+      width: "100%",
+      visible: false,
+      loading:false,
+      rules,
+      params,
+      tabName: tabName,
+      TabColumns: TabColumns,
+      TableColumns: TableColumns,
+    };
+  },
+  computed: {
+    title: {
+      get() {
+        const { addType } = this;
+        if (addType === "add") {
+          return "新 增";
+        }
+        if (addType === "edit") {
+          return "编 辑";
+        }
+      },
+      set() {},
+    },
+    materialInfo:{
+      get(){
+        const { materialBasic } = this.params;
+        this.params.materialBasic = materialBasic.map((item, index) => ({
+          ...item,
+          $index: index,
+        }));
+
+        return {
+          materialBasic: this.params.materialBasic.filter(
+            ({ delFlag }) => delFlag !== "2"
+          ),
+        }
+      },
+      set(){},
+    }
+  
+  },
+  watch: {
+    
+  },
+  methods: {
+    setVisible(prop){
+      this.visible = prop;
+    },
+    beforeOpen(){
+      if(this.addType === 'add'){
+        let {name,nickName} = this.$store.state.user;
+        this.params.createBy = name;
+        this.params.createByName = nickName;
+        this.params.createTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
+        this.params.updateBy = name;
+        this.params.updateByName = nickName;
+        this.params.updateTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
+        // this.params.approver = name;
+        this.params.applicationTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
+        this.params.status = '0';
+        console.log(this.$store.state.user,'user');
+        this.params.orgName = '德荣集团';
+        this.useRowAdd(this.tabName);
+      }
+    },
+
+    //
+    async fetchItem(prop) {
+      console.log(prop,'prop----------------');
+      try {
+        // try
+        this.loading = true;
+
+        let { code, data } = await getChangeDetails(prop.id);
+
+        if(code == 200){
+          this.params = data;
+        }
+        
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    
+    //
+    async hide() {
+      const {
+        TabColumns,
+        TableColumns,
+        TabColumns: [
+          {
+            item: { key: tabName },
+          },
+        ],
+      } = useColumns();
+      this.visible = false;
+      this.$emit('success');
+      this.tabName = tabName;
+      this.params = this.$init.params([...TabColumns, ...TableColumns]);
+    },
+    //
+    async useRowAdd(prop) {
+      
+      const { TableColumns } = this.TabColumns.find(
+        ({ item: { key } }) => key === prop
+      );
+      this.params[prop].push({
+        delFlag: "0",
+        materialClassifyId:null,
+        ...this.$init.params(TableColumns),
+      });
+    },
+    //
+    async useRowRemove(prop, scope) {
+      const { addType } = this.$props;
+      const {
+        row: { $index },
+      } = scope;
+      if (addType === "add") {
+        this.params[prop].splice($index, 1);
+      }
+      if (addType === "edit") {
+        this.params[prop] = this.params[prop].map((item, index) => ({
+          ...item,
+          delFlag: index === $index ? "2" : item.delFlag,
+        })).filter(item =>( item.id  || (!item.id && item.delFlag === '0')) )
+        ;
+      }
+    },
+    handleSubmitValidate(prop,cb){
+
+      this.$refs[prop].$refs[prop].validate(async (valid) => {
+        if (valid) {
+          try {
+            this.loading = true;
+
+            let validList = this.params['materialBasic'].filter(item => item.delFlag === '0');
+
+            if(validList.length){
+              await cb();
+            }else{
+              this.$notify.error({
+                message:'物料信息不能不为空!'
+              })
+            }
+            
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    //
+    async useSubmit(prop) {
+      console.log(this.params,'this.params');
+      this.handleSubmitValidate(prop,async()=>{
+
+        try {
+          this.loading = true;
+          const {code,msg} = await addChangeList(this.params);
+
+          if(code == 200){
+
+            this.hide();
+            this.$notify.success({
+              title: msg,
+            });
+          }
+          
+        } catch (error) {}
+        finally{
+          this.loading = false;
+        }
+
+        
+        // await;
+      })
+    },
+  },
+  created() {
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+
+<template>
+    <el-drawer
+      v-bind="$attrs"
+      v-on="$listeners"
+      :size="width"
+      :visible.sync="visible"
+      destroy-on-close
+      :show-close="false"
+      @close="hide"
+      @open="beforeOpen"
+      v-loading="loading"
+    >
+      <div 
+        slot="title" 
+        style="display: flex;
+            justify-content: space-between;
+            align-items: center;"
+      >
+        <h3>{{title}}</h3>
+        <div>
+          <el-button
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="useSubmit('superForm')"
+          >确 认</el-button
+        >
+        <el-button :size="$attrs.size" :loading="loading" @click="hide"
+          >取 消</el-button
+        >
+        </div>
+      </div>
+      <el-super-form
+        v-model="params"
+        :dict="dict"
+        :rules="rules"
+        :size="$attrs.size"
+        :columns="TableColumns"
+        ref="superForm"
+        label-width="auto"
+        label-position="right"
+        style="padding: 20px"
+      >
+        <template slot="puOrgName" slot-scope="scope">
+          <component
+            v-bind="scope.attr"
+            v-model="scope.row[scope.item.key]"
+            :size="$attrs.size"
+            :source.sync="scope.row"
+          >
+          </component
+        ></template>
+      </el-super-form>
+      
+  
+      <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+        <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="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"
+                >
+                </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"
+                >
+                </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"
+                >
+                </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"
+                  :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>
+        </el-tab-pane>
+      </el-tabs>
+
+      
+     
+    </el-drawer>
+</template>
+
+<style scoped>
+::v-deep .el-table__row.is-hidden {
+  display: none;
+}
+</style>
+
+

+ 7 - 0
src/views/material/changeApply/amendantRecord/column.js

@@ -0,0 +1,7 @@
+export const recordColumns = [
+  { item: { key: "pageCondtion", title: "字段名称" }, attr: {} },
+  { item: { key: "afterChangeValue", title: "变更前" }, attr: {} },
+  {
+    item: { key: "beforeChangeValue", title: "变更后" },attr: {},
+  },
+];

+ 102 - 0
src/views/material/changeApply/amendantRecord/index.vue

@@ -0,0 +1,102 @@
+<!-- 修改记录 -->
+<script>
+import {recordColumns} from './column';
+import {getRecordList} from '@/api/changeApply/basic';
+
+export default {
+  name:'AmendantRecord',
+  components:{
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+  },
+  dicts:[],
+  props:{
+    type:{
+      type:String,
+      default:'text',
+    },
+    value:{
+      type:Object,
+      require:true,
+    },
+    size:{
+      type:String,
+      default:'mini'
+    }
+  },
+  data(){
+
+    return {
+      title:'修改记录',
+      visible:false,
+      loading:false,
+      tableData:[],
+      TableColumns:recordColumns,
+      
+
+    }
+  },
+  methods:{
+    async beforeOpen(){
+      try {
+        let {id} = this.value;
+
+        this.loading = true;
+
+        let {code,rows} = await getRecordList({changeId:id});
+
+        if(code == 200){
+          this.tableData = rows;
+        }
+        
+      } catch (error) {
+        
+      }finally{
+        this.loading = false;
+      }
+    },
+    // 
+    handleClose(){},
+    handleClick(){
+      this.visible = true;
+    },
+  },
+  created(){},
+}
+</script>
+
+<template>
+
+  <el-button 
+    v-bind="$attrs"
+    v-on="$listeners"
+    :type="type"
+    @click="handleClick"
+    :size="size"
+  >
+    {{ title }}
+    <el-drawer
+      :title="title"
+      v-loading="loading"
+      width="50%"
+      @open="beforeOpen"
+      :visible.sync="visible"
+      append-to-body
+      direction="rtl"
+      :size="size"
+    >
+
+      <div style="padding: 10px;">
+
+        <el-super-table
+          v-model="tableData"
+          :dict="dict"
+          :columns="TableColumns"
+          :size="size"
+          >
+        </el-super-table>
+      </div>
+
+    </el-drawer>
+  </el-button>
+
+</template>

+ 128 - 0
src/views/material/changeApply/batchImport/index.vue

@@ -0,0 +1,128 @@
+<script>
+import { importData, fileImport} from '@/api/requisition/basic';
+export default {
+  name:'BatchImport',
+  props:{},
+  data(){
+    return {
+      title:'批量导入',
+      visible:false,
+      fileData:[]
+    }
+  },
+  methods:{
+    beforeColse(){},
+    handleClick(){
+      this.visible = true;
+    },
+    confirmUpdate(){
+  if (this.fileData.length) {
+
+    let formData = new FormData();
+
+    formData.append('file', this.fileData[0].raw);
+    importData(formData).then(res => {
+      if (res.code == 200) {
+        this.visible = false;
+        this.fileData = [];
+        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.$notify({
+          message: res.data.msg,
+          type: res.data.flag ? 'warning' : 'success'
+        });
+      } else {
+        this.$notify({
+          message: res.msg,
+          type: res.code == 200 ? 'success' : 'warning'
+        });
+      }
+    })
+      } else {
+      this.$notify({
+        title:'警告',
+        message: '请上传文件之后在确认!',
+        type: 'warning'
+      });
+      }
+    },
+  
+    handleDownTemplate(){},
+    handleFileRemove(file, fileList) {
+        console.log('删除文件', file, 'file', fileList, 'fileList');
+        this.fileData = fileList;
+      },
+    handleChangeFile(file, fileList){
+      this.fileData = fileList;
+    },
+    cancal(){
+      this.fileData = [];
+      this.visible = false;
+    },
+  },
+  created(){},
+}
+</script>
+
+<template>
+  <el-button
+    v-bind="$attrs"
+    v-on="$listeners"
+    type="primary"
+    @click="handleClick"
+    :size="size"
+  >
+    {{ title }}
+    <el-dialog 
+      :title="title" 
+      :visible.sync="visible"
+      width="35%" 
+      center
+      append-to-body
+      :before-close="beforeColse"
+    >
+      <div>
+        <el-upload 
+          accept=".xls, .xlsx" 
+          ref="upload" 
+          action="#" 
+          :on-remove="handleFileRemove"
+          :file-list="fileData" 
+          :auto-upload="false" 
+          :on-change="handleChangeFile" 
+          :limit="1"
+        >
+          <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>
+
+      </div>
+      <span slot="footer">
+        <el-button @click="cancal">取 消</el-button>
+        <el-button type="primary" @click="confirmUpdate">确 定</el-button>
+      </span>
+    </el-dialog>
+  </el-button>
+</template>

+ 77 - 0
src/views/material/changeApply/columns.js

@@ -0,0 +1,77 @@
+export default function useColumns() {
+
+  const TableColumns = [
+    { item: { key: "orgName", title: "所属组织" }, attr: {} },
+    { item: { key: "code", title: "单据编码" }, attr: {} },
+    {
+      item: { key: "applicationTime", title: "申请时间" },
+      attr: { },
+    },
+    { item: { key: "status", title: "单据状态",width:120, }, 
+      attr: {
+        
+        is: "el-dict-tag",
+        dictName: "documents_status", // 字典名
+      } 
+    },
+    // { item: { key: "materialCode", title: "物料编码" }, attr: {} },
+    // {
+    //   item: { key: "materialName", title: "物料名称" },
+    //   attr: {},
+    // },
+    { item: { key: "approver", title: "最后审批人" }, attr: {} },
+    { item: { key: "approvalTime", title: "最后审核时间" }, attr: {} },
+    { item: { key: "createByName", title: "创建人" ,width:150, }, attr: {} },
+    { item: { key: "createTime", title: "创建时间" }, attr: {} },
+    {
+      item: { key: "updateByName", title: "最后修改人" ,width:150, },
+      attr: {  },
+    },
+    { item: { key: "updateTime", title: "最后修改时间" }, attr: {} },
+   
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, fixed: false },
+  }));
+
+  const SearchColumns = [
+    {
+      item: { key: "materialCode", title: "物料编码" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "MATERIAL_PARAM",
+        valueKey: "code",
+        clearable:true,
+        dataMapping: { 
+          materialName: "name",
+        },
+      },
+    },
+    {
+      item: { key: "materialName", title: "物料名称" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "MATERIAL_PARAM",
+        valueKey: "name",
+        clearable:true,
+        dataMapping: { 
+          materialCode: "code",
+        },
+      },
+    },
+    {
+      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 },
+  }));
+
+  return { TableColumns, SearchColumns };
+}

+ 15 - 0
src/views/material/changeApply/dicts.js

@@ -0,0 +1,15 @@
+import { initDicts } from "@/utils/init.js";
+
+const modules = require.context("./add/", true, /column.js$/);
+const columns = [];
+modules.keys().forEach((fileName) => {
+  const data = modules(fileName).default();
+  for (const key in data) {
+    if (key === "TabColumns") {
+      columns.push(...data[key].map((item) => item.TableColumns).flat());
+    } else {
+      columns.push(...data[key]);
+    }
+  }
+});
+export const dicts = initDicts(columns);

+ 142 - 239
src/views/material/changeApply/index.vue

@@ -1,278 +1,181 @@
 <template>
-  <div class="changeApply">
-    <div class="applyList" v-if="isList">
-      <el-row :gutter="10" class="mb10">
-          <!-- <el-select size="small" v-model="textValue" placeholder="请选择">
-          <el-option
-            v-for="item in text"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-          </el-option>
-        </el-select>
 
-        <el-select size="small" v-model="ruleValue" placeholder="请选择">
-          <el-option
-            v-for="item in rule"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-          </el-option>
-        </el-select> -->
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">物料编码</span>
-          <el-input
-            v-model="queryParams.materialCode"
-            size="small"
-            placeholder="请输入物料编码查询"
-            clearable
-            style="width: 240px"
-          />
-        </el-col>
+  <el-card 
+    v-loading="loading" 
+    style="width: calc(100% - 24px); height: 100%; margin: 10px;padding: 10px;" 
+    :body-style="{ padding: 0 }"
+  >
 
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">物料名称</span>
-          <el-input
-            v-model="queryParams.materialName"
-            size="small"
-            placeholder="请输入物料名称查询"
-            clearable
-            style="width: 240px"
-          />
-        </el-col>
+    <AddChangeOrders
+      ref="addChangeOrders"
+      :size="size"
+      :dict="dict"
+      :add-type="optionType"
+      @success="useReset"
+    ></AddChangeOrders>
+    <SeeChangeOrders
+      ref="seeChangeOrders"
+      :size="size"
+      :dict="dict"
+      @success="useReset"
+    ></SeeChangeOrders>
 
-        <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>
+    <div>
 
+      <el-super-search
+        v-model="params"
+        :size="size"
+        :dict="dict"
+        :columns="SearchColumns"
+        @reset="useReset"
+        @row-dblclick="useSee"
+        @submit="useQuery(params, page)"
+      ></el-super-search>
+
+      <el-row 
+        :gutter="10" 
+        class="mb10" 
+        type="flex" 
+        justify="end"
+        style="margin-top: 20px;"
+      >
         <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-button type="primary" size="small" @click="newAdd">新增</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 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"
+      <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 type="selection" width="55" /> -->
-        <el-table-column label="序号" align="center" type="index" width="50" />
-        <el-table-column label="所属组织" align="center" width="200" prop="orgId" />
-        <el-table-column label="单据编码" align="center" width="200" prop="code" />
-        <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="materialName" />
-        <!-- <el-table-column label="最后审批人" align="center" width="120" prop="approver" />
-        <el-table-column label="最后审核时间" align="center" width="150" prop="approvalTime" /> -->
-        <el-table-column label="创建人" align="center" prop="createByName" />
-        <el-table-column label="创建时间" align="center" width="150" prop="createTime" />
-        <el-table-column label="最后修改人" align="center" width="120" prop="updateByName" />
-        <el-table-column label="最后修改时间" align="center" width="150" prop="updateTime" />
-        <el-table-column
-          fixed="right"
-          label="操作"
-          align="center"
-          width="150"
-          >
+        <el-table-column fixed="right" label="操作" width="150" align="center">
           <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 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-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>
+      </el-super-table>
     </div>
+</el-card>
 
-    <component :is="isComponent" v-model="isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList" v-if="!isList"/>
-  </div>
 </template>
 
 <script>
-import addApply from './add.vue';
-import { getChangeList , deleteChangeList} from '@/api/changeApply/basic'
+import { dicts } from "./dicts";
+import { getChangeList , deleteChangeList} from '@/api/changeApply/basic';
+import useColumns from './columns';
 export default {
   name: 'changeApply',
+  dicts:dicts,
   components: {
-    addApply
+    AddChangeOrders:() => import('./add/index.vue'),
+    SeeChangeOrders:() => import('./see/index.vue'),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElSuperSearch: () => import("@/components/super-search/index.vue"),
   },
-  data() {
-    return{
+
+  data(){
+    const {TableColumns,SearchColumns} = useColumns();
+    const params = this.$init.params(SearchColumns);
+    return {
+      loading:false,
+      size:'mini',
       tableList: [],
-      queryParams: {
-        materialCode: '',
-        materialName: '',
-        status: '',
-        pageNum: 1,
-        pageSize: 10
-      },
-      options: [{
-        value: 0, label: '未提交'
-      },{
-        value: 1, label: '审批中'
-      },{
-        value: 2, label: '已完成'
-      },{
-        value: 3, label: '已驳回'
-      },],
-      total:0,
-      // isComponent
-      isComponent:'addApply',
-      isList: true,
-      // 页面状态
-      page: '',
-      rowDetail: {},
-      disable: false
+      TableColumns:TableColumns,
+      page: { pageNum: 1, pageSize: 10, total: 0 },
+      params:params,
+      SearchColumns:SearchColumns,
+      optionType:'add',
+
+
     }
   },
-  created() {
+  methods:{
     
-  },
-  mounted() {
-    this.getList(this.queryParams)
-  },
-  methods: {
-    reset() {
-      this.queryParams.materialCode = ''
-      this.queryParams.materialName = ''
-      this.queryParams.pageNum = 1
-      this.queryParams.status = ''
-      this.getList(this.queryParams)
-    },
-    newAdd() {
-      this.isList = false
-      this.isComponent = 'addApply'
-      this.page = 'add'
-      this.disable = false
+    useReset(){
+      this.page.pageNum = 1;
+      this.page.pageSize = 10;
+      this.params = this.$init.params(this.SearchColumns);
+      this.useQuery(this.params, this.page);
     },
-    getList(val) {
-      console.log('val',val)
-      getChangeList(val).then(res => {
-        if (res.code === 200) {
-          this.tableList = res.rows
-          this.total = res.total
-        }
-      })
+    
+    // 
+    openAddChangeOrders(row) {
+    
+      const {setVisible,fetchItem} = this.$refs.addChangeOrders;
+
+      setVisible(true);
+
+      row && fetchItem(row);
     },
-    // 表格内状态栏判断值
-    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 '已驳回'
-      }
+
+    async newAdd(){
+      this.optionType = 'add';
+      await this.openAddChangeOrders();
     },
-    // 
-    handleSelectionChange () {
+
+    async handleEdit(row){  
+      this.optionType = 'edit';
+      await this.openAddChangeOrders(row);
 
     },
-    check(row) {
-      console.log('查看详情', row)
-      this.isList = false
-      this.isComponent = 'addApply'
-      this.page = 'check'
-      this.rowDetail = row
-      this.disable = true
+
+    async useQuery(params,page) {
+      try {
+        this.loading = true;
+        let {code,rows,total} = await getChangeList({...params,...page});
+        if (code === 200) {
+          this.tableList = rows
+          this.page.total = total;
+        }
+      } catch (error) {
+        
+      }finally{
+        this.loading = false;
+      }
     },
-    edit(row) {
-      console.log('修改先加载详情', row)
-      this.isList = false
-      this.isComponent = 'addApply'
-      this.page = 'edit'
-      this.rowDetail = row
-      this.disable = false
+   
+
+    async useSee(row){
+      const {setVisible,fetchItem} = this.$refs.seeChangeOrders;
+      await setVisible(true);
+      await fetchItem(row);
+
     },
-    deleteRow(row) {
+    deleteRow(row){
       this.$confirm('是否删除此条数据?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          deleteChangeList({id: 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)
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async() => {
+
+        try {
+          let {code,msg} = await deleteChangeList({id: row.id});
+
+          if(code == 200){
+            this.$notify.success({
+              // title: '成功',
+              message: msg,
+            });
+            await this.useQuery(this.params, this.page);
+          }
+        } catch (error) {}
+      })
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
-      this.queryParams.pageNum = val
-      this.getList(this.queryParams)
-    }
-  }
+ 
+  },
+  created(){
+    this.useQuery(this.params, this.page);
+  },
 }
-</script>
 
-<style scoped lang="scss">
-.changeApply {
-  height: calc(100vh - 84px);
-  padding: 12px;
-  box-sizing: border-box;
-}
-</style>
+</script>

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

@@ -0,0 +1,289 @@
+<!-- 批量新增 -->
+<script>
+import useColumns from "../add/column";
+import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList} from '@/api/changeApply/basic';
+
+
+export default {
+  name: "SeeChangeOrders",
+  props: {
+    dict: {
+      type: Object,
+    },
+  },
+  components: {
+    AmendantRecord: () => import("../amendantRecord/index.vue"),
+    ElSuperForm: () => import("@/components/super-form/index.vue"),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+    ElPopoverTreeSelect: () =>
+      import("@/components/popover-tree-select/index.vue"),
+  },
+
+  data() {
+
+    const {
+      TabColumns,
+      TableColumns,
+      TabColumns: [
+        {
+          item: { key: tabName },
+        },
+      ],
+    } = useColumns();
+
+    const rules = this.$init.rules([...TabColumns, ...TableColumns]);
+    const params = this.$init.params([...TabColumns, ...TableColumns]);
+    let tabColumns = _.cloneDeep(TabColumns);
+    tabColumns =  tabColumns.map(item =>( 
+
+      {...item,
+        TableColumns: [...item.TableColumns.map(column =>({
+          item:{...column.item,disabled:true},
+          attr:{
+            ...column.attr,
+            disabled:true
+          }
+        }))]
+      }
+      )
+
+    )
+
+    console.log(tabColumns,'tabColumns');
+    
+    return {
+      width: "100%",
+      visible: false,
+      loading:false,
+      title:'查看',
+      rules,
+      params,
+      tabName: tabName,
+      TabColumns: tabColumns,
+      TableColumns: TableColumns,
+    };
+  },
+  computed: {
+   
+    materialInfo:{
+      get(){
+        const { materialBasic } = this.params;
+        this.params.materialBasic = materialBasic.map((item, index) => ({
+          ...item,
+          $index: index,
+        }));
+
+        return {
+          materialBasic: this.params.materialBasic.filter(
+            ({ delFlag }) => delFlag !== "2"
+          ),
+        }
+      },
+      set(){},
+    }
+  
+  },
+  watch: {
+    
+  },
+  methods: {
+    setVisible(prop){
+      this.visible = prop;
+    },
+    beforeOpen(){
+    },
+    //
+    async fetchItem(prop) {
+      try {
+        // try
+        this.loading = true;
+
+        let { code, data } = await getChangeDetails(prop.id);
+
+        if(code == 200){
+          this.params = data;
+        }
+        
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    
+    //
+    async hide() {
+      const {
+        TabColumns,
+        TableColumns,
+        TabColumns: [
+          {
+            item: { key: tabName },
+          },
+        ],
+      } = useColumns();
+      this.visible = false;
+      this.tabName = tabName;
+      this.$emit('success');
+      this.params = this.$init.params([...TabColumns, ...TableColumns]);
+    },
+   
+    async handleSubmit(){
+      this.params = {...this.params,status:'1'};
+      console.log(this.params,'this.params');
+      try {
+          this.loading = true;
+          
+          const {code,msg} = await addChangeList(this.params);
+
+          if(code == 200){
+
+            this.hide();
+            this.$notify.success({
+              message: msg,
+            });
+          }
+          
+        } catch (error) {}
+        finally{
+          this.loading = false;
+        }
+    },
+    handleSubmitValidate(prop,cb){
+
+      this.$refs[prop].$refs[prop].validate(async (valid) => {
+        if (valid) {
+          try {
+            this.loading = true;
+
+            await cb();
+            
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+  },
+  created() {
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+
+<template>
+    <el-drawer
+      v-bind="$attrs"
+      v-on="$listeners"
+      :size="width"
+      :visible.sync="visible"
+      destroy-on-close
+      :show-close="false"
+      @close="hide"
+      @open="beforeOpen"
+      v-loading="loading"
+    >
+      <div 
+        slot="title" 
+        style="display: flex;
+            justify-content: space-between;
+            align-items: center;"
+      >
+        <h3>{{title}}</h3>
+        <div>
+          <el-button 
+            v-if="params.status === '0' || params.status === '3'"
+            type="primary"
+            :size="$attrs.size" 
+            :loading="loading" 
+            @click="handleSubmit"
+          >
+            提 交
+          </el-button>
+          <el-button :size="$attrs.size" :loading="loading" @click="hide"
+            >取 消</el-button>
+        </div>
+      </div>
+      <el-super-form
+        v-model="params"
+        :dict="dict"
+        :rules="rules"
+        :size="$attrs.size"
+        :columns="TableColumns"
+        ref="superForm"
+        label-width="auto"
+        label-position="right"
+        style="padding: 20px"
+      >
+        <template slot="puOrgName" slot-scope="scope">
+          <component
+            v-bind="scope.attr"
+            v-model="scope.row[scope.item.key]"
+            :size="$attrs.size"
+            :source.sync="scope.row"
+            @change="changePuOrgName({ ...scope, select: $event })"
+          >
+          </component
+        ></template>
+      </el-super-form>
+      
+    
+        <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+          <el-tab-pane
+            v-for="({ item, TableColumns: columns }, index) in TabColumns"
+            :key="index"
+            :label="item.title"
+            :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"
+                  @change="changeMaterialName(scope)"
+                >
+                </component>
+              </template>
+              <el-table-column fixed="right" label="操作" width="120" align="center">
+                
+                <template slot-scope="scope">
+                  <AmendantRecord
+                    v-if=" tabName ==='materialBasic' "
+                    v-model="scope.row"
+                  ></AmendantRecord>
+                  
+                </template>
+              </el-table-column>
+            </el-super-table>
+          </el-tab-pane>
+        </el-tabs>
+     
+    </el-drawer>
+</template>
+
+<style scoped>
+::v-deep .el-table__row.is-hidden {
+  display: none;
+}
+</style>
+
+

+ 9 - 8
src/views/purchase/DemandSummary/add.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="checkDemandSummary">
-    <el-card style="height: calc(100vh - 15vh);position: relative;overflow: scroll;">
+    <el-card style="position: relative;">
       <span>采购需求处理详情</span>
       <div class="btn_grooup">
         <el-button type="primary" size="mini" @click="editLine">编辑</el-button>
@@ -17,12 +17,12 @@
           :header-cell-style="{ borderColor: '#c0c0c0' }"
           class="exporttable"
           border
-          max-height="680"
+          max-height="580"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
-        <el-table-column show-overflow-tooltip type="selection"/>
-        <el-table-column show-overflow-tooltip label="序号" align="center" type="index" width="55"/>
+        <el-table-column show-overflow-tooltip type="selection" fixed="left"/>
+        <el-table-column show-overflow-tooltip label="序号" align="center" type="index" width="55" fixed="left"/>
         <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo">
           <template slot-scope="scope">
             {{ scope.$index + 1 + '0' }}
@@ -236,7 +236,6 @@ export default {
       console.log('数据', this.row)
       let param = JSON.parse(JSON.stringify(this.query))
       param.sumFlag = this.row.sumFlag
-      param.demandItemId = this.row.demandItemId
       this.getDetails(param)
     }
   },
@@ -256,6 +255,7 @@ export default {
     },
     // 如果需要回显则调用详情接口
     getDetails(row) {
+      row.demandItemId = this.row.demandItemId
       getSummaryDetail(row).then(res => {
         if (res.code === 200) {
           this.tableList = res.data
@@ -309,9 +309,10 @@ export default {
         reloadBatch(param).then(res => {
           if (res.code === 200) {
             this.$modal.notifySuccess("操作成功");
-            let param = JSON.parse(JSON.stringify(this.query))
-            param.sumFlag = this.row.sumFlag
-            this.getDetails(param)
+            let params = JSON.parse(JSON.stringify(this.query))
+            params.sumFlag = this.row.sumFlag
+            params.demandItemId = this.row.demandItemId
+            this.getDetails(params)
           }
         })
       }).catch(() =>{})

+ 6 - 5
src/views/purchase/DemandSummary/index.vue

@@ -228,12 +228,14 @@
           border
           show-summary
           :summary-method="getSummaries"
-          max-height="550"
+          height="355"
+          max-height="355"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
           :key="isUpdate"
         >
-          <el-table-column type="selection" width="60" />
+          <el-table-column type="selection" width="60" fixed="left"/>
+          <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
           <!-- <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo"/> -->
           <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="100px" :formatter="hangStatus"/>
           <el-table-column show-overflow-tooltip label="一级品类" align="center" prop="materialClassifyOneName" width="100px"/>
@@ -343,7 +345,7 @@
 </template>
 
 <script>
-import Add from './add.vue'
+import Add from './add'
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import popDialog from '@/components/PopDialog/index.vue'
@@ -782,7 +784,6 @@ export default {
 
 <style lang="scss" scoped>
 #demandSummary {
-  height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
   overflow-y: scroll;
@@ -809,7 +810,7 @@ export default {
   border: none;
 }
  ::v-deep .el-card .el-form-item {
-  margin-bottom: 10px;
+  margin-bottom: 3px;
 }
 </style>
 <style>

+ 6 - 5
src/views/purchase/MaterialClassDivision/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="MaterialClassDivision">
     <div v-if="isList">
-      <el-card style="height: calc(100vh - 15vh);position: relative;overflow: scroll;">
+      <el-card style="position: relative;">
       <el-form class="search_area" label-width="130px">
         <el-row :gutter="10">
           <el-col :span="1.5">
@@ -215,11 +215,13 @@
           :header-cell-style="{ borderColor: '#c0c0c0' }"
           class="exporttable"
           border
-          max-height="480"
+          height="390"
+          max-height="390"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column show-overflow-tooltip type="selection" width="55" />
+          <el-table-column show-overflow-tooltip type="selection" width="55" fixed="left"/>
+          <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="120" prop="materialClassify"/>
           <!-- <el-table-column show-overflow-tooltip label="物料分类名称" align="center" width="200" prop="materialClassifyName" /> -->
           <el-table-column show-overflow-tooltip label="一级分类名称" align="center" width="120" prop="materialClassifyOneName" />
@@ -484,7 +486,6 @@ export default {
 
 <style lang="scss" scoped>
 #MaterialClassDivision {
-  height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
   overflow-y: scroll;
@@ -501,7 +502,7 @@ export default {
   border: none;
 }
  ::v-deep .el-card .el-form-item {
-  margin-bottom: 10px;
+  margin-bottom: 3px;
 }
 .el-pagination {
   margin-top: 10px;

+ 305 - 142
src/views/purchase/PurchaseDemandList/add.vue

@@ -1,18 +1,123 @@
 <template>
   <div id="addDemandList">
-  <el-card style="height: calc(100vh - 15vh);position: relative;overflow: scroll;">
+  <el-card style="position: relative;">
     <span>基本信息</span>
-    <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
+    <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto" :show-message="false">
       <el-row :gutter="10">
         <el-col :span="1.5">
-            <el-form-item label="编码">
-              <el-input
-                v-model="basicForm.code"
-                size="mini"
-                disabled
-                style="width: 200px"
-              />
-            </el-form-item>
+          <el-form-item label="业务类型" prop="billType" :rules="{ required: true, message: '请选择业务类型', trigger: 'blur' }">
+            <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="mini" style="width: 200px">
+              <el-option v-for=" dict in dict.type.sys_business" :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-select clearable size="mini" v-model="basicForm.customer" :disabled="sonDisable" @clear="cleanCustomer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
+              <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="需求人员">
+              <el-select clearable size="mini" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
+                <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
+              </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="需求部门">
+            <el-select clearable v-model="basicForm.demandDept" size="mini" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
+              <el-option
+                v-for="item in deptOptions"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="需求计划">
+            <el-select v-model="basicForm.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="需求日期" prop="demandDate" :rules="{ required: true, message: '请选择需求日期', trigger: 'blur' }">
+            <el-date-picker
+              v-model="basicForm.demandDate"
+              :disabled="sonDisable"
+              clearable
+              type="date"
+              value-format="yyyy-MM-dd"
+              @change="changeDemandDate"
+              size="mini"
+              style="width: 200px"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="制单日期" prop="createTime">
+            <el-date-picker
+              v-model="basicForm.createTime"
+              :disabled="sonDisable"
+              clearable
+              type="date"
+              value-format="yyyy-MM-dd"
+              size="mini"
+              style="width: 200px"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="是否客户指定">
+            <el-select clearable v-model="basicForm.isCustomerSpecified" :disabled="sonDisable" 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-input
+              v-model.trim="basicForm.remark"
+              size="mini"
+              :disabled="sonDisable"
+              clearable
+              style="width: 200px"
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="需求客户名称">
+            <el-input disabled v-model="basicForm.customerName" size="mini" style="width: 200px"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="编码">
+            <el-input
+              v-model="basicForm.code"
+              size="mini"
+              disabled
+              style="width: 200px"
+            />
+          </el-form-item>
          </el-col>
 
         <!-- <el-col :span="1.5">
@@ -33,20 +138,6 @@
           </el-col>
 
          <el-col :span="1.5">
-            <el-form-item label="需求客户">
-              <el-select clearable size="mini" v-model="basicForm.customer" :disabled="sonDisable" @clear="cleanCustomer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
-                <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-
-         <el-col :span="1.5">
-            <el-form-item label="需求客户名称">
-              <el-input disabled v-model="basicForm.customerName" size="mini" style="width: 200px"></el-input>
-            </el-form-item>
-          </el-col>
-
-         <el-col :span="1.5">
             <el-form-item label="客户负责人">
               <el-select disabled size="mini" v-model="basicForm.customerPrincipal" style="width: 200px">
                 <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code"/>
@@ -54,43 +145,6 @@
             </el-form-item>
           </el-col>
 
-         <el-col :span="1.5">
-            <el-form-item label="需求人员">
-                <el-select clearable size="mini" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
-                  <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
-                </el-select>
-            </el-form-item>
-          </el-col>
-
-         <el-col :span="1.5">
-            <el-form-item label="需求部门">
-              <el-select clearable v-model="basicForm.demandDept" size="mini" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
-                <el-option
-                  v-for="item in deptOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="1.5">
-            <el-form-item label="需求日期" prop="demandDate" :rules="{ required: true, message: '请选择需求日期', trigger: 'blur' }">
-              <el-date-picker
-                v-model="basicForm.demandDate"
-                :disabled="sonDisable"
-                clearable
-                type="date"
-                value-format="yyyy-MM-dd"
-                @change="changeDemandDate"
-                size="mini"
-                style="width: 200px"
-              >
-              </el-date-picker>
-            </el-form-item>
-         </el-col>
-
           <el-col :span="1.5">
             <el-form-item label="单据来源">
               <el-select v-model="basicForm.source" disabled size="mini" style="width: 200px">
@@ -99,51 +153,6 @@
               </el-select>
             </el-form-item>
          </el-col>
-
-         <el-col :span="1.5">
-            <el-form-item label="业务类型" prop="billType" :rules="{ required: true, message: '请选择业务类型', trigger: 'blur' }">
-              <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="mini" style="width: 200px">
-                <el-option v-for=" dict in dict.type.sys_business" :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-select clearable v-model="basicForm.isSpeical" :disabled="sonDisable" 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="制单日期" prop="createTime">
-              <el-date-picker
-                v-model="basicForm.createTime"
-                :disabled="sonDisable"
-                clearable
-                type="date"
-                value-format="yyyy-MM-dd"
-                size="mini"
-                style="width: 200px"
-              >
-              </el-date-picker>
-            </el-form-item>
-         </el-col>
-
-          <el-col :span="1.5">
-            <el-form-item label="备注">
-              <el-input
-                v-model.trim="basicForm.remark"
-                size="mini"
-                :disabled="sonDisable"
-                clearable
-                style="width: 200px"
-              />
-            </el-form-item>
-         </el-col>
       </el-row>
 
 
@@ -158,14 +167,15 @@
       </div>
 
       <el-table
-          :data="basicForm.puDemandItemList"
+          v-myscroll
+          :data="basicForm.puDemandItemList.slice(0, over)"
           fit
           border
           :cell-style="{ borderColor: '#c0c0c0' }"
           :header-cell-style="{ borderColor: '#c0c0c0' }"
           class="exporttable"
-          height="290"
-          max-height="290"
+          height="410"
+          max-height="410"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
           :cell-class-name="cellClassName"
@@ -182,7 +192,7 @@
           <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" :formatter="hangStatus" width="100px"/>
           <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="220px" :render-header="addRedStar">
             <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'materialCode'" :rules="{ required: true, message: '请选择物料编码', trigger: 'blur' }">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'materialCode'" :show-message="false" :rules="{ required: true, message: '请选择物料编码', trigger: 'blur' }">
                 <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.materialCode" @paste.native="pasteMe($event, scope, scope.$index)">
                   <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
                 </el-input>
@@ -197,7 +207,7 @@
           <el-table-column show-overflow-tooltip label="最小包装" align="center"  prop="minPackage" width="100px"/>
           <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center"  prop="qty" width="150px" :render-header="addRedStar">
             <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :show-message="false" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
                 <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.qty" @input="getYLSL(scope)"/>
               </el-form-item>
             </template>
@@ -357,7 +367,7 @@
           <el-table-column show-overflow-tooltip label="详细地址" align="center"  prop="address" width="200px"/>
           <el-table-column show-overflow-tooltip label="价格类型" align="center"  prop="priceType" width="120px">
             <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'priceType'" :rules="{ required: true, message: '请选择价格类型', trigger: 'blur' }">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'priceType'" :show-message="false" :rules="{ required: true, message: '请选择价格类型', trigger: 'blur' }">
                 <el-select clearable :disabled="sonDisable" size="mini" v-model="scope.row.priceType">
                   <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
@@ -365,11 +375,11 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="是否客户指定" align="center"  prop="isSpeical" width="120px">
+          <el-table-column show-overflow-tooltip label="是否客户指定" align="center"  prop="isCustomerSpecified" width="120px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-switch
-                  v-model="scope.row.isSpeical"
+                  v-model="scope.row.isCustomerSpecified"
                   disabled
                   active-value="Y"
                   inactive-value="N"
@@ -408,18 +418,11 @@
       </el-table>
     </el-form>
       <div class="btn_group">
-        <el-col :span="1.5">
-          <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
-        </el-col>
-        <el-col :span="1.5" style="margin: 0 10px;">
-          <el-button type="primary" size="mini"  @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button size="mini" plain @click="back">返回</el-button>
-        </el-col>
+        <el-button type="primary" size="mini"  @click="jumpOA" v-if="sonPageStu == 'check' && (row.status == '1' || row.status == '2')">跳转OA</el-button>
+        <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
+        <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
+        <el-button type="primary" size="mini"  @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
+        <el-button size="mini" plain @click="back">返回</el-button>
       </div>
   </el-card>
 
@@ -427,7 +430,7 @@
 
       <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
 
-      <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
+      <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="false" />
 
 
     <!-- 批量调整参数 -->
@@ -514,7 +517,7 @@
 <script>
 import Reserved from './reserved.vue'
 import Refers from '@/components/Refers/refers.vue'
-import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan } from '@/api/purchase/purchaseDemand.js'
+import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan, toOA } from '@/api/purchase/purchaseDemand.js'
 // 用于回显参照框数据
 import {getRefer} from '@/api/purchase/basic.js'
 // 明细行选择物料参照
@@ -522,7 +525,7 @@ import popDialog from '@/components/PopDialog/index.vue'
 export default {
   name: 'addDemandList',
   props: ['pageStu','row', 'disable'],
-  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_plan_type', 'sys_status', 'sys_bill_source', 'sys_business','sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
   components: {
     Reserved,
     Refers,
@@ -554,11 +557,12 @@ export default {
         customerPrincipal: '',
         demandPersonal: this.$store.state.user.name,
         demandDept: this.$store.state.user.deptId,
+        planType: '1',
         demandDate: '',
         createTime: '',
         source: '4',
         billType: 'ZQBH',
-        isSpeical: 'N',
+        isCustomerSpecified: 'N',
         isProcess: '',
         isMonthleyCalculate: '',
         createTime: this.parseTime(new Date().getTime()),
@@ -640,12 +644,10 @@ export default {
       if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
         this.isBDXQ = true
         this.BDZT = false
-        this.anotherRedStar()
         this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
       } else {
         this.isBDXQ = false
         this.BDZT = true
-        this.anotherRedStar()
         this.basicForm.puDemandItemList.forEach(item => {
           item.isReplenishment = 'N'
           item.additionalSupplier = null
@@ -700,7 +702,11 @@ export default {
       this.basicForm.code = ''
       this.basicForm.createBy = ''
       this.basicForm.source = '4'
-      this.basicForm.isSpeical = 'N'
+      this.basicForm.isCustomerSpecified = 'N'
+      this.basicForm.demandPersonal = this.$store.state.user.name
+      this.basicForm.demandDept = this.$store.state.user.deptId
+      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 => {
         item.status = ''
         item.buyerName = ''
@@ -979,11 +985,9 @@ export default {
               if(this.basicForm.billType == 'BDXQ') {
                  this.BDZT = false
                  this.isBDXQ = true
-                 this.anotherRedStar()
               } else {
                  this.BDZT = true
                  this.isBDXQ = false
-                 this.anotherRedStar()
               }
             }
           })
@@ -992,7 +996,7 @@ export default {
     },
     // 单元格标红
     cellClassName({row, column, rowIndex, columnIndex}) {
-      if(this.basicForm.isSpeical == 'N' && column.label == '需求可用周期' && Number(row.demandPeriod) > 1.5 && Number(row.demandPeriod) > Number(row.minOrderQty)) {
+      if(this.basicForm.isCustomerSpecified == 'N' && column.label == '需求可用周期' && Number(row.demandPeriod) > 1.5 && Number(row.demandPeriod) > Number(row.minOrderQty)) {
         return 'success-row';
       }
     },
@@ -1318,6 +1322,7 @@ export default {
     },
     selectMaterial(selection) {
       console.log('选中的物料', selection)
+      if (selection.length <= 1) {
       // 选择新物料时先清空行内其他信息
       this.basicForm.puDemandItemList[this.tableIndex].reservedProportion = null
       this.basicForm.puDemandItemList[this.tableIndex].reservedPeriod = null
@@ -1388,7 +1393,160 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].transportationCondition = selection[0].transportationCondition
       this.basicForm.puDemandItemList[this.tableIndex].storageCondition = selection[0].storageCondition
       // 选中骨科耗材时候的物料,需求客户不必填
-
+      } else {
+        console.log('xxxxx', selection)
+        for (let i = 0;i<selection.length;i++) {
+          let line = {
+            contacts: null,
+            id: null,
+            demandId: null,
+            status: null,
+            businessDept: null,
+            businessDeptName: null,
+            materialCategory: null,
+            buyer: null,
+            buyerName: null,
+            mateiralClassifyOne: null,
+            materialClassifyOneName: null,
+            materialClassifyTwo: null,
+            materialClassifyTwoName: null,
+            materialClassifyThree: null,
+            materialClassifyThreeName: null,
+            materialClassifyFour: null,
+            materialClassifyFourName: null,
+            materialCode: null,
+            material: null,
+            materialName: null,
+            classifyId: null,
+            specification: null,
+            unit: null,
+            unitName: null,
+            manufacturerName: null,
+            registrant: null,
+            puPeriod: null,
+            expiryUnit: null,
+            expiry: null,
+            minPackage: null,
+            minOrderQty: null,
+            minBatch: null,
+            safeStock: null,
+            averageQtyMonth: null,
+            qty: null,
+            adjustmentPersonal: null,
+            adjustmentTime: null,
+            manualRegulation: null,
+            updateCause: null,
+            reservedProportion: null,
+            reservedPeriod: null,
+            reservedQty: null,
+            demandPeriod: null,
+            forecastClassify: null,
+            onemonthAvgVolume: null,
+            threemonthAvgVolume: null,
+            puFreight: null,
+            deliveryDate: null,
+            isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
+            isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
+            isBatchLock: 'N',
+            isCustomerSpecified: '',
+            remark: null,
+            puRemark: null,
+            lastWarehouseQty: null,
+            resDemandQty: null,
+            lastWarehouse: null,
+            lastWarehouseName: null,
+            deliveryWarehouse: null,
+            deliveryWarehouseName: null,
+            lastAllocation: null,
+            lastAllocationName: null,
+            deliveryAllocation: null,
+            deliveryAllocationName: null,
+            passageOn: null,
+            puOrg: null,
+            purOrgName: null,
+            lastStockQty: null,
+            superiorCenterQty: null,
+            superiorAllotQty: null,
+            availableQty: null,
+            statusAllot: 'N',
+            additionalSupplier: null,
+            additionalSupplierName: null,
+            periodUnit: null,
+            demandCustomer: this.basicForm.customer,
+            demandCustomerName: this.basicForm.customerName,
+            businessDept: this.basicForm.demandDept,
+            businessDeptName: null,
+            lastStockOrg: null,
+            lastStockOrgName: null,
+            superiorStockOrg: null,
+            superiorStockOrgName: null,
+            allotCode: null,
+            deliveryAddress: null,
+            deliveryAddressName: null,
+            contacts: null,
+            contactsPhone: null,
+            address: null,
+            source: null,
+            priceType: 'order',
+            puManagerApprover: null,
+            puManagerApproverName: null,
+            processTime: null,
+            affirmer: null,
+            tenantId: null,
+            revision: null,
+            createBy: null,
+            createByName: null,
+            createTime: null,
+            updateBy: null,
+            updateByName: null,
+            updateTime: null,
+            delFlag: 0,
+            // 新增字段
+            model: null,
+            storageCondition: null,
+            transportationCondition: null,
+          }
+                // 通过选择物料查询采购员
+          queryMan(selection[i].id).then(res => {
+            if (res.code === 200 && res.rows.length !== 0) {
+              line.buyer = res.rows[0].buyer
+              line.buyerName = res.rows[0].buyerName
+            }
+          })
+          line.businessDept = selection[i].businessDepartment
+          line.businessDeptName = selection[i].businessDepartmentName
+          line.materialCode = selection[i].code
+          line.material = selection[i].id
+          line.materialName = selection[i].name
+          line.classifyId = selection[i].classifyId
+          line.materialClassifyOneName = selection[i].oneClass
+          line.materialClassifyTwoName = selection[i].twoClass
+          line.materialClassifyThreeName = selection[i].threeClass
+          line.materialClassifyFourName = selection[i].fourClass
+          line.specification = selection[i].specification
+          line.model = selection[i].model
+          line.unit = selection[i].unitId
+          line.unitName = selection[i].unitIdName
+          line.registrant = selection[i].registrant
+          line.manufacturerName = selection[i].manufacturerIdName
+          line.puPeriod = selection[i].deliveryPeriod
+          line.expiry = selection[i].usefulLife
+          line.expiryUnit = selection[i].expiryUnitIdName
+          // line.minPackage = selection[i].usefulLife
+          line.minPackage = selection[i].minPackQty
+          line.minOrderQty = selection[i].minOrderQty
+          line.minBatch = selection[i].minBatchQty
+          line.safeStock = selection[i].safeStock
+          line.purOrgName = selection[i].purchasingOrganizationName
+          line.puOrg = selection[i].purchasingOrganization
+          // 物料存储条件和运输条件
+          line.transportationCondition = selection[i].transportationCondition
+          line.storageCondition = selection[i].storageCondition
+          this.basicForm.puDemandItemList.push(line)
+        }
+        // 删除指定下标
+        this.basicForm.puDemandItemList.splice(this.tableIndex,1)
+      }
     },
     // 明细行选择业务部门参照带出业务部门数据
     chooseDept(index, type, isPage, title) {
@@ -1575,6 +1733,11 @@ export default {
         ]; 
       }
     },
+    jumpOA() {
+      toOA(this.$store.state.user.name, this.basicForm.flowId).then(res => {
+
+      })
+    }
   }
 }
 </script>
@@ -1584,7 +1747,7 @@ export default {
   // width: 100%;
   // margin: 20px 0;
   display: flex;
-  // justify-content: center;
+  justify-content: space-between;
   position: absolute;
   top: 10px;right: 20px;
 
@@ -1600,10 +1763,10 @@ export default {
 .hang ::v-deep .el-form-item__content{
   margin-left: 0px !important;
 }
-.el-table ::v-deep .el-form-item__error{
-  padding-top: 0;
-  top: 70%
-}
+// .el-table ::v-deep .el-form-item__error{
+//   padding-top: 0;
+//   top: 70%
+// }
 .el-table ::v-deep .success-row {
   background: #f11616;
 }

+ 4 - 5
src/views/purchase/PurchaseDemandList/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="PurchaseDemandList">
     <div v-if="isList">
-      <el-card style="height: calc(100vh - 15vh);position: relative;overflow: scroll;">
+      <el-card style="position: relative;">
         <el-form class="search_area" label-width="100px">
           <el-row :gutter="10">
             <el-col :span="1.5">
@@ -165,13 +165,13 @@
           :cell-style="{ borderColor: '#c0c0c0' }"
           :header-cell-style="{ borderColor: '#c0c0c0' }"
           class="exporttable"
+          max-height="410"
           border
-          height="430"
-          max-height="430"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column show-overflow-tooltip type="selection" width="55" />
+          <el-table-column show-overflow-tooltip type="selection" width="55" fixed="left"/>
+          <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="approverFinishTime"/>
@@ -709,7 +709,6 @@ export default {
 
 <style lang="scss" scoped>
 #PurchaseDemandList {
-  height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
   overflow-y: scroll;

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

@@ -132,6 +132,7 @@ export default function useColumns() {
               specification: "specification",
               manufacturer: "manufacturerId",
               manufacturerName: "manufacturerIdName",
+              tax: "materialRateName",
             },
           },
         },
@@ -234,7 +235,6 @@ export default function useColumns() {
                 return time.getTime() < Date.now() + 3600 * 1000 * 24 * 365;
               },
             },
-
             value: new Date(new Date().getTime() + 3600 * 1000 * 24 * 366),
           },
         },

+ 44 - 187
src/views/purchase/apply/add/index.vue

@@ -1,7 +1,7 @@
 <script>
 import useColumns from "./columns";
 import { EXIST } from "@/api/business/purchase/catalogue";
-import { ITEM, SAVE } from "@/api/business/purchase/apply";
+import { SAVE } from "@/api/business/purchase/apply";
 import { tax, unit, currency } from "@/components/popover-select-v2/fetch";
 
 const fetchExist = async (prop) => {
@@ -23,14 +23,6 @@ export default {
     dict: {
       type: Object,
     },
-    selectData: {
-      type: [Array],
-      require: true,
-    },
-    addType: {
-      type: String,
-      default: "add",
-    },
   },
   components: {
     ElSuperForm: () => import("@/components/super-form/index.vue"),
@@ -50,6 +42,7 @@ export default {
     const rules = this.$init.rules([...TabColumns, ...TableColumns]);
     const params = this.$init.params([...TabColumns, ...TableColumns]);
     return {
+      title: "新 增",
       width: "100%",
       visible: false,
       loading: false,
@@ -60,82 +53,21 @@ export default {
       TableColumns: TableColumns,
     };
   },
-  computed: {
-    title: {
-      get() {
-        const { addType } = this;
-        if (addType === "add") {
-          return "新 增";
-        }
-        if (addType === "copy") {
-          return "复 制";
-        }
-        if (addType === "edit") {
-          return "编 辑";
-        }
-      },
-      set() {},
-    },
-    disabled: {
-      get() {
-        const {
-          addType,
-          selectData,
-          selectData: [{ status } = {}],
-        } = this.$props;
-        if (addType === "add") {
-          return false;
-        }
-        if (addType === "copy") {
-          if (selectData.length !== 1) {
-            return true;
-          }
-        }
-        if (addType === "edit") {
-          if (selectData.length !== 1) {
-            return true;
-          }
-          if (selectData.length === 1 && status === "1") {
-            return true;
-          }
-          if (selectData.length === 1 && status === "2") {
-            return true;
-          }
-        }
-      },
-      set() {},
-    },
-    priceApply: {
-      get() {
-        this.params.priceApplyItems = this.params.priceApplyItems.map(
-          (item, index) => ({
-            ...item,
-            $index: index,
-          })
-        );
-        return {
-          priceApplyItems: this.params.priceApplyItems.filter(
-            ({ delFlag }) => delFlag !== "2"
-          ),
-        };
-      },
-      set() {},
-    },
-  },
+  computed: {},
   watch: {},
   methods: {
     //
     changeMaterialName(prop) {
       const { row } = prop;
       const { puOrg, customer, supplier } = this.params;
-      const { rateCode, unitIdName, code: materialCode } = row;
+      const { tax: taxName, unitName, code: materialCode } = row;
       // task 1
-      tax(rateCode).then((res) => {
+      tax(taxName).then((res) => {
         const { ntaxrate } = res;
         row.tax = ntaxrate === "0E-8" ? "0.000000" : (ntaxrate * 1).toFixed(6);
       });
       // task 2
-      unit(unitIdName).then((res) => {
+      unit(unitName).then((res) => {
         const { id, code, name } = res;
         row.unit = id;
         row.unitCode = code;
@@ -145,99 +77,50 @@ export default {
         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;
-        row.isApprovalFirst = isApprovalFirst;
-        row.isPriceAdjustment = isPriceAdjustment;
-      });
-    },
-
-    //
-    async fetchItem(prop) {
-      try {
-        // try
-        this.loading = true;
-        const { code, data } = await ITEM(prop);
-        if (code === 200) {
-          this.params = data;
-          return true;
-        } else {
-          return false;
+        if (isApprovalFirst) {
+          row.isApprovalFirst = isApprovalFirst == 0 ? "Y" : "N";
         }
-      } catch (err) {
-        // catch
-        console.error(err);
-      } finally {
-        // finally
-        this.loading = false;
-      }
+        if (isPriceAdjustment) {
+          row.isPriceAdjustment = isPriceAdjustment == 0 ? "Y" : "N";
+        }
+      });
     },
     //
     async onOpen() {
-      const { addType, selectData } = this.$props;
-      if (addType === "add") {
-        this.visible = true;
-        const {
-          deptId: puDept,
-          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;
-        this.params.puDeptName = puDeptName;
-      }
-      if (addType === "copy") {
-        const [{ id }] = selectData;
-        this.visible = await this.fetchItem(id);
-        this.params.id = null;
-        this.params.createBy = null;
-        this.params.priceCode = null;
-        this.params.createByName = null;
-        this.params.effectiveDate = null;
-        this.params.priceApplyItems = this.params.priceApplyItems.map(
-          (item) => ({
-            ...item,
-            id: null,
-            applyId: null,
-            createByName: null,
-            updateByName: null,
-          })
-        );
-      }
-      if (addType === "edit") {
-        const [{ id }] = selectData;
-        this.visible = await this.fetchItem(id);
-        this.params.priceApplyItems = this.params.priceApplyItems.map(
-          (item) => ({
-            ...item,
-          })
-        );
-      }
+      this.visible = true;
+      const {
+        deptId: puDept,
+        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;
+      this.params.puDeptName = puDeptName;
     },
     //
     async onHide() {
-      const {
-        TabColumns,
-        TableColumns,
-        TabColumns: [
-          {
-            item: { key: tabName },
-          },
-        ],
-      } = useColumns();
+      const { TabColumns, TableColumns } = useColumns();
       this.visible = false;
-      this.tabName = tabName;
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
     //
@@ -263,36 +146,15 @@ export default {
     },
     //
     async onRowRemove(prop, scope) {
-      const { addType } = this.$props;
-      const {
-        row: { $index },
-      } = scope;
-      if (addType === "add") {
-        this.params[prop].splice($index, 1);
-      }
-      if (addType === "copy") {
-        this.params[prop].splice($index, 1);
-      }
-      if (addType === "edit") {
-        this.params[prop] = this.params[prop].map((item, index) => ({
-          ...item,
-          delFlag: index === $index ? "2" : item.delFlag,
-        }));
-        console.log(this.params[prop]);
-      }
+      const { $index } = scope;
+      this.params[prop].splice($index, 1);
     },
     //
     async useSubmit(prop) {
-      this.$refs[prop].$refs[prop].validate(async (valid) => {
-        console.log(this.params);
+      this.$refs[prop].validate(async (valid) => {
         if (valid) {
           try {
             this.loading = true;
-            if (this.addType === "edit") {
-              this.params.priceApplyItems = this.params.priceApplyItems.filter(
-                (item) => item.materialName
-              );
-            }
             const { msg, code } = await SAVE(this.params);
             if (code === 200) {
               this.onHide();
@@ -318,12 +180,7 @@ export default {
 };
 </script>
 <template>
-  <el-button
-    v-bind="$attrs"
-    v-on="$listeners"
-    :disabled="disabled"
-    @click="onOpen"
-  >
+  <el-button v-bind="$attrs" v-on="$listeners" @click="onOpen">
     {{ title }}
     <el-drawer
       :show-close="false"
@@ -379,7 +236,7 @@ export default {
           lazy
         >
           <el-super-table
-            v-model="priceApply[item.key]"
+            v-model="params[item.key]"
             :dict="dict"
             :ref="tabName"
             :columns="columns"

+ 8 - 2
src/views/purchase/apply/columns.js

@@ -16,7 +16,7 @@ export default function useColumns() {
     { item: { key: "buyerName", title: "采购员" }, attr: {} },
     { item: { key: "puDeptName", title: "采购部门" }, attr: {} },
     {
-      item: { key: "file", title: "附件" },
+      item: { key: "file", title: "附件", filter: false },
       attr: { is: "el-file-preview" },
     },
     { item: { key: "createByName", title: "创建人" }, attr: {} },
@@ -35,7 +35,13 @@ export default function useColumns() {
     },
   ].map(({ item, attr }) => ({
     attr,
-    item: { ...item, hidden: true, fixed: false },
+    item: {
+      ...item,
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
   }));
   const SearchColumns = [
     {

+ 291 - 0
src/views/purchase/apply/copy/columns.js

@@ -0,0 +1,291 @@
+import CONFIG from "@/config";
+
+export default function useColumns() {
+  const TableColumns = [
+    {
+      item: { key: "priceCode", title: "价格编码" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "supplierName", title: "供应商", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "SUPPLIER_PARAM",
+        dataMapping: {
+          supplier: "id",
+          supplierCode: "code",
+          supplierName: "name",
+        },
+      },
+    },
+    {
+      item: { key: "puOrgName", title: "采购组织", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "ORG_PARAM",
+        dataMapping: { puOrg: "id", puOrgCode: "code", puOrgName: "name" },
+      },
+    },
+    {
+      item: { key: "currencyName", title: "币种", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "CURRENCY_PARAM",
+        dataMapping: {
+          currency: "id",
+          currencyCode: "code",
+          currencyName: "name",
+        },
+      },
+    },
+    {
+      item: { key: "explainStr", title: "价格合理性说明", require: true },
+      attr: { is: "el-input" },
+    },
+    {
+      item: { key: "buyerName", title: "采购员", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "CONTACTS_PARAM",
+        dataMapping: { buyer: "code", buyerName: "name" },
+      },
+    },
+    {
+      item: { key: "puDeptName", title: "采购部门", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "DEPT_PARAM",
+        dataMapping: { puDept: "id", puDeptCode: "code", puDeptName: "name" },
+      },
+    },
+    {
+      item: { key: "createByName", title: "创建人" },
+      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",
+      },
+    },
+    {
+      item: { key: "effectiveDate", title: "生效日期" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "file", title: "附件", require: true, span: 24 },
+      attr: { is: "el-file-upload" },
+    },
+    {
+      item: { key: "sourceType", title: "来源单据类型" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "status", title: "单据状态" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_status",
+        disabled: true,
+        readonly: true,
+        value: "0",
+      },
+    },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, span: item.span || 6 },
+  }));
+
+  const TabColumns = [
+    {
+      item: {
+        title: "物料信息表",
+        key: "priceApplyItems",
+      },
+      attr: {
+        value: [],
+      },
+      TableColumns: [
+        {
+          item: { key: "materialName", title: "物料名称", require: true },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "MATERIAL_PARAM",
+            dataMapping: {
+              model: "model",
+              material: "id",
+              materialCode: "code",
+              materialName: "name",
+              unitName: "unitIdName",
+              puUnitName: "unitIdName",
+              specification: "specification",
+              manufacturer: "manufacturerId",
+              manufacturerName: "manufacturerIdName",
+            },
+          },
+        },
+        {
+          item: { key: "materialCode", title: "物料编码", require: true },
+          attr: {},
+        },
+        { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
+        { item: { key: "specification", title: "规格" }, attr: {} },
+        { item: { key: "model", title: "型号" }, attr: {} },
+        {
+          item: { key: "unitName", title: "单位" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "UNIT_PARAM",
+            dataMapping: { unit: "id", unitCode: "code", unitName: "name" },
+          },
+        },
+        {
+          item: { key: "puUnitName", title: "采购单位" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "UNIT_PARAM",
+            dataMapping: {
+              puUnit: "id",
+              puUnitCode: "code",
+              puUnitName: "name",
+            },
+          },
+        },
+        {
+          item: { key: "conversionRate", title: "采购换算率", require: true },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: { key: "tax", title: "税率%", require: true },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "ntaxrate",
+            referName: "TAX_RATE_PARAM",
+            dataMapping: { tax: "ntaxrate" },
+          },
+        },
+        {
+          item: { key: "taxPrice", title: "含税单价", require: true },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: { key: "price", title: "无税单价", require: true },
+          attr: {
+            formatter: (prop) => {
+              const { tax = 0, taxPrice = 0 } = prop;
+              prop.price = ((taxPrice / (tax / 100 + 1)) * 1).toFixed(
+                CONFIG.precision
+              );
+              return prop.price;
+            },
+          },
+        },
+        {
+          item: { key: "currencyName", title: "币种" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "CURRENCY_PARAM",
+            dataMapping: {
+              currency: "id",
+              currencyCode: "code",
+              currencyName: "name",
+            },
+          },
+        },
+        {
+          item: {
+            key: "periodBegin",
+            title: "价格有效期(起)",
+            require: true,
+          },
+          attr: {
+            is: "el-date-picker",
+            valueFormat: "yyyy-MM-dd",
+            value: new Date(),
+          },
+        },
+        {
+          item: { key: "periodEnd", title: "价格有效期(止)", require: true },
+          attr: {
+            is: "el-date-picker",
+            valueFormat: "yyyy-MM-dd",
+            pickerOptions: {
+              disabledDate(time) {
+                return time.getTime() < Date.now() + 3600 * 1000 * 24 * 365;
+              },
+            },
+            value: new Date(new Date().getTime() + 3600 * 1000 * 24 * 366),
+          },
+        },
+        {
+          item: { key: "customerName", title: "客户" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "CUSTOMER_PARAM",
+            dataMapping: {
+              customer: "id",
+              customerCode: "code",
+              customerName: "name",
+            },
+          },
+        },
+        { item: { key: "recentlyPrice", title: "最近价格" }, attr: {} },
+        {
+          item: { key: "isApprovalFirst", title: "首次报批" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+          },
+        },
+        {
+          item: { key: "isPriceAdjustment", title: "价格调整" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+          },
+        },
+        {
+          item: { key: "priceType", title: "价格类型", require: true },
+          attr: {
+            is: "el-select",
+            dictName: "sys_price_type",
+            value: "order",
+          },
+        },
+        {
+          item: { key: "isDistributionPrice", title: "配送价", require: true },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        { item: { key: "createByName", title: "创建人名称" }, attr: {} },
+        { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
+      ],
+    },
+  ];
+
+  return { TableColumns, TabColumns };
+}

+ 322 - 0
src/views/purchase/apply/copy/index.vue

@@ -0,0 +1,322 @@
+<script>
+import useColumns from "./columns";
+import { EXIST } from "@/api/business/purchase/catalogue";
+import { ITEM, SAVE } from "@/api/business/purchase/apply";
+import { tax, unit, currency } from "@/components/popover-select-v2/fetch";
+
+const fetchExist = async (prop) => {
+  try {
+    // try
+    const { code, data } = await EXIST(prop);
+    if (code === 200) return data;
+  } catch (err) {
+    // catch
+    console.error(err);
+  } finally {
+    // finally
+  }
+};
+
+export default {
+  name: "AddDrawer",
+  props: {
+    dict: {
+      type: Object,
+    },
+    selectData: {
+      type: [Array],
+      require: true,
+    },
+  },
+  components: {
+    ElSuperForm: () => import("@/components/super-form/index.vue"),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+  },
+  data() {
+    const {
+      TabColumns,
+      TableColumns,
+      TabColumns: [
+        {
+          item: { key: tabName },
+        },
+      ],
+    } = useColumns();
+    const rules = this.$init.rules([...TabColumns, ...TableColumns]);
+    const params = this.$init.params([...TabColumns, ...TableColumns]);
+    return {
+      title: "复 制",
+      width: "100%",
+      visible: false,
+      loading: false,
+      rules: rules,
+      params: params,
+      tabName: tabName,
+      TabColumns: TabColumns,
+      TableColumns: TableColumns,
+    };
+  },
+  computed: {
+    disabled: {
+      get() {
+        const {
+          selectData: { length },
+        } = this.$props;
+        if (length !== 1) {
+          return true;
+        }
+      },
+      set() {},
+    },
+  },
+  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 fetchItem(prop) {
+      try {
+        // try
+        this.loading = true;
+        const { code, data } = await ITEM(prop);
+        if (code === 200) {
+          this.params = data;
+          return true;
+        } else {
+          return false;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //
+    async onOpen() {
+      const {
+        selectData: [{ id }],
+      } = this.$props;
+      this.visible = await this.fetchItem(id);
+      this.params.id = null;
+      this.params.createBy = null;
+      this.params.priceCode = null;
+      this.params.createByName = null;
+      this.params.effectiveDate = null;
+      this.params.priceApplyOrgs = [];
+      this.params.priceApplyItems = this.params.priceApplyItems.map((item) => ({
+        ...item,
+        id: null,
+        applyId: null,
+        createByName: null,
+        updateByName: null,
+        delFlag: 0,
+      }));
+    },
+    //
+    async onHide() {
+      const { TabColumns, TableColumns } = useColumns();
+      this.visible = false;
+      this.params = this.$init.params([...TabColumns, ...TableColumns]);
+    },
+    //
+    async onRowAdd(prop) {
+      const {
+        $notify,
+        TabColumns,
+        params: { puOrgName, supplierName },
+      } = this;
+      if (!supplierName) {
+        return $notify.info("请选择供应商");
+      }
+      if (!puOrgName) {
+        return $notify.info("请选择采购组织");
+      }
+      const { TableColumns } = TabColumns.find(
+        ({ item: { key } }) => key === prop
+      );
+      this.params[prop].push({
+        delFlag: "0",
+        ...this.$init.params(TableColumns),
+      });
+    },
+    //
+    async onRowRemove(prop, scope) {
+      const { $index } = scope;
+      this.params[prop].splice($index, 1);
+    },
+    //
+    async useSubmit(prop) {
+      this.$refs[prop].validate(async (valid) => {
+        console.log(this.params);
+        if (valid) {
+          try {
+            this.loading = true;
+            const { msg, code } = await SAVE(this.params);
+            if (code === 200) {
+              this.onHide();
+              this.$emit("success");
+              this.$notify.success(msg);
+            }
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-button
+    v-bind="$attrs"
+    v-on="$listeners"
+    :disabled="disabled"
+    @click="onOpen"
+  >
+    {{ title }}
+    <el-drawer
+      :show-close="false"
+      :size="width"
+      :title="title"
+      :visible.sync="visible"
+      append-to-body
+      destroy-on-close
+      @close="onHide"
+    >
+      <template slot="title">
+        <span>{{ title }}</span>
+        <el-button
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="useSubmit('superForm')"
+        >
+          确 认
+        </el-button>
+        <el-button :size="$attrs.size" :loading="loading" @click="onHide">
+          取 消
+        </el-button>
+      </template>
+      <el-super-form
+        v-model="params"
+        :dict="dict"
+        :rules="rules"
+        :size="$attrs.size"
+        :columns="TableColumns"
+        ref="superForm"
+        label-width="auto"
+        label-position="right"
+        style="padding: 20px"
+      >
+        <template slot="puOrgName" slot-scope="scope">
+          <component
+            v-bind="scope.attr"
+            v-model="scope.row[scope.item.key]"
+            :size="$attrs.size"
+            :source.sync="scope.row"
+            @change="changePuOrgName({ ...scope, select: $event })"
+          >
+          </component
+        ></template>
+      </el-super-form>
+      <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+        <el-tab-pane
+          v-for="({ item, TableColumns: columns }, index) in TabColumns"
+          :key="index"
+          :label="item.title"
+          :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
+                  :size="$attrs.size"
+                  @click.native.prevent="onRowRemove(tabName, scope)"
+                >
+                  删除
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-super-table>
+        </el-tab-pane>
+      </el-tabs>
+    </el-drawer>
+  </el-button>
+</template>
+
+<style scoped>
+::v-deep .el-table__row.is-hidden {
+  display: none;
+}
+</style>

+ 291 - 0
src/views/purchase/apply/edit/columns.js

@@ -0,0 +1,291 @@
+import CONFIG from "@/config";
+
+export default function useColumns() {
+  const TableColumns = [
+    {
+      item: { key: "priceCode", title: "价格编码" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "supplierName", title: "供应商", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "SUPPLIER_PARAM",
+        dataMapping: {
+          supplier: "id",
+          supplierCode: "code",
+          supplierName: "name",
+        },
+      },
+    },
+    {
+      item: { key: "puOrgName", title: "采购组织", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "ORG_PARAM",
+        dataMapping: { puOrg: "id", puOrgCode: "code", puOrgName: "name" },
+      },
+    },
+    {
+      item: { key: "currencyName", title: "币种", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "CURRENCY_PARAM",
+        dataMapping: {
+          currency: "id",
+          currencyCode: "code",
+          currencyName: "name",
+        },
+      },
+    },
+    {
+      item: { key: "explainStr", title: "价格合理性说明", require: true },
+      attr: { is: "el-input" },
+    },
+    {
+      item: { key: "buyerName", title: "采购员", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "CONTACTS_PARAM",
+        dataMapping: { buyer: "code", buyerName: "name" },
+      },
+    },
+    {
+      item: { key: "puDeptName", title: "采购部门", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "DEPT_PARAM",
+        dataMapping: { puDept: "id", puDeptCode: "code", puDeptName: "name" },
+      },
+    },
+    {
+      item: { key: "createByName", title: "创建人" },
+      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",
+      },
+    },
+    {
+      item: { key: "effectiveDate", title: "生效日期" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "file", title: "附件", require: true, span: 24 },
+      attr: { is: "el-file-upload" },
+    },
+    {
+      item: { key: "sourceType", title: "来源单据类型" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "status", title: "单据状态" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_status",
+        disabled: true,
+        readonly: true,
+        value: "0",
+      },
+    },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, span: item.span || 6 },
+  }));
+
+  const TabColumns = [
+    {
+      item: {
+        title: "物料信息表",
+        key: "priceApplyItems",
+      },
+      attr: {
+        value: [],
+      },
+      TableColumns: [
+        {
+          item: { key: "materialName", title: "物料名称", require: true },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "MATERIAL_PARAM",
+            dataMapping: {
+              model: "model",
+              material: "id",
+              materialCode: "code",
+              materialName: "name",
+              unitName: "unitIdName",
+              puUnitName: "unitIdName",
+              specification: "specification",
+              manufacturer: "manufacturerId",
+              manufacturerName: "manufacturerIdName",
+            },
+          },
+        },
+        {
+          item: { key: "materialCode", title: "物料编码", require: true },
+          attr: {},
+        },
+        { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
+        { item: { key: "specification", title: "规格" }, attr: {} },
+        { item: { key: "model", title: "型号" }, attr: {} },
+        {
+          item: { key: "unitName", title: "单位" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "UNIT_PARAM",
+            dataMapping: { unit: "id", unitCode: "code", unitName: "name" },
+          },
+        },
+        {
+          item: { key: "puUnitName", title: "采购单位" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "UNIT_PARAM",
+            dataMapping: {
+              puUnit: "id",
+              puUnitCode: "code",
+              puUnitName: "name",
+            },
+          },
+        },
+        {
+          item: { key: "conversionRate", title: "采购换算率", require: true },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: { key: "tax", title: "税率%", require: true },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "ntaxrate",
+            referName: "TAX_RATE_PARAM",
+            dataMapping: { tax: "ntaxrate" },
+          },
+        },
+        {
+          item: { key: "taxPrice", title: "含税单价", require: true },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: { key: "price", title: "无税单价", require: true },
+          attr: {
+            formatter: (prop) => {
+              const { tax = 0, taxPrice = 0 } = prop;
+              prop.price = ((taxPrice / (tax / 100 + 1)) * 1).toFixed(
+                CONFIG.precision
+              );
+              return prop.price;
+            },
+          },
+        },
+        {
+          item: { key: "currencyName", title: "币种" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "CURRENCY_PARAM",
+            dataMapping: {
+              currency: "id",
+              currencyCode: "code",
+              currencyName: "name",
+            },
+          },
+        },
+        {
+          item: {
+            key: "periodBegin",
+            title: "价格有效期(起)",
+            require: true,
+          },
+          attr: {
+            is: "el-date-picker",
+            valueFormat: "yyyy-MM-dd",
+            value: new Date(),
+          },
+        },
+        {
+          item: { key: "periodEnd", title: "价格有效期(止)", require: true },
+          attr: {
+            is: "el-date-picker",
+            valueFormat: "yyyy-MM-dd",
+            pickerOptions: {
+              disabledDate(time) {
+                return time.getTime() < Date.now() + 3600 * 1000 * 24 * 365;
+              },
+            },
+            value: new Date(new Date().getTime() + 3600 * 1000 * 24 * 366),
+          },
+        },
+        {
+          item: { key: "customerName", title: "客户" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "CUSTOMER_PARAM",
+            dataMapping: {
+              customer: "id",
+              customerCode: "code",
+              customerName: "name",
+            },
+          },
+        },
+        { item: { key: "recentlyPrice", title: "最近价格" }, attr: {} },
+        {
+          item: { key: "isApprovalFirst", title: "首次报批" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+          },
+        },
+        {
+          item: { key: "isPriceAdjustment", title: "价格调整" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+          },
+        },
+        {
+          item: { key: "priceType", title: "价格类型", require: true },
+          attr: {
+            is: "el-select",
+            dictName: "sys_price_type",
+            value: "order",
+          },
+        },
+        {
+          item: { key: "isDistributionPrice", title: "配送价", require: true },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        { item: { key: "createByName", title: "创建人名称" }, attr: {} },
+        { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
+      ],
+    },
+  ];
+
+  return { TableColumns, TabColumns };
+}

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

@@ -0,0 +1,339 @@
+<script>
+import useColumns from "./columns";
+import { EXIST } from "@/api/business/purchase/catalogue";
+import { ITEM, SAVE } from "@/api/business/purchase/apply";
+import { tax, unit, currency } from "@/components/popover-select-v2/fetch";
+
+const fetchExist = async (prop) => {
+  try {
+    // try
+    const { code, data } = await EXIST(prop);
+    if (code === 200) return data;
+  } catch (err) {
+    // catch
+    console.error(err);
+  } finally {
+    // finally
+  }
+};
+
+export default {
+  name: "EditDrawer",
+  props: {
+    dict: {
+      type: Object,
+    },
+    selectData: {
+      type: [Array],
+      require: true,
+    },
+  },
+  components: {
+    ElSuperForm: () => import("@/components/super-form/index.vue"),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+  },
+  data() {
+    const {
+      TabColumns,
+      TableColumns,
+      TabColumns: [
+        {
+          item: { key: tabName },
+        },
+      ],
+    } = useColumns();
+    const rules = this.$init.rules([...TabColumns, ...TableColumns]);
+    const params = this.$init.params([...TabColumns, ...TableColumns]);
+    return {
+      title: "编 辑",
+      width: "100%",
+      visible: false,
+      loading: false,
+      rules: rules,
+      params: params,
+      tabName: tabName,
+      TabColumns: TabColumns,
+      TableColumns: TableColumns,
+    };
+  },
+  computed: {
+    disabled: {
+      get() {
+        const {
+          selectData,
+          selectData: [{ status } = {}],
+        } = this.$props;
+        if (selectData.length !== 1) {
+          return true;
+        }
+        if (selectData.length === 1 && status === "1") {
+          return true;
+        }
+        if (selectData.length === 1 && status === "2") {
+          return true;
+        }
+      },
+      set() {},
+    },
+    priceApply: {
+      get() {
+        this.params.priceApplyItems = this.params.priceApplyItems.map(
+          (item, index) => ({
+            ...item,
+            $index: index,
+          })
+        );
+        return {
+          priceApplyItems: this.params.priceApplyItems.filter(
+            ({ delFlag }) => delFlag !== "2"
+          ),
+        };
+      },
+      set() {},
+    },
+  },
+  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 fetchItem(prop) {
+      try {
+        // try
+        this.loading = true;
+        const { code, data } = await ITEM(prop);
+        if (code === 200) {
+          this.params = data;
+          return true;
+        } else {
+          return false;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //
+    async onOpen() {
+      const {
+        selectData: [{ id }],
+      } = this.$props;
+      this.visible = await this.fetchItem(id);
+    },
+    //
+    async onHide() {
+      const { TabColumns, TableColumns } = useColumns();
+      this.visible = false;
+      this.params = this.$init.params([...TabColumns, ...TableColumns]);
+    },
+    //
+    async onRowAdd(prop) {
+      const {
+        $notify,
+        TabColumns,
+        params: { puOrgName, supplierName },
+      } = this;
+      if (!supplierName) {
+        return $notify.info("请选择供应商");
+      }
+      if (!puOrgName) {
+        return $notify.info("请选择采购组织");
+      }
+      const { TableColumns } = TabColumns.find(
+        ({ item: { key } }) => key === prop
+      );
+      this.params[prop].push({
+        delFlag: "0",
+        ...this.$init.params(TableColumns),
+      });
+    },
+    //
+    async onRowRemove(prop, scope) {
+      const {
+        row: { $index },
+      } = scope;
+      this.params[prop] = this.params[prop].map((item, index) => ({
+        ...item,
+        delFlag: index === $index ? "2" : item.delFlag,
+      }));
+    },
+    //
+    async useSubmit(prop) {
+      this.$refs[prop].validate(async (valid) => {
+        console.log(this.params);
+        if (valid) {
+          try {
+            this.loading = true;
+            this.params.priceApplyItems = this.params.priceApplyItems.filter(
+              (item) => item.materialName
+            );
+            const { msg, code } = await SAVE(this.params);
+            if (code === 200) {
+              this.onHide();
+              this.$emit("success");
+              this.$notify.success(msg);
+            }
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-button
+    v-bind="$attrs"
+    v-on="$listeners"
+    :disabled="disabled"
+    @click="onOpen"
+  >
+    {{ title }}
+    <el-drawer
+      :show-close="false"
+      :size="width"
+      :title="title"
+      :visible.sync="visible"
+      append-to-body
+      destroy-on-close
+      @close="onHide"
+    >
+      <template slot="title">
+        <span>{{ title }}</span>
+        <el-button
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="useSubmit('superForm')"
+        >
+          确 认
+        </el-button>
+        <el-button :size="$attrs.size" :loading="loading" @click="onHide">
+          取 消
+        </el-button>
+      </template>
+      <el-super-form
+        v-model="params"
+        :dict="dict"
+        :rules="rules"
+        :size="$attrs.size"
+        :columns="TableColumns"
+        ref="superForm"
+        label-width="auto"
+        label-position="right"
+        style="padding: 20px"
+      >
+        <template slot="puOrgName" slot-scope="scope">
+          <component
+            v-bind="scope.attr"
+            v-model="scope.row[scope.item.key]"
+            :size="$attrs.size"
+            :source.sync="scope.row"
+            @change="changePuOrgName({ ...scope, select: $event })"
+          >
+          </component
+        ></template>
+      </el-super-form>
+      <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+        <el-tab-pane
+          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"
+          >
+            <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
+                  :size="$attrs.size"
+                  @click.native.prevent="onRowRemove(tabName, scope)"
+                >
+                  删除
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-super-table>
+        </el-tab-pane>
+      </el-tabs>
+    </el-drawer>
+  </el-button>
+</template>
+
+<style scoped>
+::v-deep .el-table__row.is-hidden {
+  display: none;
+}
+</style>

+ 19 - 17
src/views/purchase/apply/index.vue

@@ -9,6 +9,8 @@ export default {
   components: {
     SeeButton: () => import("./see/index.vue"),
     AddButton: () => import("./add/index.vue"),
+    CopyButton: () => import("./copy/index.vue"),
+    EditButton: () => import("./edit/index.vue"),
     DeleButton: () => import("./delete/index.vue"),
     SubmButton: () => import("./submit/index.vue"),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
@@ -84,7 +86,15 @@ export default {
 </script>
 
 <template>
-  <el-card v-loading="loading" :body-style="{ padding: 0 }">
+  <el-card
+    v-loading="loading"
+    :body-style="{
+      height: '100%',
+      padding: 0,
+      display: 'flex',
+      'flex-direction': 'column',
+    }"
+  >
     <el-super-search
       v-model="params"
       :size="size"
@@ -95,21 +105,15 @@ export default {
     ></el-super-search>
     <el-row class="my-4" style="text-align: right">
       <el-button-group>
-        <add-button
-          :size="size"
-          :select-data="[]"
-          :dict="dict"
-          add-type="add"
-          @success="useQuery(params, page)"
-        ></add-button>
-        <add-button
+        <add-button :size="size" :dict="dict" @success="useQuery(params, page)">
+        </add-button>
+        <copy-button
           :size="size"
           :dict="dict"
           :select-data="selectData"
-          add-type="copy"
           @success="useQuery(params, page)"
         >
-        </add-button>
+        </copy-button>
       </el-button-group>
       <el-button-group>
         <see-button
@@ -121,13 +125,12 @@ export default {
           ref="SeeButton"
           @success="useQuery(params, page)"
         ></see-button>
-        <add-button
+        <edit-button
           :size="size"
           :dict="dict"
           :select-data="selectData"
-          add-type="edit"
           @success="useQuery(params, page)"
-        ></add-button>
+        ></edit-button>
         <dele-button
           :size="size"
           :select-data="selectData"
@@ -151,9 +154,7 @@ export default {
       index
       checkbox
       pagination
-      hiddenColumns
-      filterColumns
-      height="600"
+      convenitentOperation
       @row-dblclick="useSee"
       @row-select="useSelect"
       @pagination="useQuery(params, page)"
@@ -164,6 +165,7 @@ export default {
 <style scoped lang="scss">
 .el-card {
   width: calc(100% - 32px);
+  height: calc(100vh - 32px);
   margin: 16px;
   padding: 16px;
   border-radius: 8px;

+ 11 - 8
src/views/purchase/catalogue/columns.js

@@ -30,7 +30,7 @@ export default function useColumns() {
     { item: { key: "effectiveDate", title: "价格生效日期" }, attr: {} },
     { item: { key: "endDate", title: "价格失效日期" }, attr: {} },
     { item: { key: "buyerName", title: "采购员" }, attr: {} },
-    { item: { key: "source", title: "来源单据" }, attr: {} },
+    { item: { key: "applyCode", title: "来源单据" }, attr: {} },
     {
       item: { key: "convertRate", title: "换算率" },
       attr: {
@@ -66,7 +66,13 @@ export default function useColumns() {
     { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
   ].map(({ item, attr }) => ({
     attr,
-    item: { ...item, hidden: true, fixed: false },
+    item: {
+      ...item,
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
   }));
 
   const SearchColumns = [
@@ -99,7 +105,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "source", title: "来源单据" },
+      item: { key: "applyCode", title: "来源单据" },
       attr: { is: "el-input" },
     },
     {
@@ -107,6 +113,7 @@ export default function useColumns() {
       attr: {
         is: "el-popover-select-v2",
         referName: "MATERIAL_PARAM",
+        valueKey: "code",
         dataMapping: {
           material: "id",
           materialCode: "code",
@@ -121,10 +128,6 @@ export default function useColumns() {
       item: { key: "enableStatus", title: "启用状态" },
       attr: { is: "el-select", dictName: "is_effective" },
     },
-  ].map(({ item, attr }) => ({
-    attr,
-    item: { ...item, hidden: true, span: item.span || 6 },
-  }));
-
+  ];
   return { TableColumns, SearchColumns };
 }

+ 15 - 8
src/views/purchase/catalogue/index.vue

@@ -82,7 +82,15 @@ export default {
 </script>
 
 <template>
-  <el-card v-loading="loading" :body-style="{ padding: 0 }">
+  <el-card
+    v-loading="loading"
+    :body-style="{
+      height: '100%',
+      padding: 0,
+      display: 'flex',
+      'flex-direction': 'column',
+    }"
+  >
     <el-super-search
       v-model="params"
       :size="size"
@@ -140,9 +148,7 @@ export default {
       index
       checkbox
       pagination
-      hiddenColumns
-      filterColumns
-      height="600"
+      convenitentOperation
       @row-dblclick="useSee"
       @selection-change="useSelect"
       @pagination="useQuery(params, page)"
@@ -152,10 +158,11 @@ export default {
 </template>
 <style scoped lang="scss">
 .el-card {
-  width: calc(100% - 20px);
-  height: 100%;
-  margin: 10px;
-  padding: 20px;
+  width: calc(100% - 32px);
+  height: calc(100vh - 32px);
+  margin: 16px;
+  padding: 16px;
+  border-radius: 8px;
 }
 .el-button-group + .el-button-group {
   margin: 0 0 0 10px;

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

@@ -126,25 +126,24 @@ export default {
       this.params.buyerName = buyerName;
       this.params.puDept = puDept;
       this.params.puDeptName = puDeptName;
-      const  {id,code, name } =  await this.getCurrency("人民币");
+      const { id, code, name } = await this.getCurrency("人民币");
       this.params.currency = id;
       this.params.currencyCode = code;
-      this .params.currencyName = name;
+      this.params.currencyName = name;
       this.visible = await this.fetchCode();
     },
-    async getCurrency(search){
-
-      let page = {pageNum: 1, pageSize:10,}
+    async getCurrency(search) {
+      let page = { pageNum: 1, pageSize: 10 };
 
       const { code, rows } = await REFER(
-          {
-            isPage:true,
-            search,
-            type: 'CURRENCY_PARAM',
-          },
-          page
+        {
+          isPage: true,
+          search,
+          type: "CURRENCY_PARAM",
+        },
+        page
       );
-      if(code == 200){
+      if (code == 200) {
         return rows[0];
       }
     },
@@ -177,7 +176,7 @@ export default {
     },
     //
     async useSubmit(prop) {
-      this.$refs[prop].$refs[prop].validate(async (valid) => {
+      this.$refs[prop].validate(async (valid) => {
         if (valid) {
           try {
             // try
@@ -202,8 +201,7 @@ export default {
       });
     },
   },
-  created() {
-  },
+  created() {},
   mounted() {},
   destroyed() {},
 };
@@ -220,24 +218,27 @@ export default {
       :show-close="false"
       @close="hide"
     >
-      <div slot="title" 
-          style="
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-          ">
-        <h3>{{title}}</h3>
+      <div
+        slot="title"
+        style="
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+        "
+      >
+        <h3>{{ title }}</h3>
         <div style="text-align: right">
           <el-button
             type="primary"
             :size="$attrs.size"
             :loading="loading"
             @click="useSubmit('superForm')"
-            >确 认</el-button>
+            >确 认</el-button
+          >
           <el-button :size="$attrs.size" :loading="loading" @click="hide"
-            >取 消</el-button>
+            >取 消</el-button
+          >
         </div>
-        
       </div>
 
       <el-super-form
@@ -265,8 +266,8 @@ export default {
             :dict="dict"
             :ref="tabName"
             :columns="columns"
-            :iconOperation="false"
             :size="$attrs.size"
+            index
           >
             <template slot="materialName" slot-scope="scope">
               <component
@@ -284,7 +285,7 @@ export default {
                   type="text"
                   :size="$attrs.size"
                   @click="useRowAdd(tabName)"
-                >增行
+                  >增行
                 </el-button>
               </template>
               <template slot-scope="scope">
@@ -292,14 +293,13 @@ export default {
                   type="text"
                   :size="$attrs.size"
                   @click.native.prevent="useRowRemove(tabName, scope)"
-                >删行
+                  >删行
                 </el-button>
               </template>
             </el-table-column>
           </el-super-table>
         </el-tab-pane>
       </el-tabs>
-      
     </el-drawer>
   </el-button>
 </template>

+ 7 - 1
src/views/purchase/contract/columns.js

@@ -223,7 +223,13 @@ export default function useColumns() {
     },
   ].map(({ item, attr }) => ({
     attr,
-    item: { ...item, hidden: true, fixed: false },
+    item: {
+      ...item,
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
   }));
 
   const SearchColumns = [

+ 35 - 31
src/views/purchase/contract/edit/columns.js

@@ -3,7 +3,7 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { key: "puOrgName", title: "采购组织", require: true },
+      item: { key: "puOrgName", title: "采购组织", require: true ,},
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -32,7 +32,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "buyerName", title: "采购员", require: true },
+      item: { key: "buyerName", title: "采购员", require: true ,},
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -46,7 +46,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "supplierName", title: "供应商", require: true },
+      item: { key: "supplierName", title: "供应商", require: true, },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -58,7 +58,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "contractType", title: "合同类型", require: true },
+      item: { key: "contractType", title: "合同类型", require: true ,},
       attr: { is: "el-select", dictName: "puarchase_contract_contract_type" },
     },
     {
@@ -69,7 +69,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "puDeptName", title: "采购部门", require: true },
+      item: { key: "puDeptName", title: "采购部门", require: true, },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -81,33 +81,33 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "supplierTier", title: "供应商层级", require: true },
+      item: { key: "supplierTier", title: "供应商层级", require: true ,},
       attr: { is: "el-select", dictName: "puarchase_contract_supplier_tier" },
     },
     {
-      item: { key: "contractName", title: "合同名称", require: true },
+      item: { key: "contractName", title: "合同名称", require: true, },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "grossRateAverage", title: "平均毛利率 (%)", require: true },
+      item: { key: "grossRateAverage", title: "平均毛利率 (%)", require: true ,},
       attr: {
         is: "el-input-number",
         precision: 2,
       },
     },
     {
-      item: { key: "approveFlow", title: "审批流程", require: true },
+      item: { key: "approveFlow", title: "审批流程", require: true, },
       attr: { is: "el-select", dictName: "puarchase_contract_approve_flow" },
     },
     {
-      item: { key: "consumableClass", title: "耗材类别", require: true },
+      item: { key: "consumableClass", title: "耗材类别", require: true, },
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_consumable_class",
       },
     },
     {
-      item: { key: "effectiveDate", title: "合同生效日期", require: true },
+      item: { key: "effectiveDate", title: "合同生效日期", require: true ,},
       attr: {
         is: "el-date-picker",
         valueFormat: "yyyy-MM-dd",
@@ -125,22 +125,22 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "contractFormat", title: "合同格式", require: true },
+      item: { key: "contractFormat", title: "合同格式", require: true, },
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_contract_format",
       },
     },
     {
-      item: { key: "productName", title: "产品类别&名称", require: true },
+      item: { key: "productName", title: "产品类别&名称", require: true, },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "endDate", title: "合同终止日期", require: true },
+      item: { key: "endDate", title: "合同终止日期", require: true ,},
       attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
     },
     {
-      item: { key: "invoiceTax", title: "发票税率 (%)", require: true },
+      item: { key: "invoiceTax", title: "发票税率 (%)", require: true,},
       attr: {
         is: "el-popover-select-v2",
         valueKey: "ntaxrate",
@@ -151,23 +151,23 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "emergencyDegree", title: "紧急程度", require: true },
+      item: { key: "emergencyDegree", title: "紧急程度", require: true ,},
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_emergency_degree",
       },
     },
     {
-      item: { key: "project", title: "项目医院", require: true },
+      item: { key: "project", title: "项目医院", require: true ,},
       attr: { is: "el-input" },
     },
     {
-      item: { key: "deliveryType", title: "交货方式", require: true },
+      item: { key: "deliveryType", title: "交货方式", require: true, },
       attr: { is: "el-select", dictName: "puarchase_contract_delivery_type" },
     },
     {
       item: { key: "source", title: "合同来源" },
-      attr: { is: "el-input", value: "自制", disabled: true },
+      attr: { is: "el-input", value: "自制", disabled: true, },
     },
     {
       item: { key: "contractPartycName", title: "合同丙方" },
@@ -182,7 +182,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "guaranteePeriodEnd", title: "质保期限", require: true },
+      item: { key: "guaranteePeriodEnd", title: "质保期限", require: true ,},
       attr: { is: "el-input-number", precision: 2 },
     },
     {
@@ -197,11 +197,11 @@ export default function useColumns() {
       attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
     },
     {
-      item: { key: "isTarget", title: "是否有指标", require: true },
+      item: { key: "isTarget", title: "是否有指标", require: true ,},
       attr: { is: "el-select", dictName: "sys_yes_no" },
     },
     {
-      item: { key: "contractTarget", title: "合同指标", require: true },
+      item: { key: "contractTarget", title: "合同指标", require: true, },
       attr: { is: "el-input", placeholder: '当【是否有指标】="有"时,必填' },
     },
     {
@@ -213,7 +213,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "isRebate", title: "是否有返利", require: true },
+      item: { key: "isRebate", title: "是否有返利", require: true, },
       attr: { is: "el-select", dictName: "sys_yes_no" },
     },
     {
@@ -228,7 +228,7 @@ export default function useColumns() {
       attr: { is: "el-input" },
     },
     {
-      item: { key: "rollbackPolicy", title: "退换货政策", require: true },
+      item: { key: "rollbackPolicy", title: "退换货政策", require: true ,},
       attr: { is: "el-input" },
     },
     {
@@ -282,7 +282,7 @@ export default function useColumns() {
       attr: { is: "el-input" },
     },
     {
-      item: { key: "paymentAgreement", title: "付款协议", require: true },
+      item: { key: "paymentAgreement", title: "付款协议", require: true, },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -301,7 +301,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "currencyName", title: "币种", require: true },
+      item: { key: "currencyName", title: "币种", require: true, },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -333,6 +333,7 @@ export default function useColumns() {
           item: {
             title: "物料名称",
             key: "materialName",
+            require: true ,
           },
           attr: {
             is: "el-popover-select-v2",
@@ -352,6 +353,7 @@ export default function useColumns() {
           item: {
             title: "物料编码",
             key: "material",
+            require: true ,
           },
           attr: {},
         },
@@ -383,7 +385,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "税率%", key: "tax" },
+          item: { title: "税率%", key: "tax" ,require: true, },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "ntaxrate",
@@ -400,7 +402,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "含税单价", key: "taxPrice" },
+          item: { title: "含税单价", key: "taxPrice" ,require: true, },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -417,7 +419,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "无税单价", key: "taxFreePrice" },
+          item: { title: "无税单价", key: "taxFreePrice" ,require: true, },
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
@@ -524,6 +526,7 @@ export default function useColumns() {
           item: {
             title: "付款起点",
             key: "origin",
+            require: true 
           },
           attr: {
             is: "el-select",
@@ -531,14 +534,14 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "账期天数", key: "paymetDays" },
+          item: { title: "账期天数", key: "paymetDays" ,require: true, },
           attr: {
             is: "el-input-number",
             precision: 2,
           },
         },
         {
-          item: { title: "付款比例%", key: "ratio" },
+          item: { title: "付款比例%", key: "ratio",require: true,  },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -575,6 +578,7 @@ export default function useColumns() {
           item: {
             title: "结算方式",
             key: "paymentMeans",
+            require:true,
           },
           attr: {
             is: "el-popover-select-v2",

+ 22 - 24
src/views/purchase/contract/edit/index.vue

@@ -187,7 +187,7 @@ export default {
     },
     //
     async useSubmit(prop) {
-      this.$refs[prop].$refs[prop].validate(async (valid) => {
+      this.$refs[prop].validate(async (valid) => {
         if (valid) {
           try {
             // try
@@ -238,27 +238,27 @@ export default {
       destroy-on-close
       @close="hide"
     >
-
-    <div slot="title" 
-          style="
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-          ">
-        <h3>{{title}}</h3>
+      <div
+        slot="title"
+        style="
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+        "
+      >
+        <h3>{{ title }}</h3>
         <div style="text-align: right">
           <el-button
-          type="primary"
-          :size="$attrs.size"
-          :loading="loading"
-          @click="useSubmit('superForm')"
-          >确 认</el-button
-        >
+            type="primary"
+            :size="$attrs.size"
+            :loading="loading"
+            @click="useSubmit('superForm')"
+            >确 认</el-button
+          >
           <el-button :size="$attrs.size" :loading="loading" @click="hide"
-          >取 消</el-button
-        >
+            >取 消</el-button
+          >
         </div>
-        
       </div>
       <el-super-form
         v-model="params"
@@ -272,7 +272,6 @@ export default {
         style="padding: 20px"
       ></el-super-form>
       <el-tabs v-model="tabName" style="margin: 0 20px">
-        
         <el-tab-pane
           v-for="{ item, TableColumns: columns } in TabColumns"
           :key="item.key"
@@ -286,7 +285,7 @@ export default {
             :ref="tabName"
             :columns="columns"
             :size="$attrs.size"
-            :iconOperation="false"
+            index
           >
             <template slot="materialName" slot-scope="scope">
               <component
@@ -304,7 +303,7 @@ export default {
                   type="text"
                   :size="$attrs.size"
                   @click="useRowAdd(tabName)"
-                >增行
+                  >增行
                 </el-button>
               </template>
               <template slot-scope="scope">
@@ -312,20 +311,19 @@ export default {
                   type="text"
                   :size="$attrs.size"
                   @click.native.prevent="useRowSubmit(tabName, scope)"
-                >更新
+                  >更新
                 </el-button>
                 <el-button
                   type="text"
                   :size="$attrs.size"
                   @click.native.prevent="useRowRemove(tabName, scope)"
-                >删行
+                  >删行
                 </el-button>
               </template>
             </el-table-column>
           </el-super-table>
         </el-tab-pane>
       </el-tabs>
-      
     </el-drawer>
   </el-button>
 </template>

+ 21 - 22
src/views/purchase/contract/index.vue

@@ -36,8 +36,8 @@ export default {
     this.useQuery(this.params, this.page);
   },
   methods: {
-    setSelectable(){
-      return true
+    setSelectable() {
+      return true;
     },
     //
     async fetchList(prop, page) {
@@ -92,7 +92,15 @@ export default {
 </script>
 
 <template>
-  <el-card v-loading="loading" :body-style="{ padding: 0 }">
+  <el-card
+    v-loading="loading"
+    :body-style="{
+      height: '100%',
+      padding: 0,
+      display: 'flex',
+      'flex-direction': 'column',
+    }"
+  >
     <el-super-search
       v-model="params"
       :size="size"
@@ -101,7 +109,7 @@ export default {
       @reset="useReset"
       @submit="useQuery(params, page)"
     ></el-super-search>
-    <div style="margin: 20px 0 ; text-align: right">
+    <div style="margin: 20px 0; text-align: right">
       <el-button-group>
         <add-button
           :size="size"
@@ -168,38 +176,29 @@ export default {
       v-model="tableData"
       :size="size"
       :dict="dict"
-      max-height="600"
+      :page="page"
       :columns="TableColumns"
       :selectable="setSelectable"
+      index
       checkbox
       pagination
+      convenitentOperation
       @row-dblclick="useSee"
       @selection-change="useSelect"
-      :page="page"
       @pagination="useQuery(params, page)"
     >
-      <!-- <el-table-column fixed width="55" align="center" label="#" prop="$index">
-      </el-table-column> -->
-      <!-- <el-table-column fixed width="55" align="center" type="selection">
-      </el-table-column> -->
     </el-super-table>
-    <!-- <pagination
-      :total="page.total"
-      :page.sync="page.pageNum"
-      :limit.sync="page.pageSize"
-      @pagination="useQuery(params, page)"
-      style="height: 32px; margin: 20px 0 0 0; padding: 0 !important"
-    /> -->
   </el-card>
 </template>
 <style scoped lang="scss">
 .el-card {
-  width: calc(100% - 20px);
-  height: 100%;
-  margin: 10px;
-  padding: 20px;
+  width: calc(100% - 32px);
+  height: calc(100vh - 32px);
+  margin: 16px;
+  padding: 16px;
+  border-radius: 8px;
 }
 .el-button-group + .el-button-group {
-  margin: 0 0 0 10px;
+  margin: 0 0 0 8px;
 }
 </style>

+ 6 - 5
src/views/purchase/deliveryAddress/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="deliveryAddressList">
     <div v-if="isList">
-      <el-card style="height: calc(100vh - 15vh);position: relative;overflow: scroll;">
+      <el-card style="position: relative;">
       <el-form class="search_area" label-width="100px">
         <el-row :gutter="10">
           <el-col :span="1.5">
@@ -176,11 +176,13 @@
           :header-cell-style="{ borderColor: '#c0c0c0' }"
           class="exporttable"
           border
-          max-height="480"
+          height="430"
+          max-height="430"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column show-overflow-tooltip type="selection" width="55" />
+          <el-table-column show-overflow-tooltip type="selection" width="55" fixed="left"/>
+          <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="120" prop="warehouseProperty" :formatter="formatterWarehouseProperty"/>
           <el-table-column show-overflow-tooltip label="仓库档案名称" align="center" width="180" prop="warehouseName"/>
           <el-table-column show-overflow-tooltip label="收货仓库编码" align="center" prop="code" width="150"/>
@@ -498,7 +500,6 @@ export default {
 
 <style lang="scss" scoped>
 #deliveryAddressList {
-  height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
   overflow-y: scroll;
@@ -519,7 +520,7 @@ export default {
   border: none;
 }
  ::v-deep .el-card .el-form-item {
-  margin-bottom: 10px;
+  margin-bottom: 3px;
 }
 </style>
 <style>

+ 6 - 0
src/views/purchase/purchase-order/add/index.vue

@@ -703,6 +703,12 @@ export default {
                 :label="cColumn.title"
                 :width="cColumn.width || 80"
               >
+              <template slot="header" slot-scope="scope">
+                <span v-if="cColumn.require" style="color: #ff4949">*</span>
+                <span>
+                  {{ cColumn.title }}
+                </span>
+              </template>
                 <template slot-scope="scope">
                   <el-form-item 
                     label-width="0" 

+ 6 - 0
src/views/purchase/purchase-order/edit/index.vue

@@ -641,6 +641,12 @@ export default {
                 :label="cColumn.title" 
                 :width="cColumn.width"
                 >
+                <template slot="header" slot-scope="scope">
+                  <span v-if="cColumn.require" style="color: #ff4949">*</span>
+                  <span>
+                    {{ cColumn.title }}
+                  </span>
+                </template>
                 <template slot-scope="scope">
 
                   <el-form-item 

+ 26 - 16
src/views/purchase/purchase-order/index.vue

@@ -61,8 +61,8 @@ export default {
     },
   },
   created() {
-    // this.fetchList(this.params, this.page);
-    this.handleRefreshList();
+    this.fetchList(this.params, this.page);
+    // this.handleRefreshList();
   },
   methods: {
     async fetchList(data, params) {
@@ -115,10 +115,19 @@ export default {
       this.page.pageNum = 1;
 
       this.page.pageSize = 10;
+      console.log(this,'this-------------------');
 
-      this.checkedList = [];
+      this.$refs.purchaseTable.$refs.superTable.clearSelection();
+
+      for (const key in this.tabTableDatas) {
+        this.tabTableDatas[key] = []
+      }
+
+      this.$refs.puOrderItemList[0].$refs.superTable.clearSelection();
+
+      // this.checkedList = [];
               
-      this.checkedTabList = [];
+      // this.checkedTabList = [];
 
       this.primaryResource = {};
 
@@ -188,9 +197,11 @@ export default {
       await fetchItem(id);
       
     },
+    
     // 获取子表信息
      handleDetailsData(row) {
 
+      
       window.clearTimeout(this.timeOut);
 
       this.timeOut = setTimeout(async () =>{
@@ -465,6 +476,9 @@ export default {
       console.log(this.checkedList, 'this.checkedList');
 
     },
+    handleSelectionChange(selection){
+      this.checkedList = selection;
+    },
     // 子表Select框
     handleTabSelect(selection, row){
 
@@ -472,6 +486,9 @@ export default {
 
       console.log(this.checkedTabList, 'this.checkedTabList');
     },
+    handleTabSelectionChange(selection){
+      this.checkedTabList = selection;
+    },
     // 保留两位小数,补位
     keepTwoDecimalStr(num) {
 
@@ -582,6 +599,7 @@ export default {
 
     <el-super-table
       v-model="tableData"
+      ref="purchaseTable"
       max-height="480"
       :dict="dict"
       :columns="tableColumns"
@@ -593,11 +611,9 @@ export default {
       @pagination="fetchList(params, page)"
       @row-dblclick="handleOpenSeeDrawer" 
       @row-click="handleDetailsData" 
+      @selection-change="handleSelectionChange"
       @select="handleSelect"
     >
-
-      <!-- <el-table-column type="selection" width="45" fixed></el-table-column>
-      <el-table-column type="index" width="50" label="序号"></el-table-column> -->
       
       <el-table-column fixed="right" label="操作" width="120">
           <template slot-scope="scope">
@@ -637,15 +653,6 @@ export default {
     
     </el-super-table>
 
-    <!-- <pagination
-      v-show="page.total>0"
-      :total="page.total"
-      :page.sync="page.pageNum"
-      :limit.sync="page.pageSize"
-      :page-sizes="[10,20,50,100,500,1000]"
-      @pagination="fetchList(params, page)"
-    />
-    -->
     <div style="position: relative; padding-top: 10px;" v-loading="tabLoading">
       <el-row style="position: absolute; top: 30px; right: 20px;z-index: 10;">
         <el-button 
@@ -664,6 +671,7 @@ export default {
         >
           <el-super-table
             v-model="tabTableDatas[column.key]"
+            :ref="column.key"
             max-height="200"
             :dict="dict"
             :columns="column.tableColumns"
@@ -671,6 +679,8 @@ export default {
             :checkbox="setTabSelectable()"
             :iconOperation="false"
             @select="handleTabSelect"
+            @selection-change="handleTabSelectionChange"
+
           >
             <!-- <el-table-column
               v-if=" tabName === 'puOrderItemList'" 

+ 6 - 0
src/views/purchase/purchase-order/see/index.vue

@@ -304,6 +304,12 @@ export default {
                 :label="cColumn.title" 
                 :width="cColumn.width || 80"
               >
+                <template slot="header" slot-scope="scope">
+                  <span v-if="cColumn.require" style="color: #ff4949">*</span>
+                  <span>
+                    {{ cColumn.title }}
+                  </span>
+                </template>
                 <template slot-scope="scope">
                   <el-tag v-if="cColumn.key === 'index'">
                     {{ scope.$index + 1 }}

+ 7 - 1
src/views/purchase/task/columns.js

@@ -75,7 +75,13 @@ export default function useColumns() {
     { item: { key: "unitName", title: "单位" }, attr: {} },
   ].map(({ item, attr }) => ({
     attr,
-    item: { ...item, hidden: true, width: 200 },
+    item: {
+      ...item,
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
   }));
 
   const SearchColumns = [

+ 19 - 28
src/views/purchase/task/index.vue

@@ -1,6 +1,6 @@
 <script>
-import { dicts } from "./dicts";
 import useColumns from "./columns";
+import { dicts } from "./dicts";
 import { LIST } from "@/api/business/purchase/task";
 
 export default {
@@ -8,7 +8,7 @@ export default {
   dicts: dicts,
   components: {
     DcButton: () => import("./dao-chu/index.vue"),
-    MxButton: () => import("./ming-xi/index.vue"),
+    SeeButton: () => import("./see/index.vue"),
     ZpButton: () => import("./zhuan-pai/index.vue"),
     ThxqButton: () => import("./tui-hui-xu-qiu/index.vue"),
     XyzcButton: () => import("./xie-yi-zhi-cai/index.vue"),
@@ -17,17 +17,17 @@ export default {
   },
   data() {
     const { TableColumns, SearchColumns } = useColumns();
+    const page = this.$init.page();
     const params = this.$init.params(SearchColumns);
     return {
-      key: 0,
       size: "mini",
       loading: false,
+      page: page,
       params: params,
       tableData: [],
       selectData: [],
       TableColumns: TableColumns,
       SearchColumns: SearchColumns,
-      page: { pageNum: 1, pageSize: 20, total: 0 },
     };
   },
   computed: {},
@@ -91,8 +91,7 @@ export default {
     },
     // 重 置
     useReset() {
-      this.page.pageNum = 1;
-      this.page.pageSize = 20;
+      this.page = this.$init.page();
       this.params = this.$init.params(this.SearchColumns);
       this.useQuery(this.params, this.page);
     },
@@ -100,16 +99,6 @@ export default {
     useSelect(prop, value) {
       this.selectData = prop;
     },
-    // 明 细
-    async useSee(prop) {
-      const { open } = this.$refs.mingxi;
-      await open(prop);
-    },
-    // 导 出
-    async useExport(prop, page) {
-      const { open } = this.$refs.daochu;
-      await open(prop, page);
-    },
   },
 };
 </script>
@@ -120,6 +109,8 @@ export default {
     :body-style="{
       height: '100%',
       padding: 0,
+      display: 'flex',
+      'flex-direction': 'column',
     }"
   >
     <el-super-search
@@ -133,6 +124,14 @@ export default {
     ></el-super-search>
     <div class="my-4" style="text-align: right">
       <el-button-group>
+        <see-button
+          :size="size"
+          :dict="dict"
+          :select-data="selectData"
+          @success="useQuery(params, page)"
+        ></see-button>
+      </el-button-group>
+      <el-button-group>
         <thxq-button
           :size="size"
           :select-data="selectData"
@@ -140,6 +139,7 @@ export default {
         ></thxq-button>
         <xyzc-button
           :size="size"
+          :dict="dict"
           :select-data="selectData"
           @success="useQuery(params, page)"
         ></xyzc-button>
@@ -151,14 +151,6 @@ export default {
           @success="useQuery(params, page)"
         >
         </zp-button>
-        <mx-button
-          v-show="false"
-          :size="size"
-          :dict="dict"
-          :select-data="selectData"
-          ref="mingxi"
-          @success="useQuery(params, page)"
-        ></mx-button>
       </el-button-group>
       <el-button-group>
         <dc-button
@@ -175,11 +167,10 @@ export default {
       :dict="dict"
       :page="page"
       :columns="TableColumns"
-      :selectable="setSelectable"
       index
       checkbox
-      hiddenColumns
-      height="600"
+      pagination
+      convenitentOperation
       @row-select="useSelect"
       @pagination="useQuery(params, page)"
     >
@@ -189,7 +180,7 @@ export default {
 <style scoped lang="scss">
 .el-card {
   width: calc(100% - 32px);
-  // height: calc(100vh - 32px);
+  height: calc(100vh - 32px);
   margin: 16px;
   padding: 16px;
   border-radius: 8px;

+ 0 - 0
src/views/purchase/task/ming-xi/columns.js → src/views/purchase/task/see/columns.js


+ 13 - 2
src/views/purchase/task/ming-xi/index.vue → src/views/purchase/task/see/index.vue

@@ -21,8 +21,8 @@ export default {
     const { TableColumns } = useColumns();
     return {
       title: "明 细",
-      width: "25%",
-      column: 1,
+      width: "100%",
+      column: 3,
       visible: false,
       loading: false,
       TableColumns: TableColumns,
@@ -62,6 +62,10 @@ export default {
       const { id } = prop;
       this.visible = await this.fetchItem(id);
     },
+    //
+    async hide() {
+      this.visible = false;
+    },
   },
   created() {},
   mounted() {},
@@ -77,11 +81,18 @@ export default {
   >
     {{ title }}
     <el-drawer
+      :show-close="false"
       :size="width"
       :title="title"
       :visible.sync="visible"
       append-to-body
     >
+      <template slot="title">
+        <span>{{ title }}</span>
+        <el-button :size="$attrs.size" :loading="loading" @click="hide">
+          取 消
+        </el-button>
+      </template>
       <el-super-descriptions
         v-model="params"
         :dict="dict"

+ 23 - 11
src/views/purchase/task/xie-yi-zhi-cai/column.js

@@ -2,11 +2,23 @@ import CONFIG from "@/config";
 
 export const TableColumns = [
   {
-    item: { key: "supplierName", title: "供应商" },
+    item: { key: "puOrgName", title: "采购组织" },
     attr: {},
   },
   {
-    item: { key: "puOrgName", title: "采购组织" },
+    item: { key: "manufacturerName", title: "生产厂商" },
+    attr: {},
+  },
+  {
+    item: { key: "materialName", title: "物料名称" },
+    attr: {},
+  },
+  {
+    item: { key: "demandDate", title: "需求时间" },
+    attr: {},
+  },
+  {
+    item: { key: "supplierName", title: "供应商" },
     attr: {},
   },
   {
@@ -30,7 +42,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop.tax * 1).toFixed(CONFIG.precision);
+        return (prop * 1).toFixed(CONFIG.precision);
       },
     },
   },
@@ -38,8 +50,8 @@ export const TableColumns = [
     item: { key: "taxFreePrice", title: "无税单价" },
     attr: {
       is: "el-computed-input-v2",
-      formatter: (prop = 0) => {
-        return (prop.tax * 1).toFixed(CONFIG.precision);
+      formatter: (prop) => {
+        return (prop * 1).toFixed(CONFIG.precision);
       },
     },
   },
@@ -47,16 +59,16 @@ export const TableColumns = [
     item: { key: "taxPrice", title: "主含税单价" },
     attr: {
       is: "el-computed-input-v2",
-      formatter: (prop = 0) => {
-        return (prop.tax * 1).toFixed(CONFIG.precision);
+      formatter: (prop) => {
+        return (prop * 1).toFixed(CONFIG.precision);
       },
     },
   },
   {
-    item: { key: "purchaseQuantity", title: "本次采购数量" },
+    item: { key: "purchaseQuantity", title: "本次采购数量", fixed: true },
     attr: {
       is: "el-input-number",
-      min: () => 0,
+      min: 0,
       max: (prop) => {
         const { puQty = 0, executeQty = 0 } = prop;
         return puQty - executeQty;
@@ -65,7 +77,7 @@ export const TableColumns = [
     },
   },
   {
-    item: { key: "arrivalDatePlan", title: "计划到货日期" },
+    item: { key: "arrivalDatePlan", title: "计划到货日期", fixed: true },
     attr: {
       is: "el-date-picker",
       valueFormat: "yyyy-MM-dd",
@@ -77,7 +89,7 @@ export const TableColumns = [
     },
   },
   {
-    item: { key: "note", title: "备注" },
+    item: { key: "note", title: "备注", fixed: true },
     attr: {
       is: "el-input",
       autosize: true,

+ 31 - 84
src/views/purchase/task/xie-yi-zhi-cai/index.vue

@@ -12,13 +12,14 @@ export default {
     },
   },
   components: {
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElDictTag: () => import("@/components/DictTag/index.vue"),
     ElComputedInputV2: () => import("@/components/computed-input-v2/index.vue"),
   },
   data() {
     return {
       title: "协议直采",
-      width: "50%",
+      width: "100%",
       column: 1,
       visible: false,
       loading: false,
@@ -110,94 +111,14 @@ export default {
   >
     {{ title }}
     <el-drawer
+      :show-close="false"
       :size="width"
       :title="title"
       :visible.sync="visible"
       append-to-body
     >
-      <div v-for="(item, index) in data" :key="index" style="margin: 10px">
-        <el-descriptions :size="$attrs.size" :column="column" border>
-          <template #title>
-            <span style="margin-right: 10px">{{ item.materialName }}</span>
-            <span style="color: tomato">{{ item.puQty }}</span>
-            (<span style="color: tomato">{{
-              item.puQty - (item.executeQty || 0)
-            }}</span
-            >)
-            <span> {{ item.puUnitName }}</span>
-          </template>
-          <el-descriptions-item label="需求组织">
-            {{ item.demandOrgName }}
-          </el-descriptions-item>
-          <el-descriptions-item label="采购组织">
-            {{ item.puOrgName }}
-          </el-descriptions-item>
-          <el-descriptions-item label="需求时间">
-            {{ item.demandDate }}
-          </el-descriptions-item>
-        </el-descriptions>
-        <el-table
-          v-loading="loading"
-          :size="$attrs.size"
-          :data="item.orderPriceVos"
-          style="width: 100%"
-        >
-          <el-table-column
-            v-for="(cItem, cIndex) in tableColumns"
-            :key="cIndex"
-            :prop="cItem.item.key"
-            :label="cItem.item.title"
-            :fixed="cItem.item.fixed"
-            :width="cItem.item.width || 250"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <el-input-number
-                v-if="cItem.attr.is === 'el-input-number'"
-                v-model="scope.row[cItem.item.key]"
-                :size="$attrs.size"
-                :min="cItem.attr.min(item)"
-                :max="cItem.attr.max(item)"
-                :controls-position="cItem.attr.controlsPosition"
-                style="width: 90%"
-              ></el-input-number>
-              <el-date-picker
-                v-else-if="cItem.attr.is === 'el-date-picker'"
-                v-model="scope.row[cItem.item.key]"
-                :size="$attrs.size"
-                :type="cItem.attr.type"
-                :value-format="cItem.attr.valueFormat"
-                :picker-options="cItem.attr.pickerOptions"
-                style="width: 90%"
-              ></el-date-picker>
-              <el-input
-                v-else-if="cItem.attr.is === 'el-input'"
-                v-model="scope.row[cItem.item.key]"
-                :size="$attrs.size"
-                autosize
-                type="textarea"
-                style="width: 90%"
-              ></el-input>
-              <el-computed-input-v2
-                v-else-if="cItem.attr.is === 'el-computed-input-v2'"
-                v-on="cItem.listeners"
-                v-model="scope.row[cItem.item.key]"
-                :source="scope.row"
-                :formatter="cItem.attr.formatter"
-                style="width: 100%"
-              ></el-computed-input-v2>
-              <el-dict-tag
-                v-else-if="cItem.attr.is === 'el-dict-tag'"
-                :size="$attrs.size"
-                :value="scope.row[cItem.item.key]"
-                :options="dict.type[cItem.attr.dictName]"
-              />
-              <span v-else>{{ scope.row[cItem.item.key] }}</span>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <div style="text-align: right; margin: 20px 20px 0">
+      <template slot="title">
+        <span>{{ title }}</span>
         <el-button
           :size="$attrs.size"
           :loading="loading"
@@ -211,6 +132,32 @@ export default {
           @click="submit(data)"
           >确 认</el-button
         >
+      </template>
+      <div v-for="(item, index) in data" :key="index" class="m-4">
+        <h3 class="mb-4">
+          <span style="margin-right: 10px">{{ item.materialName }}</span>
+          <span style="color: tomato">{{ item.puQty }}</span>
+          (<span style="color: tomato">{{
+            item.puQty - (item.executeQty || 0)
+          }}</span
+          >) <span> {{ item.puUnitName }}</span>
+        </h3>
+        <el-super-table
+          v-model="item.orderPriceVos"
+          :columns="tableColumns"
+          :size="$attrs.size"
+          :dict="dict"
+        >
+          <template slot="purchaseQuantity" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :max="scope.attr.max(scope.row)"
+            >
+            </component>
+          </template>
+        </el-super-table>
       </div>
     </el-drawer>
   </el-button>

+ 9 - 12
src/views/purchase/transferOrder/add.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="addOder">
-    <el-card style="height: calc(100vh - 15vh);position: relative;overflow: scroll;">
+    <el-card style="position: relative;">
       <span>基本信息</span>
       <el-form
         :model="basicForm"
@@ -17,7 +17,7 @@
                 v-model="basicForm.deliveryInventoryOrg"
                 :disabled="sonDisable"
                 @clear="clean('调出库存组织')"
-                @change="controlCk"
+                @change="controlCk('调出库存组织')"
                 @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')"
                 style="width: 200px"
               >
@@ -124,7 +124,7 @@
                 v-model="basicForm.storageInventoryOrg"
                 :disabled="sonDisable"
                 @clear="clean('调入库存组织')"
-                @change="controlCk"
+                @change="controlCk('调入库存组织')"
                 @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')"
                 style="width: 200px"
               >
@@ -452,7 +452,7 @@
               :data="materialInfo"
               fit
               border
-              max-height="480"
+              max-height="280"
               style="font-size: 12px"
               :row-class-name="rowClassName"
             >
@@ -935,7 +935,7 @@
               :data="receiveInfo"
               fit
               border
-              max-height="480"
+              max-height="280"
               style="font-size: 12px"
             >
               <el-table-column
@@ -1136,7 +1136,7 @@
               :data="priceList"
               fit
               border
-              max-height="480"
+              max-height="280"
               style="font-size: 12px"
             >
               <el-table-column
@@ -1267,7 +1267,7 @@
               :data="resultList"
               fit
               border
-              max-height="480"
+              max-height="280"
               style="font-size: 12px"
             >
               <el-table-column
@@ -1704,12 +1704,9 @@ export default {
       });
     },
     // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
-    controlCk() {
+    controlCk(val) {
       console.log("进了吗");
-      if (
-        this.basicForm.deliveryInventoryOrg &&
-        this.basicForm.storageInventoryOrg
-      ) {
+      if (this.basicForm.deliveryInventoryOrg && this.basicForm.storageInventoryOrg){
         this.isOrg = false;
       } else {
         this.basicForm.deliveryDept = "";

+ 5 - 4
src/views/purchase/transferOrder/index.vue

@@ -78,7 +78,8 @@
           show-summary
           :summary-method="getSummaries"
           highlight-current-row
-          max-height="680"
+          height="280"
+          max-height="280"
           style="font-size: 12px;"
           ref="multipleTable"
           @row-click="select"
@@ -150,7 +151,8 @@
             :header-cell-style="{ borderColor: '#c0c0c0' }"
             class="exporttable"
             border
-            max-height="380"
+            height="125"
+            max-height="125"
             style="font-size: 12px;"
             >
             <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
@@ -542,7 +544,6 @@ export default {
 
 <style lang="scss" scoped>
 #transferOrder {
-  height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
   overflow-y: scroll;
@@ -563,7 +564,7 @@ export default {
   border: none;
 }
  ::v-deep .el-card .el-form-item {
-  margin-bottom: 10px;
+  margin-bottom: 3px;
 }
 </style>
 <style>

+ 0 - 1
vue.config.js

@@ -47,7 +47,6 @@ 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://127.0.0.1:8000/drp-admin`,
         changeOrigin: true,
         pathRewrite: {