xgwangman 4 年之前
父节点
当前提交
813c76c8e0
共有 4 个文件被更改,包括 294 次插入82 次删除
  1. 1 1
      .env
  2. 16 0
      src/assets/css/common.css
  3. 184 25
      src/views/order/components/details.vue
  4. 93 56
      src/views/order/orderList.vue

+ 1 - 1
.env

@@ -1,5 +1,5 @@
 VUE_APP_ADMIN_TOKEN_NAME = 'admin_token'
-VUE_APP_API_URL_PREFIX = 'http://192.168.3.204:8001/api/admin/'
+VUE_APP_API_URL_PREFIX = '/api/admin/'
 VUE_APP_API_ACTION_NAME = '_action'
 VUE_APP_API_TOKEN_NAME = '_token'
 VUE_APP_INDEX_URL = '/'

+ 16 - 0
src/assets/css/common.css

@@ -331,4 +331,20 @@ textarea:-ms-input-placeholder {
 }
 .jie-suan .ivu-table-tbody tr {
   cursor: pointer;
+}
+.shen-model .ivu-modal-body p {
+  font-size: 20px;
+  text-align:center;
+  margin-bottom: 20px;
+}
+.shen-model .ivu-modal-content .ivu-modal-footer {
+  text-align: center;
+  padding: 18px;
+}
+.shen-model .ivu-modal-content .ivu-modal-footer button{
+  width: 70px;
+  height: 35px;
+}
+.shen-model .ivu-modal-content .ivu-modal-footer .ivu-btn-error {
+  margin: 0 22px 0 30px;
 }

+ 184 - 25
src/views/order/components/details.vue

@@ -7,7 +7,9 @@
                 <div class="classfity">
                     <span>订单编号: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{orDetails?orDetails.order_code:'--'}}</span>
                     <span>订单时间: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{orDetails?orDetails.create_time:'--'}}</span>
+                    <span v-if="orderType == 7">订单类型: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{orDetails?orDetails.dis_word ? '分销' : '直销':'--'}}</span>
                     <span>产品类型: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{orDetails?orDetails.product_type:'--'}}</span>
+                    <span v-if="orderType == 7">审核状态: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i :class="orDetails.course_status | courseColr">{{orDetails.course_status | coursed}}</i></span>
                 </div>
             </div>
             <Divider />
@@ -126,6 +128,15 @@
                         <i v-if="orDetails">{{orDetails.pay_way == 'wx_pc'?'微信':'支付宝'}}</i>
                     </span>
                     <span v-else>支付方式: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i v-if="orDetails">{{orDetails.pay_way?orDetails.pay_way:'--'}}</i></span>
+                    <span v-if="orderType == 7">大会员金额: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                        <i :class="orDetails.order_status" v-if="orDetails">--</i>
+                    </span>
+                    <span v-if="orderType == 7">子会员金额: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                        <i :class="orDetails.order_status" v-if="orDetails">--</i>
+                    </span>
+                    <span v-if="orderType == 7">订单金额: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                        <i :class="orDetails.money" v-if="orDetails">{{orDetails.order_money?('¥'+orDetails.order_money/100).toLocaleString('en-US'):'--'}}</i>
+                    </span>
                     <span v-if="orderType == 1">实付数量: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                         <i v-if="orDetails">{{orDetails.original_price?orDetails.original_price:'--'}}</i>
                     </span><!-- 线下课程 -->
@@ -138,6 +149,13 @@
                     <span v-else>支付状态: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                         <i :class="orDetails.order_status | orderWord" v-if="orDetails">{{orDetails.order_status}}</i>
                     </span>
+                    <span>支付凭证: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                        <i v-if="book.transferV">
+                            <a :href="book.transferV" target="_blank" v-if="book.transferV">{{book.transferV?"点击查看":'--'}}</a>
+                            <i v-else>--</i>
+                        </i>
+                        <i v-else>--</i>
+                    </span>
                 </div>
             </div>
             <Divider />
@@ -191,42 +209,157 @@
             </div>
             <Divider />
         </div>
+        <div class="bot-btn">
+            <Button 
+                class="shen-btn" 
+                type="primary" 
+                size="large"
+                @click="audited()"
+                v-if="orDetails.course_status == 2 && orDetails.order_status !== '已取消' && orDetails.order_status !== -2"
+            >审核</Button>
+            <Button 
+                class="shen-btn" 
+                type="primary" 
+                size="large"
+                disabled
+                v-else
+            >审核</Button>
+            <Button 
+                class="tui-btn" 
+                size="small" 
+                type="error" 
+                @click="refund(orDetails.order_code)"
+                v-if="$route.query.orderStas == 1"
+            >退款</Button>
+            <Button 
+                class="tui-btn" 
+                size="small" 
+                type="error" 
+                disabled
+                v-else
+            >退款</Button>
+        </div>
+        <Modal title="审核" v-model="funds.sShow" class-name="shen-model">
+            <p>请确认此订单审核结果!</p>
+            <Input type="number" size="large" placeholder="请输入实付金额" v-model="funds.sum"></Input>
+            <div slot="footer">
+                <Button type="primary" size="large" @click="subConfirm">通过</Button>
+                <Button type="error" size="large" @click="defeated">失败</Button>
+                <Button size="large" @click="subCancel">取消</Button>
+            </div>
+        </Modal>
+        <Modal title="退款原因" v-model="models.tShow">
+            <Input type="textarea" size="large" :rows="3" placeholder="请填写退款原因" v-model="models.cause"></Input>
+            <div slot="footer">
+                <Button type="primary" size="large" @click="subSave">提交</Button>
+            </div>
+        </Modal>
     </div>
 </template>
 
 <script>
-import { ChangeDate, ChangeDate1 } from '../../../assets/js/date.js'
+import { ChangeDate, ChangeDate1, ChangeDate2 } from '../../../assets/js/date.js'
 export default {
     props:{
         orderType: String
     },
     created () {
-        let rout = this.$route.query
-        this.$request('/order/orderList/orderDetails').data({
-            id: rout.id,
-            type: rout.proType
-        }).success((r) => {
-            this.orders = r.data
-            this.orDetails = r.data.res;
-            this.book = r.data.filterData;
-            // if (this.book && this.book.keywords) {
-            //     this.book.keywords.forEach(e => {// 将对象转为用,分割开的数组
-            //         this.arr.push(e.keyword)
-            //         this.keyMsg = this.arr.join(",")
-            //     });
-            // }
-            this.strCourse = r.data.resCourse;
-            if (this.strCourse) {
-                this.l_starttime = ChangeDate1(this.strCourse.l_starttime);
-                this.l_endtime = ChangeDate1(this.strCourse.l_endtime);
-            }
-            if (this.orDetails) {
-                this.vip_starttime = ChangeDate(this.orDetails.vip_starttime);
-                this.vip_endtime = ChangeDate(this.orDetails.vip_endtime);
+        this.ordered()
+    },
+    methods: {
+        ordered() {
+            let rout = this.$route.query
+            this.$request('/order/orderList/orderDetails').data({
+                id: rout.id,
+                type: rout.proType
+            }).success((r) => {
+                this.orders = r.data
+                this.orDetails = r.data.res;
+                this.book = r.data.filterData;
+                // if (this.book && this.book.keywords) {
+                //     this.book.keywords.forEach(e => {// 将对象转为用,分割开的数组
+                //         this.arr.push(e.keyword)
+                //         this.keyMsg = this.arr.join(",")
+                //     });
+                // }
+                this.strCourse = r.data.resCourse;
+                if (this.strCourse) {
+                    this.l_starttime = ChangeDate1(this.strCourse.l_starttime);
+                    this.l_endtime = ChangeDate1(this.strCourse.l_endtime);
+                }
+                if (this.orDetails) {
+                    this.vip_starttime = ChangeDate(this.orDetails.vip_starttime);
+                    this.vip_endtime = ChangeDate(this.orDetails.vip_endtime);
+                }
+            }).get()
+        },
+        refund (code) {
+            this.models.tShow = true
+            this.models.reCode = code
+        },
+        audited() {
+            this.funds.sShow = true
+        },
+        audFunc(num) {
+            this.$request('/order/orderList/transferAccounts').data({
+                pay_money: this.funds.sum,
+                order_code: this.orDetails.order_code,
+                courseStatus: num
+            }).showSuccessTip().success(() => {
+                this.ordered()
+            }).post()
+        },
+        subConfirm() {
+            if (this.funds.sum == '') {
+                this.$Message.warning('实付金额为必填项')
+                return
             }
-        }).get()
+            this.funds.sShow = false
+            this.audFunc(4)
+        },
+        defeated() {
+            this.funds.sShow = false
+            this.audFunc(3)
+        },
+        subCancel() {
+            this.funds.sShow = false
+        },
+        subSave () {
+            var curTime = new Date().getTime()
+            this.$request('/order/orderList/confirmRefund').data({
+                orderCode: this.models.reCode,
+                applyReason: this.models.cause,
+                applyTime: ChangeDate2(curTime)
+            }).showSuccessTip().success(() => {
+                this.models.tShow = false
+                this.models.cause = ''
+                this.reload()
+            }).get()
+        },
     },
     filters: {
+        coursed(val) {
+            if (val == 2) {
+                return '未审核'
+            } else if (val == 3) {
+                return '未通过'
+            } else if (val == 4) {
+                return '已通过'
+            } else if (val < 2) {
+                return '无需审核'
+            }
+        },
+        courseColr(val) {
+            if (val == 2) {
+                return 'color2'
+            } else if (val == 3) {
+                return 'color1'
+            } else if (val == 4) {
+                return 'color3'
+            } else if (val < 2) {
+                return 'color4'
+            }
+        },
         invoiceStas(val) {
             if (val == -2) {
                 return '已冲红'
@@ -303,7 +436,17 @@ export default {
             l_starttime: '',
             l_endtime: '',
             vip_starttime: '',
-            vip_endtime: ''
+            vip_endtime: '',
+            funds: {
+                sShow: false,
+                sum: '',
+                shCode: ''
+            },
+            models: {
+                tShow: false,
+                cause: '',
+                reCode: ''
+            }
         }
     }
 }
@@ -351,8 +494,24 @@ export default {
                 .color3 {
                     color: #34bfa3;
                 }
+                .color4 {
+                    color: #36a3f7;
+                }
             }
         }
     }
+    .bot-btn {
+        display: flex;
+        flex-direction: initial;
+        justify-content: center;
+        margin-top: 80px;
+        button {
+            width: 110px;
+            height: 40px;
+        }
+        .tui-btn {
+            margin-left: 40px;
+        }
+    }
 }
 </style>

+ 93 - 56
src/views/order/orderList.vue

@@ -31,6 +31,9 @@
             <Select size="large" placeholder="发票状态" clearable v-model="filter.invoiceStatus" style="width:100px;margin:0 10px 10px 0">
                 <Option v-for="item in invoiceSta" :value="item.v" :key="item.v">{{ item.n }}</Option>
             </Select>
+            <Select size="large" placeholder="审核状态" clearable v-model="filter.course_status" style="width:100px;margin:0 10px 10px 0">
+                <Option v-for="item in auditSta" :value="item.v" :key="item.v">{{ item.n }}</Option>
+            </Select>
             <Select size="large" placeholder="付款方式" clearable v-model="filter.payWay" style="width:100px;margin:0 10px 10px 0">
                 <Option v-for="item in payStatus" :value="item.v" :key="item.v">{{ item.n }}</Option>
             </Select>
@@ -74,6 +77,16 @@
                 @on-ok="confirmed2"
                 @on-open-change="opened2"
             ></DatePicker><br/>
+            <Select 
+                size="large" 
+                placeholder="会员等级" 
+                clearable 
+                v-model="filter.level" 
+                style="width:100px;margin:0 10px 10px 0"
+                v-show="select4"
+            >
+                <Option v-for="item in classDown" :value="item.v" :key="item.v">{{ item.n }}</Option>
+            </Select>
             <Select 
                 size="large" 
                 placeholder="付费类型" 
@@ -103,7 +116,7 @@
                 v-show="select3"
             >
                 <Option v-for="item in invoicePerson" :value="item.v" :key="item.v">{{ item.n }}</Option>
-            </Select><br v-show="select1 || select2 || select3"/>
+            </Select><br v-show="select1 || select2 || select3 || select4"/>
         </template>
         <template slot="exportData" v-if="flag">
             <Button type="primary" size="large" @click="orderExport" style="margin: 0 0 10px 10px">导出结果</Button>
@@ -115,6 +128,7 @@
             ref="selection" 
             :columns="columns" 
             :data="list.lists" 
+            @on-row-click="rowClick"
             stripe
         >
             <template slot-scope="{ row }" slot="type">
@@ -125,45 +139,15 @@
                 {{row.action}}
             </Tooltip>
             </template>
-            <template slot-scope="{ row }" slot="op">
-            <Button 
-                class="find-btn" 
-                size="small" 
-                type="primary" 
-                style="margin-right:5px"
-            >
-                <router-link :to="{path:'/order/orderList/orderDetail',query:{id:row.id,proType:row.product_type}}" target="_blank" style="color:#fff">查看</router-link>
-            </Button>
-            <Button 
-                class="find-btn" 
-                size="small" 
-                type="error" 
-                @click="refund(row.order_code)"
-                v-if="row.order_status == 1"
-            >退款</Button>
-            <Button 
-                class="find-btn" 
-                size="small" 
-                type="error" 
-                disabled
-                v-else
-            >退款</Button>
-            </template>
         </Table>
         <template slot="options">
             <div style="color:#d7d7d7;font-size:14px">共计{{list.total}}个订单,实付金额¥{{list.money>=0?list.money:0}}</div>
         </template>
     </table-lists>
-    <Modal title="退款原因" v-model="models.tShow">
-        <Input type="textarea" size="large" :rows="3" placeholder="请填写退款原因" v-model="models.cause"></Input>
-        <div slot="footer">
-            <Button type="primary" size="large" @click="subSave">提交</Button>
-        </div>
-    </Modal>
   </div>
 </template>
 <script>
-import { ChangeDate,ChangeDate2 } from '../../assets/js/date.js'
+import { ChangeDate } from '../../assets/js/date.js'
 export default {
     watch: {
         'filter.productType': {
@@ -172,18 +156,31 @@ export default {
                     this.select1 = true
                     this.select2 = false
                     this.select3 = false
+                    this.select4 = false
                     this.filter.dataType = ''
                     this.filter.invoiceType = ''
+                    this.filter.level = ''
                 } else if (newVal == '2') {
                     this.select2 = true
                     this.select1 = false
                     this.select3 = false
+                    this.select4 = false
                     this.filter.payType = ''
                     this.filter.invoiceType = ''
+                    this.filter.level = ''
                 } else if (newVal == '4') {
                     this.select3 = true
                     this.select1 = false
                     this.select2 = false
+                    this.select4 = false
+                    this.filter.dataType = ''
+                    this.filter.payType = ''
+                    this.filter.level = ''
+                } else if (newVal == '6') {
+                    this.select4 = true
+                    this.select1 = false
+                    this.select2 = false
+                    this.select3 = false
                     this.filter.dataType = ''
                     this.filter.payType = ''
                 } else {
@@ -193,6 +190,7 @@ export default {
                     this.filter.payType = ''
                     this.filter.dataType = ''
                     this.filter.invoiceType = ''
+                    this.filter.level = ''
                 }
             },
             deep: true
@@ -219,11 +217,13 @@ export default {
                 this.filter.orderType = ''
                 this.filter.orderStatus = ''
                 this.filter.invoiceStatus = ''
+                this.filter.course_status = ''
                 this.filter.payMoneyMin = ''
                 this.filter.payMoneyMax = ''
                 this.filter.orderTimeStart = ''
                 this.filter.orderTimeEnd = ''
                 this.filter.payWay = ''
+                this.filter.level = ''
                 this.filter.payType = ''
                 this.filter.dataType = ''
                 this.filter.invoiceType = ''
@@ -231,6 +231,10 @@ export default {
                 this.dataVal2 = ''
             }
         },
+        rowClick(row) {
+            const news = this.$router.resolve({path:'/order/orderList/orderDetail',query:{id:row.id,proType:row.product_type,orderStas:row.course_status}})
+            window.open(news.href,'_blank')
+        },
         handleChange1 (date) {
             this.filter.orderTimeStart = date
         },
@@ -277,10 +281,6 @@ export default {
                 this.confirmed2()
             }
         },
-        refund (code) {
-            this.models.tShow = true
-            this.models.reCode = code
-        },
         orderExport() {
             if (this.list.lists.length == 0) {
                 this.$Notice.warning({
@@ -294,12 +294,14 @@ export default {
                 productType: this.filter.productType,
                 orderStatus: this.filter.orderStatus,
                 invoiceStatus: this.filter.invoiceStatus,
+                course_status: this.filter.course_status,
                 payWay: this.filter.payWay,
                 orderTimeStart: this.filter.orderTimeStart,
                 orderTimeEnd: this.filter.orderTimeEnd,
                 payMoneyMin: this.filter.payMoneyMin,
                 payMoneyMax: this.filter.payMoneyMax,
                 orderType: this.filter.orderType,
+                level: this.filter.level,
                 payType: this.filter.payType,
                 dataType: this.filter.dataType,
                 invoiceType: this.filter.invoiceType
@@ -322,17 +324,6 @@ export default {
                 }
             })
         },
-        subSave () {
-            var curTime = new Date().getTime()
-            this.$request('/order/orderList/confirmRefund').data({
-                orderCode: this.models.reCode,
-                applyReason: this.models.cause,
-                applyTime: ChangeDate2(curTime)
-            }).showSuccessTip().success(() => {
-                this.models.tShow = false
-                this.reload()
-            }).get()
-        },
         reload () {
             this.$refs.tableLists.reload(true)
         }
@@ -346,14 +337,10 @@ export default {
             select1: false,
             select2: false,
             select3: false,
+            select4: false,
             flag: true,
             filterType: 1,
             filterReset: 1,
-            models: {
-                tShow: false,
-                cause: '',
-                reCode: ''
-            },
             proType: [
                 {v: '', n: '全部'},
                 {v: '6', n: '大会员'},
@@ -383,6 +370,13 @@ export default {
                 {v: '0', n: '未申请'},
                 {v: '1', n: '已申请'}
             ],
+            auditSta: [
+                {v: '', n: '全部'},
+                {v: '0', n: '无需审核'},
+                {v: '2', n: '未审核'},
+                {v: '3', n: '未通过'},
+                {v: '4', n: '已通过'}
+            ],
             payStatus: [
                 {v: '', n: '全部'},
                 {v: '0', n: '支付宝'},
@@ -408,6 +402,12 @@ export default {
                 {v: '0', n: '汇学网'},
                 {v: '1', n: '王凯精品课'}
             ],
+            classDown: [
+                {v: '', n: '全部'},
+                {v: '3', n: '商机版'},
+                {v: '2', n: '智慧版'},
+                {v: '1', n: '专家版'}
+            ],
             filter: {
                 // keyword: '',
                 productType: '',
@@ -418,7 +418,9 @@ export default {
                 orderTimeEnd: '',
                 payMoneyMin: '',
                 payMoneyMax: '',
+                course_status: '',
                 payWay: '',
+                level: '',
                 payType: '',
                 dataType: '',
                 invoiceType: ''
@@ -601,10 +603,45 @@ export default {
                     }
                 },
                 {
-                    title: '操作',
-                    slot: 'op',
-                    align: 'center'
-                },
+                    title: '审核状态',
+                    key: 'course_status',
+                    align: 'center',
+                    render: (h, {row}) => {
+                        if (row.course_status == 2) {
+                            return h('div', {
+                                style:{
+                                    color: '#ffb822'
+                                }
+                            }, [
+                                h('span','未审核')
+                            ])
+                        } else if (row.course_status == 3) {
+                            return h('div', {
+                                style:{
+                                    color: '#f4516c'
+                                }
+                            }, [
+                                h('span','未通过')
+                            ])
+                        } else if (row.course_status == 4) {
+                            return h('div', {
+                                style:{
+                                    color: '#34bfa3'
+                                }
+                            }, [
+                                h('span','已通过')
+                            ])
+                        } else if (row.course_status < 2) {
+                            return h('div', {
+                                style:{
+                                    color: '#36a3f7'
+                                }
+                            }, [
+                                h('span','无需审核')
+                            ])
+                        }
+                    }
+                }
             ],
             list: []
         }