MS-QJVSRANLTYEO\Administrator 4 rokov pred
rodič
commit
e64d3d62ce

+ 30 - 1
Yijia-SaaS/yijia-ui/src/api/dataSource/saleReport.js

@@ -38,11 +38,40 @@ export function listDayReport(query) {
     method: 'get',
     params: query
   })
-}export function getDetails(query) {
+}
+export function getDetails(query) {
   return request({
     url: '/station/order/list',
     method: 'get',
     params: query
   })
 }
+export function listQydata92(query) {
+  return request({
+    url: '/station/order/listQydata92',
+    method: 'get',
+    params: query
+  })
+}
+export function listQydata95(query) {
+  return request({
+    url: '/station/order/listQydata95',
+    method: 'get',
+    params: query
+  })
+}
+export function listQydata97(query) {
+  return request({
+    url: '/station/order/listQydata97',
+    method: 'get',
+    params: query
+  })
+}
+export function listXdata(query) {
+  return request({
+    url: '/station/order/listXdata',
+    method: 'get',
+    params: query
+  })
+}
 

+ 13 - 1
Yijia-SaaS/yijia-ui/src/api/station/manage.js

@@ -50,4 +50,16 @@ export function exportManage(query) {
     method: 'get',
     params: query
   })
-}
+}
+// 用户状态修改
+export function changeManageStatus(deviceId, deviceStatus) {
+  const data = {
+    deviceId,
+    deviceStatus
+  }
+  return request({
+    url: '/station/manage/changeManageStatus',
+    method: 'put',
+    data: data
+  })
+}

+ 168 - 12
Yijia-SaaS/yijia-ui/src/views/dataSource/dayReport.vue

@@ -62,8 +62,9 @@
         </el-col>
       </el-row>
     </div>
-    <div style="width:100%; height: 81px;background: #FFFFFF;">
+    <div style="width:100%; height: 360px;margin: 0px 30px;background: #FFFFFF;">
       <span  style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:20px;">销售情况</span>
+      <div  ref="myChart"  style="width:100%; height: 350px;" ></div>
     </div>
     <div style="width:100%; height: 181px;">
       <span  style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:20px;">详情:</span>
@@ -115,11 +116,15 @@
 </template>
 
 <script>
-  import { listSum,listOilType,listDayReport,getDetails } from "@/api/dataSource/saleReport";
+import echarts from 'echarts'
+require('echarts/theme/macarons') // echarts theme
+import { listSum,listOilType,listDayReport,getDetails,listXdata,listQydata92,listQydata95,listQydata97 } from "@/api/dataSource/saleReport";
+
 export default {
   name: "source",
   data() {
     return {
+      charts: null,
       // 遮罩层
       loading: true,
       // 选中数组
@@ -136,6 +141,14 @@ export default {
       couponList: [],
       dayReportDetailsList: [],
       dateRangeCreatedDate:[],
+      //x轴数据
+      xdata:[],
+      //92#汽油数据
+      qydata92:[],
+      //95#汽油数据
+      qydata95:[],
+      //97#汽油数据
+      qydata97:[],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -163,10 +176,144 @@ export default {
       }
     };
   },
+  mounted() {
+    this.$nextTick(() => {
+      this.initChart();
+    });
+  },
   created() {
-    this.getList();
+    //获取折线图的数据
+    this.reset();
+    this.queryParams.beginTime = this.getMonthDate();
+    this.queryParams.endTime = this.getEndFormatDate(new Date());
+    this.getDatas();
+    this.dayDataSource();
+    //不加等待时间的话,初始化了echarts,,getDatas的数据没有获取到。等待后数据获取到,重新加载就可以了。
+    setTimeout(() =>{
+      this.initChart();
+    },1000);
   },
   methods: {
+    initChart(){
+      // 初始化echarts
+      this.charts = echarts.init(this.$refs.myChart, 'macarons');
+      console.log("xdata",this.xdata);
+      this.charts.setOption({
+        xAxis: {
+          data: this.xdata,
+            boundaryGap: false,
+            axisTick: {
+            show: false
+          }
+        },
+        tooltip: {
+          trigger: 'axis',
+            axisPointer: {
+            type: 'cross'
+          },
+          padding: [5, 10]
+        },
+        yAxis: {
+          axisTick: {
+            show: false
+          }
+        },
+        legend: {
+          data: ['92#', '95#','97#']
+        },
+        series: [{
+          name: '92#', itemStyle: {
+            normal: {
+              color: '#FF005A',
+              lineStyle: {
+                color: '#FF005A',
+                width: 2
+              }
+            }
+          },
+          smooth: true,
+          type: 'line',
+          data: this.qydata92,
+          animationDuration: 2800,
+          animationEasing: 'cubicInOut'
+        },
+          {
+            name: '95#',
+            smooth: true,
+            type: 'line',
+            itemStyle: {
+              normal: {
+                color: '#3888fa',
+                lineStyle: {
+                  color: '#3888fa',
+                  width: 2
+                },
+              }
+            },
+            data: this.qydata95,
+            animationDuration: 2800,
+            animationEasing: 'quadraticOut'
+          },
+          {
+            name: '97#',
+            smooth: true,
+            type: 'line',
+            itemStyle: {
+              normal: {
+                color: '#ffff00',
+                lineStyle: {
+                  color: '#ffff00',
+                  width: 2
+                },
+              }
+            },
+            data: this.qydata97,
+            animationDuration: 2800,
+            animationEasing: 'quadraticOut'
+          }]
+      });
+    },
+    //获取折线图用到的数据
+    getDatas(){
+      listXdata(this.queryParams).then(response => {
+        this.xdata=[];
+        console.log("查询到的xdata",response.rows);
+        if (response.rows === "undefined") {
+        } else {
+          for (let i in response.rows){
+            this.xdata.push(response.rows[i].createdDate);
+          }
+        }
+      });
+      listQydata92(this.queryParams).then(response => {
+        this.qydata92=[];
+        if (response.rows === "undefined") {
+        } else {
+          for (let i in response.rows){
+            this.qydata92.push(response.rows[i].amt);
+          }
+        }
+      });
+      listQydata95(this.queryParams).then(response => {
+        this.qydata95=[];
+        if (response.rows === "undefined") {
+        } else {
+          for (let i in response.rows){
+            this.qydata95.push(response.rows[i].amt);
+          }
+        }
+      });
+      listQydata97(this.queryParams).then(response => {
+        this.qydata97=[];
+        if (response.rows === "undefined") {
+        } else {
+          for (let i in response.rows){
+            this.qydata97.push(response.rows[i].amt);
+          }
+        }
+      });
+    },
+
     /** 查询优惠劵管理列表 */
     getList() {
       listSum(this.queryParams).then(response => {
@@ -213,7 +360,11 @@ export default {
       this.reset();
       this.queryParams.beginTime = this.getDates();
       this.queryParams.endTime = this.getEndFormatDate(new Date());
+      this.getDatas();
       this.getList();
+      setTimeout(() =>{
+        this.initChart();
+      },1000);
     },
 
     //本月数据
@@ -221,7 +372,9 @@ export default {
       this.reset();
       this.queryParams.beginTime = this.getMonthDate();
       this.queryParams.endTime = this.getEndFormatDate(new Date());
+      this.getDatas();
       this.getList();
+      this.initChart();
     },
 
     //按照指定日期
@@ -229,8 +382,11 @@ export default {
       this.reset();
       this.queryParams.beginTime = this.dateRangeCreatedDate[0];
       this.queryParams.endTime = this.dateRangeCreatedDate[1];
-
+      this.getDatas();
       this.getList();
+      setTimeout(() =>{
+        this.initChart();
+      },1000);
     },
     //今天
     getNowFormatDate(date) {
@@ -243,15 +399,15 @@ export default {
       if (strDate >= 0 && strDate <= 9) {
         strDate = "0" + strDate;
       }
-      let currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
-      return currentdate;
+      let currentdate1 = date.getFullYear() + seperator1 + month + seperator1 + strDate;
+      return currentdate1;
     },
     //明天
     getEndFormatDate(myDate) {
       let date = myDate.getDate();
       date = date + 1;
       myDate.setDate(date);
-      let seperator1 = "-";
+      let seperator2 = "-";
       let month = myDate.getMonth() + 1;
       let strDate = myDate.getDate();
       if (month >= 1 && month <= 9) {
@@ -260,15 +416,15 @@ export default {
       if (strDate >= 0 && strDate <= 9) {
         strDate = "0" + strDate;
       }
-      let currentdate = myDate.getFullYear() + seperator1 + month + seperator1 + strDate;
-      return currentdate;
+      let currentdate2 = myDate.getFullYear() + seperator2 + month + seperator2 + strDate;
+      return currentdate2;
     },
     //昨天
     getFormatDate(myDate) {
       let date = myDate.getDate();
       date = date - 1;
       myDate.setDate(date);
-      let seperator1 = "-";
+      let seperator3 = "-";
       let month = myDate.getMonth() + 1;
       let strDate = myDate.getDate();
       if (month >= 1 && month <= 9) {
@@ -277,8 +433,8 @@ export default {
       if (strDate >= 0 && strDate <= 9) {
         strDate = "0" + strDate;
       }
-      let currentdate = myDate.getFullYear() + seperator1 + month + seperator1 + strDate;
-      return currentdate;
+      let currentdate3 = myDate.getFullYear() + seperator3 + month + seperator3 + strDate;
+      return currentdate3;
     },
     getDates() {
       var new_Date = new Date()

+ 2 - 0
Yijia-SaaS/yijia-ui/src/views/dataSource/saleReport.vue

@@ -376,6 +376,7 @@ export default {
       let currentdate=myDate.getFullYear()+seperator1+month+seperator1+strDate;
       return currentdate;
     },
+    //本周
     getDates() {
       var new_Date = new Date()
       var timesStamp = new_Date.getTime();
@@ -390,6 +391,7 @@ export default {
       dates= dt.getFullYear() +"-"+ m+"-" + d
       return dates;
     },
+    /*本月*/
     getMonthDate(){
       let date=new Date();
       let seperator1="-";

+ 51 - 11
Yijia-SaaS/yijia-ui/src/views/station/manage/index.vue

@@ -13,8 +13,7 @@
       </el-form-item>
 
       <el-form-item label="设备序列号" prop="deviceSerialNum">
-        <el-input.
-
+        <el-input
           v-model="queryParams.deviceSerialNum"
           placeholder="请输入设备序列号"
           clearable
@@ -44,8 +43,7 @@
             size="mini"
             type="text"
             icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['station:manage:edit']"
+            @click="handleStatusUpdate(scope.row)"
           >停用</el-button>
           <el-button
             size="mini"
@@ -82,10 +80,23 @@
         <el-form-item label="设备名称" prop="deviceName">
           <el-input v-model="form.deviceName" placeholder="请输入设备名称" />
         </el-form-item>
-        <el-form-item label="设备名称" v-show="false" prop="stationId">
-          <el-input v-model="form.stationId" placeholder="请输入设备名称" />
+        <el-form-item label="油站名称" prop="stationId" >
+          <el-select
+            v-model="form.stationId"
+            placeholder="请选择油站"
+            clearable
+            size="small"
+            @change="onInstitutionChang"
+          >
+            <el-option
+              v-for="item in stationOptions"
+              :key="item.stationId"
+              :label="item.stationName"
+              :value="item.stationId"
+            ></el-option>
+          </el-select>
         </el-form-item>
-        <el-form-item label="油站名称" prop="stationName">
+        <el-form-item label="油站名称" v-show="false" prop="stationName">
           <el-input v-model="form.stationName" placeholder="请输入油站名称" />
         </el-form-item>
         <el-form-item label="设备类型" >
@@ -113,8 +124,8 @@
             </el-checkbox>
           </el-checkbox-group>
         </el-form-item>
-        <el-form-item label="设备状态" prop="deviceStatus">
-          <el-select v-model="form.deviceStatus" multiple placeholder="请选择">
+        <el-form-item label="设备状态" >
+          <el-select v-model="form.deviceStatus" clearable size="small" placeholder="请选择">
             <el-option
               v-for="dict in deviceStatusOptions"
               :key="dict.dictValue"
@@ -136,8 +147,8 @@
 </template>
 
 <script>
-import { listManage, getManage, delManage, addManage, updateManage, exportManage } from "@/api/station/manage";
-import{selectGun} from "@/api/station/gun";
+import { listManage, getManage, delManage, addManage, updateManage, exportManage,changeManageStatus } from "@/api/station/manage";
+import{stationinfo,selectGun} from "@/api/station/gun";
 
 export default {
   name: "Manage",
@@ -164,6 +175,7 @@ export default {
       deviceStatusOptions:[],
       //设备类型
       deviceTypeOptions:[],
+      stationOptions:[],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -203,6 +215,9 @@ export default {
     selectGun().then(response => {
       this.checkList = response.rows;
     });
+    stationinfo().then(response => {
+      this.stationOptions = response.rows;
+    });
   },
   methods: {
     /** 查询油站设备管理列表 */
@@ -271,10 +286,28 @@ export default {
         this.title = "修改油站设备管理";
       });
     },
+
+    handleStatusUpdate(row){
+      let text = row.deviceStatus === "1" ? "启用" : "停用";
+      this.$confirm('确认要"' + text + '""' + row.deviceSerialNum + '"设备吗?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+          return changeManageStatus(row.deviceId, "2");
+      }).then(() => {
+        this.msgSuccess(text + "成功");
+        this.handleQuery();
+      });
+
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+          if(this.gunNoList !=null && this.gunNoList.length>0){
+            this.form.gunNo=this.gunNoList.toString();
+          }
           if (this.form.deviceId != null) {
             updateManage(this.form).then(response => {
               this.msgSuccess("修改成功");
@@ -305,6 +338,13 @@ export default {
           this.msgSuccess("删除成功");
         })
     },
+    onInstitutionChang(e){
+      let obj = {};
+      obj = this.stationOptions.find((item)=>{//这里的userList就是上面遍历的数据源
+        return item.stationId === e;//筛选出匹配数据
+      })
+      this.form.stationName=obj.stationName;
+    },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;

+ 1 - 1
Yijia-SaaS/yijia-ui/src/views/station/order/index.vue

@@ -86,7 +86,7 @@
         <el-button icon="el-icon-download" size="mini" @click="handleExport"  v-hasPermi="['station:order:export']">导出</el-button>
       </el-form-item>
     </el-form>
-    <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="orderList" >
       <el-table-column v-if="false" label="订单id" align="center" prop="orderId" />
       <el-table-column label="订单号"  width="200" align="center" prop="orderNo" />
       <el-table-column label="油品名称" align="center" prop="oilName" />

+ 16 - 22
Yijia-SaaS/yijia-ui/src/views/station/structure/index.vue

@@ -4,7 +4,7 @@
       <el-form-item  prop="carNumber">开班时间:{{opo.classStartDate}} 班结人:{{opo.classStructureMan}}
       </el-form-item>
       <el-form-item>
-        <el-button icon="el-icon-plus" size="mini" @click="handleAdd">添加班结</el-button>
+        <el-button icon="el-icon-plus" v-if="isclose" size="mini" @click="handleAdd">添加班结</el-button>
       </el-form-item>
     </el-form>
 
@@ -73,24 +73,10 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      //是否显示班结
+      isclose:true,
       // 查询参数
       queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        stationId: null,
-        stationName: null,
-        person: null,
-        gunNo: null,
-        salesVolume: null,
-        salesAmount: null,
-        discount: null,
-        coupon: null,
-        netReceipts: null,
-        salesNum: null,
-        printNum: null,
-        classStructureNo: null,
-        classStructureDate: null,
-        classStructureMan: null
       },
       stationOptions:[],
       opo:{
@@ -107,11 +93,12 @@ export default {
   created() {
     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.resetQuery();
+     this.queryParams.classStructureNo=this.$route.query.classesNo;
      this.queryParams.stationId=this.$route.query.stationId;
      this.getClassInfo();
+     this.isclose=false;
    }
 
   },
@@ -119,6 +106,7 @@ export default {
     /** 查询班结管理列表 */
     getList() {
       this.loading = true;
+
       listPersonnelStructure(this.queryParams).then(response => {
         this.structureList = response.rows;
         this.loading = false;
@@ -359,7 +347,10 @@ export default {
       };
       this.resetForm("form");
     },
-
+    resetQuery() {
+      this.queryParams = {};
+      this.resetForm("queryForm");
+    },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
@@ -388,10 +379,13 @@ export default {
         this.msgSuccess("新增成功");
         this.open = false;
         this.getClassInfo();
-
-
       });
     }
+  },
+  watch:{
+    $route(to){
+      this.$router.go(0);
+    }
   }
 };
 </script>

+ 69 - 9
Yijia-SaaS/yijia-ui/src/views/station/summary/index.vue

@@ -12,7 +12,7 @@
       </el-form-item>
       <el-form-item label="开始时间" prop="startDate">
         <el-date-picker clearable size="small" style="width: 200px"
-          v-model="queryParams.startDate"
+          v-model="queryParams.beginTime"
           type="date"
           value-format="yyyy-MM-dd"
           placeholder="选择开始时间">
@@ -20,7 +20,7 @@
       </el-form-item>
       <el-form-item label="结束时间" prop="endDate">
         <el-date-picker clearable size="small" style="width: 200px"
-          v-model="queryParams.endDate"
+          v-model="queryParams.endTime"
           type="date"
           value-format="yyyy-MM-dd"
           placeholder="选择结束时间">
@@ -75,16 +75,16 @@
       <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 :to="{path:'/station/structure',query:{classesNo:scope.row.classesNo,stationId:scope.row.stationId}}"  class="link-type">
+            <span icon="el-icon-search" >查看 </span>
           </router-link>
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['customer:setting:edit']"
-          >查看</el-button>
+            icon="el-icon-download"
+            @click="handleExport(scope.row)"
+            v-hasPermi="['station:structure:export']"
+          >下载</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -101,6 +101,7 @@
 
 <script>
 import { listSummary } from "@/api/station/summary";
+import { exportStructure } from "@/api/station/structure";
 
 export default {
   name: "Summary",
@@ -142,6 +143,50 @@ export default {
         dzkAmt: null,
         classesMan: null
       },
+      // 查询参数
+      queryParam: {
+        orderNo: null,
+        stationId: null,
+        stationName: null,
+        oilGun: null,
+        oilName: null,
+        oilPirce: null,
+        oilType: null,
+        consumerId: null,
+        consumer: null,
+        amt: null,
+        orderLiters: null,
+        payType: null,
+        payWay: null,
+        payDate: null,
+        oilPersonnel: null,
+        orderType: null,
+        printNum: null,
+        classStructureNo: null,
+        classStartDate: null,
+        classStructureDate: null,
+        classStructureMan: null,
+        oils: null,
+        receivableAmt: null,
+        receivedAmt: null,
+        discountAmt: null,
+        discountCouponAmt: null,
+        discountCoupon: null,
+        wxAmt: null,
+        zfbAmt: null,
+        posAmt: null,
+        xjAmt: null,
+        didiAppAmt: null,
+        tyAppAmt: null,
+        otherAmt: null,
+        dzkAmt: null,
+        score: null,
+        memberNo: null,
+        memberAmt: null,
+        carNo: null,
+        customerPhone: null,
+        customerGrade: null
+      },
       // 表单参数
       form: {},
       // 表单校验
@@ -187,6 +232,7 @@ export default {
       };
       this.resetForm("form");
     },
+
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
@@ -196,8 +242,22 @@ export default {
     resetQuery() {
       this.resetForm("queryForm");
       this.handleQuery();
+    },
+    /** 导出按钮操作 */
+    handleExport(row) {
+      const classesNo = row.classesNo;
+      this.queryParam.classStructureNo=classesNo;
+      const queryParams = this.queryParam;
+      this.$confirm('是否确认导出所有班结数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return exportStructure(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      })
     }
-
   }
 };
 </script>