From 5575c862d9852741abf521b33c0601765ed8a8f7 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 27 May 2022 11:22:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 5 + src/utils/api.js | 3 +- src/views/customer/AddCustomer.vue | 29 +++-- src/views/customer/Order.vue | 166 +++++++++++++++++++++++++ src/views/join/index.vue | 2 +- src/views/join1/index.vue | 193 ----------------------------- src/views/order/AddOrder.vue | 55 +++----- src/views/parner/staff.vue | 5 +- src/views/serve/projectAdd.vue | 1 + src/views/system/manageLog.vue | 1 + src/views/user/User.vue | 28 +++-- 11 files changed, 234 insertions(+), 254 deletions(-) create mode 100644 src/views/customer/Order.vue delete mode 100644 src/views/join1/index.vue diff --git a/src/router/index.js b/src/router/index.js index 0e27058..7149a93 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -26,6 +26,11 @@ let router = new Router({ component: () => import( '../views/customer/AddCustomer.vue'), // meta: { title: '新增客户' } }, + { + path: '/bmOrder', + component: () => import( '../views/customer/Order.vue'), + // meta: { title: '新增客户' } + }, { path: '/user', component: () => import( '../views/user/User.vue'), diff --git a/src/utils/api.js b/src/utils/api.js index a470b61..3fddbc7 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -2,7 +2,7 @@ import Setting from "@/setting"; const host = Setting.apiBaseURL const uploadURL = Setting.uploadURL -const host1 = 'http://192.168.31.137:9000/' +const host1 = 'http://39.108.250.202:9000/' export default { @@ -52,6 +52,7 @@ export default { queryPhone: `liuwanr/user/queryPhone`, queryPlatform: `liuwanr/userInfo/queryPlatform`, getAListOfClientBusinessManagers: `nakadai/nakadai/customer/getAListOfClientBusinessManagers`, + getBusinessManagerOrder: `nakadai/nakadai/customer/getBusinessManagerOrder`, // 用户管理 delUserAccounts: `users/users/userAccount/delUserAccounts`, diff --git a/src/views/customer/AddCustomer.vue b/src/views/customer/AddCustomer.vue index 21fcf0c..06c5e57 100644 --- a/src/views/customer/AddCustomer.vue +++ b/src/views/customer/AddCustomer.vue @@ -12,11 +12,11 @@ -
+ - + @@ -229,15 +229,22 @@
- + + + - - - - - - - + + + + + + + + @@ -711,7 +718,7 @@ export default { }, // 商务经理查看 toOrder(row) { - + this.$router.push(`/bmOrder?businessManagerId=${row.businessManagerId}&customerId=${this.customerId}&customerName=${this.form.customerName}`) }, tabChange(index) { diff --git a/src/views/customer/Order.vue b/src/views/customer/Order.vue new file mode 100644 index 0000000..99d4fb4 --- /dev/null +++ b/src/views/customer/Order.vue @@ -0,0 +1,166 @@ + + + + + + diff --git a/src/views/join/index.vue b/src/views/join/index.vue index 8c20a0d..ddb6391 100644 --- a/src/views/join/index.vue +++ b/src/views/join/index.vue @@ -1,7 +1,7 @@ @@ -374,6 +374,7 @@ @input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="scope.row.finalPrice" type="text"> + @@ -930,6 +931,7 @@ export default { orderAmount: form.orderType === 2 ? 0 : form.orderAmount, // 如果是试用的订单,则订单金额显示为0 orderId: form.orderId, options: form.options, + businessManagerId: +form.businessManagerId }; this.coursePermissions = list.filter(i => i.authority === 1); this.dataPlatformPermissions = list.filter(i => i.authority === 0); @@ -1322,14 +1324,13 @@ export default { }, // 课程计算折扣率 calculateDiscountCourse(val, row) { - if (row.finalPrice) - debugger - row.discountRate = (row.finalPrice / row.marketValue * 100).toFixed(2) + "%"; + const { finalPrice, marketValue } = row + if (finalPrice) row.discountRate = marketValue == 0 ? '0%' : (finalPrice / marketValue * 100).toFixed(2) + "%"; }, // 数据计算折扣率 calculateDiscount(val, row) { - if (row.finalValue) - row.discountRate = (row.finalValue / row.marketValue * 100).toFixed(2) + "%"; + const { finalValue, marketValue } = row + if (finalValue) row.discountRate = marketValue == 0 ? '0%' : (finalValue / marketValue * 100).toFixed(2) + "%"; }, // 合同起止日期选择 contractTimeChange(val) { @@ -1338,28 +1339,18 @@ export default { this.contract.endTime = val[1]; } }, - // 新增数据平台权限时,计算总的金额数目 + // 计算订单总额 allAmount($event, row) { this.dealSettlePrice(row) - // 课程权限总价 - let courseArr = []; - this.coursePermissions.map(e => { - courseArr.push(+e.finalPrice); - }); - let courseTotalPrice = courseArr.reduce((a, b) => a + b, 0); - // 数据权限总价 - let dataArr = []; - this.dataPlatformPermissions.map(e => { - dataArr.push(+e.totalAmount); - }); - let dataTotalPrice = dataArr.reduce((a, b) => a + b, 0); - this.form.orderAmount = courseTotalPrice * 10000 + dataTotalPrice; + let total = 0 + const list = [...this.coursePermissions, ...this.dataPlatformPermissions] + list.map(e => total += +e.finalPrice) + this.form.orderAmount = total * 10000 }, // 成交价修改后,计算成交单价 计算规则:成交价/账号数/时间(成交单价为元/账号/年,所以时间要换算成年的单位去计算) dealFinalValue(val, row) { const { periodOfUse, options, accountNum, finalPrice } = row if (periodOfUse && accountNum && finalPrice) { - debugger row.finalValue = (finalPrice / accountNum / periodOfUse * (!options ? 365 : options === 1 ? @@ -1379,21 +1370,13 @@ export default { } this.allAmount(e, row) }, - // 计算成交价 - dealBargain(e, row) { - if (row.accountNum && row.totalAmount) { - row.finalPrice = this.handleNaN(Math.round(row.totalAmount / row.accountNum).toFixed(2)) - } - }, // 计算结算价 dealSettlePrice(row) { - debugger - const unit = row.options // 使用期限单位 const useUnit = row.periodOfUse // 使用期限 let sPrice = '' if (row.settlementMethod === '0') { - // 结算单价。计算规则:结算单价(**元/年)*购买时长(单位年)*数量(课程为1,数据为账号数量) + // 结算单价。计算规则:结算单价(**元/年)*购买时长(单位年)*数量(课程为1,数据为账号数量)(单位是万) const priceUnit = row.settlementPriceUnit sPrice = ((!unit ? priceUnit / 365 * useUnit : @@ -1401,10 +1384,10 @@ export default { priceUnit / 12 * useUnit : priceUnit * useUnit) * (row.authority ? 1 : - row.accountNum)).toFixed(2) + row.accountNum) / 10000).toFixed(2) } else { - // 比例分成。计算规则:成交价*商务分成比例 - sPrice = row.finalPrice * row.businessProportion / 100 + // 比例分成。计算规则:成交价*商务分成比例(单位是万) + sPrice = row.finalPrice * row.businessProportion / 100 / 10000 } row.settlementPrice = this.handleNaN(sPrice) }, @@ -1437,11 +1420,11 @@ export default { if (row.authority) { const price = row.marketPrice // 市场单价 // 结算单价是元/年,所以如果选择的不是年,要进行换算(日:/365,月:/12) - row.marketValue = (!unit ? + row.marketValue = ((!unit ? price / 365 * useUnit : unit === 1 ? price / 12 * useUnit : - price * useUnit).toFixed(2) + price * useUnit) / 10000).toFixed(2) } this.dealSettlePrice(row) // 只有改变了起止日期才需要调接口查询订单,该接口作用是把开始时间传过去,会返回一个提示或者时间,如果是时间,则把时间+1天,如果是提示,则无法保存 diff --git a/src/views/parner/staff.vue b/src/views/parner/staff.vue index ea90f8f..bdf244c 100644 --- a/src/views/parner/staff.vue +++ b/src/views/parner/staff.vue @@ -410,10 +410,11 @@ export default { this.expireTime = `${date.getFullYear()}-${util.preZero(date.getMonth() + 1)}-${util.preZero(date.getDate())} ${util.preZero(date.getHours())}:${util.preZero(date.getMinutes())}:${util.preZero(date.getMinutes())}` this.parnerVisible = true const cur = this.$refs.orgTree.getCurrentKey() - this.link = `${location.origin}${Setting.isDev || Setting.isPro ? '' : 'nakadai'}/#/join?accountId=${accountId}&id=${cur ? cur: this.orgList[0].id}&userName=${this.userName}` + const link = `${location.origin}${Setting.isDev || Setting.isPro ? '' : 'nakadai'}/#/join?accountId=${accountId}&id=${cur ? cur: this.orgList[0].id}` // 生成二维码 - axios.get(`${this.api.generationQrCode}?url=${this.link}`, { + this.link = link + axios.get(`${this.api.generationQrCode}?url=${encodeURIComponent(link)}`, { responseType: 'blob' }).then(({ data }) => { this.qrcode = window.URL.createObjectURL(data) diff --git a/src/views/serve/projectAdd.vue b/src/views/serve/projectAdd.vue index 7aa55e1..8ca36af 100644 --- a/src/views/serve/projectAdd.vue +++ b/src/views/serve/projectAdd.vue @@ -435,6 +435,7 @@ export default { this.submiting = true this.$store.dispatch("setSystemId", this.projectManage.systemId); this.projectManage.state = state; + this.projectManage.ztOpen = state ? 0 : 1 let { systemId } = this.projectManage; if (this.projectId) { if (systemId == 2 || systemId == 3) { diff --git a/src/views/system/manageLog.vue b/src/views/system/manageLog.vue index 2e0cf18..2ef593c 100644 --- a/src/views/system/manageLog.vue +++ b/src/views/system/manageLog.vue @@ -199,6 +199,7 @@ export default { } /deep/.timeline { margin-left: 20%; + overflow: hidden; .el-timeline-item__node--normal { top: 30px; } diff --git a/src/views/user/User.vue b/src/views/user/User.vue index f8f563c..03004ad 100644 --- a/src/views/user/User.vue +++ b/src/views/user/User.vue @@ -264,18 +264,26 @@ export default { } this.loading = true this.$post(this.api.queryUserInfoList, data).then(({ page, total }) => { + const promises = [] page.map(e => { - // 循环查询每个用户的详情,获取绑定平台和用户信息 - this.$get(this.api.viewUserDetailsforNakadai, { userId: e.userId }).then(({ result }) => { - const platList = result.bindingPlatformAndUserList - // 只有绑定用户每个都禁用了,这里才是禁用,否则就是启用 。1->启用,0->禁用 - e.isEnable = platList.find(e => e.isEnable) ? 1 : 0 - e.userIds = platList.map(e => e.userId) // 获取userId的集合,删除用户的时候需要 - }).catch((res) => {}) + promises.push(new Promise((resolve, reject) => { + // 循环查询每个用户的详情,获取绑定平台和用户信息 + this.$get(this.api.viewUserDetailsforNakadai, { userId: e.userId }).then(({ result }) => { + const platList = result.bindingPlatformAndUserList + // 只有绑定用户每个都禁用了,这里才是禁用,否则就是启用 。1->启用,0->禁用 + e.isEnable = platList.find(e => e.isEnable) ? 1 : 0 + e.userIds = platList.map(e => e.userId) // 获取userId的集合,删除用户的时候需要 + resolve() + }).catch((res) => { + reject() + }) + })) + }) + Promise.all(promises).then(_ => { + this.userData = page + this.totals = total + this.loading = false }) - this.userData = page - this.totals = total - this.loading = false }).catch(res => { this.loading = false })