002201 1 년 전
부모
커밋
e584a3ff30

+ 29 - 7
src/views/purchase/catalogue/columns.js

@@ -42,12 +42,7 @@ export default function useColumns() {
     { item: { width: 100, key: "applyCode", title: "来源单据" }, attr: {} },
     {
       item: { width: 100, key: "convertRate", title: "换算率" },
-      attr: {
-        formatter: (prop) => {
-          const { convertRate = 0 } = prop;
-          return convertRate * 1;
-        },
-      },
+      attr: {},
     },
     {
       item: { width: 100, key: "status", title: "有效状态" },
@@ -72,10 +67,15 @@ export default function useColumns() {
     { item: { width: 100, key: "expiryEarly", title: "效期预警" }, attr: {} },
     { item: { width: 100, key: "priority", title: "含税/无税优先" }, attr: {} },
     { item: { width: 100, key: "createByName", title: "创建人" }, attr: {} },
+    { item: { width: 100, key: "createTime", title: "创建时间" }, attr: {} },
     {
       item: { width: 100, key: "updateByName", title: "更新人名称" },
       attr: {},
     },
+    {
+      item: { width: 100, key: "updateTime", title: "更新时间" },
+      attr: {},
+    },
   ].map(({ item, attr }) => ({
     attr,
     item: {
@@ -145,9 +145,31 @@ export default function useColumns() {
       attr: { is: "el-select", dictName: "is_effective" },
     },
     {
-      item: { width: 100, key: "enableStatus", title: "启用状态" },
+      item: { width: 100, key: "enableStatus", title: "启用状态", span: 4 },
       attr: { is: "el-select", dictName: "is_effective" },
     },
+    {
+      item: { width: 100, key: "createTime", title: "价格日期", span: 8 },
+      attr: {
+        is: "el-date-picker",
+        type: "datetimerange",
+        rangeSeparator: "至",
+        startPlaceholder: "开始日期",
+        endPlaceholder: "结束日期",
+        valueFormat: "yyyy-MM-dd hh:mm:ss",
+      },
+    },
+    {
+      item: { width: 100, key: "invalid", title: "价格失效日期", span: 8 },
+      attr: {
+        is: "el-date-picker",
+        type: "datetimerange",
+        rangeSeparator: "至",
+        startPlaceholder: "开始日期",
+        endPlaceholder: "结束日期",
+        valueFormat: "yyyy-MM-dd hh:mm:ss",
+      },
+    },
   ];
   return { TableColumns, SearchColumns };
 }

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

@@ -58,7 +58,21 @@ export default {
     },
     // 查 询
     useQuery(prop, page) {
-      this.fetchList(prop, page);
+      const { invalid, createTime } = prop;
+      const [invalidStart, invalidEnd] = invalid || [];
+      const [createTimeStart, createTimeEnd] = createTime || [];
+      this.fetchList(
+        {
+          ...prop,
+          invalidStart,
+          invalidEnd,
+          createTimeStart,
+          createTimeEnd,
+          invalid: null,
+          createTime: null,
+        },
+        page
+      );
     },
     // 重 置
     useReset() {

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

@@ -80,7 +80,9 @@ export default {
           {
             validator: (rule, value, callback) => {
               if (!newValue) {
-                callback(new Error("请选择合同生效日期!"));
+                callback(new Error("合同生效日期不能为空"));
+              } else if (!value) {
+                callback(new Error("合同失效日期不能为空"));
               } else if (
                 new Date(value).getTime() <
                 new Date(newValue).getTime() + 24 * 1000 * 3600

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

@@ -54,8 +54,8 @@ export default {
               const { msg, code } = await REMOVE(id);
               if (code === 200) {
                 done();
-                this.$emit("success");
                 this.$notify.success(msg);
+                this.$emit("submit-success");
               }
             } catch (err) {
               // catch

+ 17 - 12
src/views/purchase/contract/index.vue

@@ -6,11 +6,10 @@ export default {
   name: "PuchaseContract",
   dicts: dicts,
   components: {
-    AddFormModel: () => import("./add/index.vue"),
-    EditFormModel: () => import("./edit/index.vue"),
-    SeeFormModel: () => import("./see/index.vue"),
-    SeeButton: () => import("./see/index.vue"),
-    DeleButton: () => import("./delete/index.vue"),
+    ElAddForm: () => import("./add/index.vue"),
+    ElEditForm: () => import("./edit/index.vue"),
+    ElSeeForm: () => import("./see/index.vue"),
+    ElDeleteButton: () => import("./delete/index.vue"),
     SubmButton: () => import("./submit/index.vue"),
     TermButton: () => import("./termination/index.vue"),
     PigeButton: () => import("./pigeonhole/index.vue"),
@@ -116,25 +115,30 @@ export default {
       const { id } = prop;
       this.drawerVisible = true;
       this.components.title = id ? `明细-${id}` : "明细";
-      this.components.is = "SeeFormModel";
+      this.components.is = "ElSeeForm";
     },
     // 新 增
     useAdd() {
       this.drawerVisible = true;
       this.components.title = "新增";
-      this.components.is = "AddFormModel";
+      this.components.is = "ElAddForm";
     },
     // 期 初 补 录
     useReord() {
       this.drawerVisible = true;
       this.components.title = "期初补录";
-      this.components.is = "AddFormModel";
+      this.components.is = "ElAddForm";
     },
     // 编 辑
     useEdit() {
       this.drawerVisible = true;
       this.components.title = "编 辑";
-      this.components.is = "EditFormModel";
+      this.components.is = "ElEditForm";
+    },
+    // 删 除
+    useDelete() {
+      this.useQuery(this.params, this.page);
+      this.$refs.superTable.clearSelection();
     },
   },
 };
@@ -191,11 +195,11 @@ export default {
         <el-button :size="size" :disabled="EditDisabled" @click="useEdit">
           编辑
         </el-button>
-        <dele-button
+        <el-delete-button
           :size="size"
           :select-data="selectData"
-          @success="useQuery(params, page)"
-        ></dele-button>
+          @submit-success="useDelete"
+        ></el-delete-button>
       </el-button-group>
       <el-button-group>
         <subm-button
@@ -225,6 +229,7 @@ export default {
     </div>
     <el-super-table
       v-model="tableData"
+      ref="superTable"
       :size="size"
       :dict="dict"
       :page="page"