Browse Source

全局注入参数

Joe 4 years ago
parent
commit
b43d9f510a

+ 8 - 1
src/components/SelectDept/index.vue

@@ -1,4 +1,9 @@
 <template>
+<div>
+  {{this.$store.state.user.deptName}}
+</div>
+
+<!--
   <treeselect
     style="
       width: 180px;
@@ -11,12 +16,14 @@
     :options="options"
     :defaultExpandLevel="Infinity"
   />
+-->
 </template>
 
 <script>
 import { userdepttree } from "@/api/system/dept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
 export default {
   components: { Treeselect },
   data() {
@@ -40,10 +47,10 @@ export default {
       userdepttree().then((response) => {
         this.options = response.data;
         if (response.data != null && response.data.length > 0) {
-          console.log("111",response);
           this.value = response.data[0].id;
           this.$store.selectDeptName = response.data[0].label;
           this.$store.selectDeptId = response.data[0].id;
+          console.log("this.$store",this.$store)
         }
       });
     },

+ 17 - 0
src/main.js

@@ -65,6 +65,23 @@ Vue.use(Element, {
   size: Cookies.get('size') || 'medium' // set element-ui default size
 })
 
+Vue.mixin({
+  computed:{
+    jiBie:()=>{
+      return this.state.user.jiBie
+    },
+    deptId:()=>{
+      return this.state.user.deptId
+    },
+  },
+  created: function () {
+    var myOption = this.$options.myOption
+    if (myOption) {
+      console.log(myOption)
+    }
+  }
+})
+
 Vue.config.productionTip = false
 
 new Vue({

+ 1 - 1
src/router/index.js

@@ -59,7 +59,7 @@ export const constantRoutes = [
     children: [
       {
         path: 'index',
-        component: (resolve) => require(['@/views/dataSource/saleReport'], resolve),
+        component: (resolve) => require(['@/views/index'], resolve),
         name: '首页',
         meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
       }

+ 8 - 3
src/store/modules/user.js

@@ -10,7 +10,8 @@ const user = {
     avatar: '',
     roles: [],
     permissions: [],
-    jiBie:''
+    jiBie:'',
+    deptName:''
   },
 
   mutations: {
@@ -29,11 +30,14 @@ const user = {
     SET_PERMISSIONS: (state, permissions) => {
       state.permissions = permissions
     },
-    SET_DEPT:(state,deptId)=>{
+    SET_DEPT:(state, deptId)=>{
       state.deptId=deptId
     },
-    SET_JIBIE:(state,jiBie)=>{
+    SET_JIBIE:(state, jiBie)=>{
       state.jiBie=jiBie
+    },
+    SET_DEPTNAME:(state, deptName)=>{
+      state.deptName=deptName
     }
   },
 
@@ -76,6 +80,7 @@ const user = {
               throw new Error(info.msg)
             }
             commit("SET_JIBIE",info.data.jiBie)
+            commit("SET_DEPTNAME",info.data.deptName)
           }) 
           resolve(res)
         }).catch(error => {

+ 562 - 0
src/views/overview/summary.vue

@@ -0,0 +1,562 @@
+<template>
+  <div>
+    <div>
+      <span  style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:20px;">数据概览</span>
+      <el-form :model="queryParams" style="margin-left: 20px;" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+        <el-form-item>
+          <el-button  size="mini" @click="dayDataSource">今天</el-button>
+          <el-button  size="mini" @click="yesDataSource">昨天</el-button>
+          <el-button  size="mini" @click="workDataSource">本周</el-button>
+          <el-button  size="mini" @click="monthDataSource">本月</el-button>
+          <el-date-picker style="margin: 0px 10px;"
+            v-model="dateRangeCreatedDate"
+            type="datetimerange"
+            size="mini"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期">
+          </el-date-picker>
+          <el-button type="cyan" size="mini" @click="queryDataSource">查询</el-button>
+        </el-form-item>
+      </el-form>
+      <el-row :gutter="10" class="panel-group">
+        <el-col :xs="12" :sm="12" :lg="6" >
+          <div class="flex xiaoliang">
+            <div style="line-height: 62px;font-size: 2vw;">
+              {{ form.zongliters }}
+            </div>
+            <div style="font-size: 2vw;">
+              总销量(L)
+            </div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="6">
+          <div  class="flex xiaoe">
+            <div style="line-height: 62px;font-size: 2vw;">
+              {{ form.zongAmt }}
+            </div>
+            <div style="font-size: 2vw;">
+              总金额(元)
+            </div>
+          </div>
+        </el-col>
+        <el-col   :xs="12" :sm="12" :lg="6">
+          <div class="flex qiyou">
+            <div style="font-size: 28px;margin-top: -20px;">  汽油  </div>
+            <div class="flex-qy" style="margin-top: 30px;">
+              <div class="flex-qy-sx"  style="margin-right: 10px;">
+                <div style="font-size: 1.5vw;" >{{ form.qyliters }}</div>
+                <div style="font-size: 1.5vw;">升数(L)</div>
+              </div>
+              <div class="flex-qy-sx"  style="margin-left: 10px;">
+                <div style="font-size: 1.5vw;">{{ form.qyamt }} </div>
+                <div style="font-size: 1.5vw;">金额(元)</div>
+              </div>
+            </div>
+          </div>
+        </el-col>
+        <el-col  :xs="12" :sm="12" :lg="6">
+          <div class="flex chaiyou">
+            <div style="font-size: 28px;margin-top: -20px;">  柴油  </div>
+            <div class="flex-qy" style="margin-top: 30px;">
+              <div class="flex-qy-sx" style="margin-right: 10px;">
+                <div style="font-size:1.5vw;">{{ form.cyliters }}</div>
+                <div style="font-size: 1.5vw;">升数(L)</div>
+              </div>
+              <div class="flex-qy-sx" style="margin-left: 10px;">
+                <div style="font-size: 1.5vw;">{{ form.cyamt }}</div>
+                <div style="font-size: 1.5vw;">金额(元)</div>
+              </div>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <div style="width:100%; height: 151px;background: #FFFFFF;">
+      <span  style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:20px;">收入概览</span>
+      <el-row style="display:flex; align-items:center;justify-content:center;width:100%; height: 100%;">
+        <el-col :xs="12" :sm="12" :lg="3" >
+          <div class="flex-sr">
+            <div>
+              <span class="sr-font">{{ form.wxAmt }}</span>
+            </div>
+            <div>微信(元)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div><span class="sr-font">{{ form.zfbAmt }}</span></div>
+            <div>支付宝(元)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div>
+              <span class="sr-font">{{ form.xjAmt }}</span>
+            </div>
+            <div >现金(元)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div>
+              <span class="sr-font">{{ form.posAmt }}</span>
+            </div>
+            <div >POS(元)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div>
+              <span class="sr-font">{{ form.didiAppAmt }}</span>
+            </div>
+            <div>滴滴APP(元)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div>
+              <span class="sr-font">{{ form.tyAppAmt }}</span>
+            </div>
+            <div>团油APP(元)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div>
+              <span class="sr-font">{{ form.otherAmt }}</span>
+            </div>
+            <div>其他(元)</div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <div style="width:100%; height: 151px;">
+      <span  style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:20px;">今日数据</span>
+      <el-row style="display:flex; align-items:center;justify-content:center;width:100%; height: 100%;">
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div>
+               <span class="sr-font">{{ infoFrom.czAmt }}</span>
+            </div>
+            <div>充值金额(元)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div>
+               <span class="sr-font">{{ infoFrom.xfAmt }}</span>
+            </div>
+            <div>消费金额(元)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div><span class="sr-font">{{ infoFrom.yeAmt }}</span></div>
+            <div>余额(元)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div><span class="sr-font">{{ infoFrom.jrhy}}</span></div>
+            <div>新增电子卡(个)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+             <div><span class="sr-font">{{ infoFrom.zonghy }}</span></div>
+            <div>电子卡总数(个)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div><span>0</span></div>
+            <div>营销费用(元)</div>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="3">
+          <div class="flex-sr">
+            <div><span>0</span></div>
+            <div>营销产出比(%)</div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+  </div>
+</template>
+
+<script>
+  import { listSum,listOilType,listViewData,listCZData,listXFData,listHYData,listJRHYData } from "@/api/dataSource/saleReport";
+
+export default {
+  name: "sourceI",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      dateRangeCreatedDate:[],
+      // 查询参数
+      queryParams: {
+        createdDate: null,
+        stationId: null,
+        stationName: null,
+        beginTime:null,
+        endTime:null
+      },
+      queryInfo:{
+        stationId:null
+      },
+      // 表单参数
+      form: {
+        zongAmt:0,
+        zongliters:0,
+        qyamt:0,
+        cyamt:0,
+        qyliters:0,
+        cyliters:0,
+        wxAmt:0,
+        zfbAmt:0,
+        xjAmt:0,
+        didiAppAmt:0,
+        tyAppAmt:0,
+        otherAmt:0,
+        memberAmt:0,
+        posAmt:0              
+      },
+      infoFrom:{
+         czAmt:0,
+        xfAmt:0,
+        yeAmt:0,
+        jrhy:0,
+        zonghy:0
+      },
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.dayDataSource();
+  },
+  methods: {
+    /** 查询优惠劵管理列表 */
+    getList() {
+      if(this.queryParams.stationId==null || this.queryParams.stationId==""){
+        this.queryParams.stationId =this.$store.state.user.deptId;
+      }
+      listSum(this.queryParams).then(response => {
+        if(response.hasOwnProperty('data')){
+          this.form.zongAmt = response.data.amt;
+          this.form.zongliters = response.data.orderLiters;
+        }
+      });
+      listOilType(this.queryParams).then(response => {
+        if(response.hasOwnProperty('rows')){
+          for(let i in response.rows){
+            if(response.rows[i].oilType==="2"){
+              this.form.qyamt=response.rows[i].amt;
+              this.form.qyliters=response.rows[i].orderLiters;
+            }else if(response.rows[i].oilType==="1"){
+              this.form.cyamt=response.rows[i].amt;
+              this.form.cyliters=response.rows[i].orderLiters;
+            }
+          }
+        }
+      });
+      listViewData(this.queryParams).then(response => {
+        if(response.hasOwnProperty('data')){
+          if(response.data.wxAmt){
+            this.form.wxAmt = response.data.wxAmt;
+          }else{
+            this.form.wxAmt = 0;
+          }
+          if(response.data.zfbAmt){
+            this.form.zfbAmt = response.data.zfbAmt;
+          }else{
+            this.form.zfbAmt = 0;
+          }
+          if(response.data.xjAmt){
+            this.form.xjAmt = response.data.xjAmt;
+          }else{
+            this.form.xjAmt = 0;
+          }
+          if(response.data.didiAppAmt){
+            this.form.didiAppAmt = response.data.didiAppAmt;
+          }else{
+            this.form.didiAppAmt = 0;
+          }
+          if(response.data.tyAppAmt){
+            this.form.tyAppAmt = response.data.tyAppAmt;
+          }else{
+            this.form.tyAppAmt = 0;
+          }
+          if(response.data.otherAmt){
+            this.form.otherAmt = response.data.otherAmt;
+          }else{
+            this.form.otherAmt = 0;
+          }
+          if(response.data.memberAmt){
+            this.form.memberAmt = response.data.memberAmt;
+          }else{
+            this.form.memberAmt = 0;
+          }
+          if(response.data.posAmt){
+            this.form.posAmt = response.data.posAmt;
+          }else{
+            this.form.posAmt = 0;
+          }
+        }
+      });
+      
+      
+    },
+    //本日的数据
+    dayDataSource(){
+      this.reset();
+      this.queryParams.beginTime=this.getNowFormatDate(new Date());
+      this.queryParams.endTime =this.getEndFormatDate(new Date());
+      this.queryParams.stationId=this.$store.selectDeptId;
+      this.getList();
+      console.log("this.queryParams",this.queryParams);
+      listCZData(this.queryParams).then(response => {
+        if(response.hasOwnProperty('data')){
+          if(response.data.amt){
+            this.infoFrom.czAmt = response.data.amt;
+          }else{
+            this.infoFrom.czAmt = 0;
+          }
+        }
+      });
+      listXFData(this.queryParams).then(response => {
+        if(response.hasOwnProperty('data')){
+          if(response.data.amt){
+            this.infoFrom.xfAmt = response.data.amt;
+          }else{
+            this.infoFrom.xfAmt = 0;
+          }
+        }
+      });
+      this.queryInfo.stationId =this.queryParams.stationId;
+      listHYData(this.queryInfo).then(response => {
+        if(response.hasOwnProperty('data')){
+          if(response.data.amt){
+            this.infoFrom.yeAmt = response.data.amt;
+          }else{
+            this.infoFrom.yeAmt = 0;
+          }
+          if(response.data.num){
+            this.infoFrom.zonghy = response.data.num;
+          }else{
+            this.infoFrom.zonghy = 0;
+          }
+        }
+      });
+      listJRHYData(this.queryParams).then(response => {
+        if(response.hasOwnProperty('data')){
+          if(response.data.num){
+            this.infoFrom.jrhy = response.data.num;
+          }else{
+            this.infoFrom.jrhy = 0;
+          }
+        }
+      });
+    },
+    //昨天的数据
+    yesDataSource(){
+      this.reset();
+      this.queryParams.beginTime=this.getFormatDate(new Date());
+      this.queryParams.endTime =this.getNowFormatDate(new Date());
+      this.queryParams.stationId=this.$store.selectDeptId;
+      this.getList();
+    },
+    //本周的数据
+    workDataSource(){
+      this.reset();
+      this.queryParams.beginTime=this.getDates();
+      this.queryParams.endTime =this.getEndFormatDate(new Date());
+       this.queryParams.stationId=this.$store.selectDeptId;
+      this.getList();
+    },
+    //本月数据
+    monthDataSource(){
+      this.reset();
+      this.queryParams.beginTime=this.getMonthDate();
+      this.queryParams.endTime =this.getEndFormatDate(new Date());
+      this.queryParams.stationId=this.$store.selectDeptId;
+      this.getList();
+    },
+    //按照指定日期
+    queryDataSource(){
+      this.reset();
+      this.queryParams.beginTime =this.dateRangeCreatedDate[0];
+      this.queryParams.endTime = this.dateRangeCreatedDate[1];
+      this.queryParams.stationId=this.$store.selectDeptId;
+      this.getList();
+    },
+    //今天
+    getNowFormatDate(date){
+      let seperator1="-";
+      let month=date.getMonth()+1;
+      let strDate=date.getDate();
+      if (month>=1&&month<=9){
+        month="0"+month;
+      }
+      if (strDate>=0&&strDate<=9){
+        strDate="0"+strDate;
+      }
+      let currentdate=date.getFullYear()+seperator1+month+seperator1+strDate;
+      return currentdate;
+    },
+    //明天
+    getEndFormatDate(myDate){
+      let date = myDate.getDate();
+      date = date +1;
+      myDate.setDate(date);
+      let seperator1="-";
+      let month=myDate.getMonth()+1;
+      let strDate=myDate.getDate();
+      if (month>=1&&month<=9){
+        month="0"+month;
+      }
+      if (strDate>=0&&strDate<=9){
+        strDate="0"+strDate;
+      }
+      let currentdate=myDate.getFullYear()+seperator1+month+seperator1+strDate;
+      return currentdate;
+    },
+    //昨天
+    getFormatDate(myDate){
+      let date = myDate.getDate();
+      date = date - 1;
+      myDate.setDate(date);
+      let seperator1="-";
+      let month=myDate.getMonth()+1;
+      let strDate=myDate.getDate();
+      if (month>=1&&month<=9){
+        month="0"+month;
+      }
+      if (strDate>=0&&strDate<=9){
+        strDate="0"+strDate;
+      }
+      let currentdate=myDate.getFullYear()+seperator1+month+seperator1+strDate;
+      return currentdate;
+    },
+    //本周
+    getDates() {
+      var new_Date = new Date()
+      var timesStamp = new_Date.getTime();
+      var currenDay = new_Date.getDay();
+      var dates = new Date(timesStamp + 24 * 60 * 60 * 1000 * (0 - (currenDay + 6) % 7)).toLocaleDateString().replace(/[年月]/g, '-').replace(/[日上下午]/g, '');
+      let s=dates.replace(/-/g,"/");
+      var dt =new Date(s);
+      var m = dt.getMonth()+1;
+      var d = dt.getDate();
+      m = m<10?"0"+m:m;
+      d = d<10?"0"+d:d;
+      dates= dt.getFullYear() +"-"+ m+"-" + d
+      return dates;
+    },
+    /*本月*/
+    getMonthDate(){
+      let date=new Date();
+      let seperator1="-";
+      let month=date.getMonth()+1;
+      if (month>=1&&month<=9){
+        month="0"+month;
+      }
+      let currentdate=date.getFullYear()+seperator1+month+seperator1+"01";
+      return currentdate;
+    },
+    // 表单重置
+    reset() {
+      this.queryParams = {
+        createdDate: null,
+        stationId: null,
+        stationName: null,
+        beginTime:null,
+        endTime:null
+      };
+      this.form = {
+          zongAmt:0,
+          zongliters:0,
+          qyamt:0,
+          cyamt:0,
+          qyliters:0,
+          cyliters:0,
+          wxAmt:0,
+          zfbAmt:0,
+          xjAmt:0,
+          didiAppAmt:0,
+          tyAppAmt:0,
+          otherAmt:0,
+          memberAmt:0,
+          posAmt:0
+      };
+    }
+  },
+
+
+};
+</script>
+<style lang="scss" scoped>
+  .flex{
+    display:flex;
+    align-items:center;
+    justify-content:center;
+    width: 100%;
+    height: 170px;
+    flex-direction:column;
+
+  }
+  .xiaoliang{
+    background-image: url('../../assets/image/bj-1.png');
+    background-size: 100% 100%;
+  }
+  .xiaoe{
+    background-image: url('../../assets/image/bj-02.png');
+    background-size: 100% 100%;
+  }
+  .qiyou{
+    background-image: url('../../assets/image/bj-3.png');
+    background-size: 100% 100%;
+  }
+  .chaiyou{
+    background-image: url('../../assets/image/bj-4.png');
+    background-size: 100% 100%;
+  }
+  .flex-qy{
+    display:flex;
+    align-items:center;
+    justify-content:center;
+  }
+  .flex-qy-sx{
+    display:flex;
+    align-items:center;
+    justify-content:center;
+    flex-direction:column;
+  }
+  .panel-group {
+    padding-left: 10px;
+  }
+
+  .flex-sr{
+    display:flex;
+    align-items:center;
+    justify-content:center;
+    width: 100%;
+    flex-direction:column;
+  }
+  .sr-font{
+    font-size: 20px;
+    color: #F4A645;
+  }
+
+</style>

+ 331 - 224
src/views/station/order/index.vue

@@ -1,7 +1,12 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
       <el-form-item label="客户姓名" prop="consumer">
         <el-input
           v-model="queryParams.likeConsumer"
@@ -21,7 +26,12 @@
         />
       </el-form-item>
       <el-form-item label="油品名称" prop="oilName">
-        <el-select v-model="queryParams.oilName" placeholder="油品名称" clearable size="small">
+        <el-select
+          v-model="queryParams.oilName"
+          placeholder="油品名称"
+          clearable
+          size="small"
+        >
           <el-option
             v-for="dict in oilNameOptions"
             :key="dict.dictLabel"
@@ -48,54 +58,147 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      
+
       <el-form-item label="创建时间" prop="createdDate">
-        <el-date-picker style="width: 350px"
-                        v-model="dateRangeCreatedDate" size="mini" value-format="yyyy-MM-dd HH:mm:ss"
-                        type="datetimerange"
-                        range-separator="至"
-                        start-placeholder="开始日期"
-                        end-placeholder="结束日期">
+        <el-date-picker
+          style="width: 350px"
+          v-model="dateRangeCreatedDate"
+          size="mini"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        >
         </el-date-picker>
       </el-form-item>
       <el-form-item>
-        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button type="info" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-        <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport"  v-hasPermi="['station:order:export']">导出</el-button>
+        <el-button
+          type="cyan"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button
+          type="info"
+          icon="el-icon-refresh"
+          size="mini"
+          @click="resetQuery"
+          >重置</el-button
+        >
+        <el-button
+          type="warning"
+          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" >
-      <el-table-column v-if="false" label="订单id" align="center" prop="orderId" />
-      <el-table-column label="订单号"  width="200" align="center" prop="orderNo" />
+    <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" />
       <el-table-column label="油品价格" align="center" prop="oilPirce" />
       <el-table-column label="加油升数" align="center" prop="orderLiters" />
       <el-table-column label="应付金额" align="center" prop="receivableAmt" />
       <el-table-column label="实付金额" align="center" prop="amt" />
       <el-table-column label="优惠金额" align="center" prop="discountAmt" />
-      <el-table-column label="客户姓名" width="120" align="center" prop="consumer" />
-      <el-table-column label="加油员" width="120" align="center" prop="oilPersonnel" />
+      <el-table-column
+        label="客户姓名"
+        width="120"
+        align="center"
+        prop="consumer"
+      />
+      <el-table-column
+        label="加油员"
+        width="120"
+        align="center"
+        prop="oilPersonnel"
+      />
       <el-table-column label="加油枪号" align="center" prop="oilGun" />
-      <el-table-column label="支付类型" align="center" prop="payType" :formatter="payTypeFotmat"/>
-      <el-table-column label="油站名称" width="120" align="center" v-if="false" prop="stationName" />
-      <el-table-column v-if="false" label="用户id(消费者)" align="center" prop="consumerId" />
-      <el-table-column v-if="false" label="油站id" align="center" prop="stationId" />
-      <el-table-column label="状态" align="center" prop="status" :formatter="statusFotmat"/>
-      <el-table-column label="支付方式" align="center" prop="payWay" :formatter="payWayFotmat"/>
-      <el-table-column label="支付时间" align="center" prop="payDate" width="150">
+      <el-table-column
+        label="支付类型"
+        align="center"
+        prop="payType"
+        :formatter="payTypeFotmat"
+      />
+      <el-table-column
+        label="油站名称"
+        width="120"
+        align="center"
+        v-if="false"
+        prop="stationName"
+      />
+      <el-table-column
+        v-if="false"
+        label="用户id(消费者)"
+        align="center"
+        prop="consumerId"
+      />
+      <el-table-column
+        v-if="false"
+        label="油站id"
+        align="center"
+        prop="stationId"
+      />
+      <el-table-column
+        label="状态"
+        align="center"
+        prop="status"
+        :formatter="statusFotmat"
+      />
+      <el-table-column
+        label="支付方式"
+        align="center"
+        prop="payWay"
+        :formatter="payWayFotmat"
+      />
+      <el-table-column
+        label="支付时间"
+        align="center"
+        prop="payDate"
+        width="150"
+      >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.payDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+          <span>{{
+            parseTime(scope.row.payDate, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="创建时间" align="center" prop="createdDate" width="150">
+      <el-table-column
+        label="创建时间"
+        align="center"
+        prop="createdDate"
+        width="150"
+      >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+          <span>{{
+            parseTime(scope.row.createdDate, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="订单类型" align="center" prop="orderType" v-if="false" />
+      <el-table-column
+        label="订单类型"
+        align="center"
+        prop="orderType"
+        v-if="false"
+      />
     </el-table>
     <pagination
-      v-show="total>0"
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -104,206 +207,210 @@
   </div>
 </template>
 <script>
-  import { listOrder, exportOrder } from "@/api/station/order";
-  import {stationinfo} from "@/api/station/gun";
+import { listOrder, exportOrder } from "@/api/station/order";
+import { stationinfo } from "@/api/station/gun";
 
-  export default {
-    name: "Order",
-    data() {
-      return {
-         //创建订单时间间隔
-        dateRangeCreatedDate:[],
-        // 遮罩层
-        loading: true,
-        // 选中数组
-        ids: [],
-        // 非单个禁用
-        single: true,
-        // 非多个禁用
-        multiple: true,
-        // 显示搜索条件
-        showSearch: true,
-        // 总条数
-        total: 0,
-        // 订单支付表格数据
-        orderList: [],
-        oilNameOptions: [],
-        //字典
-        payTypeOptions:[],
-        payWayOptions:[],
-        //下拉油站
-        stationOptions:[],
-        // 弹出层标题
-        title: "",
-        // 是否显示弹出层
-        open: false,
-        // 查询参数
-        queryParams: {
-          pageNum: 1,
-          pageSize: 10,
-          orderNo: null,
-          oilGun: null,
-          oilName: null,
-          consumerId: null,
-          consumer: null,
-          amt: null,
-          stationId: null,
-          status: null,
-          orderLiters: null,
-          payType: null,
-          payWay: null,
-          stationName: null,
-          payDate: null,
-          payMaxDate: null,
-          payMinDate: null,
-          createdMaxDate: null,
-          createdMinDate: null,
-          oilPersonnel: null,
-          createdDate: null,
-          orderType: 1,
-          likeConsumer: null,
-          likeCustomerPhone: null,
-          likeCarNo: null
-        },
-        // 表单参数
-        form: {},
-        // 表单校验
-        rules: {
-        }
-      };
-    },
-    created() {
-      this.getList();
+export default {
+  name: "Order",
+  data() {
+    return {
+      //创建订单时间间隔
+      dateRangeCreatedDate: [],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单支付表格数据
+      orderList: [],
+      oilNameOptions: [],
       //字典
-      this.getDicts("pay_type").then(response => {
-        this.payTypeOptions = response.data;
-      });
-      this.getDicts("pay_way").then(response => {
-        this.payWayOptions = response.data;
-      });
-      stationinfo().then(response => {
-        this.stationOptions = response.rows;
+      payTypeOptions: [],
+      payWayOptions: [],
+      //下拉油站
+      stationOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderNo: null,
+        oilGun: null,
+        oilName: null,
+        consumerId: null,
+        consumer: null,
+        amt: null,
+        stationId: null,
+        status: null,
+        orderLiters: null,
+        payType: null,
+        payWay: null,
+        stationName: null,
+        payDate: null,
+        payMaxDate: null,
+        payMinDate: null,
+        createdMaxDate: null,
+        createdMinDate: null,
+        oilPersonnel: null,
+        createdDate: null,
+        orderType: 1,
+        likeConsumer: null,
+        likeCustomerPhone: null,
+        likeCarNo: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {},
+    };
+  },
+  created() {
+    this.getList();
+    //字典
+    this.getDicts("pay_type").then((response) => {
+      this.payTypeOptions = response.data;
+    });
+    this.getDicts("pay_way").then((response) => {
+      this.payWayOptions = response.data;
+    });
+    stationinfo().then((response) => {
+      this.stationOptions = response.rows;
+    });
+    this.getDicts("oil_name").then((response) => {
+      this.oilNameOptions = response.data;
+    });
+  },
+  methods: {
+    payTypeFotmat(row, column) {
+      if (row.payType === "wx") {
+        return "微信支付";
+      } else if (row.payType === "zfb") {
+        return "支付宝支付";
+      } else if (row.payType === "xj") {
+        return "现金支付";
+      } else if (row.payType === "dzk") {
+        return "电子卡支付";
+      } else if (row.payType === "POS") {
+        return "POS机支付";
+      } else if (row.payType === "yzf") {
+        return "预支付";
+      } else if (row.payType === "kbzf") {
+        return "卡包支付";
+      }
+    },
+    payWayFotmat(row, column) {
+      if (row.payWay === "02") {
+        return "公众号";
+      } else if (row.payWay === "03") {
+        return "小程序";
+      }
+    },
+    statusFotmat(row, column) {
+      if (row.status === "0") {
+        return "未支付";
+      } else if (row.status === "1") {
+        return "已支付";
+      }
+    },
+    //orderTypeFotmat
+    // orderTypeFotmat(row, column){
+    //   if(row.orderType === '1'){
+    //     return '柴油'
+    //   }else if(row.orderType === '2'){
+    //     return '汽油'
+    //   }
+    // },
+
+    /** 查询订单支付列表 */
+    getList() {
+      this.loading = true;
+      this.queryParams.stationId = this.$store.selectDeptId;
+      if (
+        this.queryParams.stationId == null ||
+        this.queryParams.stationId == ""
+      ) {
+        this.queryParams.stationId = this.$store.state.user.deptId;
+      }
+      listOrder(
+        this.addDateRange(this.queryParams, this.dateRangeCreatedDate)
+      ).then((response) => {
+        this.orderList = response.rows;
+        this.total = response.total;
+        this.loading = false;
       });
-      this.getDicts("oil_name").then(response => {
-        this.oilNameOptions = response.data;
+    },
+    onInstitutionChang(e) {
+      let obj = {};
+      obj = this.stationOptions.find((item) => {
+        //这里的userList就是上面遍历的数据源
+        return item.stationId === e; //筛选出匹配数据
       });
+      this.form.stationName = obj.stationName;
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        orderId: null,
+        orderNo: null,
+        oilGun: null,
+        oilName: null,
+        consumerId: null,
+        consumer: null,
+        amt: null,
+        stationId: null,
+        status: "0",
+        orderLiters: null,
+        payType: null,
+        payWay: null,
+        payDate: null,
+        oilPersonnel: null,
+        createdDate: null,
+        orderType: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRangeCreatedDate = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
     },
-    methods: {
-      payTypeFotmat(row, column){
-        if(row.payType === 'wx'){
-          return '微信支付'
-        }else if(row.payType === 'zfb'){
-          return '支付宝支付'
-        }else if(row.payType === 'xj'){
-          return '现金支付'
-        }else if(row.payType === 'dzk'){
-          return '电子卡支付'
-        }
-        else if(row.payType === 'POS'){
-          return 'POS机支付'
-        }
-        else if(row.payType === 'yzf'){
-          return '预支付'
-        }
-        else if(row.payType === 'kbzf'){
-          return '卡包支付'
-        }
-      },
-      payWayFotmat(row, column){
-        if(row.payWay === '02'){
-          return '公众号'
-        }else if(row.payWay === '03'){
-          return '小程序'
-        }
-      },
-      statusFotmat(row, column){
-        if(row.status === '0'){
-          return '未支付'
-        }else if(row.status === '1'){
-          return '已支付'
-        }
-      },
-      //orderTypeFotmat
-      // orderTypeFotmat(row, column){
-      //   if(row.orderType === '1'){
-      //     return '柴油'
-      //   }else if(row.orderType === '2'){
-      //     return '汽油'
-      //   }
-      // },
-
-      /** 查询订单支付列表 */
-      getList() {
-        this.loading = true;
-        this.queryParams.stationId= this.$store.selectDeptId;
-        if(this.queryParams.stationId==null || this.queryParams.stationId==""){
-          this.queryParams.stationId =this.$store.state.user.deptId;
-        }
-        listOrder(this.addDateRange(this.queryParams, this.dateRangeCreatedDate)).then(response => {
-          this.orderList = response.rows;
-          this.total = response.total;
-          this.loading = false;
-        });
-      },
-      onInstitutionChang(e){
-        let obj = {};
-        obj = this.stationOptions.find((item)=>{//这里的userList就是上面遍历的数据源
-          return item.stationId === e;//筛选出匹配数据
-        })
-        this.form.stationName=obj.stationName;
-      },
-      // 取消按钮
-      cancel() {
-        this.open = false;
-        this.reset();
-      },
-      // 表单重置
-      reset() {
-        this.form = {
-          orderId: null,
-          orderNo: null,
-          oilGun: null,
-          oilName: null,
-          consumerId: null,
-          consumer: null,
-          amt: null,
-          stationId: null,
-          status: "0",
-          orderLiters: null,
-          payType: null,
-          payWay: null,
-          payDate: null,
-          oilPersonnel: null,
-          createdDate: null,
-          orderType: null
-        };
-        this.resetForm("form");
-      },
-      /** 搜索按钮操作 */
-      handleQuery() {
-        this.queryParams.pageNum = 1;
-        this.getList();
-      },
-      /** 重置按钮操作 */
-      resetQuery() {
-        this.dateRangeCreatedDate =[];
-        this.resetForm("queryForm");
-        this.handleQuery();
-      },
 
-      /** 导出按钮操作 */
-      handleExport() {
-        const queryParams = this.queryParams;
-        this.$confirm('是否确认导出所有订单支付数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm("是否确认导出所有订单支付数据项?", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(function () {
           return exportOrder(queryParams);
-        }).then(response => {
-          this.download(response.msg);
         })
-      }
-    }
-  };
+        .then((response) => {
+          this.download(response.msg);
+        });
+    },
+  },
+};
 </script>

+ 3 - 3
src/views/station/price/index.vue

@@ -7,7 +7,7 @@
         <el-button  type="success" icon="el-icon-edit" size="mini"  @click="handleAddAdjust"  v-hasPermi="['station:adjust:add']">调价</el-button>
       </el-form-item>
     </el-form>
-    <el-table v-loading="loading" :data="priceList"  ref = "multipleTable"  @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="priceList"  ref="multipleTable"  @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="油品价格id" v-if="false" align="center" prop="oilPriceId" />
       <el-table-column label="油品名称" align="center" prop="oilName" />
@@ -63,7 +63,7 @@
     <el-dialog :title="titleAdjust" :visible.sync="open1" :rules="rules" width="500px" append-to-body>
       <el-form ref="form1" :model="form1"  label-width="80px">
         <el-form-item label="油品名称" prop="oilName" >
-          <el-select :disabled="disabled" v-model="form1.oilName" placeholder="油品名称" clearable size="small">
+          <el-select :disabled="editInfo" v-model="form1.oilName" placeholder="油品名称" clearable size="small">
             <el-option
               v-for="dict in oilNameOptions"
               :key="dict.dictLabel"
@@ -92,7 +92,7 @@
           </el-date-picker>
         </el-form-item>
         <el-form-item label="油站名称"  prop="stationId"  >
-          <el-select disabled="disabled"
+          <el-select :disabled="editInfo"
             v-model="form1.stationId"
             placeholder="请选择油站"
             clearable