From aa05aa898fe22778562d43b07dd32e450d2aebd4 Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Mon, 26 Jul 2021 17:26:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83bug=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/AddOrder.vue | 60 +++++++++++++++--------------------- src/views/order/Order.vue | 4 +-- 2 files changed, 27 insertions(+), 37 deletions(-) diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue index 6524edb..7fb9459 100644 --- a/src/views/order/AddOrder.vue +++ b/src/views/order/AddOrder.vue @@ -186,7 +186,7 @@ @@ -218,7 +218,7 @@ @@ -233,7 +233,7 @@ @@ -241,7 +241,7 @@ @@ -303,8 +303,7 @@ - + @@ -647,25 +646,25 @@ export default { }; }, - created(){ + async created(){ this.token = sessionStorage.getItem('token') - this.getCityData() // 处于查看状态 if(this.$route.query.watch){ this.disabled = true - this.getDetail(this.$route.query.watch) + await this.getDetail(this.$route.query.watch) } // 处于编辑状态 if(this.$route.query.edit){ this.editDisabled = true - this.getDetail(this.$route.query.edit) + await this.getDetail(this.$route.query.edit) } + this.getCityData()// 取得城市 }, + methods: { // 读取页面详情 async getDetail(id){ - this.$get(this.api.orderDetail,{orderId:+id}).then(res=>{ - console.log(res,'请求详情'); + return this.$get(this.api.orderDetail,{orderId:+id}).then(res=>{ let form = res.orderDetails.order,// 基本信息 contract = res.orderDetails.contractInformation?res.orderDetails.contractInformation:{},// 合同 list = res.orderDetails.orderOther// 俩列表 @@ -681,7 +680,6 @@ export default { classArr = list.filter(e=>{// 课程权限 return e.authority===1 }) - console.log(dataArr,'dataArr'); this.form = { orderNumber: form.orderNumber, createTime: form.createTime, @@ -696,7 +694,6 @@ export default { orderAmount: form.orderAmount, orderId:form.orderId } - this.contract = { contractName:contract.contractName, contractMoney:contract.contractMoney, @@ -710,7 +707,6 @@ export default { this.contractTime = [contract.startTime,contract.endTime] } this.dataPlatform = dataArr - console.log(this.dataPlatform,'当前的值'); }) }, // 新增订单 @@ -749,7 +745,6 @@ export default { if (valid) { this.loading = true this.$post(this.api.orderAdd,param).then(res=>{ - console.log(res,'新增订单'); this.$router.push('/order') this.loading = false this.$message.success('添加订单成功!') @@ -788,6 +783,13 @@ export default { }) }, + /* 处理0开头的期限 */ + zero(e,row){ + if(e[0]=='0'){ + row.periodOfUse = e.substring(1) + this.zero(row.periodOfUse,row) + } + }, // 订单客户框触发选择页面 gotoClient(){ this.showSelectClient = !this.showSelectClient @@ -801,7 +803,6 @@ export default { this.form.phone = val.phone this.form.email = val.email this.form.orderContact = val.name - console.log(val,'取得返回值'); this.$get(this.api.queryCustomerDetails,{customerId:val.id}).then(res=>{ this.form.provinceId = res.result.customer.provinceId this.form.cityId = res.result.customer.cityId @@ -829,22 +830,18 @@ export default { productName:this.productName } this.$post(this.api.listByEntity,param).then(res=>{ - console.log(res,'请求成功'); this.boxDataPlatform = res.pageList.records this.platfromTotals = res.pageList.total }).catch(err=>{ - console.log(err,'请求错误'); }) }, // 数据平台--弹框列表选中 boxDataPlatformSelection(val){ this.platformSelect = val - console.log(val,'数据选中',this.platformSelect); }, // 数据平台弹框--确定 addPlatform(){ - console.log(this.platformSelect,'this.platformSelect'); if(this.platformSelect.length>0){ let that = this let fn = function(e){ @@ -906,7 +903,6 @@ export default { if(val.length>0){ this.contract.startTime = val[0] this.contract.endTime = val[1] - console.log(this.contract.startTime,this.contract.endTime,'s-e'); } }, // 新增数据平台权限时,计算总的金额数目 @@ -921,7 +917,6 @@ export default { // 总金额触发--计算账号或市场价 allAmountChange(val,row){ - console.log(val,row,'kankan'); if(row.totalAmount){ let all = row.totalAmount if(row.accountNum){// 若有账号 @@ -930,7 +925,6 @@ export default { if(row.finalPrice){// 若有市场价 row.accountNum = Math.floor(all/row.finalPrice) } - console.log(val,row); } }, // 计算成交总额 @@ -957,10 +951,7 @@ export default { // // 使用期限转换以及计算剩余天数 deadLine(e,row){ - - console.log(row.ship,e,'row.consignment'); if(e==='') { - console.log('進入return'); row.startTime = '' row.endTime = '' return @@ -977,12 +968,7 @@ export default { //补全0,并拼接当前的时间点 let nowYear = year + char + completeDate(month) + char +completeDate(day); // 判断结束日期 - console.log('取余',year+parseInt((+month+(+e))%12)); - console.log(year,'当前年'); - console.log(+year + parseInt((+month+(+e))/12) ,'处理过的年',parseInt((+month+(+e))%12)===0,'处理的值'); - console.log((+month+(+e))%12,'月份%12'); let endYear = year + (parseInt((+month+(+e))/12)===0?0:parseInt((+month+(+e))/12)) + char + completeDate((+month+(+e))%12) + char +completeDate(day); - console.log(endYear,'endYear'); // 得出起始年月日 row.startTime = nowYear @@ -994,7 +980,6 @@ export default { let date2 = Date.parse(nowYear); let ms = Math.abs(date1 - date2) let days = Math.floor(ms / (24 * 3600 * 1000)); - console.log(Date.parse(endYear),nowYear,date1,date2,days,'剩余期限'); row.remainingPeriod = days }, @@ -1026,7 +1011,6 @@ export default { provinceId: this.form.provinceId } return this.$get(this.api.queryCity,data).then(res => { - console.log(res.list,'res.list'); this.cityList = res.list }).catch(res => {}); }, @@ -1177,7 +1161,6 @@ export default { // 上传成功 uploadSuccess(response, file, fileList) { this.contract.contractFile = response.filesResult.fileUrl - console.log(this.contract,response,'this.contract'); }, // 上传报错 uploadError(err, file, fileList) { @@ -1213,7 +1196,14 @@ export default {