wanyongkang
2020-10-20 19:00:09 +08:00
parent b19e646df1
commit e41cd9a07a
2 changed files with 293 additions and 165 deletions

View File

@@ -10,14 +10,42 @@
v-if="$local.isRoot()" v-if="$local.isRoot()"
>导出</el-button> >导出</el-button>
<div class="search-box"> <div class="search-box">
<el-cascader <!-- <el-cascader
placeholder="选择产品/套餐" placeholder="选择产品/套餐"
size="small" size="small"
v-model="searchModel.pModel" v-model="searchModel.pModel"
:options="options" :options="options"
:props="{ checkStrictly: true}" :props="{ checkStrictly: true}"
clearable clearable
></el-cascader> ></el-cascader> -->
<el-select
v-model="searchModel.ProductIds"
multiple
collapse-tags
style="margin-left: 10px;"
size=small
placeholder="请选择产品">
<el-option
v-for="item in products"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select
v-model="searchModel.PackageNames"
multiple
collapse-tags
style="margin-left: 10px;"
size=small
placeholder="请选择套餐">
<el-option
v-for="item in packages"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<!-- <el-select v-model="searchModel.ProductId" placeholder="选择产品" clearable size="small"> <!-- <el-select v-model="searchModel.ProductId" placeholder="选择产品" clearable size="small">
<el-option v-for="item in products" :key="item.Name" :label="item.Name" :value="item.Id"></el-option> <el-option v-for="item in products" :key="item.Name" :label="item.Name" :value="item.Id"></el-option>
</el-select> --> </el-select> -->
@@ -27,6 +55,7 @@
collapse-tags collapse-tags
clearable clearable
size="small" size="small"
style="margin-left: 10px;"
placeholder="选择类型" placeholder="选择类型"
> >
<el-option v-for="item in types" :key="item.text" :label="item.text" :value="item.value"></el-option> <el-option v-for="item in types" :key="item.text" :label="item.text" :value="item.value"></el-option>
@@ -38,11 +67,13 @@
range-separator="" range-separator=""
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
style="margin-left: 10px;"
></el-date-picker> ></el-date-picker>
<el-input <el-input
v-model="searchModel.keyWord" v-model="searchModel.keyWord"
placeholder="请输入订单号、订单名称、用户名" placeholder="请输入订单号、订单名称、用户名"
clearable clearable
style="margin-left: 10px;"
size="small" size="small"
> >
<el-button slot="append" icon="el-icon-search" @click="search"></el-button> <el-button slot="append" icon="el-icon-search" @click="search"></el-button>
@@ -120,10 +151,31 @@ export default {
retData: { TotalCount: 0, Data: [] }, retData: { TotalCount: 0, Data: [] },
dateRange: [], dateRange: [],
products: [], products: [],
packages: [
{
label: '年卡',
value: '年卡'
}, {
label: '季卡',
value: '季卡'
}, {
label: '月卡',
value: '月卡'
}, {
label: '周卡',
value: '周卡'
}, {
label: '天卡',
value: '天卡'
}, {
label: '测试卡',
value: '测试卡'
}
],
searchModel: { searchModel: {
PageIndex: 1, PageIndex: 1,
ProductId: null, ProductIds: [],
PackageId: null, PackageNames: [],
keyWord: '', keyWord: '',
Status: 0, Status: 0,
PayType: 0, PayType: 0,
@@ -169,8 +221,8 @@ export default {
created () { created () {
this.$store.commit('setCurrentNav', '订单管理>>订单明细') this.$store.commit('setCurrentNav', '订单管理>>订单明细')
this.get() this.get()
// this.getProduct() this.getProduct()
this.getProductWithPackage() // this.getProductWithPackage()
}, },
methods: { methods: {
search () { search () {
@@ -182,10 +234,6 @@ export default {
this.searchModel.Btime = this.dateRange[0] this.searchModel.Btime = this.dateRange[0]
this.searchModel.Etime = this.dateRange[1] this.searchModel.Etime = this.dateRange[1]
} }
if (this.searchModel.pModel.length > 0) {
this.searchModel.ProductId = this.searchModel.pModel[0]
}
if (this.searchModel.pModel.length > 0) { this.searchModel.PackageId = this.searchModel.pModel[1] }
this.$api.get('course/v1/order/page', this.searchModel).then(res => { this.$api.get('course/v1/order/page', this.searchModel).then(res => {
this.retData = res this.retData = res
}) })
@@ -193,28 +241,34 @@ export default {
getProduct () { getProduct () {
this.loading = true this.loading = true
this.$api.get('course/v1/product/page', this.searchModel).then(res => { this.$api.get('course/v1/product/page', this.searchModel).then(res => {
this.products = res.Data res.Data.forEach(m => {
var product = {
label: m.Name,
value: m.Id
}
this.products.push(product)
})
this.loading = false this.loading = false
}) })
this.loading = false
}, },
getProductWithPackage () { getProductWithPackage () {
this.loading = true this.loading = true
this.$api.get('course/v1/product/ProductWithPackage').then(res => { this.$api.get('course/v1/product/ProductWithPackage').then(res => {
this.options = res.Data
var options = [] var options = []
res.Data.forEach(m => { res.Data.forEach(m => {
var product = { var product = {
label: m.Product.Name, label: m.Product.Name,
value: m.Product.Id, value: m.Product.Id
children: []
} }
this.products.push(product)
m.Packages.forEach(p => { m.Packages.forEach(p => {
var pkg = { var pkg = {
label: p.Name, label: p.Name,
value: p.Id value: p.Id
} }
product.children.push(pkg) this.pa.push(pkg)
}) })
options.push(product) options.push(product)
}) })

View File

@@ -8,20 +8,49 @@
<!-- <el-button size="small" type="primary" icon="el-icon-edit">老账号认证</el-button> --> <!-- <el-button size="small" type="primary" icon="el-icon-edit">老账号认证</el-button> -->
<div class="search-box"> <div class="search-box">
<el-cascader <!-- <el-cascader
placeholder="选择产品/套餐" placeholder="选择产品/套餐"
size="small" size="small"
v-model="searchModel.pModel" v-model="searchModel.pModel"
:options="options" :options="options"
:props="{ checkStrictly: true}" :props="{ checkStrictly: true}"
clearable clearable
></el-cascader> ></el-cascader> -->
<el-select
v-model="searchModel.ProductIds"
multiple
collapse-tags
style="width:200px;"
size=small
placeholder="请选择产品">
<el-option
v-for="item in products"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select
v-model="searchModel.PackageNames"
multiple
collapse-tags
style="width:200px;"
size=small
placeholder="请选择套餐">
<el-option
v-for="item in packages"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<!-- <el-select v-model="searchModel.ProductId" placeholder="选择产品" clearable size="small"> <!-- <el-select v-model="searchModel.ProductId" placeholder="选择产品" clearable size="small">
<el-option v-for="item in products" :key="item.Name" :label="item.Name" :value="item.Id"></el-option> <el-option v-for="item in products" :key="item.Name" :label="item.Name" :value="item.Id"></el-option>
</el-select> --> </el-select> -->
<el-select <el-select
v-model="searchModel.accountTypes" v-model="searchModel.accountTypes"
multiple multiple
style="width:150px;"
collapse-tags collapse-tags
clearable clearable
size="small" size="small"
@@ -31,13 +60,23 @@
</el-select> </el-select>
<el-date-picker <el-date-picker
size="small" size="small"
style="width:200px"
v-model="dateRange1"
type="daterange"
range-separator=""
start-placeholder="账号开通"
end-placeholder="日期选择"
></el-date-picker>
<el-date-picker
size="small"
style="width:200px"
v-model="dateRange" v-model="dateRange"
type="daterange" type="daterange"
range-separator="" range-separator=""
start-placeholder="开始日" start-placeholder="账号到"
end-placeholder="结束日期" end-placeholder="日期选择"
></el-date-picker> ></el-date-picker>
<el-select v-model="searchModel.ExpirdDay" placeholder="选择过期时间" clearable size="small"> <el-select v-model="searchModel.ExpirdDay" placeholder="选择过期时间" style="width:100px" clearable size="small">
<el-option <el-option
v-for="item in expirdtypes" v-for="item in expirdtypes"
:key="item.text" :key="item.text"
@@ -127,75 +166,100 @@
</template> </template>
<script> <script>
export default { export default {
name: "treeTable", name: 'treeTable',
components: { components: {
userDrawer: () => import("@/components/common/userDrawer"), userDrawer: () => import('@/components/common/userDrawer'),
phoneHide: () => import("@/components/common/phonehide") phoneHide: () => import('@/components/common/phonehide')
}, },
data() { data () {
return { return {
options: [], options: [],
showOnlineDialog:false, showOnlineDialog: false,
loading: false, loading: false,
loadingOnline:false, loadingOnline: false,
retData: { TotalCount: 0, Data: [] }, retData: { TotalCount: 0, Data: [] },
products: [], products: [],
packages: [
{
label: '年卡',
value: '年卡'
}, {
label: '季卡',
value: '季卡'
}, {
label: '月卡',
value: '月卡'
}, {
label: '周卡',
value: '周卡'
}, {
label: '天卡',
value: '天卡'
}, {
label: '测试卡',
value: '测试卡'
}
],
dateRange: [], dateRange: [],
dateRange1: [],
searchModel: { searchModel: {
ExpirdDay: -1, ExpirdDay: -1,
UserId: 0, UserId: 0,
PageIndex: 1, PageIndex: 1,
keyWord: "", keyWord: '',
ProductId: null, ProductIds: [],
PackageId:null, PackageNames: [],
accountTypes: null, accountTypes: null,
pModel:[], pModel: [],
Btime: "", Btime: '',
Etime: "", Etime: '',
Bktime: '',
Ektime: ''
}, },
onlineClient:[], onlineClient: [],
currentAccount: {}, currentAccount: {},
account: [], account: [],
types: [ types: [
{ text: "新开", value: 1 }, { text: '新开', value: 1 },
{ text: "批量新开", value: 2 }, { text: '批量新开', value: 2 },
{ text: "续费", value: 3 }, { text: '续费', value: 3 },
{ text: "批量续费", value: 4 }, { text: '批量续费', value: 4 },
{ text: "老账号认证", value: 100 }, { text: '老账号认证', value: 100 },
{ text: "测试", value: 200 } { text: '测试', value: 200 }
], ],
expirdtypes: [ expirdtypes: [
{ text: "全部", value: -1 }, { text: '全部', value: -1 },
{ text: "已过期", value: 0 }, { text: '已过期', value: 0 },
{ text: "1天过期", value: 1 }, { text: '1天过期', value: 1 },
{ text: "3天过期", value: 3 }, { text: '3天过期', value: 3 },
{ text: "1周过期", value: 7 } { text: '1周过期', value: 7 }
], ],
typeFormat(row, column, cellValue, index) { typeFormat (row, column, cellValue, index) {
switch (cellValue) { switch (cellValue) {
case 1: case 1:
return "新开"; return '新开'
case 2: case 2:
return "批量新开"; return '批量新开'
case 3: case 3:
return "续费"; return '续费'
case 4: case 4:
return "批量续费"; return '批量续费'
case 100: case 100:
return "老账号认证"; return '老账号认证'
case 200: case 200:
return "测试"; return '测试'
}
return ''
} }
return "";
} }
};
}, },
created () { created () {
this.$store.commit('setCurrentNav', '会员管理>>账号管理') this.$store.commit('setCurrentNav', '会员管理>>账号管理')
var userId = this.$route.query.userId var userId = this.$route.query.userId
if (userId) this.searchModel.UserId = userId if (userId) this.searchModel.UserId = userId
this.get() this.get()
this.getProductWithPackage() // this.getProductWithPackage()
this.getProduct()
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
let user_info = this.$local.getUserByCache().Manager.RealName let user_info = this.$local.getUserByCache().Manager.RealName
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
@@ -210,42 +274,49 @@ export default {
}, },
methods: { methods: {
search () { search () {
this.searchModel.PageIndex=1; this.searchModel.PageIndex = 1
this.get(); this.get()
}, },
get() { get () {
if (this.dateRange && this.dateRange.length == 2) { if (this.dateRange && this.dateRange.length === 2) {
this.searchModel.Btime = this.dateRange[0]; this.searchModel.Btime = this.dateRange[0]
this.searchModel.Etime = this.dateRange[1]; this.searchModel.Etime = this.dateRange[1]
}
if (this.dateRange1 && this.dateRange1.length === 2) {
this.searchModel.Bktime = this.dateRange1[0]
this.searchModel.Ektime = this.dateRange1[1]
} }
if(this.searchModel.pModel.length>0)
this.searchModel.ProductId=this.searchModel.pModel[0];
if(this.searchModel.pModel.length>0)
this.searchModel.PackageId=this.searchModel.pModel[1];
this.$api this.$api
.get("course/v1/productaccount/page", this.searchModel) .get('course/v1/productaccount/page', this.searchModel)
.then(res => { .then(res => {
this.retData = res; this.retData = res
}); })
}, },
getProduct() { getProduct () {
this.loading = true; this.loading = true
this.$api.get("course/v1/product/page", this.searchModel).then(res => { this.$api.get('course/v1/product/page', this.searchModel).then(res => {
this.products = res.Data; res.Data.forEach(m => {
this.loading = false; var product = {
}); label: m.Name,
value: m.Id
}
this.products.push(product)
})
this.loading = false
})
this.loading = false
}, },
getProductWithPackage() { getProductWithPackage () {
this.loading = true; this.loading = true
this.$api.get("course/v1/product/ProductWithPackage").then(res => { this.$api.get('course/v1/product/ProductWithPackage').then(res => {
this.options = res.Data; this.options = res.Data
var options = []; var options = []
res.Data.forEach(m => { res.Data.forEach(m => {
var product = { var product = {
label: m.Product.Name, label: m.Product.Name,
value: m.Product.Id, value: m.Product.Id,
children: [] children: []
}; }
m.Packages.forEach(p => { m.Packages.forEach(p => {
var pkg = { var pkg = {
@@ -254,116 +325,119 @@ export default {
} }
product.children.push(pkg) product.children.push(pkg)
}) })
options.push(product); options.push(product)
}); })
this.options=options; this.options = options
this.loading = false; this.loading = false
}); })
}, },
del(item) { del (item) {
var that = this; var that = this
this.$confirm("确定删除?", "", { this.$confirm('确定删除?', '', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(_ => { }).then(_ => {
this.$api this.$api
.post("course/v1/productaccount/Delete?id=" + item.Id) .post('course/v1/productaccount/Delete?id=' + item.Id)
.then(res => { .then(res => {
that.get(); that.get()
}); })
}); })
}, },
dels() { dels () {
var that = this; var that = this
if( this.account.length==0){ if (this.account.length === 0) {
// eslint-disable-next-line no-undef
$this.$warn('请选账号') $this.$warn('请选账号')
return return
} }
var ids= this.account.map(m => m.Id) var ids = this.account.map(m => m.Id)
this.$confirm("确定删除?", "", { this.$confirm('确定删除?', '', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(_ => { }).then(_ => {
this.$api this.$api
.post("course/v1/productaccount/Deletes",ids) .post('course/v1/productaccount/Deletes',ids)
.then(res => { .then(res => {
that.searchModel.PageIndex=1; that.searchModel.PageIndex = 1
that.get(); that.get()
}); })
}); })
}, },
goAdd() { goAdd () {
this.$router.push({ name: "addPackage", query: { optype: 1 } }); this.$router.push({ name: 'addPackage', query: { optype: 1 } })
}, },
goEdit(item) { goEdit (item) {
this.$router.push({ this.$router.push({
name: "addPackage", name: 'addPackage',
query: { id: item.Id, optype: 2 } query: { id: item.Id, optype: 2 }
}); })
}, },
batchSelectUser() { batchSelectUser () {
if (this.account.length == 0) { if (this.account.length == 0) {
this.$warn("请选择账号"); this.$warn('请选择账号')
return; return
} }
this.$refs["userDrawer"].show(); this.$refs['userDrawer'].show()
}, },
selectUser(row) { selectUser (row) {
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection()
this.$refs.multipleTable.toggleRowSelection(row); this.$refs.multipleTable.toggleRowSelection(row)
this.$refs["userDrawer"].show(); this.$refs['userDrawer'].show()
}, },
handleSelectionChange(val) { handleSelectionChange (val) {
this.account = val; this.account = val
}, },
onSelect(item) { onSelect (item) {
var data = { var data = {
AccountIds: this.account.map(m => m.Id), AccountIds: this.account.map(m => m.Id),
UserId: item.Id UserId: item.Id
};
this.$confirm("确定要迁移吗?").then(_ => {
this.$api.post("course/v1/productaccount/BindUser", data).then(res => {
this.get();
});
});
},
online(item){
this.showOnlineDialog=true;
this.loadingOnline=true;
var params={
productId:item.ProductId,
account:item.Account,
} }
this.onlineClient=[]; this.$confirm('确定要迁移吗?').then(_ => {
this.$api this.$api.post('course/v1/productaccount/BindUser', data).then(res => {
.get("course/v1/productaccount/OnLine", params) this.get()
.then(res => { })
this.loadingOnline=false,
this.onlineClient = res.Data;
this.onlineClient.forEach(m=>m.info=item)
}) })
}, },
killout(item){ online (item) {
var params={ this.showOnlineDialog = true
productId:item.info.ProductId, this.loadingOnline = true
id:item.Id, var params = {
productId: item.ProductId,
account: item.Account
}
this.onlineClient = []
this.$api
.get('course/v1/productaccount/OnLine', params)
.then(res => {
// eslint-disable-next-line no-unused-expressions
this.loadingOnline = false,
this.onlineClient = res.Data
// eslint-disable-next-line no-return-assign
this.onlineClient.forEach(m => m.info = item)
})
},
killout (item) {
var params = {
productId: item.info.ProductId,
id: item.Id
} }
this.$api this.$api
.get("course/v1/productaccount/KillOut",params) .get('course/v1/productaccount/KillOut', params)
.then(res => { .then(res => {
if(res.Data){ if (res.Data) {
this.$info("离线成功"); this.$info('离线成功')
} }
this.online(item.info) this.online(item.info)
}) })
}, },
dataExport(){ dataExport () {
this.$api.getDownloadFile("/course/v1/productaccount/Export"); this.$api.getDownloadFile('/course/v1/productaccount/Export')
} }
} }
}; }
</script> </script>
<style scoped> <style scoped>
.red { .red {