diff --git a/src/utils/api.js b/src/utils/api.js index efe8c3b..ab882c9 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -1,6 +1,7 @@ import Setting from "@/setting"; const host = Setting.apiBaseURL +const host1 = 'http://192.168.31.151:9000/' const uploadURL = Setting.uploadURL export default { @@ -271,4 +272,6 @@ export default { generateInvitationCode: `nakadai/partnerAccount/generateInvitationCode`, generationQrCode: `nakadai/partnerAccount/generationQrCode`, queryUserInfoByPhone: `nakadai/partner-team/queryUserInfoByPhone`, + getAllTeam: `nakadai/partnerClassification/getAllTeam`, + partnerRemoval: `nakadai/partnerAccount/partnerRemoval`, }; \ No newline at end of file diff --git a/src/views/customer/AddCustomer.vue b/src/views/customer/AddCustomer.vue index 122e86f..d1f6eb0 100644 --- a/src/views/customer/AddCustomer.vue +++ b/src/views/customer/AddCustomer.vue @@ -77,7 +77,7 @@
- 确定 + 确定 取消
@@ -240,9 +240,9 @@ - + @@ -733,8 +733,14 @@ export default { pageNum: this.pageBm, pageSize: this.pageSizeBm }).then(({ data }) => { - this.bms = data.records - this.totalBm = data.total + data.records.map(e => { + let name = '' + // 拼接团队名称,teamDel:1已删除,0未删除 + e.teamInformationRespList.map(n => name += `${n.partnerClassificationName}${n.teamDel ? '(被解散)' : ''}
`) + e.bmName = name + }) + this.bms = data.records + this.totalBm = data.total }).catch(res => {}) }, handleCurrentChangeBm(val) { @@ -744,7 +750,7 @@ export default { }, // 商务经理查看 toOrder(row) { - this.$router.push(`/bmOrder?businessManagerId=${row.businessManagerId}&customerId=${this.customerId}&customerName=${this.form.customerName}&userName=${row.userName}`) + this.$router.push(`/bmOrder?businessManagerId=${row.businessManagerId}&customerId=${this.customerId}&customerName=${this.form.customerName}&userName=${row.userName}&teamId=${row.teamId}`) }, // tab切换 diff --git a/src/views/customer/Order.vue b/src/views/customer/Order.vue index 3f76882..b38681d 100644 --- a/src/views/customer/Order.vue +++ b/src/views/customer/Order.vue @@ -60,6 +60,7 @@ export default { data() { return { businessManagerId: this.$route.query.businessManagerId, + teamId: this.$route.query.teamId, customerId: this.$route.query.customerId, customerName: this.$route.query.customerName, keyword: "", @@ -85,6 +86,7 @@ export default { getData() { let data = { businessManagerId: this.businessManagerId, + teamId: this.teamId, keywords: this.keyword, customerId: this.customerId, pageNum: this.page, diff --git a/src/views/join/index.vue b/src/views/join/index.vue index 5181b83..a14c8d0 100644 --- a/src/views/join/index.vue +++ b/src/views/join/index.vue @@ -126,7 +126,7 @@ export default { // 手机号输入完后,带出信息 phoneChange() { // 添加成员才需要 - if (!this.form.isTeam) { + if (this.form.isTeam == 0) { const { form } = this this.$get(this.api.queryUserInfoByPhone, { phone: form.phone diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue index 7454754..61bb4a5 100644 --- a/src/views/order/AddOrder.vue +++ b/src/views/order/AddOrder.vue @@ -53,9 +53,9 @@ - - - + + + @@ -96,6 +96,11 @@ type="number" v-model="form.orderAmount" placeholder="请输入订单金额"> + + + + + @@ -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 diff --git a/src/views/parner/staff.vue b/src/views/parner/staff.vue index db306a4..2f2f7ca 100644 --- a/src/views/parner/staff.vue +++ b/src/views/parner/staff.vue @@ -2,9 +2,20 @@
+
+
或然城市合伙人
+ +
+ 团队合伙人 +
+
+ 未加入团队的合伙人 +
+
+
-
-
或然城市合伙人
+
+ 添加分类
@@ -103,8 +114,8 @@ @@ -179,6 +190,7 @@ export default { return { accountId: this.$store.state.accountId, userName: this.$store.state.userName, + type: 1, orgList: [], orgListDia: [], orgVisible: false, // 员工组织架对话框 @@ -379,6 +391,7 @@ export default { }, // 点击树节点查询列表数据 handleNodeClick(data) { + this.type = 1 this.curTeamId = '' if (data.isTeam) { this.curTeamId = data.id @@ -404,6 +417,7 @@ export default { // 员工列表 getList() { this.$post(this.api.partnerAccountList, { + type: this.type, partnerClassificationId: this.curTeamId, keyWord: this.keyWord, pageNum: this.page, @@ -431,7 +445,7 @@ export default { this.$confirm("确定要删除吗?", "提示", { type: "warning" }).then(() => { - this.$post(`${this.api.delPartnerAccount}?accountIds=${row.accountId}`).then(res => { + this.$post(`${this.api.delPartnerAccount}?teamId=${row.partnerClassificationId}`).then(res => { util.successMsg("删除成功") this.getList() }).catch(res => {}) @@ -442,7 +456,10 @@ export default { this.$confirm("确定要移除吗?", "提示", { type: "warning" }).then(() => { - this.$post(`${this.api.delPartnerAccount}?accountIds=${row.accountId}`).then(res => { + this.$get(this.api.partnerRemoval, { + partnerId: row.partnerId, + teamId: row.partnerClassificationId, + }).then(res => { util.successMsg("移除成功") this.getList() }).catch(res => {})