|
|
@ -186,7 +186,7 @@ |
|
|
|
<el-table-column label="使用期限" align="center" width="200"> |
|
|
|
<el-table-column label="使用期限" align="center" width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="course-input"> |
|
|
|
<div class="course-input"> |
|
|
|
<el-input :disabled="disabled||editDisabled" maxlength="4" @change="deadLine($event,scope.row)" oninput="value=value.replace(/[^0-9.]/g,'')" v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input> |
|
|
|
<el-input onkeyup="value=this.value.replace(/\D+/g,'')" :class="!scope.row.periodOfUse?'red':''" :disabled="disabled||editDisabled" maxlength="4" @change="deadLine($event,scope.row),zero($event,scope.row)" oninput="value=value.replace(/[^0-9.]/g,'')" v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input> |
|
|
|
<span>月</span> |
|
|
|
<span>月</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -218,7 +218,7 @@ |
|
|
|
<el-table-column label="成交价" align="center" width="185"> |
|
|
|
<el-table-column label="成交价" align="center" width="185"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="small"> |
|
|
|
<div class="small"> |
|
|
|
<el-input :disabled="disabled||editDisabled" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" @change="[dealComputers($event,scope.row),discount($event,scope.row),userAmount($event,scope.row)]" v-model="scope.row.finalPrice" placeholder="请输入"type="text"></el-input> |
|
|
|
<el-input :class="!scope.row.finalPrice?'red':''" :disabled="disabled||editDisabled" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" @change="[dealComputers($event,scope.row),discount($event,scope.row),userAmount($event,scope.row)]" v-model="scope.row.finalPrice" placeholder="请输入"type="text"></el-input> |
|
|
|
<span>元 / 账号</span> |
|
|
|
<span>元 / 账号</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -233,7 +233,7 @@ |
|
|
|
<el-table-column label="账号数" align="center" width="150"> |
|
|
|
<el-table-column label="账号数" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="small"> |
|
|
|
<div class="small"> |
|
|
|
<el-input :disabled="disabled||editDisabled" @change="[dealComputers($event,scope.row),dealBargain($event,scope.row)]" v-model="scope.row.accountNum" placeholder="请输入"type="text"></el-input> |
|
|
|
<el-input :class="!scope.row.accountNum?'red':''" :disabled="disabled||editDisabled" @change="[dealComputers($event,scope.row),dealBargain($event,scope.row)]" v-model="scope.row.accountNum" placeholder="请输入"type="text"></el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
@ -241,7 +241,7 @@ |
|
|
|
<el-table-column label="总金额(元)" align="center" width="180"> |
|
|
|
<el-table-column label="总金额(元)" align="center" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="small"> |
|
|
|
<div class="small"> |
|
|
|
<el-input :disabled="disabled||editDisabled" @blur="[allAmount($event,scope.row),allAmountChange($event,scope.row)]" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="scope.row.totalAmount" placeholder="请输入"type="text"></el-input> |
|
|
|
<el-input :class="!scope.row.totalAmount?'red':''" :disabled="disabled||editDisabled" @blur="[allAmount($event,scope.row),allAmountChange($event,scope.row)]" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="scope.row.totalAmount" placeholder="请输入"type="text"></el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
@ -303,8 +303,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="合同金额" prop="contractInformationSum"> |
|
|
|
<el-form-item label="合同金额" prop="contractInformationSum"> |
|
|
|
<el-input v-model="contract.contractMoney" |
|
|
|
<el-input oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="contract.contractMoney" placeholder="请输入合同金额"></el-input> |
|
|
|
placeholder="请输入合同金额"></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
@ -647,25 +646,25 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
created(){ |
|
|
|
async created(){ |
|
|
|
this.token = sessionStorage.getItem('token') |
|
|
|
this.token = sessionStorage.getItem('token') |
|
|
|
this.getCityData() |
|
|
|
|
|
|
|
// 处于查看状态 |
|
|
|
// 处于查看状态 |
|
|
|
if(this.$route.query.watch){ |
|
|
|
if(this.$route.query.watch){ |
|
|
|
this.disabled = true |
|
|
|
this.disabled = true |
|
|
|
this.getDetail(this.$route.query.watch) |
|
|
|
await this.getDetail(this.$route.query.watch) |
|
|
|
} |
|
|
|
} |
|
|
|
// 处于编辑状态 |
|
|
|
// 处于编辑状态 |
|
|
|
if(this.$route.query.edit){ |
|
|
|
if(this.$route.query.edit){ |
|
|
|
this.editDisabled = true |
|
|
|
this.editDisabled = true |
|
|
|
this.getDetail(this.$route.query.edit) |
|
|
|
await this.getDetail(this.$route.query.edit) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.getCityData()// 取得城市 |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 读取页面详情 |
|
|
|
// 读取页面详情 |
|
|
|
async getDetail(id){ |
|
|
|
async getDetail(id){ |
|
|
|
this.$get(this.api.orderDetail,{orderId:+id}).then(res=>{ |
|
|
|
return this.$get(this.api.orderDetail,{orderId:+id}).then(res=>{ |
|
|
|
console.log(res,'请求详情'); |
|
|
|
|
|
|
|
let form = res.orderDetails.order,// 基本信息 |
|
|
|
let form = res.orderDetails.order,// 基本信息 |
|
|
|
contract = res.orderDetails.contractInformation?res.orderDetails.contractInformation:{},// 合同 |
|
|
|
contract = res.orderDetails.contractInformation?res.orderDetails.contractInformation:{},// 合同 |
|
|
|
list = res.orderDetails.orderOther// 俩列表 |
|
|
|
list = res.orderDetails.orderOther// 俩列表 |
|
|
@ -681,7 +680,6 @@ export default { |
|
|
|
classArr = list.filter(e=>{// 课程权限 |
|
|
|
classArr = list.filter(e=>{// 课程权限 |
|
|
|
return e.authority===1 |
|
|
|
return e.authority===1 |
|
|
|
}) |
|
|
|
}) |
|
|
|
console.log(dataArr,'dataArr'); |
|
|
|
|
|
|
|
this.form = { |
|
|
|
this.form = { |
|
|
|
orderNumber: form.orderNumber, |
|
|
|
orderNumber: form.orderNumber, |
|
|
|
createTime: form.createTime, |
|
|
|
createTime: form.createTime, |
|
|
@ -696,7 +694,6 @@ export default { |
|
|
|
orderAmount: form.orderAmount, |
|
|
|
orderAmount: form.orderAmount, |
|
|
|
orderId:form.orderId |
|
|
|
orderId:form.orderId |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.contract = { |
|
|
|
this.contract = { |
|
|
|
contractName:contract.contractName, |
|
|
|
contractName:contract.contractName, |
|
|
|
contractMoney:contract.contractMoney, |
|
|
|
contractMoney:contract.contractMoney, |
|
|
@ -710,7 +707,6 @@ export default { |
|
|
|
this.contractTime = [contract.startTime,contract.endTime] |
|
|
|
this.contractTime = [contract.startTime,contract.endTime] |
|
|
|
} |
|
|
|
} |
|
|
|
this.dataPlatform = dataArr |
|
|
|
this.dataPlatform = dataArr |
|
|
|
console.log(this.dataPlatform,'当前的值'); |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 新增订单 |
|
|
|
// 新增订单 |
|
|
@ -749,7 +745,6 @@ export default { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
this.loading = true |
|
|
|
this.loading = true |
|
|
|
this.$post(this.api.orderAdd,param).then(res=>{ |
|
|
|
this.$post(this.api.orderAdd,param).then(res=>{ |
|
|
|
console.log(res,'新增订单'); |
|
|
|
|
|
|
|
this.$router.push('/order') |
|
|
|
this.$router.push('/order') |
|
|
|
this.loading = false |
|
|
|
this.loading = false |
|
|
|
this.$message.success('添加订单成功!') |
|
|
|
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(){ |
|
|
|
gotoClient(){ |
|
|
|
this.showSelectClient = !this.showSelectClient |
|
|
|
this.showSelectClient = !this.showSelectClient |
|
|
@ -801,7 +803,6 @@ export default { |
|
|
|
this.form.phone = val.phone |
|
|
|
this.form.phone = val.phone |
|
|
|
this.form.email = val.email |
|
|
|
this.form.email = val.email |
|
|
|
this.form.orderContact = val.name |
|
|
|
this.form.orderContact = val.name |
|
|
|
console.log(val,'取得返回值'); |
|
|
|
|
|
|
|
this.$get(this.api.queryCustomerDetails,{customerId:val.id}).then(res=>{ |
|
|
|
this.$get(this.api.queryCustomerDetails,{customerId:val.id}).then(res=>{ |
|
|
|
this.form.provinceId = res.result.customer.provinceId |
|
|
|
this.form.provinceId = res.result.customer.provinceId |
|
|
|
this.form.cityId = res.result.customer.cityId |
|
|
|
this.form.cityId = res.result.customer.cityId |
|
|
@ -829,22 +830,18 @@ export default { |
|
|
|
productName:this.productName |
|
|
|
productName:this.productName |
|
|
|
} |
|
|
|
} |
|
|
|
this.$post(this.api.listByEntity,param).then(res=>{ |
|
|
|
this.$post(this.api.listByEntity,param).then(res=>{ |
|
|
|
console.log(res,'请求成功'); |
|
|
|
|
|
|
|
this.boxDataPlatform = res.pageList.records |
|
|
|
this.boxDataPlatform = res.pageList.records |
|
|
|
this.platfromTotals = res.pageList.total |
|
|
|
this.platfromTotals = res.pageList.total |
|
|
|
}).catch(err=>{ |
|
|
|
}).catch(err=>{ |
|
|
|
console.log(err,'请求错误'); |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 数据平台--弹框列表选中 |
|
|
|
// 数据平台--弹框列表选中 |
|
|
|
boxDataPlatformSelection(val){ |
|
|
|
boxDataPlatformSelection(val){ |
|
|
|
this.platformSelect = val |
|
|
|
this.platformSelect = val |
|
|
|
console.log(val,'数据选中',this.platformSelect); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 数据平台弹框--确定 |
|
|
|
// 数据平台弹框--确定 |
|
|
|
addPlatform(){ |
|
|
|
addPlatform(){ |
|
|
|
console.log(this.platformSelect,'this.platformSelect'); |
|
|
|
|
|
|
|
if(this.platformSelect.length>0){ |
|
|
|
if(this.platformSelect.length>0){ |
|
|
|
let that = this |
|
|
|
let that = this |
|
|
|
let fn = function(e){ |
|
|
|
let fn = function(e){ |
|
|
@ -906,7 +903,6 @@ export default { |
|
|
|
if(val.length>0){ |
|
|
|
if(val.length>0){ |
|
|
|
this.contract.startTime = val[0] |
|
|
|
this.contract.startTime = val[0] |
|
|
|
this.contract.endTime = val[1] |
|
|
|
this.contract.endTime = val[1] |
|
|
|
console.log(this.contract.startTime,this.contract.endTime,'s-e'); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 新增数据平台权限时,计算总的金额数目 |
|
|
|
// 新增数据平台权限时,计算总的金额数目 |
|
|
@ -921,7 +917,6 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
// 总金额触发--计算账号或市场价 |
|
|
|
// 总金额触发--计算账号或市场价 |
|
|
|
allAmountChange(val,row){ |
|
|
|
allAmountChange(val,row){ |
|
|
|
console.log(val,row,'kankan'); |
|
|
|
|
|
|
|
if(row.totalAmount){ |
|
|
|
if(row.totalAmount){ |
|
|
|
let all = row.totalAmount |
|
|
|
let all = row.totalAmount |
|
|
|
if(row.accountNum){// 若有账号 |
|
|
|
if(row.accountNum){// 若有账号 |
|
|
@ -930,7 +925,6 @@ export default { |
|
|
|
if(row.finalPrice){// 若有市场价 |
|
|
|
if(row.finalPrice){// 若有市场价 |
|
|
|
row.accountNum = Math.floor(all/row.finalPrice) |
|
|
|
row.accountNum = Math.floor(all/row.finalPrice) |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(val,row); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 计算成交总额 |
|
|
|
// 计算成交总额 |
|
|
@ -957,10 +951,7 @@ export default { |
|
|
|
// |
|
|
|
// |
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|
deadLine(e,row){ |
|
|
|
deadLine(e,row){ |
|
|
|
|
|
|
|
|
|
|
|
console.log(row.ship,e,'row.consignment'); |
|
|
|
|
|
|
|
if(e==='') { |
|
|
|
if(e==='') { |
|
|
|
console.log('進入return'); |
|
|
|
|
|
|
|
row.startTime = '' |
|
|
|
row.startTime = '' |
|
|
|
row.endTime = '' |
|
|
|
row.endTime = '' |
|
|
|
return |
|
|
|
return |
|
|
@ -977,12 +968,7 @@ export default { |
|
|
|
//补全0,并拼接当前的时间点 |
|
|
|
//补全0,并拼接当前的时间点 |
|
|
|
let nowYear = year + char + completeDate(month) + char +completeDate(day); |
|
|
|
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); |
|
|
|
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 |
|
|
|
row.startTime = nowYear |
|
|
@ -994,7 +980,6 @@ export default { |
|
|
|
let date2 = Date.parse(nowYear); |
|
|
|
let date2 = Date.parse(nowYear); |
|
|
|
let ms = Math.abs(date1 - date2) |
|
|
|
let ms = Math.abs(date1 - date2) |
|
|
|
let days = Math.floor(ms / (24 * 3600 * 1000)); |
|
|
|
let days = Math.floor(ms / (24 * 3600 * 1000)); |
|
|
|
console.log(Date.parse(endYear),nowYear,date1,date2,days,'剩余期限'); |
|
|
|
|
|
|
|
row.remainingPeriod = days |
|
|
|
row.remainingPeriod = days |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -1026,7 +1011,6 @@ export default { |
|
|
|
provinceId: this.form.provinceId |
|
|
|
provinceId: this.form.provinceId |
|
|
|
} |
|
|
|
} |
|
|
|
return this.$get(this.api.queryCity,data).then(res => { |
|
|
|
return this.$get(this.api.queryCity,data).then(res => { |
|
|
|
console.log(res.list,'res.list'); |
|
|
|
|
|
|
|
this.cityList = res.list |
|
|
|
this.cityList = res.list |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => {}); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -1177,7 +1161,6 @@ export default { |
|
|
|
// 上传成功 |
|
|
|
// 上传成功 |
|
|
|
uploadSuccess(response, file, fileList) { |
|
|
|
uploadSuccess(response, file, fileList) { |
|
|
|
this.contract.contractFile = response.filesResult.fileUrl |
|
|
|
this.contract.contractFile = response.filesResult.fileUrl |
|
|
|
console.log(this.contract,response,'this.contract'); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 上传报错 |
|
|
|
// 上传报错 |
|
|
|
uploadError(err, file, fileList) { |
|
|
|
uploadError(err, file, fileList) { |
|
|
@ -1213,7 +1196,14 @@ export default { |
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
/deep/.course-input .el-input__inner { |
|
|
|
/deep/.course-input .el-input__inner { |
|
|
|
width: 100px; |
|
|
|
width: 100px; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/deep/.course-input .red .el-input__inner { |
|
|
|
|
|
|
|
border:1px solid red; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .small .red .el-input__inner{ |
|
|
|
|
|
|
|
border:1px solid red; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/deep/ .small .el-input__inner{ |
|
|
|
/deep/ .small .el-input__inner{ |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|