diff --git a/src/App.vue b/src/App.vue
index 5cda722..d6ff496 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -3,6 +3,7 @@
刘榕ip
陈赓ip
+ 测试服ip
diff --git a/src/setting.js b/src/setting.js
index e72a2b5..a0cd797 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -15,8 +15,8 @@ if (isDev) {
sandPath = `http://${location.hostname}:9520`
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
- host = localStorage.getItem('nakadaiIp') == 1 ? 'http://192.168.31.51:9000/' : 'http://192.168.31.217:9000/'
- // host = 'http://192.168.31.51:9000/'
+ const ips = ['http://192.168.31.217:9000/', 'http://192.168.31.51:9000/', 'http://121.37.12.51/']
+ host = ips[+localStorage.getItem('nakadaiIp')]
} else if (isPro) {
sandPath = `https://izhixinyun.com/sandbox`
jumpPath = 'https://judgment.huorantech.cn/'
diff --git a/src/views/Login.vue b/src/views/Login.vue
index b0075ab..eecc038 100644
--- a/src/views/Login.vue
+++ b/src/views/Login.vue
@@ -9,125 +9,78 @@
-
+
依据国家政策法规,需绑定手机号进行网络实名才可登录使用本平台
-
+
-
+
-
- {{phoneBtnText}}
+
+ {{ phoneBtnText
+ }}
-
-
+
@@ -249,7 +202,8 @@ export default {
}).catch(err => {
if (err.status === 30001) {
this.phoneVisible = true
- } else if (err.status == 10004) {
+ } else if (err.status == 10004 || err.status == 10005) {
+ param.code = ''
this.blur()
}
});
@@ -343,143 +297,166 @@ export default {
\ No newline at end of file
diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue
index d6ce0c8..3da098b 100644
--- a/src/views/order/AddOrder.vue
+++ b/src/views/order/AddOrder.vue
@@ -11,8 +11,12 @@
返回
{{ titlesw }}
- 确定
-
+
+ 一键发货
+
+ 确定
+
+
@@ -66,7 +70,7 @@
+ @change="orderTypeChange">
@@ -125,6 +129,17 @@
+
+
+
+
+
+
+
-
-
-
+
@@ -188,7 +201,7 @@
元
@@ -262,6 +275,17 @@
+
+
+
+
+
+
+
-
-
-
+
@@ -293,7 +315,7 @@
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)"
placeholder="请选择使用日期">
- - {{ scope.row.endTime
+ - {{ scope.row.endTime
}}
@@ -325,7 +347,7 @@
元
@@ -399,7 +421,18 @@
-
+
+
+
+
+
+
+
+
-
-
-
+
@@ -474,7 +506,7 @@
-
+
-
+
元
-
+
+
+
+
+
+
+
+
-
-
-
+
@@ -679,13 +720,23 @@
-
+
+
+
+
+
+
+
-
-
-
+
@@ -749,7 +798,7 @@
元
@@ -821,6 +870,17 @@
+
+
+
+
+
+
+
-
-
-
+
@@ -884,7 +942,7 @@
元
@@ -1098,30 +1156,42 @@ export default {
return {
// authority: 权限。0数据平台,1为课程,2职站增值模块,3实训课程(非集成),4实验工具
deliverShow: ['pageTypes', 'dataPageTypes', 'modelPageTypes', 'practiceCourseTypes', 'expToolTypes', 'theoryCourse'],
- listName: [
+ productProps: [
{
id: 1,
- name: 'coursePermissions'
+ name: 'coursePermissions',
+ deadline: '',
+ unit: 2,
},
{
id: 2,
- name: 'theoryCourseList'
+ name: 'theoryCourseList',
+ deadline: '',
+ unit: 2,
},
{
id: 3,
- name: 'valuePermissions'
+ name: 'valuePermissions',
+ deadline: '',
+ unit: 2,
},
{
id: 4,
- name: 'practicalCourses'
+ name: 'practicalCourses',
+ deadline: '',
+ unit: 2,
},
{
id: 5,
- name: 'dataPlatformPermissions'
+ name: 'dataPlatformPermissions',
+ deadline: '',
+ unit: 2,
},
{
id: 6,
- name: 'expTools'
+ name: 'expTools',
+ deadline: '',
+ unit: 2,
},
],
pageTypes: false,
@@ -1310,7 +1380,23 @@ export default {
// 用于区分栏目 1实训课程 2理论课程 3职站增值应用 4实训课程(非集成)5数据前瞻 6实验工具
classificationId: 0,
// 理论课程数据
- theoryCourseList: []
+ theoryCourseList: [],
+ units: [
+ {
+ id: 0,
+ name: '日'
+ },
+ {
+ id: 1,
+ name: '月'
+ },
+ {
+ id: 2,
+ name: '年'
+ },
+ ],
+ batchDeadline1: '',
+ batchUnit1: 2,
};
},
watch: {
@@ -1488,16 +1574,25 @@ export default {
* type 正式为1
* 试用为2
*/
- updateOrderType (type) {
- console.log('options=>', type)
+ orderTypeChange (type) {
if (type == 1) {
- this.coursePermissions.forEach(item => {
- this.dealSettlePrice(item)
+ this.coursePermissions.forEach(e => {
+ this.dealSettlePrice(e)
+ this.calculateDiscountCourse(e)
})
} else {
- this.coursePermissions.forEach(item => {
- item.finalPrice = 0
- item.settlementPrice = 0
+ this.productProps.map(e => {
+ this[e.name].map(n => {
+ n.finalPrice = 0
+ n.settlementPrice = 0
+ // 如果使用期限没填,则默认1月
+ if (!n.periodOfUse) {
+ n.periodOfUse = 1
+ n.options = 1
+ this.deadLine(n.periodOfUse, n, n.options, 1)
+ }
+ this.calculateDiscountCourse(n)
+ })
})
}
},
@@ -1524,7 +1619,7 @@ export default {
e.periodOfUse = "";
} else if (!this.viewDisabled) { // 如果不是查看
e.startTime = cur.startTime.split(" ")[0];
- e.endTime = cur.endTime.split(" ")[0];
+ if (cur.endTime) e.endTime = cur.endTime.split(" ")[0];
}
// }
if (item && this.renewDisabled) {
@@ -1577,6 +1672,29 @@ export default {
const curClient = this.clients.find(e => e.customerId == customerId)
this.$post(`${this.api.refreshCache}?schoolId=${curClient ? curClient.schoolId : ''}`).then(res => { }).catch(res => { })
},
+ // 一键发货
+ shipAll () {
+ this.productProps.map(e => {
+ this[e.name].map(n => {
+ n.ship = 1
+ n.isEnable = 1
+ })
+ })
+ },
+ // 批量设置产品时间
+ batchDeadlineChange (i) {
+ this[this.productProps[i].name].map(e => {
+ e.periodOfUse = this.productProps[i].deadline
+ this.deadLine(e.periodOfUse, e, e.options, 1)
+ })
+ },
+ // 批量设置产品期限单位
+ batchUnitChange (i) {
+ this[this.productProps[i].name].map(e => {
+ e.options = this.productProps[i].unit
+ this.deadLine(e.periodOfUse, e, e.options, 1)
+ })
+ },
// 新增订单
submitOrder () {
let purchase = 0 // 总采购成本
@@ -1798,10 +1916,9 @@ export default {
// 更换了订单客户后重新获取结算价
getSettlemennt () {
const list = []
- this.listName.map(e => e.name).forEach(e => {
+ this.productProps.map(e => e.name).forEach(e => {
list.push(...this[e])
})
- console.log("🚀 ~ file: AddOrder.vue:1954 ~ getSettlemennt ~ list:", list)
list.map(e => {
this.$post(`${this.api.queryCitySettlementPrice}?mallId=${e.mallId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`).then(res => {
@@ -1898,7 +2015,7 @@ export default {
},
practicalCoursesSelectable (row, index) { // 禁止勾选已经选过的数据平台
let boolean = true;
- const { name } = this.listName.find(e => e.id == this.classificationId)
+ const { name } = this.productProps.find(e => e.id == this.classificationId)
this[name].length && this[name].some(e => {
if (e.mallId == row.mallId) {
boolean = false;
@@ -1938,13 +2055,13 @@ export default {
break;
}
const { orderType } = this.form
- const { name } = this.listName.find(e => e.id == that.classificationId)
- let fn = function (e) {
- that[name].push({
+ const { name } = this.productProps.find(e => e.id == that.classificationId)
+ let createProduct = function (e) {
+ const row = {
dataOrCourseId: e.associatedProduct,// id
mallId: e.mallId,
productName: e.productName,// 名称
- periodOfUse: "",// 使用期限
+ periodOfUse: orderType === 2 ? 1 : '',// 使用期限
startTime: new Date(),// 开始
endTime: "", // 终止
remainingPeriod: "",// 剩余期限
@@ -1958,11 +2075,12 @@ export default {
isEnable: 0, // 启用否:1启用,0禁用
ship: 0,// 发货否(0未发货,1已发货,默认不发货)
authority, // 区分权限
- options: 2,
+ options: orderType === 2 ? 1 : 2,
settlementPrice: orderType === 2 ? 0 : '', // 结算价
settlementPriceUnit: e.settlementPrice || 0, // 结算单价
mallNonAssociatedLinks: e.mallNonAssociatedLinks // 产品链接
- })
+ }
+ that[name].push(row)
};
const productId = []
this.practicalCoursesSelect.map(e => {// 取得选中的值,进行赋值
@@ -1975,33 +2093,37 @@ export default {
if (mall) {
e.settlementPrice = mall.discountRate
}
- fn(e);
+ createProduct(e)
}).catch((res) => { })
}
});
- this.practicalCourseVisible = false;
- this.practicalCourseName = "";
- this.practicalCoursesSelect = [];
+ this.practicalCourseVisible = false
+ this.practicalCourseName = ''
+ this.practicalCoursesSelect = []
/* 调接口,判断是否为客户已有的产品功能 */
- productId.length && await this.$post(this.api.renew, {
- authority,
- customerId: this.form.customerId,
- productId,
- }).then(res => {
+ if (productId.length) {
+ const res = await this.$post(this.api.renew, {
+ authority,
+ customerId: this.form.customerId,
+ productId,
+ })
this[name].map(e => {
- res.orderOthers.map(el => {
- if (el.dataOrCourseId == e.dataOrCourseId && el.authority == authority) {
- let time = new Date(el.endTime)
- time = new Date(time.setDate(time.getDate() + 1))
- e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}`
- e.endTime = "";
- e.periodOfUse = "";
- e.renew = true;
- }
- });
- });
- });
+ const cur = res.orderOthers.find(n => n.mallId === e.mallId && n.dataOrCourseId == e.dataOrCourseId && n.authority == authority)
+ if (cur) {
+ let time = new Date(cur.endTime)
+ time = new Date(time.setDate(time.getDate() + 1))
+ e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}`
+ e.endTime = ''
+ // e.periodOfUse = orderType === 2 ? 0 : ''
+ e.renew = true
+ }
+ if (orderType === 2) {
+ this.deadLine(e.periodOfUse, e, e.options, 1)
+ this.calculateDiscountCourse(e)
+ }
+ })
+ }
} else {
return this.$message.warning("请选择数据");
}
@@ -2086,10 +2208,10 @@ export default {
return isNaN(val) ? 0 : val
},
// 课程计算折扣率
- calculateDiscountCourse (val, row) {
+ calculateDiscountCourse (row) {
const { finalPrice, marketValue } = row
// (原价-现价)÷原价 x100%
- if (finalPrice) row.discountRate = marketValue == 0 ? '0%' : ((marketValue - finalPrice) / marketValue * 100).toFixed(2) + "%";
+ if (finalPrice !== '') row.discountRate = marketValue == 0 ? '0%' : ((marketValue - finalPrice) / marketValue * 100).toFixed(2) + "%";
},
// 数据计算折扣率
calculateDiscount (val, row) {
@@ -2105,7 +2227,7 @@ export default {
}
},
// 计算订单总额
- allAmount ($event, row) {
+ allAmount (row) {
this.dealSettlePrice(row)
let total = 0
const list = [...this.coursePermissions, ...this.dataPlatformPermissions, ...this.practicalCourses, ...this.expTools]
@@ -2139,7 +2261,7 @@ export default {
}
}
this.dealSettlePrice(row)
- this.allAmount(e, row)
+ this.allAmount(row)
},
// 计算结算价
dealSettlePrice (row) {
@@ -2177,10 +2299,11 @@ export default {
let time = new Date(row.startTime).getTime();
let endTime = time + optionsData
- row.endTime = time + optionsData
var timestamp = endTime;
var dt = new Date(timestamp); //根据时间戳生成的时间对象
+ // debugger
row.endTime = (dt.getFullYear()) + "-" + (dt.getMonth() + 1) + "-" + (dt.getDate())
+ console.log("🚀 ~ deadLine ~ row.endTime:", row.endTime)
let endYear = timestamp - time
let endYears = endYear / 1000 / 60 / 60 / 24
row.remainingPeriod = endYears
@@ -2195,7 +2318,7 @@ export default {
price * useUnit)).toFixed(2)
this.dealComputers(e, row)
- row.authority ? this.calculateDiscountCourse(e, row) : this.calculateDiscount(e, row)
+ row.authority ? this.calculateDiscountCourse(row) : this.calculateDiscount(e, row)
// 只有改变了起止日期才需要调接口查询订单,该接口作用是把开始时间传过去,会返回一个提示或者时间,如果是时间,则把时间+1天,如果是提示,则无法保存
if (isDate) {
@@ -2442,6 +2565,10 @@ export default {
width: 100px;
}
+.batch-time {
+ width: 110px !important;
+}
+
.time-input {
width: 90px !important;
}
diff --git a/src/views/serve/Configure.vue b/src/views/serve/Configure.vue
index bc4f5b1..f302dd0 100644
--- a/src/views/serve/Configure.vue
+++ b/src/views/serve/Configure.vue
@@ -1,7 +1,6 @@
-
+
@@ -12,37 +11,23 @@
-
-
+
+
-
-
+
+
-
+
@@ -50,84 +35,53 @@
-
+
-
+
-
+
-
-
+
+
{{ types[scope.row.type] }}
-
-
+
+
{{ belongs[scope.row.belong] }}
-
+
{{ states[scope.row.state] }}
-
+
- 进入
+ 进入
-
+
- 进入
+ 进入
-
+
- 进入
+ 进入
@@ -154,7 +108,7 @@ export default {
1: '外部产品',
0: '内部系统'
},
- types: ['编程类', '流程类'],
+ types: ['编程类', '流程类', 'AI类'],
states: ['运行中', '默认'],
page: +this.$route.query.page || 1,
pageSize: 10
@@ -227,10 +181,10 @@ export default {
-