From e6b84e58f5899c75e8db303787d51cc85cdb782d Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Tue, 17 May 2022 09:33:54 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=81=94=E8=B0=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/setting.js | 4 +-
src/utils/api.js | 19 +--
src/views/customer/AddCustomer.vue | 210 ++++++++++++++++++++++++-----
src/views/order/AddOrder.vue | 47 ++++++-
src/views/parner/staff.vue | 29 ----
5 files changed, 233 insertions(+), 76 deletions(-)
diff --git a/src/setting.js b/src/setting.js
index 4cef5e3..1f122c1 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -9,8 +9,8 @@ let jumpPath = `${location.origin}/judgmentPoint`
let host = `${location.origin}:9000/`
if (isDev) {
jumpPath = "http://192.168.31.125:8087/"; // 本地调试-需要启动本地判分点系统
- host = 'http://39.108.250.202:9000/'
- // host = 'http://192.168.31.151:9000/'// 榕
+ // host = 'http://39.108.250.202:9000/'
+ host = 'http://192.168.31.151:9000/'// 榕
// host = 'http://192.168.31.137:9000/'// 赓
} else if (isPro) {
jumpPath = "http://www.huorantech.cn/judgmentPoint/";
diff --git a/src/utils/api.js b/src/utils/api.js
index c5f3b38..45a8ce2 100644
--- a/src/utils/api.js
+++ b/src/utils/api.js
@@ -2,6 +2,7 @@ import Setting from "@/setting";
const host = Setting.apiBaseURL
const uploadURL = Setting.uploadURL
+const host1 = 'http://192.168.31.151:9000/'
export default {
@@ -16,14 +17,14 @@ export default {
checkWorkNumOrAccount: `occupationlab/architecture/checkWorkNumOrAccount`, // 新增/编辑学生前:校验学号或者学生账号
// 订单管理
- orderAdd: `nakadai/nakadai/order/add`,// 订单添加
- orderDelete: `nakadai/nakadai/order/delete`,// 删除定单
- orderDetail: `nakadai/nakadai/order/get`,// 订单详情
- orderList: `nakadai/nakadai/order/list`,// 订单列表
- orderUpdate: `nakadai/nakadai/order/update`,// 订单更新
- renew: `nakadai/nakadai/orderOther/renew`,// 续费信息管理-post
- ship: `nakadai/nakadai/orderOther/ship`,// 处理时的订单发货管理-post
- getOrderOtherTime: `nakadai/nakadai/orderOther/getOrderOtherTime`,
+ orderAdd: `${host1}nakadai/nakadai/order/add`,// 订单添加
+ orderDelete: `${host1}nakadai/nakadai/order/delete`,// 删除定单
+ orderDetail: `${host1}nakadai/nakadai/order/get`,// 订单详情
+ orderList: `${host1}nakadai/nakadai/order/list`,// 订单列表
+ orderUpdate: `${host1}nakadai/nakadai/order/update`,// 订单更新
+ renew: `${host1}nakadai/nakadai/orderOther/renew`,// 续费信息管理-post
+ ship: `${host1}nakadai/nakadai/orderOther/ship`,// 处理时的订单发货管理-post
+ getOrderOtherTime: `${host1}nakadai/nakadai/orderOther/getOrderOtherTime`,
queryAccountIsExist: `liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在
@@ -37,6 +38,8 @@ export default {
doAssign: `data/data/permission/doAssign`,
updateCustomerByRoleId: `nakadai/nakadai/customer/updateCustomerByRoleId`,
checkEmailOrPhone: `nakadai/nakadai/customer/checkEmailOrPhone`, // 新增客户前:校验手机号或者邮箱
+ getProductsSubscribedByCustomers: `nakadai/nakadai/customer/getProductsSubscribedByCustomers`,
+ orderBulkDisableEnable: `/nakadai/nakadai/orderOther/orderBulkDisableEnable`,
resetPwdCustomer: `nakadai/nakadai/customer/resetPwd`,
queryCustomerIsExists: `nakadai/nakadai/customer/queryCustomerIsExists`,
diff --git a/src/views/customer/AddCustomer.vue b/src/views/customer/AddCustomer.vue
index 8f9bea9..566e326 100644
--- a/src/views/customer/AddCustomer.vue
+++ b/src/views/customer/AddCustomer.vue
@@ -83,45 +83,51 @@
-
-
-
+
+
-
-
-
+
+
-
-
+
- 导出列表
+ 导出列表
-
+
-
-
+
+
+
+ {{scope.row.authority ? '课程' : '数据'}}
+
+
- {{scope.row.startTime}}~{{scope.row.endTime}}
+ {{scope.row.status === '已过期' ? '' : scope.row.startTime + ' ~ ' + scope.row.endTime}}
+
- {{scope.row.remainingPeriod}} 天
+ {{scope.row.remain}} 天
-
+
-
- 未发货
+
@@ -132,13 +138,13 @@
-
-
-
+
+
-
-
+
@@ -147,19 +153,31 @@
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+ {{ scope.row.orderContent }}
+
+ {{ scope.row.orderContent }}
+
+
+
+ {{ scope.row.orderContent }}
+
+
+
+
+
+
+
订单详情
@@ -171,7 +189,7 @@
@@ -205,7 +223,7 @@
@@ -249,7 +267,8 @@ export default {
tab4: '合同信息',
tab5: '商务经理',
},
- customerData: [],
+ products: [],
+ productAll: [],
showFile:false,
pdfVisible:false,
showImg:false,
@@ -333,6 +352,12 @@ export default {
name: '到期',
value: 3
}],
+
+ form2: {
+ productType: '',
+ status: '全部',
+ keyword: ''
+ },
// 产品类型
productTypeList: [
{
@@ -371,6 +396,11 @@ export default {
name: '待生效'
}
],
+
+ pageOrder: 1,
+ pageSizeOrder: 10,
+ orders: [],
+
// 订单状态
orderStatusList: [
{
@@ -404,8 +434,17 @@ export default {
submiting: false // 新增编辑防抖标识
};
},
+ watch: {
+ 'form2.keyword': function(val) {
+ clearTimeout(this.searchTimer)
+ this.searchTimer = setTimeout(() => {
+ this.filterForm2()
+ },500)
+ },
+ },
mounted() {
this.getIndustryClass()
+ this.getProduct()
if(this.customerId){
this.$get(this.api.queryCustomerDetails,{
customerId: this.customerId
@@ -413,6 +452,7 @@ export default {
let customer = res.result.customer
this.form = {
customerId: customer.customerId,
+ customerName: customer.customerName,
schoolId: customer.schoolId,
countries: customer.countries,
industryClassId: customer.industryClassId,
@@ -427,6 +467,7 @@ export default {
name: customer.name,
position: customer.position,
}
+ this.getOrder()
this.contractInformations = res.result.contractInformations.filter(e => e.contractNumber || e.contractName); // 必须有合同编号或者名称,否则不展示
this.coursePermissionss = res.result.coursePermissionss
this.dataPermissionss = res.result.dataPermissionss
@@ -439,6 +480,106 @@ export default {
}
},
methods: {
+ // 获取已订阅产品
+ getProduct() {
+ this.$get(this.api.getProductsSubscribedByCustomers, {
+ customeId: this.customerId
+ }).then(({ data }) => {
+ data.map(e => {
+ const list = e.startAndEndTimeList
+ let connect = true // 每个订单的开始结束日期是否连续
+ list.map((n, i) => {
+ // 第一个不用计算。用当前订单的开始日期跟上一个订单的结束日期做比较,只差一天,就表示是连续订单
+ if (i) {
+ if (new Date(n.startTime).getTime() - 86400000 !== new Date(list[i - 1].endTime).getTime()) connect = false
+ }
+ })
+ // 如果是连续订单,则取第一个订单的开始日期和最后一个订单的结束日期
+ const now = Date.now()
+ if (now < list[0].startTime) {
+ e.startTime = list[0].startTime
+ e.endTime = connect ? list[list.length - 1].endTime : list[0].endTime
+ e.status = '未生效'
+ } else if (now > list[list.length - 1].endTime) {
+ e.status = '已过期'
+ } else {
+ // 连续订单
+ if (connect) {
+ e.startTime = list[0].startTime
+ e.endTime = list[list.length - 1].endTime
+ e.status = '生效中'
+ } else {
+ for (const i in list) {
+ const n = list[i]
+ if (now >= new Date(n.startTime).getTime() && now <= new Date(n.endTime).getTime()) {
+ // 生效中的订单,直接取该订单的开始结束日期
+ e.startTime = n.startTime
+ e.endTime = n.endTime
+ e.status = '生效中'
+ e.orderEnable = n.isEnable
+ // 如果还有未生效的订单
+ if (list[i + 1]) {
+ e.other = '还有‘’2022-7.01-8.01的订单还未生效'
+ }
+ break
+ } else if (i && now > new Date(list[i - 1].endTime).getTime() && now < new Date(n.startTime).getTime()) {
+ // 当前时间位于两个订单时间之间,则取次订单的开始结束日期,并且为未生效
+ e.startTime = n.startTime
+ e.endTime = n.endTime
+ e.status = '未生效'
+ break
+ }
+ }
+ }
+ }
+ e.remain = this.getRemain(e.startTime, e.endTime) // 获取剩余期限
+ e.startTime = e.startTime.replace(' 00:00:00', '')
+ e.endTime = e.endTime.replace(' 00:00:00', '')
+ e.isEnable = connect ?
+ 1 :
+ (e.status === '已过期' || !e.orderEnable) ?
+ 0 :
+ e.status === '生效中' ?
+ 1 :
+ 0
+ })
+ this.products = data
+ this.productAll = data
+ }).catch(res => {})
+ },
+ // 获取剩余日期
+ getRemain(startTime, endTime) {
+ return (new Date(endTime).getTime() - new Date(startTime).getTime()) / 86400000
+ },
+ // 已订阅产品筛选
+ filterForm2() {
+ const list = this.productAll
+ const { productType, status, keyword } = this.form2
+ this.products = list.filter(e => e.status === status && e.productName.includes(keyword))
+ },
+
+ // 订单记录
+ getOrder() {
+ let data = {
+ cityId: '',
+ customerName: this.form.customerName,
+ orderStatus: '',
+ orderType: '',
+ pageNo: this.pageOrder,
+ pageSize: this.pageSizeOrder,
+ provinceId: ''
+ };
+ this.$post(this.api.orderList, data).then(({ orderPage }) => {
+ orderPage.orders.forEach(e => {
+ e.orderType = this.orderTypeFn(e.orderType)
+ e.orderStatus = this.orderStatusFn(e.orderStatus)
+ e.orderNature = this.orderNatureFn(e.orderNature)
+ });
+ this.orders = orderPage.orders
+ this.totals = orderPage.total
+ }).catch(res => {})
+ },
+
tabChange(index) {
this.curTab = index
},
@@ -513,12 +654,11 @@ export default {
this.industryList = res.list
}).catch(res => {});
},
- switchOff(val,row,index) {
- this.$get(this.api.updateEnabled,{
- id: row.id,
- isEnable: val
+ switchOff(val, row) {
+ this.$post(`${this.api.orderBulkDisableEnable}?isOpen=${val}`, {
+ ids: row.id
}).then(res => {
- this.$message.success(val ? '启用成功' : '禁用成功')
+ this.$message.success(val ? '禁用成功' : '启用成功')
}).catch(res => {})
},
phoneChange() { // 切换手机号
@@ -678,4 +818,8 @@ export default {
font-size: 26px;
color: #9278FF;
}
+/deep/.warning {
+ margin-left: 5px;
+ color: #9278FF;
+}
diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue
index 8938230..6d2f0bc 100644
--- a/src/views/order/AddOrder.vue
+++ b/src/views/order/AddOrder.vue
@@ -53,6 +53,9 @@
+
+
+
@@ -175,6 +178,15 @@
+
+
+
+
+ 万
+
+
+
@@ -188,6 +200,19 @@
+
+
+
+
+ 万
+
+
+
-
+
-
+
-
+
+
+
+
+
+ 万
+
+
+
@@ -633,7 +671,8 @@ export default {
phone: "",
orderAmount: 0,
// orderId: this.$store.state.orderId,
- customerName: ""// 客户名称
+ customerName: "",// 客户名称
+ businessManager: ''
},
coursePermissions: [],// 课程权限
dataPlatformPermissions: [],// 数据平台权限
diff --git a/src/views/parner/staff.vue b/src/views/parner/staff.vue
index 4e4c083..e9e8ed6 100644
--- a/src/views/parner/staff.vue
+++ b/src/views/parner/staff.vue
@@ -113,35 +113,6 @@
加盟商、合作伙伴可以通过这个二维码加入 城市合伙人计划
-
-
-
-
- 模板下载
-
-
- 上传文件
-
-
部分数据导入失败,查看失败原因
-
-
-