|
|
@ -54,13 +54,13 @@ |
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="6" :offset="2"> |
|
|
|
<el-col :span="6" :offset="2"> |
|
|
|
<el-form-item prop="customerName" label="订单客户"> |
|
|
|
<el-form-item prop="customerName" label="订单客户"> |
|
|
|
<div v-if="!disabled&&!editDisabled" @click="gotoClient" style="cursor: pointer"> |
|
|
|
<div v-if="!disabled&&!editDisabled&&!renewDisabled" @click="gotoClient" style="cursor: pointer"> |
|
|
|
<el-input v-model="form.customerName" placeholder="请选择客户"></el-input> |
|
|
|
<el-input v-model="form.customerName" placeholder="请选择客户"></el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-input v-if="disabled||editDisabled" disabled v-model="form.customerName" placeholder="请选择客户"></el-input> |
|
|
|
<el-input v-if="disabled||editDisabled||renewDisabled" disabled v-model="form.customerName" placeholder="请选择客户"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="orderType" label="订单类型"> |
|
|
|
<el-form-item prop="orderType" label="订单类型"> |
|
|
|
<el-select :disabled="disabled||editDisabled" v-model="form.orderType" clearable placeholder="请选择订单类型"> |
|
|
|
<el-select :disabled="disabled||editDisabled||renewDisabled" v-model="form.orderType" clearable placeholder="请选择订单类型"> |
|
|
|
<el-option v-for="(item,index) in orderTypeList" :key="index" :label="item.name" :value="item.value"></el-option> |
|
|
|
<el-option v-for="(item,index) in orderTypeList" :key="index" :label="item.name" :value="item.value"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
@ -175,7 +175,7 @@ |
|
|
|
<p class="addhr_tag"></p> |
|
|
|
<p class="addhr_tag"></p> |
|
|
|
<span>数据平台权限</span> |
|
|
|
<span>数据平台权限</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-button v-if="!disabled&&!editDisabled" type="primary" size="small" round class="mag" @click="addDataJurisdiction()">添加</el-button> |
|
|
|
<el-button v-if="!disabled&&!editDisabled&&!renewDisabled" type="primary" size="small" round class="mag" @click="addDataJurisdiction()">添加</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-table :data="dataPlatform" class="orderTable" stripe header-align="center" :summary-method="getSummaries"> |
|
|
|
<el-table :data="dataPlatform" class="orderTable" stripe header-align="center" :summary-method="getSummaries"> |
|
|
@ -294,7 +294,6 @@ |
|
|
|
<p class="addhr_tag"></p> |
|
|
|
<p class="addhr_tag"></p> |
|
|
|
<span>合同信息</span> |
|
|
|
<span>合同信息</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-form :disabled="disabled" ref="contract" :model="contract" :rules="rules" label-width="80px" > |
|
|
|
<el-form :disabled="disabled" ref="contract" :model="contract" :rules="rules" label-width="80px" > |
|
|
|
<el-col :span="8" :offset="4"> |
|
|
|
<el-col :span="8" :offset="4"> |
|
|
@ -336,6 +335,7 @@ |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-success="uploadSuccess" |
|
|
|
:on-success="uploadSuccess" |
|
|
|
|
|
|
|
:before-upload="beforeAvatarUpload" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
:limit="1" |
|
|
|
:limit="1" |
|
|
|
:on-exceed="handleExceed" |
|
|
|
:on-exceed="handleExceed" |
|
|
@ -494,8 +494,9 @@ export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
loading:false,// 页面加载 |
|
|
|
loading:false,// 页面加载 |
|
|
|
disabled:false,// 全局禁用,用于查看。 |
|
|
|
disabled:false,// 查看禁用。 |
|
|
|
editDisabled:false,// 编辑禁用,区分查看的功能 |
|
|
|
editDisabled:false,// 编辑禁用 |
|
|
|
|
|
|
|
renewDisabled:false,// 续费禁用 |
|
|
|
|
|
|
|
|
|
|
|
showSelectClient:false,// 切换展示选择客户页 |
|
|
|
showSelectClient:false,// 切换展示选择客户页 |
|
|
|
form: {// 基本信息 |
|
|
|
form: {// 基本信息 |
|
|
@ -658,6 +659,11 @@ export default { |
|
|
|
this.editDisabled = true |
|
|
|
this.editDisabled = true |
|
|
|
await this.getDetail(this.$route.query.edit) |
|
|
|
await this.getDetail(this.$route.query.edit) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* 处于续费状态 */ |
|
|
|
|
|
|
|
if(this.$route.query.renew){ |
|
|
|
|
|
|
|
this.renewDisabled = true |
|
|
|
|
|
|
|
await this.getDetail(this.$route.query.renew) |
|
|
|
|
|
|
|
} |
|
|
|
this.getCityData()// 取得城市 |
|
|
|
this.getCityData()// 取得城市 |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -673,8 +679,15 @@ export default { |
|
|
|
e.isEnable?e.isEnable=false:e.isEnable=true |
|
|
|
e.isEnable?e.isEnable=false:e.isEnable=true |
|
|
|
}) |
|
|
|
}) |
|
|
|
let dataArr = list.filter(e=>{// 数据平台 |
|
|
|
let dataArr = list.filter(e=>{// 数据平台 |
|
|
|
e.startTime = e.startTime.split(" ")[0] |
|
|
|
if(this.renewDisabled){/* 处于续费 */ |
|
|
|
e.endTime = e.endTime.split(" ")[0] |
|
|
|
e.startTime = e.endTime.split(" ")[0] |
|
|
|
|
|
|
|
e.endTime = "" |
|
|
|
|
|
|
|
e.periodOfUse = '' |
|
|
|
|
|
|
|
e.residueRecord = e.remainingPeriod |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
e.startTime = e.startTime.split(" ")[0] |
|
|
|
|
|
|
|
e.endTime = e.endTime.split(" ")[0] |
|
|
|
|
|
|
|
} |
|
|
|
return e.authority===0 |
|
|
|
return e.authority===0 |
|
|
|
}), |
|
|
|
}), |
|
|
|
classArr = list.filter(e=>{// 课程权限 |
|
|
|
classArr = list.filter(e=>{// 课程权限 |
|
|
@ -701,7 +714,7 @@ export default { |
|
|
|
startTime:contract.startTime?contract.startTime:'', |
|
|
|
startTime:contract.startTime?contract.startTime:'', |
|
|
|
endTime:contract.endTime?contract.endTime:'', |
|
|
|
endTime:contract.endTime?contract.endTime:'', |
|
|
|
contractId:contract.contractId, |
|
|
|
contractId:contract.contractId, |
|
|
|
uploadList:{name:contract.contractFile?contract.contractFile.split().pop():'',url:contract.contractFile} |
|
|
|
uploadList:{name:contract.contractFile?contract.contractFile.split('/').pop():'',url:contract.contractFile} |
|
|
|
} |
|
|
|
} |
|
|
|
if(contract.startTime&&contract.endTime){ |
|
|
|
if(contract.startTime&&contract.endTime){ |
|
|
|
this.contractTime = [contract.startTime,contract.endTime] |
|
|
|
this.contractTime = [contract.startTime,contract.endTime] |
|
|
@ -736,13 +749,19 @@ export default { |
|
|
|
e.ship?e.ship=1:e.ship=0 |
|
|
|
e.ship?e.ship=1:e.ship=0 |
|
|
|
e.isEnable?e.isEnable=0:e.isEnable=1 |
|
|
|
e.isEnable?e.isEnable=0:e.isEnable=1 |
|
|
|
}) |
|
|
|
}) |
|
|
|
let param = { |
|
|
|
|
|
|
|
contractInformation:this.contract,//合同信息 |
|
|
|
|
|
|
|
order:this.form,// 订单基本数据 |
|
|
|
|
|
|
|
orderOther:[...this.dataPlatform,...this.jurisdictionData]//订单其他数据 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$refs['form'].validate((valid) => { |
|
|
|
this.$refs['form'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
|
|
|
|
if(this.renewDisabled){/* 续费状态下 */ |
|
|
|
|
|
|
|
this.dataPlatform.map(e=>{ |
|
|
|
|
|
|
|
delete e.residueRecord |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.form.orderNature = 2 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let param = { |
|
|
|
|
|
|
|
contractInformation:this.contract,//合同信息 |
|
|
|
|
|
|
|
order:this.form,// 订单基本数据 |
|
|
|
|
|
|
|
orderOther:[...this.dataPlatform,...this.jurisdictionData]//订单其他数据 |
|
|
|
|
|
|
|
} |
|
|
|
this.loading = true |
|
|
|
this.loading = true |
|
|
|
this.$post(this.api.orderAdd,param).then(res=>{ |
|
|
|
this.$post(this.api.orderAdd,param).then(res=>{ |
|
|
|
this.$router.push('/order') |
|
|
|
this.$router.push('/order') |
|
|
@ -942,6 +961,10 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 权限switch切换--计算天数 |
|
|
|
// 权限switch切换--计算天数 |
|
|
|
formSwitch (e,row) { |
|
|
|
formSwitch (e,row) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if("遇见西瓜") return '买一个包子' |
|
|
|
|
|
|
|
else return '买一斤包子' |
|
|
|
|
|
|
|
|
|
|
|
if(this.editDisabled){ |
|
|
|
if(this.editDisabled){ |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
@ -949,13 +972,9 @@ export default { |
|
|
|
// this.deadLine(row.periodOfUse,row) |
|
|
|
// this.deadLine(row.periodOfUse,row) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// |
|
|
|
// |
|
|
|
|
|
|
|
|
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|
deadLine(e,row){ |
|
|
|
deadLine(e,row){ |
|
|
|
if(e==='') { |
|
|
|
|
|
|
|
row.startTime = '' |
|
|
|
|
|
|
|
row.endTime = '' |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function completeDate(value) { |
|
|
|
function completeDate(value) { |
|
|
|
if(value==0) return '12' |
|
|
|
if(value==0) return '12' |
|
|
|
return value < 10 ? "0"+value:value; |
|
|
|
return value < 10 ? "0"+value:value; |
|
|
@ -965,31 +984,64 @@ export default { |
|
|
|
let day = nowDate.getDate(); |
|
|
|
let day = nowDate.getDate(); |
|
|
|
let month = nowDate.getMonth() + 1; |
|
|
|
let month = nowDate.getMonth() + 1; |
|
|
|
let year = nowDate.getFullYear(); |
|
|
|
let year = nowDate.getFullYear(); |
|
|
|
//补全0,并拼接当前的时间点 |
|
|
|
console.log(nowDate,'nowdata'); |
|
|
|
let nowYear = year + char + completeDate(month) + char +completeDate(day); |
|
|
|
|
|
|
|
// 判断结束日期 |
|
|
|
if(this.renewDisabled){/* 处于续费状态 */ |
|
|
|
let endYear = year + (parseInt((+month+(+e))/12)===0?0:parseInt((+month+(+e))/12)) + char + completeDate((+month+(+e))%12) + char +completeDate(day); |
|
|
|
if(!e) return row.endTime = '' |
|
|
|
|
|
|
|
let arr = row.startTime.split('-') |
|
|
|
|
|
|
|
let renewY = arr.shift()/* 年 */ |
|
|
|
|
|
|
|
let renewM = arr.shift()/* 月 */ |
|
|
|
|
|
|
|
let renewD = arr.shift()/* 日 */ |
|
|
|
|
|
|
|
console.log(renewY,renewM,day,'拆分时间'); |
|
|
|
|
|
|
|
let endYear = +renewY + (parseInt((+renewM+(+e))/12)===0?0:parseInt((+renewM+(+e))/12))+ char + completeDate((+renewM+(+e))%12) + char + completeDate(renewD); |
|
|
|
|
|
|
|
row.endTime = endYear |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 计算剩余天数 |
|
|
|
|
|
|
|
let date1 = Date.parse(endYear); |
|
|
|
|
|
|
|
let date2 = Date.parse(row.startTime); |
|
|
|
|
|
|
|
let ms = Math.abs(date1 - date2) |
|
|
|
|
|
|
|
row.remainingPeriod = Math.floor(ms / (24 * 3600 * 1000)) + row.residueRecord; |
|
|
|
|
|
|
|
|
|
|
|
// 得出起始年月日 |
|
|
|
|
|
|
|
row.startTime = nowYear |
|
|
|
|
|
|
|
row.endTime = endYear |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 计算剩余天数 |
|
|
|
|
|
|
|
let date1 = Date.parse(endYear); |
|
|
|
}else{ |
|
|
|
|
|
|
|
if(e==='') { |
|
|
|
|
|
|
|
row.startTime = '' |
|
|
|
|
|
|
|
row.endTime = '' |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//补全0,并拼接当前的时间点 |
|
|
|
|
|
|
|
let nowYear = year + char + completeDate(month) + char +completeDate(day); |
|
|
|
|
|
|
|
// 判断结束日期 |
|
|
|
|
|
|
|
let endYear = year + (parseInt((+month+(+e))/12)===0?0:parseInt((+month+(+e))/12)) + char + completeDate((+month+(+e))%12) + char +completeDate(day); |
|
|
|
|
|
|
|
// 得出起始年月日 |
|
|
|
|
|
|
|
row.startTime = nowYear |
|
|
|
|
|
|
|
row.endTime = endYear |
|
|
|
|
|
|
|
// 计算剩余天数 |
|
|
|
|
|
|
|
let date1 = Date.parse(endYear); |
|
|
|
|
|
|
|
let date2 = Date.parse(nowYear); |
|
|
|
|
|
|
|
let ms = Math.abs(date1 - date2) |
|
|
|
|
|
|
|
let days = Math.floor(ms / (24 * 3600 * 1000)); |
|
|
|
|
|
|
|
row.remainingPeriod = days |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let date2 = Date.parse(nowYear); |
|
|
|
|
|
|
|
let ms = Math.abs(date1 - date2) |
|
|
|
|
|
|
|
let days = Math.floor(ms / (24 * 3600 * 1000)); |
|
|
|
|
|
|
|
row.remainingPeriod = days |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 删除数据平台产品 |
|
|
|
// 删除数据平台产品 |
|
|
|
delDataForm(index){ |
|
|
|
delDataForm(index){ |
|
|
|
|
|
|
|
|
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
.then(() => { |
|
|
|
this.dataPlatform.splice(index,1) |
|
|
|
if(this.renewDisabled&&this.dataPlatform.length===1){ |
|
|
|
|
|
|
|
return this.$message.warning('续费至少保留一条产品信息!') |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.dataPlatform.splice(index,1) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
@ -1158,8 +1210,23 @@ export default { |
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 上传前 |
|
|
|
|
|
|
|
beforeAvatarUpload(file) { |
|
|
|
|
|
|
|
const size = file.size / 1024 / 1024 < 10; |
|
|
|
|
|
|
|
let type = file.name.split('.').pop() |
|
|
|
|
|
|
|
let str = ["jpg","jepg","gif","png","doc","pdf"].includes(type.toLowerCase()) |
|
|
|
|
|
|
|
console.log(type,str,'类型判断'); |
|
|
|
|
|
|
|
if(!str){ |
|
|
|
|
|
|
|
this.$message.error('只能上传图片,word文件和pdf文件!') |
|
|
|
|
|
|
|
}else if (!size) { |
|
|
|
|
|
|
|
this.$message.error('上传头像图片大小不能超过 10MB!'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return str&&size |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
// 上传成功 |
|
|
|
// 上传成功 |
|
|
|
uploadSuccess(response, file, fileList) { |
|
|
|
uploadSuccess(response, file, fileList) { |
|
|
|
|
|
|
|
console.log(file,'上传构子',response,); |
|
|
|
this.contract.contractFile = response.filesResult.fileUrl |
|
|
|
this.contract.contractFile = response.filesResult.fileUrl |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 上传报错 |
|
|
|
// 上传报错 |
|
|
@ -1170,9 +1237,17 @@ export default { |
|
|
|
center: true |
|
|
|
center: true |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除上传合同前的确认 |
|
|
|
// 删除上传文件前的确认 |
|
|
|
beforeRemove(file, fileList) { |
|
|
|
beforeRemove(file, fileList) { |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
console.log(file,'删除钩子'); |
|
|
|
|
|
|
|
let type = file.name.split('.').pop() |
|
|
|
|
|
|
|
let str = ["jpg","jepg","gif","png","doc","pdf"].includes(type.toLowerCase()) |
|
|
|
|
|
|
|
const size = file.size / 1024 / 1024 < 10; |
|
|
|
|
|
|
|
if(!size||!str){ |
|
|
|
|
|
|
|
return true |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除文件钩子 |
|
|
|
// 删除文件钩子 |
|
|
|
handleRemove(file, fileList) { |
|
|
|
handleRemove(file, fileList) { |
|
|
|