|
@@ -0,0 +1,209 @@
|
|
|
+;
|
|
|
+var orderPage = new Vue({
|
|
|
+ el: "#orderPage",
|
|
|
+ data: {
|
|
|
+ isRequset:true,
|
|
|
+ noMore: false,
|
|
|
+ userId: 0,
|
|
|
+ tabsListIndex:0,
|
|
|
+ tabsList: [
|
|
|
+ {value: 0,text: '全部'},
|
|
|
+ {value: 1,text: '获取'},
|
|
|
+ {value: 2,text: '消耗'}
|
|
|
+ ],
|
|
|
+ listQuery:{
|
|
|
+ year:'',
|
|
|
+ month:'',
|
|
|
+ type:0,
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:10
|
|
|
+ },
|
|
|
+ beansList:[
|
|
|
+ {
|
|
|
+ type:1,
|
|
|
+ state:1,
|
|
|
+ number:100,
|
|
|
+ time:'2021-05-12 11:53:26'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type:1,
|
|
|
+ state:2,
|
|
|
+ number:500,
|
|
|
+ time:'2021-05-12 11:53:26'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type:2,
|
|
|
+ state:3,
|
|
|
+ number:1000,
|
|
|
+ time:'2021-05-12 11:53:26'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ listRecord: 0,
|
|
|
+ pageInput: '1',
|
|
|
+ orderList:[],
|
|
|
+ confirmedCount:'',//待確認數量
|
|
|
+ paymentCount:'',//待付款
|
|
|
+ waitShipmentsCount:'',//待发货
|
|
|
+ shipmentsCount:'',//已发货
|
|
|
+ salesReturnCount:'',//退货款
|
|
|
+ modelType:0,
|
|
|
+ orderIdentificationId:0,
|
|
|
+ payModelData:{},
|
|
|
+ hanldOrderData:{},//监听点击的单个订单项的按钮
|
|
|
+ confrimsBtn:true,
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ NumFormat:function(text) {//处理金额
|
|
|
+ return Number(text).toFixed(2);
|
|
|
+ },
|
|
|
+ NumBadge:function(n){//处理
|
|
|
+ var num ='';
|
|
|
+ if(n>100){num = 99}else{num = n;}
|
|
|
+ return num;
|
|
|
+ },
|
|
|
+ stateTypeText:function(type){
|
|
|
+ var stateText = '',
|
|
|
+ stateTextObject={
|
|
|
+ 1:'获取',
|
|
|
+ 2:'消耗'
|
|
|
+ };
|
|
|
+ Object.keys(stateTextObject).forEach(function(key){
|
|
|
+ if(key == type){
|
|
|
+ stateText = stateTextObject[key]
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return stateText;
|
|
|
+ },
|
|
|
+ stateText:function (state){ //采美豆类型文字
|
|
|
+ var stateText = '',
|
|
|
+ stateTextObject={
|
|
|
+ 1:'注册机构',
|
|
|
+ 2:'升级会员机构',
|
|
|
+ 3:'普通机构完善资料',
|
|
|
+ 4:'会员机构完善资料',
|
|
|
+ 5:'下单',
|
|
|
+ 6:'线上支付订单',
|
|
|
+ 7:'确认收货',
|
|
|
+ 8:'系统发放',
|
|
|
+ 9:'抵用退回',
|
|
|
+ 10:'抵用运费',
|
|
|
+ 11:'退款回收'
|
|
|
+ };
|
|
|
+ Object.keys(stateTextObject).forEach(function(key){
|
|
|
+ if(key == state){
|
|
|
+ stateText = stateTextObject[key]
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return stateText;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ pageTotal: function () {
|
|
|
+ var total = Math.ceil(this.listRecord / this.listQuery.pageSize);
|
|
|
+ return total > 0 ? total : 1;
|
|
|
+ },
|
|
|
+ showPageBtn: function () {
|
|
|
+ var total = Math.ceil(this.listRecord / this.listQuery.pageSize);
|
|
|
+ total = total > 0 ? total : 1;
|
|
|
+ var index = this.listQuery.pageNum, arr = [];
|
|
|
+ if (total <= 6) {
|
|
|
+ for (var i = 1; i <= total; i++) {
|
|
|
+ arr.push(i);
|
|
|
+ }
|
|
|
+ return arr;
|
|
|
+ }
|
|
|
+ if (index <= 3) return [1, 2, 3, 4, 5, 0, total];
|
|
|
+ if (index >= total - 2) return [1, 0, total - 4, total - 3, total - 2, total - 1, total];
|
|
|
+ return [1, 0, index - 2, index - 1, index, index + 1, index + 2, 0, total];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ tabClick:function(index){//点击Tab切换查询列表
|
|
|
+ var _self = this;
|
|
|
+ _self.tabsListIndex = index;
|
|
|
+ _self.listQuery.type = index;
|
|
|
+ },
|
|
|
+ initDate:function(){//初始化获取当前年月
|
|
|
+ var _self = this;
|
|
|
+ var _Date = new Date();
|
|
|
+ _self.listQuery.year = _Date.getFullYear();
|
|
|
+ _self.listQuery.month = _Date.getMonth();
|
|
|
+ console.log('当前年份==========>', _self.listQuery.year);
|
|
|
+ console.log('当前月份==========>', _self.listQuery.month);
|
|
|
+ },
|
|
|
+ reduceMonth:function(){//减月份
|
|
|
+ var _self = this;
|
|
|
+ _self.listQuery.month--;
|
|
|
+ if(_self.listQuery.month == 0){
|
|
|
+ _self.listQuery.year--;
|
|
|
+ _self.listQuery.month = 12;
|
|
|
+ }
|
|
|
+ console.log('年==========>', _self.listQuery.year);
|
|
|
+ console.log('月==========>', _self.listQuery.month);
|
|
|
+ },
|
|
|
+ addMonth:function(){//加月份
|
|
|
+ var _self = this;
|
|
|
+ _self.listQuery.month++;
|
|
|
+ if(_self.listQuery.month > 12){
|
|
|
+ _self.listQuery.year++;
|
|
|
+ _self.listQuery.month = 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toPagination: function (pageNum) {//点击切换分页
|
|
|
+ if (pageNum <= this.pageTotal) {
|
|
|
+ this.listQuery.pageNum = pageNum;
|
|
|
+ this.GetQueryOrderListData();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkNum: function () {//输入跳转分页
|
|
|
+ if (this.pageInput > this.pageTotal) {
|
|
|
+ this.pageInput = this.pageTotal;
|
|
|
+ } else if (this.pageInput < 1) {
|
|
|
+ this.pageInput = 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeOrderFn:function(index,status){
|
|
|
+ var _self = this;
|
|
|
+ _self.orderTabBarIndex = index;
|
|
|
+ _self.listQuery.orderState = status;
|
|
|
+ _self.listQuery.searchNo = '';
|
|
|
+ _self.listQuery.beginTime = '';
|
|
|
+ _self.listQuery.endTime = '';
|
|
|
+ _self.listQuery.pageNum = 1;
|
|
|
+ _self.isRequset = true;
|
|
|
+ _self.GetQueryOrderListData()
|
|
|
+ },
|
|
|
+ GetQueryOrderListData:function(){//查询订单列表
|
|
|
+ var _self = this;
|
|
|
+ OrderApi.GetQueryOrderListData(_self.listQuery,function (response) {
|
|
|
+ if(response.code == 0){
|
|
|
+ var data = response.data;
|
|
|
+ if(data.results && data.results.length>0) {
|
|
|
+ _self.orderList = [];
|
|
|
+ _self.orderList = data.results;
|
|
|
+ _self.listRecord = data.totalRecord;
|
|
|
+ }else{
|
|
|
+ _self.orderList = [];
|
|
|
+ _self.orderList = data.results;
|
|
|
+ _self.listRecord = data.totalRecord;
|
|
|
+ }
|
|
|
+ _self.isRequset = false;
|
|
|
+ }else{
|
|
|
+ CAIMEI.Alert(response.msg, '确定', false);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted: function () {
|
|
|
+ if(globalUserData){
|
|
|
+ this.userId = globalUserData.userId;
|
|
|
+ this.listQuery.orderState = CAIMEI.getUrlParam('state');
|
|
|
+ this.listQuery.userId = this.userId;
|
|
|
+ this.GetQueryOrderListData();
|
|
|
+ this.initDate();
|
|
|
+ }
|
|
|
+ $('.navLayout').find('.navList').removeClass("on").find('.con').hide().find('a').removeClass("on");
|
|
|
+ $('.navLayout').find('.navList').eq(0).addClass("on").find('.con').show().find('a').eq(0).addClass("on");
|
|
|
+ var _self = this;
|
|
|
+ }
|
|
|
+});
|