Просмотр исходного кода

费用管理增加费用状态 有效状态的筛选

祁鹏飞 1 месяц назад
Родитель
Сommit
189f073f05

+ 2 - 1
src/components/complexTable/index.vue

@@ -55,7 +55,8 @@
         </el-table-column>
         <el-table-column v-if="showIndex" type="index" label="序号" width="55" />
         <el-table-column v-for="column in columns" :key="column.prop" :prop="column.prop" :label="column.label"
-          :sortable="column.sortable ?'custom' : false" :width="column.width"
+          :sortable="column.sortable ?'custom' : false" :width="column.width" :filters="column.filters"
+          :filter-method="column.filters?(value, row) =>  row[column.prop] === value:undefined"
           :align="column.align ? column.align : 'center'" show-overflow-tooltip>
           <template #header>
             <slot name="search" :slotData="column"></slot>

+ 4 - 5
src/views/quoteConfig/agreement/agreementDetails.vue

@@ -779,7 +779,7 @@ const ruleFeeEditVisible = ref(false);//编辑弹窗
 const ruleFeeHeaderTitle = ref();//编辑弹窗title
 const costitemEditInfo = ref();
 const RulesInfo = ref({});
-const columns = [
+const columns = computed(() => [
   { prop: "costRules", label: "费用规则", width: '200', },
   { prop: "priorityLevel", label: "优先级", width: '100', },
   { prop: "costDescribe", label: "费用规则", width: '200', },
@@ -830,7 +830,7 @@ const columns = [
     }
   },
   {
-    prop: "isEnabled", label: "费用状态", width: '200', component: "Tag",
+    prop: "isEnabled", label: "费用状态", width: '200', component: "Tag", filters: getDict('is_enable').map(v => ({ text: v.label, value: Number(v.value) })),
     formatter: (row: any) => {
       let name = getDict('is_enable').find(val => val.value == row.isEnabled).label
       if (name) {
@@ -850,7 +850,7 @@ const columns = [
     }
   },
   {
-    prop: "isValid", label: "有效状态", width: '200',
+    prop: "isValid", label: "有效状态", width: '200', filters: getDict('valid_status').map(v => ({ text: v.label, value: Number(v.value) })),
     component: "Tag",
     formatter: (row: any) => {
       let name = getDict('valid_status').find(val => val.value == row.isValid).label
@@ -859,14 +859,13 @@ const columns = [
       }
     }
   },
-];
+]);
 const ruleFeeAdd = (item: any) => {
   RulesInfo.value = item;
   ruleFeeVisible.value = true;
 }
 //费用提交
 const ruleFeeSave = (data: object) => {
-
   api.agreementApi.ptlAgreementCostsave(data).then((res: any) => {
     if (res.code == '200') {
       ElMessage({