Sfoglia il codice sorgente

充值管理-余额预警,订单管理添加平台单号

dujingxian 4 anni fa
parent
commit
a746b83560

+ 15 - 4
src/pages/subPages/balance.vue

@@ -24,9 +24,9 @@
                     {{available_predeposit}}
                 </el-form-item>
                 <el-form-item
-                    label="设置余额预警:"
+                    label="余额预警:"
                     prop="alarm_amount">
-                    <el-input
+                    <!-- <el-input
                         size="small"
                         v-model="balanceForm.alarm_amount"
                         autocomplete="off"
@@ -35,7 +35,11 @@
                         @blur="balanceForm.alarm_amount = $event.target.value"
                         ></el-input>
                     <el-button type="primary" size="small" @click="onBalance">设置</el-button>
-                    <span style="color:rgb(255 1 1 / 0.7);margin-left:10px;font-size:12px;">建议设置50000及以上余额预警</span>
+                    <span style="color:rgb(255 1 1 / 0.7);margin-left:10px;font-size:12px;">建议设置50000及以上余额预警</span> -->
+                    <template v-if="balanceForm.alarm_amount">
+                        {{balanceForm.alarm_amount}}
+                    </template>
+                    <span v-else style="color:rgb(255 1 1 / 0.7);font-size:12px;line-height:20px;display: inline-block;margin-top: 9px;">请去设置里设置余额预警,当账户所剩余额达到预警额度时,将会给预留电话发送短信提醒。</span>
                 </el-form-item>
                 <el-form-item label="余额预警电话:">
                     <template v-if="this.cWarningList">
@@ -56,7 +60,7 @@
 <el-container direction="vertical">
     <!-- <el-header height="40px" style="border-bottom: 1px solid #eee">余额充值</el-header> -->
     <div style="margin-bottom:20px;">
-        <el-date-picker v-model="dataRange" :clearable="false" value-format="timestamp" format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+        <el-date-picker v-model="dataRange" :clearable="false" value-format="timestamp" format="yyyy-MM-dd" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width:260px;"></el-date-picker>
         <el-button style="margin-left:10px;" type="primary" @click="onSearch">查询</el-button>
         <el-button style="margin-left:10px;" type="danger" @click="onReset">重置</el-button>
         <el-button style="margin-left:10px;" type="warning" @click="onRecharge">充值申请提交</el-button>
@@ -775,6 +779,13 @@ export default {
 .bankDeposit .el-form-item {
     margin-bottom: 0px;
 }
+/deep/.el-date-editor .el-range-separator {
+    padding: 0;
+    width: 20px;/*no */
+}
+/deep/.el-date-editor .el-range-input {
+    width: 100px;/*no */
+}
 </style>
 <style>
 .el-main {

+ 11 - 7
src/pages/subPages/home.vue

@@ -32,7 +32,7 @@
       <div class="center">
         <div class="centerLeft">
           <div class="todayOrder">
-            <div>今日订单累计(个)</div>
+            <div class="todayOrders">今日订单累计(个)</div>
             <div class="count" >{{todayOrder.count}}</div>
             <div class="orders">
               <div class="orderIcon">
@@ -52,7 +52,7 @@
               </div>
               <div class="orderIcon">
                 <img src="../../assets/todayOrder_04@2x.png" alt="">
-                <div>处理中订单数</div>
+                <div>充值中订单数</div>
                 <div>{{todayOrder.sendCount}}</div>
               </div>
             </div>
@@ -109,11 +109,10 @@ export default {
         amountCount: ''
       },
       // 一周订单总数
-      weekOrderCount: []
+      weekOrderCount: [],
     }
   },
   created() {
-    // this.getHomeData()
   },
   mounted() {
     this.getEcharts()
@@ -146,7 +145,7 @@ export default {
                   data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
                   axisTick: {
                       alignWithLabel: true
-                  }
+                  },
               }
           ],
           yAxis: [
@@ -154,8 +153,9 @@ export default {
                 type: 'value',
                 axisLine: {show:true},
                 axisTick: {show:true},
-                min: 0,
-                max: +200,
+                min: 1,
+                minInterval:1,
+                max: 0,
               }
           ],
           series: [
@@ -190,6 +190,7 @@ export default {
           let weekOrderCount = res.datas.weeksStatistics
           Object.values(weekOrderCount).forEach(item => this.weekOrderCount.push(item.count))
           option.series[0].data = this.weekOrderCount
+          option.yAxis[0].max = res.datas.max
           myChart.setOption(option)
           setTimeout(function (){
             window.onresize = function () {
@@ -322,6 +323,9 @@ export default {
   padding: 42px 59px;
   text-align: center;
 }
+.todayOrders {
+  font-size: 30px;
+}
 .orders {
   overflow: hidden;
   display: flex;

+ 9 - 1
src/pages/subPages/message.vue

@@ -2,7 +2,8 @@
 <el-card>
 <el-container direction="vertical">
     <div>
-        <el-date-picker v-model="dataRange" clearable value-format="timestamp" format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="margin-right: 10px;margin-bottom:20px;"></el-date-picker>
+         <!-- HH:mm:ss -->
+        <el-date-picker v-model="dataRange" clearable value-format="timestamp" format="yyyy-MM-dd" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="margin-right: 10px;margin-bottom:20px;width:260px"></el-date-picker>
         <el-select v-model="changeVal" clearable placeholder="变动类型" style="margin-right: 10px;margin-bottom:20px;">
             <el-option
                 v-for="item in changeType"
@@ -194,6 +195,13 @@ export default {
 /deep/.el-table .cell {
     padding-right: 7px;
 }
+/deep/.el-date-editor .el-range-separator {
+    padding: 0;
+    width: 20px;/*no */
+}
+/deep/.el-date-editor .el-range-input {
+    width: 100px;/*no */
+}
 </style>
 <style>
 .el-main {

+ 34 - 17
src/pages/subPages/order.vue

@@ -9,6 +9,11 @@
             clearable></el-input>
         <el-input
             style="width:200px;margin-bottom:20px;margin-right: 10px;"
+            placeholder="请输入平台单号"
+            v-model.trim="order_sn"
+            clearable></el-input>
+        <el-input
+            style="width:200px;margin-bottom:20px;margin-right: 10px;"
             placeholder="请输入卡号"
             v-model.trim="card_no"
             clearable></el-input>
@@ -16,10 +21,10 @@
             v-model="dataRange"
             clearable
             value-format="timestamp"
-            format="yyyy-MM-dd HH:mm:ss"
+            format="yyyy-MM-dd"
             type="datetimerange"
             range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
-            style="margin-bottom:20px;margin-right: 10px;"></el-date-picker>
+            style="margin-bottom:20px;margin-right: 10px;width:260px"></el-date-picker>
         <el-select v-model="RechargeType" clearable placeholder="--充值卡类型--" style="margin-right: 10px;margin-bottom:20px;width: 140px;">
             <el-option
                 v-for="item in moneyType"
@@ -66,14 +71,14 @@
     </el-header>
    
     <el-table :data="tableData" border style="width: 1561px;" v-loading="isLoading">
-        <el-table-column align="left" type="index" width="50" label="序号" fixed />
-        <el-table-column align="left" prop="mch_order" width="200" label="客户单号" fixed></el-table-column>
-        <el-table-column align="left" prop="card_no" width="180" label="卡号"></el-table-column>
-        <el-table-column align="right" prop="refill_amount" label="充值面额" width="80"></el-table-column>
-        <el-table-column align="left" prop="card_type_name" label="充值卡类型" width="95"></el-table-column>
-        <el-table-column align="left" prop="order_time" width="160" label="充值时间"></el-table-column>
-        <el-table-column align="left" prop="diff_time_text" width="125" label="耗时"></el-table-column>
-        <el-table-column align="left" label="充值状态" width="85">
+        <el-table-column align="center" type="index" width="50" label="序号" fixed />
+        <el-table-column align="center" prop="mch_order" width="200" label="客户单号" fixed></el-table-column>
+        <el-table-column align="center" prop="card_no" width="180" label="卡号"></el-table-column>
+        <el-table-column align="center" prop="refill_amount" label="充值面额" width="80"></el-table-column>
+        <el-table-column align="center" prop="card_type_name" label="充值卡类型" width="95"></el-table-column>
+        <el-table-column align="center" prop="order_time" width="160" label="充值时间"></el-table-column>
+        <el-table-column align="center" prop="diff_time_text" width="70" label="耗时"></el-table-column>
+        <el-table-column align="center" label="充值状态" width="85">
             <template slot-scope="{row}">
                 <el-tag type = 'success' v-if="row.order_state == '40'">充值成功</el-tag>
                 <el-tag type = 'warning' v-if="row.order_state == '20'">支付成功</el-tag>
@@ -82,16 +87,16 @@
                 <el-tag type = 'danger' v-if="row.order_state == '0'">已取消</el-tag>
             </template>
         </el-table-column>
-        <!-- <el-table-column align="left" prop="official_sn" label="批次号"></el-table-column> -->
-        <el-table-column align="left" prop="order_sn" width="180" label="平台单号"></el-table-column>
-        <el-table-column align="left" prop="official_sn" width="250" label="官方流水号">
+        <!-- <el-table-column align="center" prop="official_sn" label="批次号"></el-table-column> -->
+        <el-table-column align="center" prop="order_sn" width="180" label="平台单号"></el-table-column>
+        <el-table-column align="center" prop="official_sn" width="250" label="官方流水号">
             <template slot-scope="{row}">
                 {{row.official_sn ? row.official_sn : '无'}}
             </template>
         </el-table-column>
-        <el-table-column align="left" prop="err_msg" label="失败原因" width="300"></el-table-column>
-        <el-table-column align="right" prop="mch_amount" label="扣款金额" width="80" fixed="right"></el-table-column>
-        <!-- <el-table-column align="left" width="200" label="状态查询">
+        <el-table-column align="center" prop="err_msg" label="失败原因" width="300"></el-table-column>
+        <el-table-column align="center" prop="mch_amount" label="扣款" width="70" fixed="right"></el-table-column>
+        <!-- <el-table-column align="center" width="200" label="状态查询">
             <template slot-scope="{row}">
                 <el-button type="primary" size="small" v-show="row && row.order_state_text == '充值中'">查询</el-button>
             </template>
@@ -146,7 +151,9 @@ export default {
             // 充值耗时-常量
             timeConstant,
             // 卡号
-            card_no: ''
+            card_no: '',
+            // 平台单号
+            order_sn: ''
         };
     },
     created () {
@@ -209,6 +216,7 @@ export default {
                 param.append('mch_order', this.mch_order)
                 param.append('time', this.time)
                 param.append('card_no', this.card_no)
+                param.append('order_sn', this.order_sn)
                 // const res = await queryList(this.pageNumber, startTime, endTime, this.RechargeType)
                 const res = await queryList(param)
                 console.log('查询订单', res);
@@ -232,6 +240,7 @@ export default {
             this.mch_order = ''
             this.time = ''
             this.card_no = ''
+            this.order_sn = ''
             this.getOrderList();
         },
         // 分页
@@ -258,6 +267,7 @@ export default {
                     param.append('refill_amount', this.amount)
                     param.append('mch_order', this.mch_order)
                     param.append('card_no', this.card_no)
+                    param.append('order_sn', this.order_sn)
                     // const res = await queryList(this.pageNumber, startTime, endTime, this.RechargeType)
                     const res = await queryList(param)
                     console.log('查询订单', res);
@@ -291,6 +301,13 @@ export default {
 /deep/.el-table .cell {
     padding-right: 7px;
 }
+/deep/.el-date-editor .el-range-separator {
+    padding: 0;
+    width: 20px;/*no */
+}
+/deep/.el-date-editor .el-range-input {
+    width: 100px;/*no */
+}
 </style>
 <style>
 .el-select-dropdown__empty {

+ 78 - 5
src/pages/subPages/view.vue

@@ -27,13 +27,14 @@
                     <el-input v-if="useKey == '1'" v-model="formKey.ReSecurityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
                     <el-input v-else v-model="formKey.securityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
                     <el-button type="primary" size="small" @click="updateKey">{{useKey == '1' ? '重设' : '设置'}}</el-button>
-                    <el-alert
+                    <!-- <el-alert
                         title="请输入32位字符串,用于接口生成签名"
                         type="info"
                         show-icon
                         style="width:880px;display:inline"
                         :closable="false">
-                    </el-alert>
+                    </el-alert> -->
+                    <span style="color:rgb(255 1 1 / 0.7);margin-left:10px;font-size:12px;">请输入32位字符串,用于接口生成签名</span>
                 </el-form-item>
                 <el-form-item label="ip白名单:" >
                     <div v-if="cIpList">
@@ -71,7 +72,21 @@
     <el-card>
         <el-container direction="vertical">
             <h3 style="margin-bottom:20px">余额预警电话设置:</h3>
-            <el-form label-width="120px" ref="formWarning">
+            <el-form label-width="120px" ref="formWarning" :model="balanceForm" :rules="balanceRules">
+                <el-form-item
+                    label="设置余额预警:"
+                    prop="alarm_amount">
+                    <el-input
+                        size="small"
+                        v-model="balanceForm.alarm_amount"
+                        autocomplete="off"
+                        style="width: 140px;margin-right:10px"
+                        onkeyup="value=value.replace(/[^\d.]/g,'')"
+                        @blur="balanceForm.alarm_amount = $event.target.value"
+                        ></el-input>
+                    <el-button type="primary" size="small" @click="onBalance">设置</el-button>
+                    <span style="color:rgb(255 1 1 / 0.7);margin-left:10px;font-size:12px;">建议设置50000及以上余额预警</span>
+                </el-form-item>
                 <el-form-item label="余额预警电话:" >
                     <div v-if="cWarningList">
                         <el-input style="width: 300px;margin-bottom: 10px;margin-right: 10px;" :value="addphone.phone"></el-input>
@@ -121,6 +136,34 @@ import {
 export default {
     name: 'pageView',
     data() {
+        var checkAmount = (rule, value, callback) => {
+            console.log('rule', rule, value);
+            console.log('value', value);
+            if (value === '') {
+                return callback(new Error('余额预警不能为空'));
+            } else if (value.indexOf(".") != -1 && value.split('.').length > 2) {
+                callback(new Error('请输入正确格式,只能有一位小数点'));
+            } else if (value.indexOf(".") != -1 && value.split('.')[1].length > 2) {
+                callback(new Error('小数点后面只能有两位'));
+            } else {
+                var Money = parseFloat(value).toFixed(3);
+                var MoneyResult = Money.substring(0, Money.length - 1);
+                var xsd = MoneyResult.toString().split(".");
+                // console.log('Money', Money, MoneyResult, xsd, xsd[1].length);
+                // if (xsd.length == 1) {
+                //     this.balanceForm.alarm_amount = creditResult.toString() + ".00";
+                // }
+                if (xsd.length > 1) {
+                    if (xsd[1].length == 1) {
+                        this.balanceForm.alarm_amount = MoneyResult;
+                    }
+                    if (xsd[1].length > 1) {
+                        this.balanceForm.alarm_amount = xsd[0].toString() + "." + xsd[1].toString().substring(0, 2);
+                    }
+                }
+                callback()
+            }
+        };
         var checkPhone = (rule, value, callback) => {
             if (!value) {
                 return callback(new Error('联系方式不能为空'));
@@ -191,7 +234,16 @@ export default {
                 ]
             },
             warningDialogVisible: false,
-            repeatPhone: false
+            repeatPhone: false,
+            // 余额预警
+            balanceForm: {
+                alarm_amount: '',
+            },
+            balanceRules: {
+                alarm_amount: [
+                    {validator: checkAmount, trigger: 'blur'}
+                ]
+            },
         };
     },
     created() {
@@ -307,6 +359,7 @@ export default {
                     this.useKey = res.datas.use_key
                     this.userForm.name = res.datas.contact_name != 'null' ? res.datas.contact_name : ''
                     this.userForm.phone = res.datas.contact_phone != 'null' ? res.datas.contact_phone : ''
+                    this.balanceForm.alarm_amount = res.datas.alarm_amount != 'null' ? res.datas.alarm_amount : ''
                     this.warningList = res.datas.warning_phone
                 }
             } catch (error) {
@@ -463,7 +516,27 @@ export default {
             .catch(() => {
                 return false;
             });
-        }
+        },
+        // 设置余额预警
+        async onBalance() {
+            try {
+                // if (!this.warningList.length) {
+                //     this.warningDialogVisible = true
+                //     return
+                // }
+                let param = new URLSearchParams()
+                param.append('alarm_amount', this.balanceForm.alarm_amount)
+                const res = await onSubUser(param)
+                // console.log('设置余额预警', res);
+                if (res && res.code == 200) {
+                    this.getUserInfo()
+                    this.$message.success('设置余额预警成功')
+                }
+            } catch (error) {
+                console.log(error);
+                this.$message.error('设置余额预警失败')
+            }
+        },
     },
 };
 </script>