|
|
@ -83,13 +83,13 @@ |
|
|
|
<ul class="filter"> |
|
|
|
<ul class="filter"> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>产品类型</label> |
|
|
|
<label>产品类型</label> |
|
|
|
<el-select v-model="form2.productType" clearable placeholder="请选择产品类型"> |
|
|
|
<el-select v-model="form2.productType" placeholder="请选择产品类型" @change="filterForm2"> |
|
|
|
<el-option v-for="(item,index) in productTypeList" :key="index" :label="item.name" :value="item.id"></el-option> |
|
|
|
<el-option v-for="(item,index) in productTypeList" :key="index" :label="item.name" :value="item.id"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>订阅状态</label> |
|
|
|
<label>订阅状态</label> |
|
|
|
<el-select v-model="form2.status" clearable placeholder="请选择订阅状态" @change="filterForm2"> |
|
|
|
<el-select v-model="form2.status" placeholder="请选择订阅状态" @change="filterForm2"> |
|
|
|
<el-option v-for="(item,index) in subStatusList" :key="index" :label="item.name" :value="item.name"></el-option> |
|
|
|
<el-option v-for="(item,index) in subStatusList" :key="index" :label="item.name" :value="item.name"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</li> |
|
|
|
</li> |
|
|
@ -98,7 +98,7 @@ |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-button type="primary">导出列表</el-button> |
|
|
|
<el-button type="primary" @click="exportList">导出列表</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="products" class="orderTable" stripe header-align="center" @selection-change="handleSelectionChange" row-key="customerId"> |
|
|
|
<el-table :data="products" class="orderTable" stripe header-align="center" @selection-change="handleSelectionChange" row-key="customerId"> |
|
|
@ -106,17 +106,16 @@ |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="productName" label="产品名称" align="center"></el-table-column> |
|
|
|
<el-table-column prop="productName" label="产品名称" align="center"></el-table-column> |
|
|
|
<el-table-column prop="courseName" label="产品类型" align="center"> |
|
|
|
<el-table-column prop="productTypeName" label="产品类型" align="center"></el-table-column> |
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{scope.row.authority ? '课程' : '数据'}} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="起止日期" align="center"> |
|
|
|
<el-table-column label="起止日期" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{scope.row.status === '已过期' ? '' : scope.row.startTime + ' ~ ' + scope.row.endTime}} |
|
|
|
{{ scope.row.status === '已过期' ? '' : scope.row.startAndEndTime }} |
|
|
|
<!-- <el-tooltip class="item" effect="dark" content="Top nbspCenter 提示文字" placement="top"> |
|
|
|
<el-tooltip v-if="scope.row.other" class="item" effect="dark" placement="top"> |
|
|
|
|
|
|
|
<div slot="content"> |
|
|
|
|
|
|
|
还有<span v-html="scope.row.other"></span><br>的订单还未生效 |
|
|
|
|
|
|
|
</div> |
|
|
|
<i class="el-icon-warning warning"></i> |
|
|
|
<i class="el-icon-warning warning"></i> |
|
|
|
</el-tooltip> --> |
|
|
|
</el-tooltip> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="剩余期限" align="center"> |
|
|
|
<el-table-column label="剩余期限" align="center"> |
|
|
@ -127,7 +126,7 @@ |
|
|
|
<el-table-column prop="status" label="订阅状态" align="center"></el-table-column> |
|
|
|
<el-table-column prop="status" label="订阅状态" align="center"></el-table-column> |
|
|
|
<el-table-column label="产品状态" align="center"> |
|
|
|
<el-table-column label="产品状态" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-switch v-model="scope.row.isEnable" :active-value="0" :inactive-value="1" :active-text="scope.row.isEnable ? '禁用' : '启用'" :disabled="scope.row.status !== '生效中'" @change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
<el-switch v-model="scope.row.isEnable" :active-value="1" :inactive-value="0" :active-text="scope.row.isEnable ? '启用' : '禁用'" :disabled="scope.row.status === '已过期'" @change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
@ -138,13 +137,13 @@ |
|
|
|
<ul class="filter"> |
|
|
|
<ul class="filter"> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>订单类型</label> |
|
|
|
<label>订单类型</label> |
|
|
|
<el-select v-model="form.provinces" clearable placeholder="请选择订单类型"> |
|
|
|
<el-select v-model="form3.orderType" clearable placeholder="请选择订单类型"> |
|
|
|
<el-option v-for="(item,index) in customerTypeList" :key="index" :label="item.name" :value="item.id"></el-option> |
|
|
|
<el-option v-for="(item,index) in orderTypeList" :key="index" :label="item.name" :value="item.id"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>订单状态</label> |
|
|
|
<label>订单状态</label> |
|
|
|
<el-select v-model="form.provinces" clearable placeholder="请选择订单状态"> |
|
|
|
<el-select v-model="form3.orderStatus" clearable placeholder="请选择订单状态"> |
|
|
|
<el-option v-for="(item,index) in orderStatusList" :key="index" :label="item.name" :value="item.id"></el-option> |
|
|
|
<el-option v-for="(item,index) in orderStatusList" :key="index" :label="item.name" :value="item.id"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</li> |
|
|
|
</li> |
|
|
@ -153,7 +152,7 @@ |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-input style="width: 250px;" placeholder="请输入订单编号、内容" prefix-icon="el-icon-search" clearable></el-input> |
|
|
|
<el-input style="width: 250px;" placeholder="请输入订单编号、内容" prefix-icon="el-icon-search" clearable v-model="form3.keyword"></el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="orders" class="orderTable" stripe header-align="center" @selection-change="handleSelectionChange" row-key="customerId"> |
|
|
|
<el-table :data="orders" class="orderTable" stripe header-align="center" @selection-change="handleSelectionChange" row-key="customerId"> |
|
|
@ -253,10 +252,13 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import pdf from '../../components/pdf.vue' |
|
|
|
import pdf from '../../components/pdf.vue' |
|
|
|
|
|
|
|
import util from '@/utils/util' |
|
|
|
|
|
|
|
import axios from 'axios' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
components:{pdf}, |
|
|
|
components:{pdf}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
token: sessionStorage.getItem('token'), |
|
|
|
customerId : this.$route.query.id, |
|
|
|
customerId : this.$route.query.id, |
|
|
|
isDetail : Boolean(this.$route.query.show), |
|
|
|
isDetail : Boolean(this.$route.query.show), |
|
|
|
curTab: 'tab1', |
|
|
|
curTab: 'tab1', |
|
|
@ -369,7 +371,7 @@ export default { |
|
|
|
name: '实训课程产品' |
|
|
|
name: '实训课程产品' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
id: 2, |
|
|
|
id: 0, |
|
|
|
name: '理论课程产品' |
|
|
|
name: '理论课程产品' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
@ -397,10 +399,20 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
pageOrder: 1, |
|
|
|
form3: { |
|
|
|
pageSizeOrder: 10, |
|
|
|
orderType: '', |
|
|
|
orders: [], |
|
|
|
orderStatus: '', |
|
|
|
|
|
|
|
keyword: '' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 订单类型 |
|
|
|
|
|
|
|
orderTypeList: [{ |
|
|
|
|
|
|
|
name: '正式', |
|
|
|
|
|
|
|
value: 1 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name: '试用', |
|
|
|
|
|
|
|
value: 2 |
|
|
|
|
|
|
|
}], |
|
|
|
// 订单状态 |
|
|
|
// 订单状态 |
|
|
|
orderStatusList: [ |
|
|
|
orderStatusList: [ |
|
|
|
{ |
|
|
|
{ |
|
|
@ -416,6 +428,10 @@ export default { |
|
|
|
name: '待发货' |
|
|
|
name: '待发货' |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
pageOrder: 1, |
|
|
|
|
|
|
|
pageSizeOrder: 10, |
|
|
|
|
|
|
|
orders: [], |
|
|
|
|
|
|
|
|
|
|
|
countryList: [{ |
|
|
|
countryList: [{ |
|
|
|
name:'中国' |
|
|
|
name:'中国' |
|
|
|
}], |
|
|
|
}], |
|
|
@ -467,7 +483,7 @@ export default { |
|
|
|
name: customer.name, |
|
|
|
name: customer.name, |
|
|
|
position: customer.position, |
|
|
|
position: customer.position, |
|
|
|
} |
|
|
|
} |
|
|
|
this.getOrder() |
|
|
|
// this.getOrder() |
|
|
|
this.contractInformations = res.result.contractInformations.filter(e => e.contractNumber || e.contractName); // 必须有合同编号或者名称,否则不展示 |
|
|
|
this.contractInformations = res.result.contractInformations.filter(e => e.contractNumber || e.contractName); // 必须有合同编号或者名称,否则不展示 |
|
|
|
this.coursePermissionss = res.result.coursePermissionss |
|
|
|
this.coursePermissionss = res.result.coursePermissionss |
|
|
|
this.dataPermissionss = res.result.dataPermissionss |
|
|
|
this.dataPermissionss = res.result.dataPermissionss |
|
|
@ -483,8 +499,9 @@ export default { |
|
|
|
// 获取已订阅产品 |
|
|
|
// 获取已订阅产品 |
|
|
|
getProduct() { |
|
|
|
getProduct() { |
|
|
|
this.$get(this.api.getProductsSubscribedByCustomers, { |
|
|
|
this.$get(this.api.getProductsSubscribedByCustomers, { |
|
|
|
customeId: this.customerId |
|
|
|
customeId: 19 |
|
|
|
}).then(({ data }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
|
|
|
|
const { productTypeList } = this |
|
|
|
data.map(e => { |
|
|
|
data.map(e => { |
|
|
|
const list = e.startAndEndTimeList |
|
|
|
const list = e.startAndEndTimeList |
|
|
|
let connect = true // 每个订单的开始结束日期是否连续 |
|
|
|
let connect = true // 每个订单的开始结束日期是否连续 |
|
|
@ -508,6 +525,7 @@ export default { |
|
|
|
e.startTime = list[0].startTime |
|
|
|
e.startTime = list[0].startTime |
|
|
|
e.endTime = list[list.length - 1].endTime |
|
|
|
e.endTime = list[list.length - 1].endTime |
|
|
|
e.status = '生效中' |
|
|
|
e.status = '生效中' |
|
|
|
|
|
|
|
e.orderEnable = list[0].isEnable |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
for (const i in list) { |
|
|
|
for (const i in list) { |
|
|
|
const n = list[i] |
|
|
|
const n = list[i] |
|
|
@ -517,16 +535,13 @@ export default { |
|
|
|
e.endTime = n.endTime |
|
|
|
e.endTime = n.endTime |
|
|
|
e.status = '生效中' |
|
|
|
e.status = '生效中' |
|
|
|
e.orderEnable = n.isEnable |
|
|
|
e.orderEnable = n.isEnable |
|
|
|
// 如果还有未生效的订单 |
|
|
|
|
|
|
|
if (list[i + 1]) { |
|
|
|
|
|
|
|
e.other = '还有‘’2022-7.01-8.01的订单还未生效' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break |
|
|
|
break |
|
|
|
} else if (i && now > new Date(list[i - 1].endTime).getTime() && now < new Date(n.startTime).getTime()) { |
|
|
|
} else if (i && now > new Date(list[i - 1].endTime).getTime() && now < new Date(n.startTime).getTime()) { |
|
|
|
// 当前时间位于两个订单时间之间,则取次订单的开始结束日期,并且为未生效 |
|
|
|
// 当前时间位于两个订单时间之间,则取次订单的开始结束日期,并且为未生效 |
|
|
|
e.startTime = n.startTime |
|
|
|
e.startTime = n.startTime |
|
|
|
e.endTime = n.endTime |
|
|
|
e.endTime = n.endTime |
|
|
|
e.status = '未生效' |
|
|
|
e.status = '未生效' |
|
|
|
|
|
|
|
e.orderEnable = n.isEnable |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -535,13 +550,19 @@ export default { |
|
|
|
e.remain = this.getRemain(e.startTime, e.endTime) // 获取剩余期限 |
|
|
|
e.remain = this.getRemain(e.startTime, e.endTime) // 获取剩余期限 |
|
|
|
e.startTime = e.startTime.replace(' 00:00:00', '') |
|
|
|
e.startTime = e.startTime.replace(' 00:00:00', '') |
|
|
|
e.endTime = e.endTime.replace(' 00:00:00', '') |
|
|
|
e.endTime = e.endTime.replace(' 00:00:00', '') |
|
|
|
e.isEnable = connect ? |
|
|
|
e.startAndEndTime = e.startTime + ' ~ ' + e.endTime |
|
|
|
1 : |
|
|
|
// 如果还有未生效的订单,页面上要显示出来 |
|
|
|
(e.status === '已过期' || !e.orderEnable) ? |
|
|
|
if (e.notActiveList.length) { |
|
|
|
0 : |
|
|
|
e.other = '' |
|
|
|
e.status === '生效中' ? |
|
|
|
e.notActiveList.map(j => { |
|
|
|
1 : |
|
|
|
e.other += `<br>${j.startTime.replace(' 00:00:00', '')} ~ ${j.endTime.replace(' 00:00:00', '')}` |
|
|
|
0 |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
e.productTypeName = productTypeList.find(n => n.id === e.productType).name |
|
|
|
|
|
|
|
// 1开启 0禁用(已过期的订单,或者当前生效的订单为禁用,则显示为禁用,否则是启用) |
|
|
|
|
|
|
|
e.isEnable = (e.status === '已过期' || !e.orderEnable) ? |
|
|
|
|
|
|
|
0 : |
|
|
|
|
|
|
|
1 |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.products = data |
|
|
|
this.products = data |
|
|
|
this.productAll = data |
|
|
|
this.productAll = data |
|
|
@ -555,7 +576,31 @@ export default { |
|
|
|
filterForm2() { |
|
|
|
filterForm2() { |
|
|
|
const list = this.productAll |
|
|
|
const list = this.productAll |
|
|
|
const { productType, status, keyword } = this.form2 |
|
|
|
const { productType, status, keyword } = this.form2 |
|
|
|
this.products = list.filter(e => e.status === status && e.productName.includes(keyword)) |
|
|
|
this.products = list.filter(e => (productType === '' || productType === e.productType) && (e.status === status || status === '全部') && e.productName.includes(keyword)) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 已订阅产品导出 |
|
|
|
|
|
|
|
exportList() { |
|
|
|
|
|
|
|
let list = this.productAll |
|
|
|
|
|
|
|
if(this.multipleSelection.length) list = this.multipleSelection |
|
|
|
|
|
|
|
const data = [] |
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
data.push({ |
|
|
|
|
|
|
|
productName: e.productName, |
|
|
|
|
|
|
|
productStatus: e.status, |
|
|
|
|
|
|
|
productType: e.productName, |
|
|
|
|
|
|
|
remainingPeriod: e.remain, |
|
|
|
|
|
|
|
startAndEndTime: e.startAndEndTime, |
|
|
|
|
|
|
|
subscriptionStatus: e.isEnable ? '启用' : '禁用', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
axios.post(this.api.exportSubscribedRecords, data, { |
|
|
|
|
|
|
|
headers: { |
|
|
|
|
|
|
|
token: this.token |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
responseType: 'blob' |
|
|
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
|
|
util.downloadFileDirect(`已订阅产品.xls`, new Blob([res.data])) |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 订单记录 |
|
|
|
// 订单记录 |
|
|
@ -655,11 +700,9 @@ export default { |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => {}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
switchOff(val, row) { |
|
|
|
switchOff(val, row) { |
|
|
|
this.$post(`${this.api.orderBulkDisableEnable}?isOpen=${val}`, { |
|
|
|
this.$post(`${this.api.orderBulkDisableEnable}?isOpen=${val}`, row.startAndEndTimeList.map(e => e.id)).then(res => { |
|
|
|
ids: row.id |
|
|
|
this.$message.success(val ? '启用成功' : '禁用成功') |
|
|
|
}).then(res => { |
|
|
|
}).catch(res => {}) |
|
|
|
this.$message.success(val ? '禁用成功' : '启用成功') |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
phoneChange() { // 切换手机号 |
|
|
|
phoneChange() { // 切换手机号 |
|
|
|
let regex = /^1[3456789]\d{9}$/; |
|
|
|
let regex = /^1[3456789]\d{9}$/; |
|
|
|