Selaa lähdekoodia

修改营销管理

MS-QJVSRANLTYEO\Administrator 4 vuotta sitten
vanhempi
commit
15ce3c8163
26 muutettua tiedostoa jossa 255 lisäystä ja 202 poistoa
  1. 1 1
      Yijia-SaaS/yijia-customer/src/main/resources/mapper/customer/CustomerCardSettingMapper.xml
  2. 1 1
      Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/controller/IntegralRuleController.java
  3. 10 1
      Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/domain/CustomerPoints.java
  4. 10 0
      Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/domain/IntegralRule.java
  5. 1 1
      Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/mapper/IntegralRuleMapper.java
  6. 17 8
      Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/service/impl/IntegralRuleServiceImpl.java
  7. 6 11
      Yijia-SaaS/yijia-integral/src/main/resources/mapper/integral/CustomerPointsMapper.xml
  8. 5 2
      Yijia-SaaS/yijia-integral/src/main/resources/mapper/integral/IntegralRuleMapper.xml
  9. 3 2
      Yijia-SaaS/yijia-ui/package.json
  10. 1 1
      Yijia-SaaS/yijia-ui/src/api/integral/rule.js
  11. 34 27
      Yijia-SaaS/yijia-ui/src/views/customer/cardSetting/index.vue
  12. 16 1
      Yijia-SaaS/yijia-ui/src/views/customer/cardSettingDetail/index.vue
  13. 1 1
      Yijia-SaaS/yijia-ui/src/views/customer/consumption/index.vue
  14. 2 2
      Yijia-SaaS/yijia-ui/src/views/customer/manage/index.vue
  15. 1 1
      Yijia-SaaS/yijia-ui/src/views/customer/recharge/index.vue
  16. 1 0
      Yijia-SaaS/yijia-ui/src/views/integral/points/index.vue
  17. 13 2
      Yijia-SaaS/yijia-ui/src/views/integral/rule/index.vue
  18. 103 111
      Yijia-SaaS/yijia-ui/src/views/integral/ruledetail/index.vue
  19. 6 2
      Yijia-SaaS/yijia-ui/src/views/integral/wares/index.vue
  20. 2 2
      Yijia-SaaS/yijia-ui/src/views/login.vue
  21. 4 1
      Yijia-SaaS/yijia-ui/src/views/station/manage/index.vue
  22. 1 10
      Yijia-SaaS/yijia-ui/src/views/station/order/index.vue
  23. 1 1
      Yijia-SaaS/yijia-ui/src/views/station/order/notOil.vue
  24. 12 12
      Yijia-SaaS/yijia-ui/src/views/station/pay/index.vue
  25. 1 0
      Yijia-SaaS/yijia-ui/src/views/station/price/index.vue
  26. 2 1
      Yijia-SaaS/yijia-ui/vue.config.js

+ 1 - 1
Yijia-SaaS/yijia-customer/src/main/resources/mapper/customer/CustomerCardSettingMapper.xml

@@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </select>
         
-    <insert id="insertCustomerCardSetting" parameterType="CustomerCardSetting">
+    <insert id="insertCustomerCardSetting" parameterType="CustomerCardSetting" useGeneratedKeys="true" keyProperty="id">
         insert into customer_card_setting
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null">id,</if>

+ 1 - 1
Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/controller/IntegralRuleController.java

@@ -57,7 +57,7 @@ public class IntegralRuleController extends BaseController
     }
 
     /**
-     * 查询积分明细
+     * 查询积分规则明细
      * @param integralRule
      * @return
      */

+ 10 - 1
Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/domain/CustomerPoints.java

@@ -64,8 +64,17 @@ public class CustomerPoints extends BaseEntity
     /** 油站名称 */
     @Excel(name = "油站名称")
     private String stationName;
+    private String customerName;
 
-    public void setId(Long id) 
+    public String getCustomerName() {
+        return customerName;
+    }
+
+    public void setCustomerName(String customerName) {
+        this.customerName = customerName;
+    }
+
+    public void setId(Long id)
     {
         this.id = id;
     }

+ 10 - 0
Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/domain/IntegralRule.java

@@ -95,6 +95,16 @@ public class IntegralRule extends BaseEntity
     /** 油品类型 1.油品。2.非油品*/
     private String oilType;
 
+    private String  integralFlag;
+
+    public String getIntegralFlag() {
+        return integralFlag;
+    }
+
+    public void setIntegralFlag(String integralFlag) {
+        this.integralFlag = integralFlag;
+    }
+
     public BigDecimal getRuleTerms() {
         return ruleTerms;
     }

+ 1 - 1
Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/mapper/IntegralRuleMapper.java

@@ -33,7 +33,7 @@ public interface IntegralRuleMapper
      * @param integralRule 【请填写功能名称】
      * @return 结果
      */
-    public void insertIntegralRule(IntegralRule integralRule);
+    public int insertIntegralRule(IntegralRule integralRule);
   //  public IntegralRule insertIntegralRule(IntegralRule integralRule);
 
     /**

+ 17 - 8
Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/service/impl/IntegralRuleServiceImpl.java

@@ -1,5 +1,6 @@
 package com.yijia.integral.service.impl;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.List;
@@ -80,7 +81,7 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
     @Override
     public int insertIntegralRule(IntegralRule integralRule)
     {
-        int i = 0;
+
         try {
             if(integralRule !=null && integralRule.getTermDateManage()!=null && integralRule.getTermDateManage().equals("1")){
                 SimpleDateFormat sdf =   new SimpleDateFormat( "yyyy-MM-dd");
@@ -89,21 +90,26 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
         } catch (ParseException e) {
             e.printStackTrace();
         }
-        integralRuleMapper.insertIntegralRule(integralRule);
+        int i =integralRuleMapper.insertIntegralRule(integralRule);
       //  IntegralRule rule=  integralRuleMapper.insertIntegralRule(integralRule);
         //判断规则明细
         if(integralRule.getItemsDetail()!=null &&  integralRule.getItemsDetail().size()>0){
             List<IntegralRuleDetail> list =integralRule.getItemsDetail();
             for (IntegralRuleDetail detail : list){
-                detail.setParentId(integralRule.getId().longValue());
-                detail.setOilType("1");
-                i = integralRuleDetailMapper.insertIntegralRuleDetail(detail);
+                if(detail.getSaleAmt()!=null  && detail.getIntegral()!=null && detail.getSaleAmt().compareTo(new BigDecimal("0"))==1){
+                    detail.setParentId(integralRule.getId().longValue());
+                    detail.setOilType("1");
+                    if(detail.getGread()!="" && detail.getGread()!=null && detail.getGread().equals("所有人")){
+                        detail.setGread("");
+                    }
+                    integralRuleDetailMapper.insertIntegralRuleDetail(detail);
+                }
             }
         }
         if(integralRule.getNotOilList()!=null &&  integralRule.getNotOilList().size()>0){
             List<IntegralRuleDetail> notOilList =integralRule.getNotOilList();
             for (IntegralRuleDetail itemdetail : notOilList){
-                if(itemdetail.getSaleAmt()!=null && itemdetail.getIntegral()!=null){
+                if(itemdetail.getSaleAmt()!=null && itemdetail.getIntegral()!=null&&itemdetail.getSaleAmt().compareTo(new BigDecimal("0"))==1){
                     itemdetail.setParentId(integralRule.getId().longValue());
                     itemdetail.setOilType("2");
                     integralRuleDetailMapper.insertIntegralRuleDetail(itemdetail);
@@ -139,9 +145,12 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
         if(integralRule.getItemsDetail()!=null &&  integralRule.getItemsDetail().size()>0){
             List<IntegralRuleDetail> list =integralRule.getItemsDetail();
             for (IntegralRuleDetail detail : list){
-                if(detail.getSaleAmt()!=null && detail.getIntegral()!=null){
+                if(detail.getSaleAmt()!=null  && detail.getIntegral()!=null && detail.getSaleAmt().compareTo(new BigDecimal("0"))==1){
                     detail.setParentId(integralRule.getId().longValue());
                     detail.setOilType("1");
+                    if(detail.getGread()!="" && detail.getGread()!=null && detail.getGread().equals("所有人")){
+                        detail.setGread("");
+                    }
                     integralRuleDetailMapper.insertIntegralRuleDetail(detail);
                 }
             }
@@ -149,7 +158,7 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
         if(integralRule.getNotOilList()!=null &&  integralRule.getNotOilList().size()>0){
             List<IntegralRuleDetail> notOilList =integralRule.getNotOilList();
             for (IntegralRuleDetail itemdetail : notOilList){
-               if(itemdetail.getSaleAmt()!=null && itemdetail.getIntegral()!=null){
+               if(itemdetail.getSaleAmt()!=null && itemdetail.getIntegral()!=null&&itemdetail.getSaleAmt().compareTo(new BigDecimal("0"))==1){
                    itemdetail.setParentId(integralRule.getId().longValue());
                    itemdetail.setOilType("2");
                    integralRuleDetailMapper.insertIntegralRuleDetail(itemdetail);

+ 6 - 11
Yijia-SaaS/yijia-integral/src/main/resources/mapper/integral/CustomerPointsMapper.xml

@@ -17,10 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="recentConsumptionDate"    column="recent_consumption_date"    />
         <result property="stationId"    column="station_id"    />
         <result property="stationName"    column="station_name"    />
+        <result property="customerName"    column="customer_name"    />
     </resultMap>
 
     <sql id="selectCustomerPointsVo">
-        select id, union_id, blog_openid, mina_openid, mobile_phone, points, consumption_points, accumulate_points, invalid_points, recent_consumption_date, station_id, station_name from customer_points
+        select id, union_id, blog_openid, mina_openid, mobile_phone, points,customer_name, consumption_points, accumulate_points, invalid_points, recent_consumption_date, station_id, station_name from customer_points
     </sql>
 
     <select id="selectCustomerPointsList" parameterType="CustomerPoints" resultMap="CustomerPointsResult">
@@ -29,20 +30,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="unionId != null  and unionId != ''"> and union_id = #{unionId}</if>
             <if test="blogOpenid != null  and blogOpenid != ''"> and blog_openid = #{blogOpenid}</if>
             <if test="minaOpenid != null  and minaOpenid != ''"> and mina_openid = #{minaOpenid}</if>
-            <choose>
-                <when test="mobilePhone != null  and mobilePhone != ''">
-                    and mobile_phone = #{mobilePhone}
-                </when>
-                <otherwise>
-                    and  mobile_phone != ""
-                </otherwise>
-            </choose>
-            <if test="points != null "> and points = #{points}</if>
-            <if test="consumptionPoints != null "> and consumption_points = #{consumptionPoints}</if>
+            <if test="mobilePhone != null  and mobilePhone != ''"> and mobile_phone = #{mobilePhone}</if>
+             and points  != 0
+            <if test="consumptionPoints != null"> and consumption_points = #{consumptionPoints}</if>
             <if test="accumulatePoints != null "> and accumulate_points = #{accumulatePoints}</if>
             <if test="invalidPoints != null "> and invalid_points = #{invalidPoints}</if>
             <if test="recentConsumptionDate != null "> and recent_consumption_date = #{recentConsumptionDate}</if>
             <if test="stationId != null "> and station_id = #{stationId}</if>
+            <if test="customerName != null and customerName != ''"> and customer_name = #{customerName}</if>
             <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
             <if test="stationIdList != null ">
                 and station_id in

+ 5 - 2
Yijia-SaaS/yijia-integral/src/main/resources/mapper/integral/IntegralRuleMapper.xml

@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="saleAmt"    column="sale_amt"    />
         <result property="integral"    column="integral"    />
         <result property="oilType"    column="oil_type"    />
+        <result property="integralFlag"    column="integral_flag"    />
     </resultMap>
 
     <sql id="selectIntegralRuleVo">
@@ -161,8 +162,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="listRuleInfo" parameterType="IntegralRule" resultMap="IntegralRuleResult">
-        SELECT a.station_id,a.station_name,a.term_date_manage,a.integral_activity,empty_date,date_picker,integral_proportion,b.rule_type,rule_terms,gread,oil_name,sale_amt,integral,oil_type
-        from integral_rule a join integral_rule_detail b on a.id =b.parent_id
+        SELECT a.station_id,a.station_name,a.term_date_manage,a.integral_activity,empty_date,date_picker,integral_proportion,b.rule_type,rule_terms,gread,oil_name,sale_amt,integral,oil_type,c.integral_flag
+        from integral_rule a
+        join integral_rule_detail b on a.id =b.parent_id
+        join station_pay c on a.station_id =c.station_id
         <where>
             <if test="stationId != null "> and a.station_id = #{stationId}</if>
             <if test="stationName != null  and stationName != ''"> and a.station_name like concat('%', #{stationName}, '%')</if>

+ 3 - 2
Yijia-SaaS/yijia-ui/package.json

@@ -36,8 +36,8 @@
     "management-system"
   ],
   "dependencies": {
-    "@riophae/vue-treeselect": "0.4.0",
-    "axios": "0.18.1",
+    "@riophae/vue-treeselect": "^0.4.0",
+    "axios": "^0.21.1",
     "clipboard": "2.0.4",
     "core-js": "3.6.5",
     "echarts": "4.2.1",
@@ -56,6 +56,7 @@
     "vue": "2.6.10",
     "vue-count-to": "1.0.13",
     "vue-cropper": "0.4.9",
+    "vue-resource": "^1.5.2",
     "vue-router": "3.0.2",
     "vue-splitpane": "1.0.4",
     "vuedraggable": "2.20.0",

+ 1 - 1
Yijia-SaaS/yijia-ui/src/api/integral/rule.js

@@ -8,7 +8,7 @@ export function listRule(query) {
     params: query
   })
 }
-// 查询积分规则列表
+// 查询积分规则明细
 export function listRuleInfo(query) {
   return request({
     url: '/integral/rule/listRuleInfo',

+ 34 - 27
Yijia-SaaS/yijia-ui/src/views/customer/cardSetting/index.vue

@@ -1,16 +1,14 @@
 <template>
   <div class="app-container">
     <el-form ref="form" :model="form" :rules="rules" label-width="130px">
-      <el-form-item label="开通卡类型设置" >
-      </el-form-item>
       <el-row>
-        <el-col :span="8" style=""> 
-          <el-form-item>
+        <el-col :span="6" style=""> 
+          <el-form-item label="是否启用充值规则">
             <el-checkbox-group v-model="cardOilsTypeList">
               <el-checkbox v-for = "item in checkList" :key="item.id" :label="item.id" :value="item.value">{{item.value}}</el-checkbox>
             </el-checkbox-group>
           </el-form-item> 
-        </el-col>  
+        </el-col>
         <el-col :span="8" style=""> 
           <el-button type="primary" style="" @click="handleAdd">新增充值规则</el-button>
         </el-col> 
@@ -33,7 +31,6 @@
                 <span v-show="scope2.row.settingRuleType=='2'">%</span>
             </template>
           </el-table-column>
-          <el-table-column label="状态" align="center" prop="status" :formatter="statusFormatter"/>
           <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
               <el-button
@@ -160,7 +157,6 @@
     </el-form>
     <div slot="footer" class="dialog-footer">
       <el-button type="primary" @click="submitForm">确 定</el-button>
-      <el-button @click="cancel">取 消</el-button>
     </div>
 
      <!-- 添加或修改客户电子会员卡充值优惠设置明细对话框 -->
@@ -208,18 +204,20 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-form-item label="状态">
+        <el-row>
+           <span style="color:red;margin-left:90px;">例:按赠送金额:充100赠送10元;按赠送比例:充100赠送10%</span>
+        </el-row>
+        <!-- <el-form-item label="状态">
            <el-radio-group v-model="infoform.status">
             <el-radio v-for="dict in statusOptions"
             :key="dict.dictValue"
             :label="dict.dictValue"
             >{{dict.dictLabel}}</el-radio>
           </el-radio-group>
-        </el-form-item>
+        </el-form-item> -->
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="save">设置</el-button>
-        <el-button @click="cancelOpen">取 消</el-button>
       </div>
     </el-dialog>
   </div>
@@ -276,6 +274,8 @@ export default {
       form: {
         detailList:[]
       },
+      //判断保存次数
+      num:0,
       query:{
         deptId: null
       },
@@ -321,9 +321,9 @@ export default {
       this.deptInfo = response.data;
       if(this.deptInfo.jiBie==2){
         this.queryParams.stationId=this.deptInfo.deptId;
-        this.queryParams.stationName=this.deptInfo.deptName;
+        this.form.stationId = this.deptInfo.deptId;
+        this.form.stationName =this.deptInfo.deptName;
         selectCustomerCardSetting(this.queryParams).then(response => {
-          console.log("response",response);
           if(response.hasOwnProperty('data')){
             this.form = response.data;
             if(this.form.cardOilsType!=null &&this.form.cardOilsType!="" ){
@@ -351,7 +351,6 @@ export default {
           this.msgSuccess("请选择油站");
       }
     });
-   
   },
   methods: {
     oilNameFormatter(row, column){
@@ -426,7 +425,7 @@ export default {
     handleAdd() {
       this.open = true;
       this.title = "添加客户电子会员卡充值优惠设置";
-      
+      // this.infoform.status="1";
     },
     /** 修改按钮操作 */
     handleUpdate(index,row) {
@@ -440,8 +439,12 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+          let flag=true;
           if(this.cardOilsTypeList !=null && this.cardOilsTypeList.length>0){
             this.form.cardOilsType=this.cardOilsTypeList.toString();
+          }else{
+            this.form.cardOilsType="";
+            flag=false;
           }
           if (this.form.id != null) {
             let datepicker = this.form.discountTimeType;
@@ -452,26 +455,31 @@ export default {
             }else{
               this.form.discountTime = this.pickerTime.toString();
             }
-            console.log("this.form",this.form);
+
             updateSetting(this.form).then(response => {
               this.msgSuccess("修改成功");
               this.jine=false;
               this.bili=false;
             });
           } else {
-            let datepicker = this.form.datePicker;
-            if(datepicker=="1"){
-              this.form.discountTime=this.collectClickWorkDay.toString();
-            }else if(datepicker=="2"){
-              this.form.discountTime=this.collectClickCalendar.toString();
+            if(this.num==0){
+              let datepicker = this.form.datePicker;
+              if(datepicker=="1"){
+                this.form.discountTime=this.collectClickWorkDay.toString();
+              }else if(datepicker=="2"){
+                this.form.discountTime=this.collectClickCalendar.toString();
+              }else{
+                this.form.discountTime = this.pickerTime.toString();
+              }
+              addSetting(this.form).then(response => {
+                this.msgSuccess("新增成功");
+                this.num=this.num+1;
+                this.jine=false;
+                this.bili=false;
+              });
             }else{
-              this.form.discountTime = this.pickerTime.toString();
+              this.msgSuccess("已新增成功,如需修改请刷新页面");
             }
-            addSetting(this.form).then(response => {
-              this.msgSuccess("新增成功");
-              this.jine=false;
-              this.bili=false;
-            });
           }
         }
       });
@@ -501,7 +509,6 @@ export default {
       this.collectClickCalendar.remove(item)
     },
     clickCalendar(item, index) {
-      console.log('item, index:', item, index)
       if (this.collectClickCalendar.indexOf(index) === -1) {
         this.collectClickCalendar.push(index)
       } else if (this.collectClickCalendar.indexOf(index) > -1) {

+ 16 - 1
Yijia-SaaS/yijia-ui/src/views/customer/cardSettingDetail/index.vue

@@ -25,7 +25,18 @@
           <span v-show="scope.row.settingRuleType==2">{{scope.row.presentAmt}}%</span>
         </template>
       </el-table-column>
-      <el-table-column label="已开通油卡类型" align="center" prop="cardOilsType" :formatter="cardOilsTypeFormatter" width="120px;"/>
+      <el-table-column label="是否启用充值规则" align="center" prop="cardOilsType" >
+        <template slot-scope="scope1">
+          <span v-show="scope1.row.cardOilsType=='1' && scope1.row.oilName=='1'">开启</span>
+          <span v-show="scope1.row.cardOilsType=='2' && scope1.row.oilName=='2'">开启</span>
+          <span v-show="scope1.row.cardOilsType=='1,2'">开启</span>
+          <span v-show="scope1.row.cardOilsType=='2,1'">开启</span>
+          <span v-show="scope1.row.cardOilsType==''">关闭</span>
+           <span v-show="scope1.row.cardOilsType=='2' && scope1.row.oilName=='1'">关闭</span>
+           <span v-show="scope1.row.cardOilsType=='1' && scope1.row.oilName=='2'">关闭</span>
+        </template>
+      </el-table-column>
+      <!-- <el-table-column label="已开通油卡类型" align="center" prop="cardOilsType" width="120px;"/> -->
       <el-table-column label="充值活动设置" align="center" prop="discountTimeSetting" :formatter="discountTimeSettingFormatter" width="100px;"/>
       <el-table-column label="周期类型" align="center" prop="discountTimeType" :formatter="discountTimeTypeFormatter" width="90px;"/>
       <el-table-column label="赠送比例" align="center" width="90px;" >
@@ -148,6 +159,10 @@ export default {
     /** 查询客户电子会员卡充值优惠设置明细列表 */
     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;
+      }
       listDetailInfo(this.queryParams).then(response => {
         this.detailList = response.rows;
         this.total = response.total;

+ 1 - 1
Yijia-SaaS/yijia-ui/src/views/customer/consumption/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="客户名" prop="customerName">
+      <el-form-item label="会员名" prop="customerName">
         <el-input
           v-model="queryParams.customerName"
           placeholder="请输入客户名"

+ 2 - 2
Yijia-SaaS/yijia-ui/src/views/customer/manage/index.vue

@@ -73,8 +73,8 @@
       <el-table-column label="手机号" align="center" prop="phoneNumber" />
       <el-table-column label="车牌号" align="center" prop="carNumber" v-if="false"/>
       <el-table-column label="油品" align="center" prop="oilName" />
-      <el-table-column label="油余额" align="center" prop="qyAmt" />
-      <el-table-column label="油余额" align="center" prop="cyAmt" />
+      <el-table-column label="油余额" align="center" prop="qyAmt" />
+      <el-table-column label="油余额" align="center" prop="cyAmt" />
       <el-table-column label="积分" align="center" prop="integral" />
       <el-table-column label="专车类型" align="center" prop="specialCarType" v-if="false"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">

+ 1 - 1
Yijia-SaaS/yijia-ui/src/views/customer/recharge/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="客户名" prop="customerName">
+      <el-form-item label="会员名" prop="customerName">
         <el-input
           v-model="queryParams.customerName"
           placeholder="请输入客户名"

+ 1 - 0
Yijia-SaaS/yijia-ui/src/views/integral/points/index.vue

@@ -22,6 +22,7 @@
       <el-table-column label="微信用户unionID" align="center" prop="unionId" v-if="false"/>
       <el-table-column label="公众号的openID" align="center" prop="blogOpenid" v-if="false"/>
       <el-table-column label="小程序的openID" align="center" prop="minaOpenid" v-if="false" />
+      <el-table-column label="会员名" align="center" prop="customerName" />
       <el-table-column label="手机号码" align="center" prop="mobilePhone" />
       <el-table-column label="账户积分余额" align="center" prop="points" />
       <el-table-column label="使用积分累计" align="center" prop="consumptionPoints" />

+ 13 - 2
Yijia-SaaS/yijia-ui/src/views/integral/rule/index.vue

@@ -30,7 +30,10 @@
               <span>{{ scope.row.oilName}}油</span>
               <span v-show="scope.row.gread=='所有人'">{{ scope.row.gread}}每消费</span>
               <span v-show="scope.row.gread!='所有人'">{{ scope.row.gread}}会员每消费</span>
-              <span>{{ scope.row.saleAmt}}元{{scope.row.integral}}积分</span>
+              <span>{{ scope.row.saleAmt}}</span>
+              <span v-show="scope.row.ruleType==3">L</span>
+               <span v-show="scope.row.ruleType!=3">元</span>
+              <span>{{scope.row.integral}}积分</span>
             </div>
             <div v-show="scope.row.oilType==2">
               <span>非油品满{{scope.row.ruleTerms}}元起累计每消费</span>
@@ -38,13 +41,20 @@
             </div>
           </template>
       </el-table-column>
+      <el-table-column label="积分规则是否开启" align="center" prop="integralFlag" width="100px;">
+         <template slot-scope="scope2">
+            <span v-show="scope2.row.integralFlag==1">开启</span>
+            <span v-show="scope2.row.integralFlag==2">关闭</span>
+         </template>  
+      </el-table-column>
       <el-table-column label="油站名称" align="center" prop="stationName" width="100px;" />
       <el-table-column label="积分活动时限" align="center" prop="termDateManage" :formatter="termDateManageFormat" width="120px;"/>    
       <el-table-column label="多倍积分活动" align="center" prop="integralActivity"  :formatter="integralActivityFormat" width="100px;"/>
       <el-table-column label="周期类型" align="center" prop="datePicker" :formatter="datePickerFormat" width="100px;"/>
       <el-table-column label="积分比例" align="center" prop="integralProportion" width="100px;">
             <template slot-scope="scope1">
-               <span>{{ scope1.row.integralProportion}}倍</span>
+               <span>{{ scope1.row.integralProportion}}</span>
+               <span v-show="scope1.row.integralProportion!=''">倍</span>
             </template>
       </el-table-column>
     </el-table>
@@ -142,6 +152,7 @@ export default {
       if(this.queryParams.stationId==null || this.queryParams.stationId==""){
         this.queryParams.stationId =this.$store.state.user.deptId;
       }
+      //积分规则信息
       listRuleInfo(this.queryParams).then(response => {
         this.ruleList = response.rows;
         this.total = response.total;

+ 103 - 111
Yijia-SaaS/yijia-ui/src/views/integral/ruledetail/index.vue

@@ -59,7 +59,8 @@
               </el-select>
               <span>每消费</span>
               <el-input-number v-model="item.saleAmt"  size="small" :min="0"/>
-              <span>元</span>
+              <span v-if="item.ruleType=='3'">L</span>
+              <span v-else>元</span>
               <el-input-number v-model="item.integral" size="small" :min="0"/>
               <span>积分</span>
             </el-form-item>
@@ -101,6 +102,11 @@
               <el-input-number v-model="item.integral" size="small" :min="0"/>
               <span>积分</span>
             </el-form-item>
+            <el-button
+                type="danger"
+                @click="delNoil()"
+                size="small"
+              >清空非油品积分规则</el-button>
           </el-form>
         </el-row>
       </div>
@@ -218,8 +224,7 @@
       </el-form-item>
     </el-form>
     <div slot="footer" class="dialog-footer"> 
-      <el-button type="primary" @click="submitForm">确 定</el-button>
-      <el-button @click="cancel">取 消</el-button>
+      <el-button type="primary" @click="submitForm" :disabled="flage" >确 定</el-button>
     </div>
   </div>
 </template>
@@ -261,6 +266,8 @@ name: "ruleDetail",
       ruleForm:{
         imgFileList:[]
       },
+      flage:false,
+      num :0,
       pickerTime:"",
       dialogVisible: false,
       // 是否显示弹出层
@@ -306,43 +313,7 @@ name: "ruleDetail",
     };
   },
   created() {
-    //判断是否是做修改
-    if(this.$route.query.stationId!=null && this.$route.query.stationId!="" && this.$route.query.parentId !=null &&this.$route.query.parentId !=""){
-      this.queryParams.stationId=this.$route.query.stationId;
-      let id=this.$route.query.parentId;
-      if(id!=null && id != ""){
-        getRule(id).then(response => {
-          this.form = response.data;
-          if(this.form.notOilList.length==0 ){
-            this.form.notOilList=[{}];
-          }
-          if(this.form.itemsDetail.length==0 ){
-            this.form.itemsDetail=[{}];
-          }
-          let datepicker = this.form.datePicker;
-          if(datepicker=="1"){
-            this.workDaytrue=true;
-            if(this.form.datePickerTime!=null){
-              this.collectClickWorkDay= this.form.datePickerTime.split(',').map(parseFloat);
-            }
-          }else if(datepicker=="2"){
-            this.moonDaytrue=true;
-            if(this.form.datePickerTime!=null){
-              this.collectClickCalendar= this.form.datePickerTime.split(',').map(parseFloat);
-            }
-          }else{
-            this.datetrue=true;
-            if(this.form.datePickerTime!=null){
-              this.pickerTime= this.form.datePickerTime.split(',');
-            }
-          }
-        });
-        oilNameInfo(this.queryParams).then(response => {
-          this.oilNameOptions = response.rows;
-        });
-      }
-    }
-    this.getDicts("is_flag").then(response => {
+    this.getDicts("status").then(response => {
       this.integralFlagOptions = response.data;
     });
     this.getDicts("rule_type").then(response => {
@@ -369,35 +340,45 @@ name: "ruleDetail",
         this.deptInfo = response.data;
         if(this.deptInfo.jiBie==2){
           this.form.stationId=this.deptInfo.deptId;
-          this.form.stationNanme=this.deptInfo.deptName;
+          this.form.stationName=this.deptInfo.deptName;
           this.queryParams.stationId=this.deptInfo.deptId;
           listRuleOne(this.queryParams).then(response => {
-            this.form = response.data;
-            if(response.data.hasOwnProperty('notOilList') && this.form.notOilList.length==0 ){
-              this.form.notOilList=[{}];
-            }
-            if(response.data.hasOwnProperty('itemsDetail') &&this.form.itemsDetail.length==0 ){
-              this.form.itemsDetail=[{}];
-            }else{
-              this.rowsnum= this.form.itemsDetail.length-1;
-              let itemDetail = this.form.itemsDetail;
-              this.sjfa(itemDetail);
-            }
-            let datepicker = this.form.datePicker;
-            if(datepicker=="1"){
-              this.workDaytrue=true;
-              if(this.form.datePickerTime!=null){
-                this.collectClickWorkDay= this.form.datePickerTime.split(',').map(parseFloat);
+            if(response.hasOwnProperty('data')){
+              this.form = response.data;
+              if(response.data.hasOwnProperty('notOilList')){
+                if(this.form.notOilList.length==0){
+                   this.form.notOilList=[{}];
+                }
+              }else{
+                  this.form.notOilList=[{}];
               }
-            }else if(datepicker=="2"){
-              this.moonDaytrue=true;
-              if(this.form.datePickerTime!=null){
-                this.collectClickCalendar= this.form.datePickerTime.split(',').map(parseFloat);
+              if(response.data.hasOwnProperty('itemsDetail')  ){
+                if(this.form.itemsDetail.length==0){
+                   this.form.itemsDetail=[{}];
+                }else{
+                  let itemDetail = this.form.itemsDetail;
+                  this.sjfa(itemDetail);
+                  this.rowsnum= this.form.itemsDetail.length-1;
+                }
+              }else{
+                this.form.itemsDetail=[{}];
               }
-            }else{
-              this.datetrue=true;
-              if(this.form.datePickerTime!=null){
-                this.pickerTime= this.form.datePickerTime.split(',');
+              let datepicker = this.form.datePicker;
+              if(datepicker=="1"){
+                this.workDaytrue=true;
+                if(this.form.datePickerTime!=null){
+                  this.collectClickWorkDay= this.form.datePickerTime.split(',').map(parseFloat);
+                }
+              }else if(datepicker=="2"){
+                this.moonDaytrue=true;
+                if(this.form.datePickerTime!=null){
+                  this.collectClickCalendar= this.form.datePickerTime.split(',').map(parseFloat);
+                }
+              }else{
+                this.datetrue=true;
+                if(this.form.datePickerTime!=null){
+                  this.pickerTime= this.form.datePickerTime.split(',');
+                }
               }
             }
           });
@@ -409,23 +390,25 @@ name: "ruleDetail",
         }
     });
 //查看当前积分设置
-      this.queryRule.stationId= this.$store.selectDeptId;
-      if(this.queryRule.stationId==null || this.queryRule.stationId==""){
-        this.queryRule.stationId =this.$store.state.user.deptId;
+    this.queryRule.stationId= this.$store.selectDeptId;
+    if(this.queryRule.stationId==null || this.queryRule.stationId==""){
+      this.queryRule.stationId =this.$store.state.user.deptId;
+    }
+    getStationPay(this.queryRule).then(response => {
+      this.ruleForm = response.data;
+      if(this.ruleForm.integralFlag == ""){
+        this.ruleForm.integralFlag ="0";
       }
-      getStationPay(this.queryRule).then(response => {
-        this.ruleForm = response.data;
-        console.log("this.ruleForm",this.ruleForm);
-        if(this.ruleForm.integralFlag == ""){
-          this.ruleForm.integralFlag ="0";
-        }
-      });
+    });
   },
   methods: {
     async sjfa(itemDetail ){
       for(let j = 0; j < itemDetail.length; j++) {
           this.queryParams.stationId = this.form.stationId;
           this.queryParams.oilName = itemDetail[j].oilName;
+          if(itemDetail[j].gread ===""){
+              itemDetail[j].gread = "所有人";
+          }
           const response = await gradeList(this.queryParams);
           response.rows.push({grade:"所有人"});
           this.gradeOptions.push(response.rows);
@@ -447,6 +430,12 @@ name: "ruleDetail",
     del(index) {
       this.form.itemsDetail.splice(index, 1);
       this.rowsnum=this.form.itemsDetail.length-1;
+      if(this.form.itemsDetail.length<=0){
+         this.addItem();
+      }
+    },
+    delNoil(){
+      this.form.notOilList =[{}];
     },
     queryreset() {
       this.queryParams={
@@ -477,8 +466,8 @@ name: "ruleDetail",
       this.queryParams.stationId = this.form.stationId;
       this.queryParams.oilName=obj.oilName;
       gradeList(this.queryParams).then(response => {
-        response.rows.push({grade:"所有人"});
         const temp = [...this.gradeOptions]
+        response.rows.push({grade:"所有人"});
         temp[index] = response.rows;
         this.gradeOptions = temp;
       });
@@ -521,9 +510,9 @@ name: "ruleDetail",
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
-            console.log("notOilList",this.form.notOilList);
-            if(this.form.notOilList!=null&&this.form.notOilList.length==0 && this.form.notOilList[0].hasOwnProperty(saleAmt)){
-              if(this.form.notOilList[0].saleAmt==""||this.form.notOilList[0].saleAmt=="0" ||this.form.notOilList[0].saleAmt=="undefined"){
+            if(this.form.notOilList!=null&&this.form.notOilList.length==0 ){
+            }else{
+               if(this.form.notOilList[0].saleAmt==""||this.form.notOilList[0].saleAmt=="0" ||this.form.notOilList[0].saleAmt=="undefined"){
                 this.form.notOilList=[{}];
               }
             }
@@ -540,11 +529,7 @@ name: "ruleDetail",
             if(itemsDetail!=null&&itemsDetail.length>1){
               for (var i = 0; i < itemsDetail.length; i++) {
                   for (var j = i + 1; j < itemsDetail.length; j++) {
-                    console.log("i--oilName:",itemsDetail[i].oilName);
-                     console.log("J--oilName:",itemsDetail[j].oilName);
                     if (itemsDetail[i].oilName == itemsDetail[j].oilName) { 
-                        console.log("i--oilName:",itemsDetail[i].gread);
-                        console.log("J--oilName:",itemsDetail[j].gread);
                       if(itemsDetail[i].gread==itemsDetail[j].gread){
                         flag=false;
                         break;
@@ -572,38 +557,45 @@ name: "ruleDetail",
                this.msgSuccess("添加的规则明细有重复的,请再次确实积分规则");
             }
           } else {
-            let datepicker = this.form.datePicker;
-            if(datepicker=="1"){
-              this.form.datePickerTime=this.collectClickWorkDay.toString();
-            }else if(datepicker=="2"){
-              this.form.datePickerTime=this.collectClickCalendar.toString();
-            }else{
-              this.form.datePickerTime = this.pickerTime.toString();
-            }
-            if(this.form.notOilList!=null&&this.form.notOilList.length>0||this.form.notOilList[0].hasOwnProperty(saleAmt)){
-              if(this.form.notOilList[0].saleAmt==""||this.form.notOilList[0].saleAmt=="0" ||this.form.notOilList[0].saleAmt=="undefined"){
-                this.form.notOilList=[];
+            if(this.num===0){
+                let datepicker = this.form.datePicker;
+              if(datepicker=="1"){
+                this.form.datePickerTime=this.collectClickWorkDay.toString();
+              }else if(datepicker=="2"){
+                this.form.datePickerTime=this.collectClickCalendar.toString();
+              }else{
+                this.form.datePickerTime = this.pickerTime.toString();
               }
-            }
-            let itemsDetail =this.form.itemsDetail;
-            let flag= true;
-            if(itemsDetail!=null&&itemsDetail.length>0){
-              for (var i = 0; i < itemsDetail.length; i++) {
-                  for (var j = i + 1; j < itemsDetail.length; j++) {
-                    if (itemsDetail[i].ruleType == itemsDetail[j].ruleType &&itemsDetail[i].oilName == itemsDetail[j].oilName&& itemsDetail[i].gread==itemsDetail[j].gread) { 
-                      flag=false;
-                      break;
+              if(this.form.notOilList!=null&&this.form.notOilList.length>0||this.form.notOilList[0].hasOwnProperty(saleAmt)){
+                if(this.form.notOilList[0].saleAmt==""||this.form.notOilList[0].saleAmt=="0" ||this.form.notOilList[0].saleAmt=="undefined"){
+                  this.form.notOilList=[{}];
+                }
+              }else{
+                this.form.notOilList=[{}];
+              }
+              let itemsDetail =this.form.itemsDetail;
+              let flag= true;
+              if(itemsDetail!=null&&itemsDetail.length>0){
+                for (var i = 0; i < itemsDetail.length; i++) {
+                    for (var j = i + 1; j < itemsDetail.length; j++) {
+                      if (itemsDetail[i].ruleType == itemsDetail[j].ruleType &&itemsDetail[i].oilName == itemsDetail[j].oilName&& itemsDetail[i].gread==itemsDetail[j].gread) { 
+                        flag=false;
+                        break;
+                      }
                     }
-                  }
-                  if (flag) break;
+                    if (flag) break;
+                }
               }
-            }
-            if(flag){
-              addRule(this.form).then(response => {
-                this.msgSuccess("新增成功");
-              });
+              if(flag){
+                addRule(this.form).then(response => {
+                  this.msgSuccess("新增成功");
+                });
+              }else{
+                this.msgSuccess("添加的规则明细有重复的,请再次确实积分规则");
+              }
+              this.num=this.num+1;
             }else{
-               this.msgSuccess("添加的规则明细有重复的,请再次确实积分规则");
+                this.msgSuccess("已新增成功!如需修改请刷新页面");
             }
           }
         }

+ 6 - 2
Yijia-SaaS/yijia-ui/src/views/integral/wares/index.vue

@@ -82,13 +82,14 @@
             :before-upload="beforeAvatarUpload">
             <img v-if="form.waresPic" :src="form.waresPic" style="width:150px;height: 150px;" class="avatar">
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+            <div class="el-upload__tip" slot="tip">点击图片重新上传,只能上传jpg/png文件,图片大小不超过2M</div>
           </el-upload>
         </el-form-item>
         <el-form-item label="商品名称" prop="waresName">
           <el-input v-model="form.waresName" placeholder="请输入商品名称" />
         </el-form-item>
         <el-form-item label="商品详情" prop="waresDetail">
-          <el-input v-model="form.waresDetail" placeholder="请输入商品详情" />
+          <textarea v-model="form.waresDetail" placeholder="请输入商品详情" rows="4" cols="50"></textarea>
         </el-form-item>
         <el-form-item label="消费积分" prop="saleIntegral">
           <el-input-number v-model="form.saleIntegral" :min="0" placeholder="请输入消费积分" />
@@ -175,6 +176,9 @@ export default {
     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;
+      }
       listWares(this.queryParams).then(response => {
         this.waresList = response.rows;
         this.total = response.total;
@@ -309,7 +313,7 @@ export default {
       this.form.waresPic = imgurl;
     },
     beforeAvatarUpload(file) {
-      const isJPG = file.type === 'image/jpeg';
+      const isJPG = file.type === 'image/jpeg'|| 'image/png';
       const isLt2M = file.size / 1024 / 1024 < 2;
       if (!isJPG) {
         this.$message.error('上传头像图片只能是 JPG 格式!');

+ 2 - 2
Yijia-SaaS/yijia-ui/src/views/login.vue

@@ -65,8 +65,8 @@ export default {
       codeUrl: "",
       cookiePassword: "",
       loginForm: {
-        username: "admin",
-        password: "admin123",
+        username: "",
+        password: "",
         rememberMe: false,
         code: "",
         uuid: ""

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

@@ -180,6 +180,9 @@ export default {
         deviceFactory: null
       },
       deptId:null,
+      queryInfo:{
+        stationId:null
+      },
       // 查询参数
       deptInfo: {},
       query:{
@@ -296,7 +299,7 @@ export default {
         if(this.form.gunNo!=null &&this.form.gunNo!="" ){
           this.gunNoList=this.form.gunNo.split(",");
         }
-        this.queryInfo.stationId=row.stationId;
+        this.queryInfo.stationId=this.form.stationId;
         listGun(this.queryInfo).then(response => {
           this.checkList = response.rows;
         });

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

@@ -20,15 +20,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="车牌号" prop="orderNo">
-        <el-input
-          v-model="queryParams.likeCarNo"
-          placeholder="请输入订单号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item label="油品名称" prop="oilName">
         <el-select v-model="queryParams.oilName" placeholder="油品名称" clearable size="small">
           <el-option
@@ -82,7 +73,7 @@
       <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="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"/>

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

@@ -40,7 +40,7 @@
       <el-table-column label="订单号"  width="200" align="center" prop="orderNo" />
       <el-table-column label="应付金额" align="center" prop="receivableAmt" />
       <el-table-column label="实付金额" align="center" prop="amt" />
-      <el-table-column label="消费者" width="120" align="center" prop="consumer" />
+      <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="payType" :formatter="payTypeFotmat"/>

+ 12 - 12
Yijia-SaaS/yijia-ui/src/views/station/pay/index.vue

@@ -209,10 +209,15 @@ export default {
         this.queryParams.stationId =this.$store.state.user.deptId;
       }
       getStationPay(this.queryParams).then(response => {
-        this.ruleForm = response.data;
-        if(response.data.imgFileList==null){
-          this.ruleForm.imgFileList=[];
-        }
+        console.log("response",response);
+         this.ruleForm = response.data;
+          if(response.data.imgFileList==null){
+            this.ruleForm.imgFileList=[];
+          }
+          if(response.data.stationId==null){
+            this.ruleForm.stationId=this.$store.state.user.deptId;
+          }
+        
       });
     },
     /** 提交按钮 */
@@ -220,23 +225,18 @@ export default {
       this.$refs["ruleForm"].validate(valid => {
         if (valid) {
           if (this.ruleForm.payId != null) {
-            updatePay(this.ruleForm).then(response => {
+            updateInfo(this.ruleForm).then(response => {
               this.msgSuccess("修改成功");
               this.look();
             });
           } else {
             addPay(this.ruleForm).then(response => {
-              this.msgSuccess("新增成功");
+              this.msgSuccess("添加成功");
               this.look();
             });
           }
         }
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
+      });  
     }
   }
 };

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

@@ -315,6 +315,7 @@ export default {
         this.form1.stationName=sss[0].stationNanme;
         this.form1.oilName=sss[0].oilName;
         this.form1.oilPriceId=sss[0].oilPriceId;
+        this.form1.oilAdjustPrice=sss[0].oilPrice;
         this.form1.takeEffectStatus='1';
         this.open1= true;
         this.titleAdjust = "添加油品调价信息";

+ 2 - 1
Yijia-SaaS/yijia-ui/vue.config.js

@@ -19,7 +19,8 @@ module.exports = {
   // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
   publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
   // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
-  outputDir: 'dist',
+  //outputDir: 'dist',
+  outputDir: 'demo',
   // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
   assetsDir: 'static',
   // 是否开启eslint保存检测,有效值:ture | false | 'error'