liujt 6 дней назад
Родитель
Сommit
08252efcfb

+ 1 - 1
src/views/rulesManagement/paymentTerms/components/searchForm.vue

@@ -15,7 +15,7 @@
             label: '关键词:',
             value: 'keyword',
             type: 'input',
-            placeholder: '编码、名称、型号、规格'
+            placeholder: '编码、名称'
           },
           // {
           //   label: '下拉检索:',

+ 53 - 3
src/views/rulesManagement/paymentTerms/index.vue

@@ -29,6 +29,17 @@
               新增
             </el-button>
           </template>
+          <template v-slot:ruleState="{ row }">
+            <el-switch
+              v-model="row.ruleState"
+              active-color="#13ce66"
+              inactive-color="#ff4949"
+              active-value="1"
+              inactive-value="0"
+              @change="(val) => handleStatus(row, val)"
+            >
+            </el-switch>
+          </template>
 
           <!-- 操作列 -->
           <template v-slot:action="{ row }">
@@ -75,11 +86,13 @@
   import { calcReceiveDateTypeOp, payConfirmTypeOp, dateUnitOptions } from '@/enum/dict';
   import {
     getTableList,
-    deleteInformation
+    deleteInformation,
+    updateRuleState
   } from '@/api/rulesManagement/receiveTerms';
+  import dictMixins from '@/mixins/dictMixins';
 
   export default {
-    mixins: [tabMixins],
+    mixins: [tabMixins, dictMixins],
     components: {
       searchForm,
       addDialog
@@ -163,6 +176,21 @@
             showOverflowTooltip: true,
             minWidth: 120
           },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'ruleState',
+            slot: 'ruleState',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
           {
             columnKey: 'action',
             label: '操作',
@@ -177,6 +205,9 @@
         cacheKeyUrl: 'eos-paymentTerms-list'
       };
     },
+    created() {
+      this.requestDict('支付类型');
+    },
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where }) {
@@ -188,6 +219,25 @@
         });
       },
 
+      handleStatus(row, val) {
+        console.log('row', row);
+        console.log('val', val);
+        let msg = val == 1 ? '是否启用该规则' : '是否关闭该规则';
+        this.$confirm(msg, '提示', {
+          type: 'warning'
+        })
+          .then(async () => {
+            await updateRuleState({
+              id: row.id,
+              ruleState: val
+            });
+            this.$message.success('操作成功');
+          })
+          .catch(() => {
+            row.ruleState = val == 1 ? 0 : 1;
+          });
+      },
+
       // 构建支付方式字符串
       buildPaymentMethod(list) {
         return list
@@ -195,7 +245,7 @@
             const unit =
               (dateUnitOptions.find(opt => opt.value === item.dateType) || {}).label ||
               '月';
-            return `${item.percentage}% ${item.paymentSum}${unit} ${item.paymentType}`;
+            return `${item.percentage}% ${item.paymentSum}${unit} ${this.dict['payment_type'].find(opt => opt.dictCode === item.paymentType)?.dictValue || ''}`;
           })
           .join(',');
       },

+ 1 - 0
src/views/rulesManagement/receiveTerms/components/addDialog.vue

@@ -126,6 +126,7 @@
             placeholder="请选择"
             class="payment-select"
             :disabled="isDetail"
+            :isProhibit="isDetail"
           />
           <el-button
             v-if="!isDetail && index === form.rulesTypePOList.length - 1"

+ 1 - 1
src/views/rulesManagement/receiveTerms/components/searchForm.vue

@@ -15,7 +15,7 @@
             label: '关键词:',
             value: 'keyword',
             type: 'input',
-            placeholder: '编码、名称、型号、规格'
+            placeholder: '编码、名称'
           },
           // {
           //   label: '下拉检索:',

+ 6 - 2
src/views/rulesManagement/receiveTerms/index.vue

@@ -90,9 +90,10 @@
     updateRuleState
   } from '@/api/rulesManagement/receiveTerms';
   import { calcReceiveDateTypeOp, payConfirmTypeOp, dateUnitOptions } from '@/enum/dict';
+  import dictMixins from '@/mixins/dictMixins';
 
   export default {
-    mixins: [tabMixins],
+    mixins: [tabMixins, dictMixins],
     components: {
       searchForm,
       addDialog
@@ -205,6 +206,9 @@
         cacheKeyUrl: 'eos-receiveTerms-list'
       };
     },
+    created() {
+      this.requestDict('支付类型');
+    },
     methods: {
       /* 表格数据源 */
       async datasource({ page, limit, where, order }) {
@@ -248,7 +252,7 @@
             const unit =
               (dateUnitOptions.find(opt => opt.value === item.dateType) || {}).label ||
               '月';
-            return `${item.percentage}% ${item.paymentSum}${unit} ${item.paymentType}`;
+            return `${item.percentage}% ${item.paymentSum}${unit} ${this.dict['payment_type'].find(opt => opt.dictCode === item.paymentType)?.dictValue || ''}`;
           })
           .join(',');
       },