|
|
|
@ -53,9 +53,9 @@ |
|
|
|
|
<el-form-item label="邮箱"> |
|
|
|
|
<el-input disabled v-model="form.email" placeholder="请输入邮箱地址"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="商务经理"> |
|
|
|
|
<el-select :disabled="viewDisabled" v-model="form.businessManagerId" clearable filterable placeholder="请选择商务经理"> |
|
|
|
|
<el-option v-for="(item, i) in bmList" :key="i" :label="item.userName" :value="item.partnerId"></el-option> |
|
|
|
|
<el-form-item label="团队"> |
|
|
|
|
<el-select :disabled="viewDisabled" v-model="form.teamId" filterable placeholder="请选择团队" @change="teamChange"> |
|
|
|
|
<el-option v-for="(item, i) in teams" :key="i" :label="item.partnerClassificationName" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
@ -96,6 +96,11 @@ |
|
|
|
|
type="number" v-model="form.orderAmount" |
|
|
|
|
placeholder="请输入订单金额"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="商务经理"> |
|
|
|
|
<el-select :disabled="viewDisabled || !form.teamId" v-model="form.businessManagerId" clearable filterable placeholder="请选择商务经理"> |
|
|
|
|
<el-option v-for="(item, i) in bmList" :key="i" :label="item.userName" :value="item.partnerId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
@ -664,7 +669,10 @@ export default { |
|
|
|
|
orderAmount: 0, |
|
|
|
|
// orderId: this.$store.state.orderId, |
|
|
|
|
customerName: "",// 客户名称 |
|
|
|
|
businessManagerId: '' |
|
|
|
|
teamId: '', |
|
|
|
|
businessManagerId: '', |
|
|
|
|
profit: 0, // 利润 |
|
|
|
|
purchaseCost: 0, // 采购成本 |
|
|
|
|
}, |
|
|
|
|
coursePermissions: [],// 课程权限 |
|
|
|
|
dataPlatformPermissions: [],// 数据平台权限 |
|
|
|
@ -729,6 +737,7 @@ export default { |
|
|
|
|
provinceList: this.$store.state.provinceList, |
|
|
|
|
cityList: [], |
|
|
|
|
schoolList: [], |
|
|
|
|
teams: [], |
|
|
|
|
bmList: [], |
|
|
|
|
yearList: [ |
|
|
|
|
{ name: "1个月", value: 30 }, |
|
|
|
@ -802,7 +811,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
async created() { |
|
|
|
|
this.getBm() |
|
|
|
|
this.getTeam() |
|
|
|
|
this.token = sessionStorage.getItem("token"); |
|
|
|
|
// 处理添加状态 |
|
|
|
|
if (this.$route.query.val == 'isAdd') { |
|
|
|
@ -880,10 +889,14 @@ export default { |
|
|
|
|
orderAmount: form.orderType === 2 ? 0 : form.orderAmount, // 如果是试用的订单,则订单金额显示为0 |
|
|
|
|
orderId: form.orderId, |
|
|
|
|
options: form.options, |
|
|
|
|
teamId: form.teamId, |
|
|
|
|
profit: form.profit, |
|
|
|
|
purchaseCost: form.purchaseCost, |
|
|
|
|
businessManagerId: form.businessManagerId ? +form.businessManagerId : '' |
|
|
|
|
}; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
form.provinceId && this.getCityData() |
|
|
|
|
form.teamId && this.getBm() |
|
|
|
|
}); |
|
|
|
|
const { orderOther } = res.orderDetails |
|
|
|
|
const promises = [] |
|
|
|
@ -959,6 +972,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 新增订单 |
|
|
|
|
submitOrder() { |
|
|
|
|
let purchase = 0 // 总采购成本 |
|
|
|
|
let profit = 0 // 总利润 |
|
|
|
|
if (!this.coursePermissions.length && !this.dataPlatformPermissions.length) { |
|
|
|
|
return this.$message.error("请选择课程权限或数据权限后再确认订单"); |
|
|
|
|
} else { |
|
|
|
@ -969,6 +984,9 @@ export default { |
|
|
|
|
if (!e.periodOfUse || e.finalPrice === '') { |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
const curPurchase = +e.settlementPrice + (e.settlementPrice / 10) |
|
|
|
|
purchase += curPurchase |
|
|
|
|
profit += +e.finalPrice - curPurchase |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -987,6 +1005,9 @@ export default { |
|
|
|
|
if (!e.periodOfUse || e.finalPrice === '' || !e.accountNum || e.settlementPrice === '') { |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
const curPurchase = +e.settlementPrice + (e.settlementPrice / 10) |
|
|
|
|
purchase += curPurchase |
|
|
|
|
profit += +e.finalPrice - curPurchase |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -1016,11 +1037,15 @@ export default { |
|
|
|
|
const time = new Date(e.startTime) |
|
|
|
|
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
|
}) |
|
|
|
|
const { form } = this |
|
|
|
|
form.purchaseCost = Math.round(purchase) |
|
|
|
|
form.profit = Math.round(profit) |
|
|
|
|
let param = { |
|
|
|
|
contractInformation: this.contract,//合同信息 |
|
|
|
|
order: this.form,// 订单基本数据 |
|
|
|
|
order: form,// 订单基本数据 |
|
|
|
|
orderOther: tempArr//俩列表 |
|
|
|
|
}; |
|
|
|
|
debugger |
|
|
|
|
this.loading = true; |
|
|
|
|
if (this.editDisabled) { |
|
|
|
|
this.$post(this.api.orderUpdate, param).then(res => { |
|
|
|
@ -1517,10 +1542,21 @@ export default { |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 团队 |
|
|
|
|
getTeam() { |
|
|
|
|
this.$get(this.api.getAllTeam).then(({ team }) => { |
|
|
|
|
this.teams = team |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
// 团队选择回调 |
|
|
|
|
teamChange() { |
|
|
|
|
this.form.businessManagerId = '' |
|
|
|
|
this.getBm() |
|
|
|
|
}, |
|
|
|
|
// 城市合伙人人员 |
|
|
|
|
getBm() { |
|
|
|
|
this.$post(this.api.partnerAccountList, { |
|
|
|
|
partnerClassificationId: '', |
|
|
|
|
partnerClassificationId: this.form.teamId, |
|
|
|
|
keyWord: '', |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 100000 |
|
|
|
|