qymljy 2 anni fa
parent
commit
292cfd98bd

+ 16 - 2
src/SDrpManagement/salerAccount/index.vue

@@ -5,7 +5,11 @@
         tableName="accountTable"
         idName="sa_hraccountclassid"
         :apiId="{query:20240111085404,del:''}"
+        :isExport="false"
     >
+      <template #titleLight>
+        <exportFile :param="param" :columns="tablecols" fileName="业务员账户"></exportFile>
+      </template>
       <template #custom >
         <div class="mt-10">
           <label  class="search__label">状态:</label>
@@ -38,19 +42,29 @@
 
 <script>
 import detail from './modules/detail.vue'
+import exportFile from '@/components/export_file/index5.vue'
 export default {
   name: "index",
-  components:{detail},
+  components:{detail,exportFile},
   data(){
     return {
-      status:''
+      status:'',
+      tablecols:[],
+      param:{}
     }
   },
   methods:{
     selectChange(){
       this.$refs.basicLayout.param.content.where.hrstatus = this.status
+      this.param = this.$refs.basicLayout.param
       this.$refs.basicLayout.listData()
     }
+  },
+  mounted() {
+    this.param = this.$refs.basicLayout.param
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).accountTable.tablecols
   }
 }
 </script>

+ 52 - 8
src/SDrpManagement/salerAccount/modules/detail.vue

@@ -12,7 +12,7 @@
       <div class="flex-align-stretch drawer__panel" style="margin-bottom: 0 !important;padding-bottom: 10px">
         <div class="mt-10">
           <label  class="search__label">收支类型:</label>
-          <el-select class="inline-24" v-model="status" placeholder="请选择类型" @change="selectChange" size="small" clearable>
+          <el-select class="inline-24" v-model="param.content.where.type" placeholder="请选择类型" @change="selectChange" size="small" clearable>
             <el-option label="收入" value="1"></el-option>
             <el-option label="支出" value="0"></el-option>
           </el-select>
@@ -32,19 +32,37 @@
               clearable>
           </el-date-picker>
         </div>
-        <div class="mt-10">
+        <div class="mt-10 inline-16">
           <el-input  style="width:200px;" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
           </el-input>
         </div>
+        <div class="mt-10">
+          <exportFile :param="param" :columns="tablecols" fileName="账户流水明细"></exportFile>
+        </div>
       </div>
-      <div style="padding:0 16px 20px 16px">
-        <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 356px)" :width="true" :custom="true" >
+      <div style="padding:0 16px 0 16px">
+        <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 182px)" :width="true" :custom="true" >
           <template v-slot:customcol="scope">
-            <div>
+            <div v-if="scope.column.columnname === 'type'">
+              {{scope.column.data[[scope.column.columnname]] == '1' ? '收入':'支出'}}
+            </div>
+            <div v-else>
               {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
             </div>
           </template>
         </tableNewLayout>
+        <div  class="container normal-panel" style="text-align:right">
+          <el-pagination
+              background
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[100, 150, 200, 250]"
+              :page-size="100"
+              layout="total,sizes, prev, pager, next, jumper"
+              :total="total">
+          </el-pagination>
+        </div>
       </div>
 
     </el-drawer>
@@ -52,18 +70,22 @@
 </template>
 
 <script>
+import exportFile from '@/components/export_file/index5.vue'
 export default {
   name: "detail",
   props:["hrid"],
+  components:{exportFile},
   data(){
     return {
       dialogFormVisible:false,
       status:'',
       dateSelect:'',
+      total:0,
+      currentPage:0,
       param:{
         "id": 20240111090304,
         "content": {
-          "pageSize": 20,
+          "pageSize": 100,
           "pageNumner": 1,
           "hrid": "",
           "where": {
@@ -86,8 +108,20 @@ export default {
       this.param.content.hrid = this.hrid
       const res = await this.$api.requested(this.param)
       this.list = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumner
+    },
+    selectChange(){
+      console.log(this.dateSelect)
+      if (this.dateSelect){
+        this.param.content.where.begdate = this.dateSelect[0]
+        this.param.content.where.enddate = this.dateSelect[1]
+      }else {
+        this.param.content.where.begdate = ''
+        this.param.content.where.enddate = ''
+      }
+      this.listData()
     },
-    selectChange(){},
     onClose(){
       this.param.content.where = {
         "condition": "",
@@ -95,7 +129,17 @@ export default {
         "enddate": "",
         "type":""
       }
-    }
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
   },
   created() {
     this.tablecols = this.tool.tabelCol(this.$route.name).accountDetailTable.tablecols

+ 37 - 0
src/SDrpManagement/salerExpenditure/index.vue

@@ -0,0 +1,37 @@
+<template>
+  <div>
+    <basicLayout
+        ref="basicLayout"
+        tableName="expenditureTable"
+        idName="sa_hraccountclassid"
+        :apiId="{query:20240111085804,del:''}"
+        :isExport="false"
+        :autoQuery="false"
+    >
+      <template v-slot:tbList="scope">
+        <div>
+          {{scope.data.column.data[[scope.data.column.columnname]] && scope.data.column.columnname !== 'operation'?scope.data.column.data[[scope.data.column.columnname]]:'--'}}
+        </div>
+      </template>
+    </basicLayout>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "index",
+  methods:{
+    listData(){
+      this.$refs.basicLayout.param.content.type = 0
+      this.$refs.basicLayout.listData()
+    }
+  },
+  mounted() {
+    this.listData()
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 37 - 0
src/SDrpManagement/salerIncome/index.vue

@@ -0,0 +1,37 @@
+<template>
+  <div>
+    <basicLayout
+        ref="basicLayout"
+        tableName="incomeTable"
+        idName="sa_hraccountclassid"
+        :apiId="{query:20240111085804,del:''}"
+        :isExport="false"
+        :autoQuery="false"
+    >
+      <template v-slot:tbList="scope">
+        <div>
+          {{scope.data.column.data[[scope.data.column.columnname]] && scope.data.column.columnname !== 'operation'?scope.data.column.data[[scope.data.column.columnname]]:'--'}}
+        </div>
+      </template>
+    </basicLayout>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "index",
+  methods:{
+    listData(){
+      this.$refs.basicLayout.param.content.type = 1
+      this.$refs.basicLayout.listData()
+    }
+  },
+  mounted() {
+    this.listData()
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 50 - 0
src/components/export_file/index5.vue

@@ -0,0 +1,50 @@
+<template>
+  <el-button type="primary" size="small" @click="exportData" plain>导 出</el-button>
+</template>
+
+<script>
+export default {
+  props:['param','columns','fileName'],
+  data(){
+    return{
+      columnsData:[]
+    }
+  },
+  methods:{
+    async exportData(){
+      let rs = []
+      this.columnsData = JSON.parse(JSON.stringify(this.columns))
+      if (this.columnsData) {
+        this.columns.filter(p=>{
+          rs.push({
+            fieldlabel:p.title,
+            fieldname:p.columnname
+          })
+        })
+      }
+      this.param.content.exportFields = rs
+      this.param.content.isExport = 1
+      /*导出数据*/
+      const res = await this.$api.requested(this.param)
+      this.downFile(res.data[0].url,this.fileName)
+      this.param.content.isExport = 0
+      this.param.content.exportFields = []
+    },
+    downFile(url, fileName) {
+      const x = new XMLHttpRequest()
+      x.open('GET', url, true)
+      x.responseType = 'blob'
+      x.onload = function() {
+        const url = window.URL.createObjectURL(x.response)
+        const a = document.createElement('a')
+        a.href = url
+        a.download = fileName
+        a.click()
+      }
+      x.send()
+    }
+  }
+}
+</script>
+<style>
+</style>

+ 20 - 0
src/router/SDrpManagement.js

@@ -341,6 +341,26 @@ const SDrpManagement = [
     },
     component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/salerAccount/index'),
   },
+  {
+    path: '/salerIncome',
+    name: 'salerIncome',
+    meta: {
+      title: '业务员收入',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/salerIncome/index'),
+  },
+  {
+    path: '/salerExpenditure',
+    name: 'salerExpenditure',
+    meta: {
+      title: '业务员收入',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/SDrpManagement/salerExpenditure/index'),
+  },
 
 ]
 export default SDrpManagement