Procházet zdrojové kódy

修改订单界面功能并进行优化,增加异常订单界面功能,修改登录功能,优化缴费名单页面

zhang před 4 roky
rodič
revize
f1917cce75

+ 17 - 1
src/components/index/Index.vue

@@ -88,6 +88,7 @@
     },
     created: function() {
       this.user_info = JSON.parse(sessionStorage.getItem('usr_info'))
+      // console.log(this.user_info)
       this.determineIdentify()
       this.getNowDate()
     },
@@ -119,7 +120,7 @@
       //判断身份
       determineIdentify(){
         // console.log(this.user_info)
-        if( this.user_info == null || this.user_info.userName != 'admin' || this.user_info.password != '123456'){
+        if( this.user_info == null){
           this.$router.push({
             path: '/'
           })
@@ -129,6 +130,21 @@
       refresh(){
         this.$router.go(0)
       },
+      // //获取管理员用户名和密码
+      // getData(url) {
+      //   this.$axios.get(url + '?' + this.$qs.stringify({}), {
+      //     headers: {
+      //       'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
+      //       'Author': 'codingliang',
+      //       'admin_token': this.user_token
+      //     }
+      //   }).then(res => {
+      //     console.log(res)
+      //   }).catch(err => {
+      //     console.log(err)
+      //     this.$message.error("订单导出失败")
+      //   })
+      // },
       onSubmit() {
         console.log('submit!');
       },

+ 11 - 2
src/components/orderList/orderList.css

@@ -37,7 +37,7 @@
 }
 
 >>>#first-right {
-  width: 420px;
+  width: 650px;
   display: flex;
   flex-direction: row;
   justify-content: space-between;
@@ -99,12 +99,21 @@
 	margin-bottom: 0px;
 }
 
+.total_order {
+	font-size: 16px;
+	font-family: Microsoft YaHei-3970(82674968);
+	font-weight: 400;
+	color: #333333;
+  width: 200px;
+	/* margin-right: 106px; */
+}
+
 .total_balance {
 	font-size: 16px;
 	font-family: Microsoft YaHei-3970(82674968);
 	font-weight: 400;
 	color: #333333;
-  width: 300px;
+  width: 280px;
 	/* margin-right: 106px; */
 }
 

+ 18 - 5
src/components/orderList/orderList.vue

@@ -7,6 +7,7 @@
           <div class="tag">订单管理</div>
         </div>
         <div id="first-right">
+          <div class="total_order">总订单数:<span class="all-money">{{recordsNum}}</span> 笔</div>
           <div class="total_balance">总金额:<span class="all-money">{{all_money.toFixed(2)}}</span> 元</div>
           <el-button type="primary" class="first-right-btn" @click="downLoadFile">导出已缴表单</el-button>
         </div>
@@ -56,10 +57,10 @@
           </el-table-column>
           </el-table> -->
           <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" :stripe='stripe' style="width: 100%" highlight-current-row>
-          <el-table-column label="订单号" align="center" width="220">
+          <el-table-column label="订单号" align="center" width="210">
             <template slot-scope="scope">{{ scope.row.order }}</template>
           </el-table-column>
-          <el-table-column prop="id" label="学号" width="180"></el-table-column>
+          <el-table-column prop="id" label="学号" width="190"></el-table-column>
           <el-table-column prop="stuName" label="姓名" width="100"></el-table-column>
           <el-table-column label="班级" width="160">
             <el-popover placement="top-start" trigger="hover" slot-scope="scope"
@@ -79,7 +80,7 @@
         </el-table>
         <div style="margin-top: 20px" class="table-footer">
           <div class="pages">
-            <el-pagination layout="prev, pager, next" :page-size="pageSize" :total="totalCount"
+            <el-pagination layout="prev, pager, next" :page-size="pageSize" :total="totalCount" :current-page.sync="currentPage"
               @current-change="handleCurrentChange"></el-pagination>
           </div>
         </div>
@@ -168,6 +169,9 @@
         stripe: true,
         bankValue: '', //选择的银行
         index: 1, //第几页
+        recordsNum: 0, //订单数量
+        payStatus: 2, //是否支付成功
+        currentPage: 1
       }
     },
     created: function() {
@@ -178,32 +182,35 @@
     methods: {
       //分页
       handleCurrentChange(val) {
-        this.index = val;
+        this.index = val
         this.tableData = []
         this.all_money = 0
         this.getTableData(this.$Api.orderList, this.flag, this.index, this.selectOrder, this.timeValue, this.bankValue)
       },
       //选择银行
       selectBank(val){
-        console.log(val)
+        // console.log(val)
         if(val == 'jianhang'){
           this.bankValue = 1
           this.tableData = []
           this.index = 1
           this.getTableData(this.$Api.orderList, this.flag, this.index, this.selectOrder, this.timeValue, this.bankValue)
           this.$message.success("已选择支付渠道为  建行支付")
+          this.currentPage = this.index
         }else if(val == 'nongshang'){
           this.bankValue = 2
           this.tableData = []
           this.index = 1
           this.getTableData(this.$Api.orderList, this.flag, this.index, this.selectOrder, this.timeValue, this.bankValue)
           this.$message.success("已选择支付渠道为  农商行支付")
+          this.currentPage = this.index
         }else{
           this.bankValue = ''
           this.tableData = []
           this.index = 1
           this.getTableData(this.$Api.orderList, this.flag, this.index, this.selectOrder, this.timeValue, this.bankValue)
           this.$message.success("已选择为所有支付")
+          this.currentPage = this.index
         }
       },
       //选择时间
@@ -224,6 +231,7 @@
           this.flag = 1
           this.index = 1
           this.getTableData(this.$Api.orderList, this.flag, this.index, this.selectOrder, this.timeValue, this.bankValue)
+          this.currentPage = this.index
         }
       },
       //选择月份按钮
@@ -249,6 +257,7 @@
         this.timeValue = this.monthValue
         this.index = 1
         this.getTableData(this.$Api.orderList, this.flag, this.index, this.selectOrder, this.timeValue, this.bankValue)
+        this.currentPage = this.index
         this.$message.success("月份选择成功")
         // console.log(this.flag+'   '+this.timeValue)
       },
@@ -262,6 +271,7 @@
         this.timeValue = this.dayValue
         this.index = 1
         this.getTableData(this.$Api.orderList, this.flag, this.index, this.selectOrder, this.timeValue, this.bankValue)
+        this.currentPage = this.index
         this.$message.success("日期选择成功")
         // console.log(this.flag+'    '+this.timeValue)
       },
@@ -287,11 +297,13 @@
         this.all_money = 0
         this.index = 1
         this.getTableData(this.$Api.orderList, this.flag, this.index, this.selectOrder, this.timeValue, this.bankValue)
+        this.currentPage = this.index
         this.$message.success("查找成功")
       },
       //获取订单数据
       getTableData(url, flag, index, key, dateStr, payMethod) {
         this.$axios.get(url + '?' + this.$qs.stringify({
+          'payStatus': this.payStatus,
           'flag': flag,
           'curPage': index,
           'pageSize': this.pageSize,
@@ -331,6 +343,7 @@
             this.tableData.push(list)
           }
           this.all_money = res.data.data.total
+          this.recordsNum = res.data.data.recordsNum
           // console.log(this.tableData)
         }).catch(err => {
           console.log(err)

+ 1 - 1
src/components/payNameList/payNameList.vue

@@ -131,7 +131,7 @@
     created: function() {
       this.user_info = JSON.parse(sessionStorage.getItem('usr_info'))
       this.user_token = this.user_info.token
-      this.determineIdentify()
+      // this.determineIdentify()
       this.getTableData(this.$Api.paylist)
     },
     methods: {

+ 5 - 0
src/components/wrongOrder/wrongOrder.css

@@ -315,6 +315,11 @@
   padding-bottom: 68px;
 }
 
+#show-btn{
+  padding-left: 6px;
+  font-size: 10px;
+}
+
 /* >>>.el-dialog--center .el-dialog__body{
   padding-bottom: 92px;
 } */

+ 124 - 60
src/components/wrongOrder/wrongOrder.vue

@@ -11,9 +11,9 @@
     <hr style="background-color: #CCCCCC;height: 1px;border: 0;margin-top: 32px;">
     <el-row>
       <el-col :span="24" class="second-row">
-        <el-form :inline="true" :model="formInline" class="demo-form-inline">
+        <el-form :inline="true" class="demo-form-inline">
           <el-form-item label="关键字:" class="shuibiaoId">
-            <el-input v-model="formInline.user" placeholder="请输入订单号或者姓名"></el-input>
+            <el-input v-model="selectOrder" placeholder="请输入订单号或者姓名"></el-input>
           </el-form-item>
           <el-form-item>
             <el-button type="primary" @click="onSubmit">搜索</el-button>
@@ -51,37 +51,36 @@
             </el-button>
           </el-table-column>
         </el-table> -->
-        <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" :stripe='stripe'
-          @selection-change="handleSelectionChange" highlight-current-row>
-          <el-table-column label="订单号" align="center" width="200">
+        <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" :stripe='stripe' style="width: 100%"
+          highlight-current-row>
+          <el-table-column label="订单号" align="center" width="210">
             <template slot-scope="scope">{{ scope.row.order }}</template>
           </el-table-column>
-          <el-table-column prop="id" label="学号" width="170"></el-table-column>
+          <el-table-column prop="id" label="学号" width="190"></el-table-column>
           <el-table-column prop="stuName" label="姓名" width="90"></el-table-column>
-          <el-table-column prop="class" label="班级" width="150"></el-table-column>
-          <el-table-column prop="money" label="金额(元)" width="100"></el-table-column>
-          <el-table-column prop="time" label="时间" width="200"></el-table-column>
-          <el-table-column label="学校状态" align="center" width="90">
-            <template slot-scope="scope">
-              <el-tag :type="scope.row.school_state === '支付失败' ? 'danger' : 'success'" disable-transitions>{{scope.row.school_state}}
-              </el-tag>
-            </template>
+          <el-table-column label="班级" width="120">
+            <el-popover placement="top-start" trigger="hover" slot-scope="scope" :content="scope.row.class">
+              <div slot="reference">{{ scope.row.class }}</div>
+            </el-popover>
           </el-table-column>
-          <el-table-column label="银行状态" align="center" width="90">
+          <el-table-column prop="money" label="金额(元)" width="100"></el-table-column>
+          <el-table-column prop="method" label="支付渠道" width="110"></el-table-column>
+          <el-table-column prop="time" label="创建时间" width="190"></el-table-column>
+          <el-table-column label="状态" align="center" width="80">
             <template slot-scope="scope">
-              <el-tag :type="scope.row.bank_state === '支付失败' ? 'danger' : 'success'" disable-transitions>{{scope.row.bank_state}}
+              <el-tag :type="scope.row.state === '支付失败' ? 'danger' : 'success'" disable-transitions>{{scope.row.state}}
               </el-tag>
             </template>
           </el-table-column>
           <el-table-column label="操作" width="80">
-            <el-button id="show-btn" slot-scope="scope" @click="handleEdit(scope.$index, scope.row)">
-              {{scope.row.state}}
+            <el-button id="show-btn" slot-scope="scope" @click="handleEdit(scope.$index, scope.row)">查询状态
             </el-button>
           </el-table-column>
         </el-table>
         <div style="margin-top: 20px" class="table-footer">
           <div class="pages">
-            <el-pagination layout="prev, pager, next" :total="1"></el-pagination>
+            <el-pagination layout="prev, pager, next" :page-size="pageSize" :total="totalCount"
+              @current-change="handleCurrentChange"></el-pagination>
           </div>
         </div>
       </el-col>
@@ -89,17 +88,18 @@
     <el-row>
       <el-col :span="24" class="forth-row">
         <!-- 编辑对话框 -->
-        <el-dialog title="" :visible.sync="editdialogFormVisible" width="640px" height="487px" top="0vh" class="my-dialog">
+        <el-dialog title="" :visible.sync="editdialogFormVisible" width="640px" height="487px" top="0vh"
+          class="my-dialog">
           <div id="center">
             <div id="logo-center"></div>
           </div>
           <div id="item-txt">
             <span class="item-text">是否确定将该订单从异常列表中移除</span>
           </div>
-            <span slot="footer" class="dialog-footer">
-              <el-button @click="editdialogFormVisible = false">取 消</el-button>
-              <el-button type="primary" @click="editdialogFormVisible = false">确 定</el-button>
-            </span>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="editdialogFormVisible = false">取 消</el-button>
+            <el-button type="primary" @click="editdialogFormVisible = false">确 定</el-button>
+          </span>
         </el-dialog>
       </el-col>
     </el-row>
@@ -111,32 +111,109 @@
     data() {
       return {
         editdialogFormVisible: false,
-        delDialogVisible: false,
-        form: {
-          id: 'KB580002652',
-          drom: '18',
-          room: '118'
-        },
-        formLabelWidth: '120px',
-        formInline: {
-          user: '',
-          options: [{
-            value: '选项1',
-            label: '全部'
-          }, {
-            value: '选项2',
-            label: '黄金糕'
-          }],
-          value: '选项1'
-        },
-        tableData: [],
-        multipleSelection: [],
-        stripe: true
+        tableData: [], //数据
+        stripe: true, //表格条纹
+        user_info: '',
+        user_token: '', //token
+        pageSize: 10, //每页订单数目
+        totalCount: 0, //总订单数
+        selectOrder: '', //查找订单号或姓名
+        flag: 1, //选择的状态
+        index: 1, //第几页
+        recordsNum: 0, //订单数量
+        payStatus: 1, //是否支付成功
+        status: 0, //状态
       }
     },
+    created: function() {
+      this.user_info = JSON.parse(sessionStorage.getItem('usr_info'))
+      this.user_token = this.user_info.token
+      this.getTableData(this.$Api.orderList, this.flag)
+    },
     methods: {
+      //分页
+      handleCurrentChange(val) {
+        this.index = val;
+        this.tableData = []
+        this.getTableData(this.$Api.orderList, this.flag, this.index, this.selectOrder)
+      },
+      //获取订单数据
+      getTableData(url, flag, index, key) {
+        this.$axios.get(url + '?' + this.$qs.stringify({
+          'payStatus': this.payStatus,
+          'flag': flag,
+          'curPage': index,
+          'pageSize': this.pageSize,
+          'keyword': key,
+        }), {
+          headers: {
+            'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
+            'Author': 'codingliang',
+            'admin_token': this.user_token
+          }
+        }).then(res => {
+          // console.log(res)
+          this.totalCount = res.data.data.page.totalCount
+          for (var i = 0; i < res.data.data.page.list.length; i++) {
+            var list = {}
+            list.order = res.data.data.page.list[i].orderNo
+            list.id = res.data.data.page.list[i].payerIdentify
+            list.stuName = res.data.data.page.list[i].studentName
+            list.class = res.data.data.page.list[i].className
+            list.money = res.data.data.page.list[i].orderAmount
+            if(res.data.data.page.list[i].payMethod == 1){
+              list.method = "建行支付"
+            }else if(res.data.data.page.list[i].payMethod == 2){
+              list.method = "农商行支付"
+            }
+            // this.all_money = (this.all_money + list.money).toFixed(2)
+            // this.all_money = this.all_money + list.money
+
+            list.time = res.data.data.page.list[i].createTime
+            if (res.data.data.page.list[i].status == 2) {
+              list.state = '支付成功'
+            } else {
+              list.state = '支付失败'
+            }
+            this.tableData.push(list)
+          }
+        }).catch(err => {
+          console.log(err)
+          this.$message.error("订单导出失败")
+        })
+      },
+      //根据关键字查找订单
       onSubmit() {
-        console.log('submit!')
+        this.tableData = []
+        this.index = 1
+        this.getTableData(this.$Api.orderList, this.flag, this.index, this.selectOrder)
+        this.$message.success("查找成功")
+      },
+      //按键查询订单状态
+      handleEdit(index, row) {
+        this.getOrderStatus(this.$Api.OrderStatus, row.order)
+      },
+      //查询订单状态
+      getOrderStatus(url, order){
+        this.$axios.get(url + '?' + this.$qs.stringify({
+          'orderNo': order,
+        }), {
+          headers: {
+            'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
+            'Author': 'codingliang',
+            'admin_token': this.user_token
+          }
+        }).then(res => {
+          this.status = res.data.data.status
+          // console.log(this.status)
+          if(this.status == 1){
+            this.$message.warning("等待支付")
+          }else if(this.status == 2){
+            this.$router.go(0)
+          }
+        }).catch(err => {
+          console.log(err)
+        })
       },
       handleOpen(key, keyPath) {
         console.log(key, keyPath)
@@ -156,25 +233,12 @@
       handleSelectionChange(val) {
         this.multipleSelection = val
       },
-      handleEdit(index, row) {
-        this.editdialogFormVisible = true
-        console.log(index, row)
-      },
       handleDelete(index, row) {
         this.delDialogVisible = true
         console.log(index, row)
       }
     },
-    created: function() {
-      // for(var i=0 ;i<this.tableData.length ;i++){
-      //   // console.log(this.tableData[i].state)
-      //   if(this.tableData[i].state=='支付失败'){
-      //     this.font_color=true
-      //   }else{
-      //     this.font_color=false
-      //   }
-      // }
-    }
+
   }
 </script>
 

+ 5 - 0
src/interface/index.js

@@ -9,6 +9,9 @@ let online_url = {
     //管理员登录
     login: base + "tuitionpayment/admininfo/login",
 
+    //管理员列表
+    loginList: base + "tuitionpayment/admininfo/list",
+
     //学生缴费列表
     paylist: base + "tuitionpayment/payableinfo/list",
     //增加名单文件上传
@@ -21,6 +24,8 @@ let online_url = {
     orderList: base + "tuitionpayment/payorder/list",
     //订单下载列表
     orderDownload: base + "tuitionpayment/payorder/downloadResult",
+    //查询订单状态
+    OrderStatus: base + "tuitionpayment/payorder/queryOrderStatu",
 
     //反馈列表
     fankui: base + "tuitionpayment/feedbackmsg/list",