订单续费和新建功能修改,发货触发接口

dev
e 3 years ago
parent de645bddad
commit ffc608c5b7
  1. 8
      src/utils/api.js
  2. 99
      src/views/order/AddOrder.vue

@ -1,9 +1,9 @@
let host = 'http://39.108.250.202:9000' // let host = 'http://39.108.250.202:9000'
let host1 = 'http://192.168.31.216:9000'//榕 let host1 = 'http://192.168.31.216:9000'//榕
let host2 = 'http://192.168.31.125:9000'//林 let host2 = 'http://192.168.31.125:9000'//林
let host3 = 'http://192.168.31.140:9000'//7 let host3 = 'http://192.168.31.140:9000'//7
// let host = 'http://192.168.31.137:9000'// 陈赓 let host = 'http://192.168.31.137:9000'// 陈赓
export default { export default {
upload:`${host}/nakadai/nakadai/oss/fileUpload`,// 上传文件-订单 upload:`${host}/nakadai/nakadai/oss/fileUpload`,// 上传文件-订单
@ -18,6 +18,10 @@ export default {
orderList:`${host}/nakadai/nakadai/order/list`,// 订单列表 orderList:`${host}/nakadai/nakadai/order/list`,// 订单列表
orderUpdate:`${host}/nakadai/nakadai/order/update`,// 订单更新 orderUpdate:`${host}/nakadai/nakadai/order/update`,// 订单更新
renew:`${host}/nakadai/nakadai/orderOther/renew`,// 续费信息管理-post
ship:`${host}/nakadai/nakadai/orderOther/ship`,// 处理时的订单发货管理-post
queryAccountIsExist: `${host}/liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在 queryAccountIsExist: `${host}/liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在

@ -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>&nbsp;/&nbsp; </span> <span>&nbsp;/&nbsp; </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){
// idpush // idpush
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
}
} }
}; };

Loading…
Cancel
Save