Selaa lähdekoodia

事业部对账单: 维度查询

lxf 1 vuosi sitten
vanhempi
commit
13513cb046

+ 9 - 0
src/components/byTable/index.vue

@@ -63,6 +63,11 @@
             </el-col>
           </el-row>
         </template>
+        <el-radio-group v-model="pagination[item.prop]" v-else-if="item.type === 'radio-group'" @change="changeRadioGroup">
+          <template v-if="item.data && item.data.length > 0">
+            <el-radio-button v-for="itemDict in item.data" :label="itemDict.dictKey">{{ itemDict.dictValue }}</el-radio-button>
+          </template>
+        </el-radio-group>
       </el-form-item>
     </template>
     <el-form-item>
@@ -323,6 +328,9 @@ export default defineComponent({
     const clickReset = () => {
       proxy.$emit("clickReset", "");
     };
+    const changeRadioGroup = () => {
+      proxy.$emit("changeRadioGroup", "");
+    };
     const handlePageChange = (val) => {
       proxy.$emit("getList", Object.assign(props.filterParams, { pageNum: val }));
     };
@@ -377,6 +385,7 @@ export default defineComponent({
       handleNativeClick,
       searchFn,
       clickReset,
+      changeRadioGroup,
       isSelectable,
       statWarpHeight,
       changeStatData,

+ 28 - 2
src/views/group/finance/summary/index.vue

@@ -9,7 +9,8 @@
         :searchConfig="searchConfig"
         highlight-current-row
         @get-list="getList"
-        @clickReset="clickReset">
+        @clickReset="clickReset"
+        @changeRadioGroup="changeRadioGroup">
       </byTable>
     </el-card>
 
@@ -43,7 +44,7 @@ const sourceList = ref({
     total: 0,
     pageNum: 1,
     pageSize: 10,
-    type: "1",
+    type: 1,
     departmentId: "",
     beginTime: "",
     endTime: "",
@@ -53,6 +54,25 @@ const loading = ref(false);
 const searchConfig = computed(() => {
   return [
     {
+      type: "radio-group",
+      prop: "type",
+      label: "维度",
+      data: [
+        {
+          dictKey: 1,
+          dictValue: "月度",
+        },
+        {
+          dictKey: 2,
+          dictValue: "季度",
+        },
+        {
+          dictKey: 3,
+          dictValue: "年度",
+        },
+      ],
+    },
+    {
       type: "date",
       propList: ["beginTime", "endTime"],
       label: "日期",
@@ -143,6 +163,9 @@ const getList = async (req, status) => {
   } else {
     sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   }
+  if (sourceList.value.pagination.beginTime || sourceList.value.pagination.endTime) {
+    sourceList.value.pagination.type = 4;
+  }
   loading.value = true;
   proxy.post("/statementOfAccountMerge/page", sourceList.value.pagination).then((res) => {
     if (res.rows && res.rows.length > 0) {
@@ -165,6 +188,9 @@ getList();
 const clickReset = () => {
   getList("", true);
 };
+const changeRadioGroup = () => {
+  getList({ beginTime: "", endTime: "" });
+};
 const openPrint = ref(false);
 const idGroupConcat = ref("");
 const activeName = ref("sku");

+ 25 - 2
src/views/subsidiary/finance/summary/index.vue

@@ -9,7 +9,8 @@
         :searchConfig="searchConfig"
         highlight-current-row
         @get-list="getList"
-        @clickReset="clickReset">
+        @clickReset="clickReset"
+        @changeRadioGroup="changeRadioGroup">
       </byTable>
     </el-card>
 
@@ -42,7 +43,7 @@ const sourceList = ref({
     total: 0,
     pageNum: 1,
     pageSize: 10,
-    type: "1",
+    type: 1,
     departmentId: proxy.useUserStore().user.deptId,
     beginTime: "",
     endTime: "",
@@ -52,6 +53,25 @@ const loading = ref(false);
 const searchConfig = computed(() => {
   return [
     {
+      type: "radio-group",
+      prop: "type",
+      label: "维度",
+      data: [
+        {
+          dictKey: 1,
+          dictValue: "月度",
+        },
+        {
+          dictKey: 2,
+          dictValue: "季度",
+        },
+        {
+          dictKey: 3,
+          dictValue: "年度",
+        },
+      ],
+    },
+    {
       type: "date",
       propList: ["beginTime", "endTime"],
       label: "日期",
@@ -150,6 +170,9 @@ getList();
 const clickReset = () => {
   getList("", true);
 };
+const changeRadioGroup = () => {
+  getList({ beginTime: "", endTime: "" });
+};
 const openPrint = ref(false);
 const idGroupConcat = ref("");
 const activeName = ref("sku");