浏览代码

no message

linwenxin 1 年之前
父节点
当前提交
f4f9cc305a

+ 41 - 105
src/views/valueAddedService/orderBranchAccount/index.vue

@@ -1,120 +1,56 @@
 <template>
-  <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-    :options-evens-group="optionsEvensGroup" :more-parameters="moreParameters" :column-parsing="columnParsing"
-    :operation="operation()" :exportList="exportList">
-    <div class="cartographer">
-      <el-dialog title="明细" width="100%" :modal="false" :visible.sync="formDialog"
-        :before-close="() => { formDialog = false }">
-        <template-page v-if="formDialog" :get-list="getList2" :columnParsing="columnParsing2" />
-      </el-dialog>
+  <zj-page-container>
+    <div class="tab">
+      <el-radio-group v-model="tabType" size="small" @change="tabTypeChange">
+        <el-radio-button label="collect">汇总</el-radio-button>
+        <el-radio-button label="offline">明细</el-radio-button>
+      </el-radio-group>
     </div>
-  </template-page>
+    <zj-page-fill>
+      <collect v-if="tabTypeCk == 'collect'" key="collect" />
+      <offline v-if="tabTypeCk == 'offline'" key="offline" :websitId="websitId" :detailParams="detailParams" />
+    </zj-page-fill>
+  </zj-page-container>
 </template>
 
 <script>
-import TemplatePage from '@/components/template/template-page-1.vue'
-import import_mixin from '@/components/template/import_mixin.js'
-import operation_mixin from '@/components/template/operation_mixin.js'
-import {
-  increOrderSettleCountList,
-  increOrderSettleCountListExport
-} from '@/api/orderBranchAccount'
-import { increOrderSettleList } from "@/api/orderSettleManag.js"
+import { EventBus } from '@/utils/eventBus'
+import collect from './pages/collect.vue'
+import offline from './pages/offline.vue'
 export default {
-  components: { TemplatePage },
-  mixins: [import_mixin,operation_mixin],
+  components: { collect, offline },
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: false
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中数据
-      recordSelected: [],
-      formDialog: false,
-      detailParams: []
+      tabType: 'collect',
+      tabTypeCk: 'collect',
+      websitId: "",
+      detailParams: [],
     }
   },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
+  created() {
+    EventBus.$on("orderBranchAccount", ({ websitId, detailParams, tabTypeCk }) => {
+      this.websitId = websitId
+      this.detailParams = detailParams
+      this.$nextTick(() => {
+        this.tabTypeCk = tabTypeCk
+        this.tabType = tabTypeCk
+      })
+    })
   },
   methods: {
-    // 列表请求函数
-    getList(p) {
-      this.detailParams = p.params.filter(item => item.param === "a.pay_time")
-      return increOrderSettleCountList(p)
-    },
-    // 列表导出函数
-    exportList: increOrderSettleCountListExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-      return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-	// 表格操作列
-	operation() {
-		return this.operationBtn({
-			detail: {
-				btnType: 'text',
-				click: ({ row, index, column }) => {
-					this.detailParams = [...this.detailParams.filter(item => item.param === "a.pay_time"), {
-					  param: "a.websit_id",
-					  compare: "=",
-					  value: row.websitId
-					}];
-					this.$nextTick(() => {
-					  this.formDialog = true
-					})
-				}
-			}
-		})
-	},
-    // 明细列表
-    getList2(p) {
-      var pam = JSON.parse(JSON.stringify(p))
-      pam.params = [...pam.params, ...this.detailParams,]
-      try {
-        return increOrderSettleList(pam)
-      } catch (err) {
-      }
-    },
-    // 表格列解析渲染数据更改
-    columnParsing2(item, defaultData) {
-      if (item.jname === 'residuNum') {
-        defaultData.render = (h, { row, index, column }) => {
-          return (
-            <div style="padding:0 6px;cursor: pointer;">
-              {row["increType"] != 1 ? row["residuNum"] : ""}
-            </div>
-          )
-        }
-      }
-      if (item.jname === 'serviceEndTime') {
-        defaultData.render = (h, { row, index, column }) => {
-          return (
-            <div style="padding:0 6px;cursor: pointer;">
-              {row[column.columnAttributes.prop] ? row[column.columnAttributes.prop].split(" ")[0] : ""}
-            </div>
-          )
-        }
-      }
-      return defaultData
-    },
-  }
+    tabTypeChange() {
+      this.websitId = ""
+      this.detailParams = []
+      this.$nextTick(() => {
+        this.tabTypeCk = this.tabType
+      })
+    }
+  },
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.tab {
+  padding: 20px 20px 0 20px;
+}
+</style>

+ 73 - 0
src/views/valueAddedService/orderBranchAccount/pages/collect.vue

@@ -0,0 +1,73 @@
+<template>
+  <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
+    :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents">
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import {
+  increOrderSettleCountList,
+  increOrderSettleCountListExport
+} from '@/api/orderBranchAccount'
+import { EventBus } from '@/utils/eventBus'
+export default {
+  components: {
+    TemplatePage,
+  },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      formBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false,
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      formData: {},
+      detailParams: []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p) {
+      this.detailParams = p.params.filter(item => item.param === "a.pay_time")
+      return increOrderSettleCountList(p)
+    },
+
+    // 列表导出函数
+    exportList: increOrderSettleCountListExport,
+
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        detail: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            var { websitId } = row
+            EventBus.$emit("orderBranchAccount", { websitId, detailParams: this.detailParams, tabTypeCk: "offline" })
+          }
+        },
+      })
+    },
+
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 86 - 0
src/views/valueAddedService/orderBranchAccount/pages/offline.vue

@@ -0,0 +1,86 @@
+<template>
+  <template-page ref="pageRef" :getList="getList" :columnParsing="columnParsing" :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents">
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import { increOrderSettleList } from "@/api/orderSettleManag.js"
+export default {
+  components: {
+    TemplatePage,
+  },
+  mixins: [import_mixin, operation_mixin],
+  props: {
+    websitId: {
+      type: [String, Number],
+      default: ""
+    },
+    detailParams: {
+      type: Array,
+      default: () => []
+    },
+  },
+  data() {
+    return {
+      formBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false,
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p, cb) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        if (this.websitId) {
+          pam.params.push({ "param": "websit_id", "compare": "=", "value": this.websitId })
+        }
+        if(this.detailParams.length){
+          pam.params = [...pam.params.filter(item => item.param !== "a.pay_time"), ...this.detailParams,]
+        }
+        return increOrderSettleList(pam)
+      } catch (err) {
+        console.log(err)
+      }
+    },
+
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep &>.zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    &>div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>