Browse Source

修改班结管理

MS-QJVSRANLTYEO\Administrator 4 years ago
parent
commit
e379dc8b93

+ 32 - 0
Yijia-SaaS/yijia-ui/src/api/station/structure.js

@@ -88,3 +88,35 @@ export function exportStructure(query) {
     params: query
   })
 }
+//
+export function getAgeClassStructure(query) {
+  return request({
+    url: '/station/structure/getAgeClassStructure',
+    method: 'get',
+    params: query
+  })
+}
+//初始化数据班结数据,根据员工汇总
+export function selectPersonnelStructure(query) {
+  return request({
+    url: '/station/structure/selectPersonnelStructure',
+    method: 'get',
+    params: query
+  })
+}
+//初始化数据班结数据,根据油品汇总
+export function selectOilStructure(query) {
+  return request({
+    url: '/station/structure/selectOilStructure',
+    method: 'get',
+    params: query
+  })
+}
+//初始化数据班结数据,根据员工/支付方式汇总
+export function selectPersonnelPayStructure(query) {
+  return request({
+    url: '/station/structure/selectPersonnelPayStructure',
+    method: 'get',
+    params: query
+  })
+}

+ 31 - 19
Yijia-SaaS/yijia-ui/src/views/station/manage/index.vue

@@ -2,7 +2,7 @@
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="88px">
       <el-form-item label="设备类型" prop="deviceType">
-        <el-select v-model="queryParams.deviceType" multiple placeholder="请选择">
+        <el-select v-model="queryParams.deviceType" clearable placeholder="请选择">
           <el-option
             v-for="dict in deviceTypeOptions"
             :key="dict.dictValue"
@@ -83,6 +83,19 @@
         <el-form-item label="设备名称" prop="deviceName">
           <el-input v-model="form.deviceName" placeholder="请输入设备名称" />
         </el-form-item>
+        <el-form-item label="设备类型" >
+          <el-select v-model="form.deviceType"  placeholder="请选择" clearable size="small">
+            <el-option
+              v-for="dict in deviceTypeOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="设备序列号" prop="deviceSerialNum">
+          <el-input v-model="form.deviceSerialNum" placeholder="请输入设备序列号" />
+        </el-form-item>
         <el-form-item label="油站名称" prop="stationId" >
           <el-select
             v-model="form.stationId"
@@ -102,19 +115,6 @@
         <el-form-item label="油站名称" v-show="false" prop="stationName">
           <el-input v-model="form.stationName" placeholder="请输入油站名称" />
         </el-form-item>
-        <el-form-item label="设备类型" >
-          <el-select v-model="form.deviceType"  placeholder="请选择" clearable size="small">
-            <el-option
-              v-for="dict in deviceTypeOptions"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="设备序列号" prop="deviceSerialNum">
-          <el-input v-model="form.deviceSerialNum" placeholder="请输入设备序列号" />
-        </el-form-item>
         <el-form-item label="绑定油枪号" prop="gunNo">
           <el-checkbox-group v-model="gunNoList">
             <el-checkbox
@@ -151,7 +151,7 @@
 
 <script>
 import { listManage, getManage, delManage, addManage, updateManage, exportManage,changeManageStatus } from "@/api/station/manage";
-import{stationinfo,selectGun} from "@/api/station/gun";
+import{stationinfo,selectGun,listGun} from "@/api/station/gun";
 
 export default {
   name: "Manage",
@@ -197,6 +197,10 @@ export default {
         deviceStatus: null,
         deviceFactory: null
       },
+      // 查询参数
+      queryInfo: {
+        stationId: null
+      },
       // 表单参数
       form: {},
       // 表单校验
@@ -214,10 +218,10 @@ export default {
     this.getDicts("device_type").then(response => {
       this.deviceTypeOptions = response.data;
     });
-    //获取油枪
-    selectGun().then(response => {
-      this.checkList = response.rows;
-    });
+    // //获取油枪
+    // selectGun().then(response => {
+    //   this.checkList = response.rows;
+    // });
     stationinfo().then(response => {
       this.stationOptions = response.rows;
     });
@@ -292,6 +296,10 @@ export default {
         if(this.form.gunNo!=null &&this.form.gunNo!="" ){
           this.gunNoList=this.form.gunNo.split(",");
         }
+        this.queryInfo.stationId=row.stationId;
+        listGun(this.queryInfo).then(response => {
+          this.checkList = response.rows;
+        });
         this.open = true;
         this.title = "修改油站设备管理";
       });
@@ -354,6 +362,10 @@ export default {
         return item.stationId === e;//筛选出匹配数据
       })
       this.form.stationName=obj.stationName;
+      this.queryInfo.stationId=obj.stationId;
+      listGun(this.queryInfo).then(response => {
+        this.checkList = response.rows;
+      });
     },
     /** 导出按钮操作 */
     handleExport() {

+ 32 - 2
Yijia-SaaS/yijia-ui/src/views/station/structure/index.vue

@@ -53,7 +53,7 @@
 </template>
 
 <script>
-import { listPersonnelPayStructure,listClass,stationinfo,listStructure,listPersonnelStructure,listOilStructure, getStructure, delStructure, addStructure, updateStructure, exportStructure } from "@/api/station/structure";
+import { listPersonnelPayStructure,listClass,getAgeClassStructure,listPersonnelStructure,listOilStructure, addStructure,selectPersonnelStructure,selectPersonnelPayStructure,selectOilStructure} from "@/api/station/structure";
 
 export default {
   name: "Structure",
@@ -93,12 +93,22 @@ export default {
   created() {
     this.loading = false;
     let classesNo =this.$route.query.classesNo;
+    //这是班结报表查看详情时传过来的数据
     if(classesNo!=null){
      this.resetQuery();
      this.queryParams.classStructureNo=this.$route.query.classesNo;
      this.queryParams.stationId=this.$route.query.stationId;
      this.getClassInfo();
      this.isclose=false;
+    }else{
+       //初始化数据,在数据中查询上次班结结束时间,这里登陆人,还不能是员工,员工不能登陆,我们只能默认这里的数据是写死的油站
+      getAgeClassStructure().then(response => {
+        this.opo = response.data;
+        this.loading = false;
+      });
+      this.initPersonnelStructure();
+      this.initOilStructure();
+      this.initPersonnelPayStructure();
     }
   },
   activated(){
@@ -113,10 +123,30 @@ export default {
     }
   },
   methods: {
+    // 初始化数据按员工汇总
+    initPersonnelStructure(){
+      selectPersonnelStructure().then(response => {
+        this.structureList = response.rows;
+        this.loading = false;
+      });
+    },
+    // 初始化数据根据油品汇总
+    initOilStructure(){
+      selectOilStructure().then(response => {
+        this.structureList1 = response.rows;
+        this.loading = false;
+      });
+    },
+    // 初始化数据根据员工/支付方式汇总
+    initPersonnelPayStructure(){
+      selectPersonnelPayStructure().then(response => {
+        this.structureList3 = response.rows;
+        this.loading = false;
+      });
+    },
     /** 查询班结管理列表 */
     getList() {
       this.loading = true;
-
       listPersonnelStructure(this.queryParams).then(response => {
         this.structureList = response.rows;
         this.loading = false;