Browse Source

班结管理,班结汇总查看详细信息

MS-QJVSRANLTYEO\Administrator 4 năm trước cách đây
mục cha
commit
fc8fe0b821

+ 14 - 1
Yijia-SaaS/yijia-ui/src/api/station/structure.js

@@ -16,7 +16,20 @@ export function listPersonnelStructure(query) {
     params: query
   })
 }
-
+export function listPersonnelPayStructure(query) {
+  return request({
+    url: '/station/structure/listPersonnelPayStructure',
+    method: 'get',
+    params: query
+  })
+}
+export function listClass(query) {
+  return request({
+    url: '/station/structure/listClass',
+    method: 'get',
+    params: query
+  })
+}
 
 export function listOilStructure(query) {
   return request({

+ 158 - 35
Yijia-SaaS/yijia-ui/src/views/station/structure/index.vue

@@ -1,27 +1,13 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="油站名称" prop="stationId" >
-        <el-select
-          v-model="queryParams.stationId"
-          placeholder="请选择油站"
-          clearable
-          size="small"
-        >
-          <el-option
-            v-for="item in stationOptions"
-            :key="item.stationId"
-            :label="item.stationName"
-            :value="item.stationId"
-          ></el-option>
-        </el-select>
+      <el-form-item  prop="carNumber">开班时间:{{opo.classStartDate}} 班结人:{{opo.classStructureMan}}
       </el-form-item>
       <el-form-item>
-        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
         <el-button icon="el-icon-plus" size="mini" @click="handleAdd">添加班结</el-button>
       </el-form-item>
     </el-form>
+
     <!--按员工汇总-->
     <span  style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:25px;">按员工汇总</span>
     <el-table v-loading="loading" show-summary :data="structureList"   :summary-method="getTotal">
@@ -40,6 +26,21 @@
       <el-table-column label="销额" align="center" prop="amt" />
       <el-table-column label="销售笔数" align="center" prop="orderNo" />
     </el-table>
+<!--按员工/支付方式汇总:    -->
+    <span  style="color:#ff9955;font-size:25px;padding-top: 15px;" >|</span><span style="font-size:25px;">按员工/支付方式汇总</span>
+    <el-table v-loading="loading" :data="structureList3"  show-summary   :summary-method="getTotal3" >
+      <el-table-column label="员工姓名" align="center" prop="oilPersonnel"  />
+      <el-table-column label="负责枪号" align="center" prop="oilGun" />
+      <el-table-column label="微信笔数" align="center" prop="wxNum" />
+      <el-table-column label="支付宝笔数" align="center" prop="zfbNum" />
+      <el-table-column label="现金笔数" align="center" prop="xjNum" />
+      <el-table-column label="优惠" align="center" prop="discountAmt" />
+      <el-table-column label="优惠卷" align="center" prop="discountCouponAmt" />
+      <el-table-column label="微信金额" align="center" prop="wxAmt" />
+      <el-table-column label="支付宝金额" align="center" prop="zfbAmt" />
+      <el-table-column label="现金金额" align="center" prop="xjAmt" />
+      <el-table-column label="会员卡支付" align="center" prop="memberAmt"/>
+    </el-table>
     <!-- 添加或修改班结管理对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <span>请确认没有车主使用系统支付</span>
@@ -52,7 +53,7 @@
 </template>
 
 <script>
-import { stationinfo,listStructure,listPersonnelStructure,listOilStructure, getStructure, delStructure, addStructure, updateStructure, exportStructure } from "@/api/station/structure";
+import { listPersonnelPayStructure,listClass,stationinfo,listStructure,listPersonnelStructure,listOilStructure, getStructure, delStructure, addStructure, updateStructure, exportStructure } from "@/api/station/structure";
 
 export default {
   name: "Structure",
@@ -67,6 +68,7 @@ export default {
       // 班结管理表格数据
       structureList: [],
       structureList1: [],
+      structureList3: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -91,6 +93,10 @@ export default {
         classStructureMan: null
       },
       stationOptions:[],
+      opo:{
+        classStructureMan:null,
+        classStartDate:null
+      },
       // 表单参数
       form: {},
       // 表单校验
@@ -99,12 +105,15 @@ export default {
     };
   },
   created() {
-    this.getList();
-    this.getList2();
-    stationinfo().then(response => {
-      this.stationOptions = response.rows;
-      this.loading = false;
-    });
+    this.loading = false;
+   let classesNo =this.$route.query.classesNo;
+   console.log("classesNo",this.$route.query);
+   if(classesNo!=null){
+     this.queryParams.classStructureNo =this.$route.query.classesNo;
+     this.queryParams.stationId=this.$route.query.stationId;
+     this.getClassInfo();
+   }
+
   },
   methods: {
     /** 查询班结管理列表 */
@@ -122,6 +131,13 @@ export default {
         this.loading = false;
       });
     },
+    getList3() {
+      this.loading = true;
+      listPersonnelPayStructure(this.queryParams).then(response => {
+        this.structureList3 = response.rows;
+        this.loading = false;
+      });
+    },
     getTotal(param) {
       const { columns, data } = param;
       const sums = [];
@@ -212,6 +228,111 @@ export default {
       });
       return sums;
     },
+    getTotal3(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计';
+          return;
+        }
+        const values = data.map(item => Number(item[column.property]));
+        if (column.property === 'wxNum') {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index]=sums[index].toFixed(0);
+        }else if(column.property === 'zfbNum'){
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index]=sums[index].toFixed(0);
+        }else if(column.property === 'xjNum'){
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index]=sums[index].toFixed(0);
+        }else if(column.property === 'discountAmt'){
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index]=sums[index].toFixed(2);
+        }else if(column.property === 'discountCouponAmt'){
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index]=sums[index].toFixed(2);
+        } else if(column.property === 'wxAmt'){
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index]=sums[index].toFixed(2);
+        } else if(column.property === 'zfbAmt'){
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index]=sums[index].toFixed(2);
+        } else if(column.property === 'xjAmt'){
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index]=sums[index].toFixed(2);
+        } else if(column.property === 'memberAmt'){
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index]=sums[index].toFixed(2);
+        } else {
+          sums[index] = '';
+        }
+      });
+      return sums;
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -238,16 +359,6 @@ export default {
       };
       this.resetForm("form");
     },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.getList();
-      this.getList2();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
 
     /** 新增按钮操作 */
     handleAdd() {
@@ -255,6 +366,17 @@ export default {
       this.open = true;
       this.title = "添加班结管理";
     },
+    getClassInfo(){
+      this.queryParams.classStructureMan=this.$store.state.user.name;
+      listClass(this.queryParams).then(response => {
+        this.opo = response.data;
+        this.queryParams.classStructureNo=response.data.classStructureNo;
+        this.queryParams.stationId=response.data.stationId;
+        this.getList();
+        this.getList2();
+        this.getList3();
+      });
+    },
     /** 提交按钮 */
     submitForm() {
       //获取当前登录人信息
@@ -265,10 +387,11 @@ export default {
       addStructure(this.form).then(response => {
         this.msgSuccess("新增成功");
         this.open = false;
-        this.getList();
+        this.getClassInfo();
+
+
       });
     }
-
   }
 };
 </script>

+ 17 - 3
Yijia-SaaS/yijia-ui/src/views/station/summary/index.vue

@@ -50,17 +50,17 @@
       </el-form-item>
     </el-form>
 
-    <el-table v-loading="loading" :data="summaryList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="summaryList" >
       <el-table-column label="班结主键id" align="center" prop="id" v-if="false" />
       <el-table-column label="班次号" align="center" prop="classesNo" />
       <el-table-column label="班次开始时间" align="center" prop="startDate" width="180">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
+          <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="班次结束时间" align="center" prop="endDate" width="180">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
+          <span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="油站id" align="center" prop="stationId" v-if="false" />
@@ -73,6 +73,20 @@
       <el-table-column label="支付宝销售金额" align="center" prop="zfbAmt" />
       <el-table-column label="电子卡销售金额" align="center" prop="dzkAmt" />
       <el-table-column label="班结人" align="center" prop="classesMan" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <router-link :to="{path:'/station/structure',query:{classesNo:scope.row.classesNo,stationId:scope.row.stationId}}" class="link-type">
+            <span>查看</span>
+          </router-link>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['customer:setting:edit']"
+          >查看</el-button>
+        </template>
+      </el-table-column>
     </el-table>
 
     <pagination