|
|
@ -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 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> |
|
|
|
<el-input onkeyup="value=this.value.replace(/\D+/g,'')" :class="!scope.row.periodOfUse&&whetherSubmit?'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 :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> |
|
|
|
<el-input :class="!scope.row.finalPrice&&whetherSubmit?'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 :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> |
|
|
|
<el-input :class="!scope.row.accountNum&&whetherSubmit?'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 :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> |
|
|
|
<el-input :class="!scope.row.totalAmount&&whetherSubmit?'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> |
|
|
@ -274,7 +274,7 @@ |
|
|
|
:inactive-value="false" |
|
|
|
:inactive-value="false" |
|
|
|
active-text="发货" |
|
|
|
active-text="发货" |
|
|
|
inactive-text="未发货" |
|
|
|
inactive-text="未发货" |
|
|
|
@change="formSwitch($event,scope.row)"> |
|
|
|
@change="deliverGoods($event,scope.row)"> |
|
|
|
</el-switch> |
|
|
|
</el-switch> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -393,7 +393,7 @@ |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加平台权限弹框 --> |
|
|
|
<!-- 添加数据平台权限弹框 --> |
|
|
|
<el-dialog :visible.sync="showPlatform" width="50%" center> |
|
|
|
<el-dialog :visible.sync="showPlatform" width="50%" center> |
|
|
|
<div class="flex-between mgb20"> |
|
|
|
<div class="flex-between mgb20"> |
|
|
|
<div class="flex-center"> |
|
|
|
<div class="flex-center"> |
|
|
@ -405,7 +405,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="boxDataPlatform" stripe header-align="center" @selection-change="boxDataPlatformSelection" :row-key="getRowKeys"> |
|
|
|
<el-table :data="boxDataPlatform" stripe header-align="center" @selection-change="boxDataPlatformSelection" :row-key="getRowKeys"> |
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column> |
|
|
|
<el-table-column type="selection" :selectable="selectable" width="55" align="center"></el-table-column> |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
|
|
|
<el-table-column prop="productName" label="产品名称" align="center"></el-table-column> |
|
|
|
<el-table-column prop="productName" label="产品名称" align="center"></el-table-column> |
|
|
|
<el-table-column prop="tableNum" label="数据量(表)" align="center"></el-table-column> |
|
|
|
<el-table-column prop="tableNum" label="数据量(表)" align="center"></el-table-column> |
|
|
@ -498,6 +498,8 @@ export default { |
|
|
|
editDisabled:false,// 编辑禁用 |
|
|
|
editDisabled:false,// 编辑禁用 |
|
|
|
renewDisabled:false,// 续费禁用 |
|
|
|
renewDisabled:false,// 续费禁用 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
whetherSubmit:false,/* 提交否 */ |
|
|
|
|
|
|
|
|
|
|
|
showSelectClient:false,// 切换展示选择客户页 |
|
|
|
showSelectClient:false,// 切换展示选择客户页 |
|
|
|
form: {// 基本信息 |
|
|
|
form: {// 基本信息 |
|
|
|
// orderNumber: '',// 编号 |
|
|
|
// orderNumber: '',// 编号 |
|
|
@ -737,6 +739,10 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if(!verify){ |
|
|
|
if(!verify){ |
|
|
|
|
|
|
|
this.whetherSubmit = true |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
this.whetherSubmit = false |
|
|
|
|
|
|
|
}, 4000); |
|
|
|
return this.$message.error('请把产品参数输入完整!') |
|
|
|
return this.$message.error('请把产品参数输入完整!') |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.dataPlatform){ |
|
|
|
if(this.dataPlatform){ |
|
|
@ -752,9 +758,14 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$refs['form'].validate((valid) => { |
|
|
|
this.$refs['form'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
if(this.renewDisabled){/* 续费状态下 */ |
|
|
|
let renew = this.dataPlatform.some(e=>e.renew) |
|
|
|
|
|
|
|
if(this.renewDisabled||renew){/* 续费状态下 */ |
|
|
|
this.form.orderNature = 2 |
|
|
|
this.form.orderNature = 2 |
|
|
|
|
|
|
|
if(renew){ |
|
|
|
|
|
|
|
this.dataPlatform.forEach(e=>{ |
|
|
|
|
|
|
|
if(e.renew) delete e.renew |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
let param = { |
|
|
|
let param = { |
|
|
|
contractInformation:this.contract,//合同信息 |
|
|
|
contractInformation:this.contract,//合同信息 |
|
|
@ -829,13 +840,10 @@ export default { |
|
|
|
this.$forceUpdate() |
|
|
|
this.$forceUpdate() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 课程权限 |
|
|
|
// 课程权限 |
|
|
|
addClassJurisdiction(){ |
|
|
|
addClassJurisdiction(){ |
|
|
|
this.classVisible = !this.classVisible |
|
|
|
this.classVisible = !this.classVisible |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 数据平台权限 |
|
|
|
// 数据平台权限 |
|
|
|
addDataJurisdiction(val){ |
|
|
|
addDataJurisdiction(val){ |
|
|
|
if(val!=='search'){ |
|
|
|
if(val!=='search'){ |
|
|
@ -859,7 +867,9 @@ export default { |
|
|
|
this.platformSelect = val |
|
|
|
this.platformSelect = val |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 数据平台弹框--确定 |
|
|
|
// 数据平台弹框--确定 |
|
|
|
addPlatform(){ |
|
|
|
async addPlatform(){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!this.form.customerId) return this.$message.warning('请先选择客户!') |
|
|
|
if(this.platformSelect.length>0){ |
|
|
|
if(this.platformSelect.length>0){ |
|
|
|
let that = this |
|
|
|
let that = this |
|
|
|
let fn = function(e){ |
|
|
|
let fn = function(e){ |
|
|
@ -880,8 +890,9 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
that.dataPlatform.push(obj) |
|
|
|
that.dataPlatform.push(obj) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
let idArr = [] |
|
|
|
this.platformSelect.map(e=>{// 取得选中的值,进行赋值 |
|
|
|
this.platformSelect.map(e=>{// 取得选中的值,进行赋值 |
|
|
|
|
|
|
|
idArr.push(e.id) |
|
|
|
if(this.dataPlatform.length>0){ |
|
|
|
if(this.dataPlatform.length>0){ |
|
|
|
// 比对是否存在该id,若存在,不操作,不存在,则进行push操作 |
|
|
|
// 比对是否存在该id,若存在,不操作,不存在,则进行push操作 |
|
|
|
let find = this.dataPlatform.some(i=>e.id === i.dataOrCourseId)// 判断已有的相同的id不进行处理 |
|
|
|
let find = this.dataPlatform.some(i=>e.id === i.dataOrCourseId)// 判断已有的相同的id不进行处理 |
|
|
@ -894,6 +905,29 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.showPlatform = !this.showPlatform |
|
|
|
this.showPlatform = !this.showPlatform |
|
|
|
this.platformSelect = [] |
|
|
|
this.platformSelect = [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 调接口,判断是否为客户已有的产品功能 */ |
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
|
|
authority:0, |
|
|
|
|
|
|
|
customerId:this.form.customerId, |
|
|
|
|
|
|
|
productId:idArr |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
await this.$post(this.api.renew,params).then(res=>{ |
|
|
|
|
|
|
|
console.log(res,'调用查询接口'); |
|
|
|
|
|
|
|
this.dataPlatform.map(e=>{ |
|
|
|
|
|
|
|
res.orderOthers.map(el=>{ |
|
|
|
|
|
|
|
if(el.dataOrCourseId === e.dataOrCourseId){ |
|
|
|
|
|
|
|
let time = el.endTime.split(" ")[0] |
|
|
|
|
|
|
|
let arr = time.split('-') |
|
|
|
|
|
|
|
e.startTime = arr[0]+'-'+arr[1]+'-'+'0'+(+arr[2]+1) |
|
|
|
|
|
|
|
e.endTime = "" |
|
|
|
|
|
|
|
e.periodOfUse = '' |
|
|
|
|
|
|
|
e.renew = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
return this.$message('请选中数据后再确定!') |
|
|
|
return this.$message('请选中数据后再确定!') |
|
|
|
} |
|
|
|
} |
|
|
@ -915,7 +949,6 @@ export default { |
|
|
|
row.accountNum = Math.floor(row.totalAmount/val) |
|
|
|
row.accountNum = Math.floor(row.totalAmount/val) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 合同起止日期选择 |
|
|
|
// 合同起止日期选择 |
|
|
|
contractTimeChange(val){ |
|
|
|
contractTimeChange(val){ |
|
|
|
if(val.length>0){ |
|
|
|
if(val.length>0){ |
|
|
@ -932,7 +965,6 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.form.orderAmount = arr.reduce((a,b)=>a+b) |
|
|
|
this.form.orderAmount = arr.reduce((a,b)=>a+b) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 总金额触发--计算账号或市场价 |
|
|
|
// 总金额触发--计算账号或市场价 |
|
|
|
allAmountChange(val,row){ |
|
|
|
allAmountChange(val,row){ |
|
|
|
if(row.totalAmount){ |
|
|
|
if(row.totalAmount){ |
|
|
@ -960,18 +992,18 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 权限switch切换--计算天数 |
|
|
|
// 权限switch切换--计算天数 |
|
|
|
formSwitch (e,row) { |
|
|
|
formSwitch (e,row) { |
|
|
|
|
|
|
|
console.log(e,row,'switch切换'); |
|
|
|
if("遇见西瓜") return '买一个包子' |
|
|
|
}, |
|
|
|
else return '买一斤包子' |
|
|
|
// 数据平台--发货 |
|
|
|
|
|
|
|
deliverGoods (e,row) { |
|
|
|
if(this.editDisabled){ |
|
|
|
if(this.editDisabled){ |
|
|
|
|
|
|
|
// this.$post(this.api.ship+"?id="+`${row.dataOrCourseId}`).then(res=>{ |
|
|
|
|
|
|
|
this.$post(this.api.ship,{id:4}).then(res=>{ |
|
|
|
|
|
|
|
console.log(res); |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
// this.deadLine(row.periodOfUse,row) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|
deadLine(e,row){ |
|
|
|
deadLine(e,row){ |
|
|
|
function completeDate(value) { |
|
|
|
function completeDate(value) { |
|
|
@ -985,14 +1017,14 @@ export default { |
|
|
|
let year = nowDate.getFullYear(); |
|
|
|
let year = nowDate.getFullYear(); |
|
|
|
console.log(nowDate,'nowdata'); |
|
|
|
console.log(nowDate,'nowdata'); |
|
|
|
|
|
|
|
|
|
|
|
if(this.renewDisabled){/* 处于续费状态 */ |
|
|
|
if(this.renewDisabled||row.renew){/* 处于续费状态 */ |
|
|
|
if(!e) return row.endTime = '' |
|
|
|
if(!e) return row.endTime = '' |
|
|
|
let arr = row.startTime.split('-') |
|
|
|
let arr = row.startTime.split('-') |
|
|
|
let renewY = arr.shift()/* 年 */ |
|
|
|
let renewY = arr.shift()/* 年 */ |
|
|
|
let renewM = arr.shift()/* 月 */ |
|
|
|
let renewM = arr.shift()/* 月 */ |
|
|
|
let renewD = arr.shift()/* 日 */ |
|
|
|
let renewD = arr.shift()/* 日 */ |
|
|
|
console.log(renewY,renewM,day,'拆分时间'); |
|
|
|
console.log(renewY,renewM,renewD,'拆分时间'); |
|
|
|
let endYear = +renewY + (parseInt((+renewM+(+e))/12)===0?0:parseInt((+renewM+(+e))/12))+ char + completeDate((+renewM+(+e))%12) + char + completeDate(renewD); |
|
|
|
let endYear = +renewY + (parseInt((+renewM+(+e))/12)===0?0:parseInt((+renewM+(+e))/12))+ char + completeDate((+renewM+(+e))%12) + char + renewD; |
|
|
|
row.endTime = endYear |
|
|
|
row.endTime = endYear |
|
|
|
|
|
|
|
|
|
|
|
// 计算剩余天数 |
|
|
|
// 计算剩余天数 |
|
|
@ -1001,8 +1033,6 @@ export default { |
|
|
|
let ms = Math.abs(date1 - date2) |
|
|
|
let ms = Math.abs(date1 - date2) |
|
|
|
row.remainingPeriod = Math.floor(ms / (24 * 3600 * 1000)) ; |
|
|
|
row.remainingPeriod = Math.floor(ms / (24 * 3600 * 1000)) ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
if(e==='') { |
|
|
|
if(e==='') { |
|
|
|
row.startTime = '' |
|
|
|
row.startTime = '' |
|
|
@ -1262,6 +1292,17 @@ export default { |
|
|
|
goback(){ |
|
|
|
goback(){ |
|
|
|
this.$router.go(-1) |
|
|
|
this.$router.go(-1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
/* 表格禁用 */ |
|
|
|
|
|
|
|
selectable(row,index){ |
|
|
|
|
|
|
|
let boolean = true |
|
|
|
|
|
|
|
this.dataPlatform.length&&this.dataPlatform.some(e=>{ |
|
|
|
|
|
|
|
if(e.dataOrCourseId === row.id){ |
|
|
|
|
|
|
|
boolean = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
console.log(boolean); |
|
|
|
|
|
|
|
return boolean |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|