全站添加筛选功能缓存

dev_review V2.5.2
yujialong 7 months ago
parent 34d84486ea
commit ebf4e9ffbc
  1. 1
      src/components/Sidebar.vue
  2. 34
      src/store/index.js
  3. 12
      src/views/course/AddCurriculum.vue
  4. 662
      src/views/course/Curriculum.vue
  5. 10
      src/views/course/contentSettings.vue
  6. 13
      src/views/customer/AddCustomer.vue
  7. 288
      src/views/customer/Order.vue
  8. 23
      src/views/customer/customer.vue
  9. 431
      src/views/information/contentManage/contentList.vue
  10. 4
      src/views/match/add/index.vue
  11. 71
      src/views/match/add/step4.vue
  12. 53
      src/views/match/list/index.vue
  13. 2
      src/views/match/manage/index.vue
  14. 3
      src/views/match/manage/matchArch.vue
  15. 24
      src/views/match/manage/matchArchList.vue
  16. 25
      src/views/match/manage/matchRank.vue
  17. 7
      src/views/match/manage/matchSignup.vue
  18. 12
      src/views/order/AddOrder.vue
  19. 713
      src/views/order/Order.vue
  20. 101
      src/views/parnerOperation/index.vue
  21. 339
      src/views/parnerOperation/info.vue
  22. 339
      src/views/parnerOperation/learn.vue
  23. 10
      src/views/parnerOperation/learnMg.vue
  24. 221
      src/views/parnerOperation/mobileRole.vue
  25. 269
      src/views/parnerOperation/pcRole.vue
  26. 279
      src/views/parnerOperation/plan.vue
  27. 9
      src/views/parnerOperation/schemeSet.vue
  28. 268
      src/views/parnerOperation/staff.vue
  29. 122
      src/views/serve/Configure.vue
  30. 2
      src/views/serve/backstage/index.vue
  31. 10
      src/views/serve/backstage/model.vue
  32. 9
      src/views/serve/backstage/sourceModel.vue
  33. 4
      src/views/serve/projectAdd.vue
  34. 83
      src/views/serve/projectList.vue
  35. 9
      src/views/shop/addProduct/index.vue
  36. 77
      src/views/shop/list/index.vue
  37. 24
      src/views/shop/list/product/index.vue
  38. 6
      src/views/theoreticalCourse/add/index.vue
  39. 46
      src/views/theoreticalCourse/contentSettings/index.vue
  40. 46
      src/views/theoreticalCourse/list/buildPlatform/index.vue
  41. 594
      src/views/theoreticalCourse/list/courseManagement/index.vue
  42. 95
      src/views/theoreticalCourse/list/index.vue
  43. 10
      src/views/theoreticalCourse/preview/index.vue
  44. 482
      src/views/user/AddUser.vue
  45. 33
      src/views/user/User.vue

@ -138,7 +138,6 @@ export default {
methods: { methods: {
handleSelect (index) { handleSelect (index) {
this.onRoutes = index this.onRoutes = index
this.$store.commit('setOrderParam', null)
this.$store.commit('setInfoTab', '1') this.$store.commit('setInfoTab', '1')
this.$store.commit('setColumnId', '') this.$store.commit('setColumnId', '')
this.$store.commit('setCompetitionCache', null) this.$store.commit('setCompetitionCache', null)

@ -21,14 +21,13 @@ const store = new Vuex.Store({
projectFields: {}, projectFields: {},
btns: [], btns: [],
routes: [], routes: [],
customerPage: 1,
matchPage: 1,
platformSource: 0,
columnId: '', columnId: '',
tabId: '1', tabId: '1',
dataPer: [], dataPer: [],
orderParam: null, competitionCache: null,
competitionCache: null referrer: '',
innerReferrer: '',
orderParam: null,
}, },
actions: { actions: {
setSystemId({ state,commit },systemId) { setSystemId({ state,commit },systemId) {
@ -54,15 +53,6 @@ const store = new Vuex.Store({
SET_USERNAME (state, userName) { SET_USERNAME (state, userName) {
state.userName = userName state.userName = userName
}, },
SET_C_PAGE: (state, page) => {
state.customerPage = page
},
SET_M_PAGE: (state, page) => {
state.matchPage = page
},
SET_M_SOURCE: (state, platformSource) => {
state.platformSource = platformSource
},
courseData (state, payload) { courseData (state, payload) {
state.courseId = payload.course_id state.courseId = payload.course_id
}, },
@ -75,10 +65,6 @@ const store = new Vuex.Store({
configData (state, payload) { configData (state, payload) {
state.configId = payload.config_id state.configId = payload.config_id
}, },
systemData (state, payload) {
state.systemId = payload.system_id
state.orderId = payload.order_id
},
userLoginData (state, payload) { userLoginData (state, payload) {
state.userLoginId = payload.userLogin_id state.userLoginId = payload.userLogin_id
state.userName = payload.userName state.userName = payload.userName
@ -105,12 +91,18 @@ const store = new Vuex.Store({
setInfoTab: (state, tabId) => { setInfoTab: (state, tabId) => {
state.tabId = tabId state.tabId = tabId
}, },
setOrderParam: (state, orderParam) => {
state.orderParam = orderParam
},
setCompetitionCache: (state, param) => { setCompetitionCache: (state, param) => {
state.competitionCache = param state.competitionCache = param
}, },
setReferrer: (state, val) => {
state.referrer = val
},
setInnerReferrer: (state, val) => {
state.innerReferrer = val
},
setOrderParam: (state, val) => {
state.orderParam = val
},
} }
}); });

@ -7,7 +7,7 @@
<div class="flex-between"> <div class="flex-between">
<div class="per_title" <div class="per_title"
v-preventReClick v-preventReClick
@click="goback()"> @click="back">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span> <span class="per_back">返回</span>
<span class="per_school" <span class="per_school"
@ -1047,8 +1047,8 @@ export default {
}).then(() => { }).then(() => {
this.$router.push(`/contentSettings?cid=${res.cid}`); this.$router.push(`/contentSettings?cid=${res.cid}`);
}).catch(() => { }).catch(() => {
this.backPage() this.$router.push('/curriculum')
}) : this.backPage() }) : this.$router.push('/curriculum')
}).catch((res) => { }).catch((res) => {
this.submiting = false this.submiting = false
this.loadIns.close() this.loadIns.close()
@ -1059,7 +1059,7 @@ export default {
} }
}); });
}, },
goback () { back () {
const id = this.form.cid const id = this.form.cid
const updateTime = this.updateTime const updateTime = this.updateTime
// //
@ -1078,8 +1078,8 @@ export default {
}, },
// //
backPage () { backPage () {
this.$router.back() this.loadIns && this.loadIns.close()
this.loadIns.close() this.$router.push(this.$store.state.referrer || '/curriculum')
} }
} }
}; };

@ -1,318 +1,371 @@
<template> <template>
<div> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
<div> class="mgb20">
<div class="flex-center mgb20"> <div>
<p class="hr_tag"></p> <div class="flex-center mgb20">
<span>筛选</span> <p class="hr_tag"></p>
</div> <span>筛选</span>
<div> </div>
<el-form label-width="80px"> <div>
<el-col :span="4"> <el-form label-width="80px">
<el-form-item label="学科类别"> <el-col :span="4">
<el-select v-model="form.categoryId" clearable <el-form-item label="学科类别">
@change="getProfessionalClass()" @clear="clearClass()"> <el-select v-model="form.categoryId"
<el-option v-for="(item,index) in subjectList" :key="index" clearable
:label="item.disciplineName" @change="getProfessionalClass()"
:value="item.disciplineId"></el-option> @clear="clearClass()">
</el-select> <el-option v-for="(item,index) in subjectList"
</el-form-item> :key="index"
</el-col> :label="item.disciplineName"
<el-col :span="4"> :value="item.disciplineId"></el-option>
<el-form-item label="专业类"> </el-select>
<el-select v-model="form.professionalCategoryId" clearable </el-form-item>
:disabled="form.categoryId ? false : true" </el-col>
@change="getProfessional()" @clear="clearProfess()"> <el-col :span="4">
<el-option v-for="(item,index) in ProfessionalClassList" :key="index" <el-form-item label="专业类">
:label="item.professionalClassName" <el-select v-model="form.professionalCategoryId"
:value="item.professionalClassId"></el-option> clearable
</el-select> :disabled="form.categoryId ? false : true"
</el-form-item> @change="getProfessional()"
</el-col> @clear="clearProfess()">
<el-col :span="4"> <el-option v-for="(item,index) in ProfessionalClassList"
<el-form-item label="专业"> :key="index"
<el-select v-model="form.professionalId" clearable :label="item.professionalClassName"
:disabled="form.professionalCategoryId ? false : true" :value="item.professionalClassId"></el-option>
@change="getData()"> </el-select>
<el-option v-for="(item,index) in ProfessionalList" :key="index" </el-form-item>
:label="item.professionalName" </el-col>
:value="item.professionalId"></el-option> <el-col :span="4">
</el-select> <el-form-item label="专业">
</el-form-item> <el-select v-model="form.professionalId"
</el-col> clearable
<el-col :span="4"> :disabled="form.professionalCategoryId ? false : true"
<el-form-item label="课程类别"> @change="getData()">
<el-select v-model="form.curriculumType" clearable <el-option v-for="(item,index) in ProfessionalList"
@change="getData()"> :key="index"
<el-option label="理论课程" :value="0"></el-option> :label="item.professionalName"
<el-option label="实训课程" :value="1"></el-option> :value="item.professionalId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="4">
<el-form-item> <el-form-item label="课程类别">
<el-input placeholder="请输入课程名称" prefix-icon="el-icon-search" <el-select v-model="form.curriculumType"
v-model="form.curriculumName" clearable clearable
@keyup.enter.native="onSearch"></el-input> @change="getData()">
</el-form-item> <el-option label="理论课程"
</el-col> :value="0"></el-option>
</el-form> <el-option label="实训课程"
</div> :value="1"></el-option>
</div> </el-select>
</el-card> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入课程名称"
prefix-icon="el-icon-search"
v-model="form.curriculumName"
clearable
@keyup.enter.native="onSearch"></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</div>
</el-card>
<el-card shadow="hover" class="card"> <el-card shadow="hover"
<div class="flex-between mgb20"> class="card">
<div class="flex-center"> <div class="flex-between mgb20">
<p class="hr_tag"></p> <div class="flex-center">
<span>课程列表</span> <p class="hr_tag"></p>
</div> <span>课程列表</span>
<div> </div>
<el-button type="primary" round @click="addcourse" v-auth>新增课程</el-button> <div>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button> <el-button type="primary"
</div> round
</div> @click="addcourse"
<el-table v-loading="loading" :data="courseData" class="table" ref="table" stripe header-align="center" v-auth>新增课程</el-button>
@selection-change="handleSelectionChange" :row-key="getRowKeys"> <el-button type="primary"
<el-table-column type="selection" width="55" align="center" round
:reserve-selection="true"></el-table-column> @click="delAllSelection"
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> v-auth>批量删除</el-button>
<el-table-column prop="curriculumName" label="课程名称" align="center"></el-table-column> </div>
<el-table-column prop="curriculumType" label="课程类型" align="center"> </div>
<template slot-scope="scope"> <el-table v-loading="loading"
<span class="ellipsis">{{ courseTypeStatus[scope.row.curriculumType] }}</span> :data="courseData"
</template> class="table"
</el-table-column> ref="table"
<el-table-column prop="userName" label="创建人" align="center"></el-table-column> stripe
<el-table-column label="配置的实训应用" align="center"> header-align="center"
<template slot-scope="scope"> @selection-change="handleSelectionChange"
<span class="ellipsis">{{ scope.row.sysName }}</span> :row-key="getRowKeys">
</template> <el-table-column type="selection"
</el-table-column> width="55"
<el-table-column prop="orderVolume" label="订单量" align="center"></el-table-column> align="center"
<el-table-column prop="expectedCourse" label="预计课时" align="center"></el-table-column> :reserve-selection="true"></el-table-column>
<el-table-column label="上架/下架" align="center"> <el-table-column type="index"
<template slot-scope="scope"> width="100"
<el-switch label="序号"
v-model="scope.row.isShelves" align="center"></el-table-column>
:active-value="1" <el-table-column prop="curriculumName"
:inactive-value="0" label="课程名称"
@change="changeSwitch($event, scope.row)" align="center"></el-table-column>
v-auth="'/curriculum:上下架'"> <el-table-column prop="curriculumType"
</el-switch> label="课程类型"
</template> align="center">
</el-table-column> <template slot-scope="scope">
<el-table-column label="操作" align="center"> <span class="ellipsis">{{ courseTypeStatus[scope.row.curriculumType] }}</span>
<template slot-scope="scope"> </template>
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button> </el-table-column>
<el-button type="text" @click="config(scope.row)" v-auth>内容设置</el-button> <el-table-column prop="userName"
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button> label="创建人"
</template> align="center"></el-table-column>
</el-table-column> <el-table-column label="配置的实训应用"
</el-table> align="center">
<div class="pagination"> <template slot-scope="scope">
<el-pagination background @current-change="handleCurrentChange" :current-page="pageNo" <span class="ellipsis">{{ scope.row.sysName }}</span>
layout="total, prev, pager, next" :total="totals"></el-pagination> </template>
</div> </el-table-column>
</el-card> <el-table-column prop="orderVolume"
</div> label="订单量"
align="center"></el-table-column>
<el-table-column prop="expectedCourse"
label="预计课时"
align="center"></el-table-column>
<el-table-column label="上架/下架"
align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.isShelves"
:active-value="1"
:inactive-value="0"
@change="changeSwitch($event, scope.row)"
v-auth="'/curriculum:上下架'">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作"
align="center">
<template slot-scope="scope">
<el-button type="text"
@click="edit(scope.row)"
v-auth>编辑</el-button>
<el-button type="text"
@click="config(scope.row)"
v-auth>内容设置</el-button>
<el-button type="text"
@click="handleDelete(scope.row)"
v-auth>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
@current-change="handleCurrentChange"
:current-page="page"
layout="total, prev, pager, next"
:total="totals"></el-pagination>
</div>
</el-card>
</div>
</template> </template>
<script> <script>
import qs from 'qs'
export default { export default {
name: "customer", data () {
data() { return {
return { courseTypeStatus: {
courseTypeStatus: { 0: "理论课程",
0: "理论课程", 1: "实训课程"
1: "实训课程" },
}, name: localStorage.getItem("ms_username"),
name: localStorage.getItem("ms_username"), courseData: [],
courseData: [], form: {
form: { categoryId: +this.$route.query.categoryId || '',
categoryId: "", professionalCategoryId: +this.$route.query.professionalCategoryId || '',
professionalCategoryId: "", professionalId: +this.$route.query.professionalId || '',
professionalId: "", curriculumType: this.$route.query.curriculumType ? +this.$route.query.curriculumType : '',
curriculumType: "", curriculumName: this.$route.query.curriculumName || ''
curriculumName: "" },
}, page: +this.$route.query.page || 1,
pageNo: +this.$route.query.page || 1, pageSize: 10,
pageSize: 10, totals: 0,
totals: 0, subjectList: [], //
subjectList: [], // ProfessionalClassList: [], //
ProfessionalClassList: [], // ProfessionalList: [], //
ProfessionalList: [], // multipleSelection: [],
multipleSelection: [], loading: false,
loading: false, searchTimer: null
searchTimer: null };
}; },
watch: {
"form.curriculumName": function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getSubject();
this.getData();
},
methods: {
getRowKeys (row) {
return row.cid;
},
//
getData () {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
let data = {
...this.form,
pageNum: this.page,
pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : ''
};
this.$post(this.api.curriculumList, data).then(res => {
this.courseData = res.page.records;
this.totals = res.page.total;
this.loading = false;
}).catch(err => { });
},
initData () {
this.page = 1;
this.getData();
},
//
async getSubject () {
const { list } = await this.$get(this.api.courseDiscipline)
this.subjectList = list
this.form.professionalCategoryId && this.getProfessionalClassData()
},
//
clearClass () {
this.form.professionalCategoryId = ''
this.form.professionalId = ''
},
//
getProfessionalClass () {
this.clearClass();
this.getProfessionalClassData();
this.page = 1;
this.getData();
},
async getProfessionalClassData () {
const { list } = await this.$get(this.api.courseProfessionalClass, {
disciplineId: this.form.categoryId
})
this.ProfessionalClassList = list
this.form.professionalId && this.getProfessionalData()
},
//
clearProfess () {
this.form.professionalId = ''
},
//
getProfessional () {
this.clearProfess();
this.getProfessionalData();
this.page = 1;
this.getData();
},
async getProfessionalData () {
const { list } = await this.$get(this.api.courseProfessional, {
professionalClassId: this.form.professionalCategoryId
})
this.ProfessionalList = list
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
},
//
addcourse () {
this.setReferrer()
this.$router.push("/addcurriculum");
}, },
watch: { //
"form.curriculumName": function(val) { edit (row) {
clearTimeout(this.searchTimer); this.setReferrer()
this.searchTimer = setTimeout(() => { this.$router.push(`/addcurriculum?cid=${row.cid}`);
this.initData(); },
}, 500); //
config (row) {
this.setReferrer()
this.$router.push(`/contentSettings?cid=${row.cid}&name=${row.curriculumName}`);
},
//
handleDelete (row) {
this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
this.getData();
this.$message.success("删除成功");
}).catch(err => { })
}).catch(() => {
});
} }
}).catch(err => { })
}, },
mounted() { //
this.getSubject(); handleSelectionChange (val) {
this.getData(); this.multipleSelection = val;
}, },
methods: { //
getRowKeys(row) { delAllSelection () {
return row.cid; if (this.multipleSelection.length) {
}, let cids = []
// this.multipleSelection.forEach(i => {
getData() { cids.push('cids=' + i.cid)
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理') });
let data = { this.$post(`${this.api.deleteCoursePrompt}?${cids.join('&')}`).then(({ status }) => {
...this.form, if (status === 200) {
pageNum: this.pageNo, this.$confirm("确定要删除吗?", "提示", {
pageSize: this.pageSize, type: "warning"
supplierId: sid ? sid.supplierId : '' }).then(() => {
}; let ids = this.multipleSelection.map(i => i.cid);
this.$post(this.api.curriculumList, data).then(res => { this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
this.courseData = res.page.records; if (ids.length == this.courseData.length) {
this.totals = res.page.total; if (this.page > 1) {
this.loading = false; this.page = this.page - 1
}).catch(err => { }
}); }
},
initData() {
this.pageNo = 1;
this.getData();
},
//
getSubject() {
this.$get(this.api.courseDiscipline).then(res => {
this.subjectList = res.list;
}).catch(err => {
});
},
//
clearClass() {
this.form.professionalCategoryId = "";
this.form.professionalId = "";
},
//
getProfessionalClass() {
this.clearClass();
this.getProfessionalClassData();
this.pageNo = 1;
this.getData();
},
getProfessionalClassData() {
let data = {
disciplineId: this.form.categoryId
};
this.$get(this.api.courseProfessionalClass, data).then(res => {
this.ProfessionalClassList = res.list;
}).catch(err => {
});
},
//
clearProfess() {
this.form.professionalId = "";
},
//
getProfessional() {
this.clearProfess();
this.getProfessionalData();
this.pageNo = 1;
this.getData();
},
getProfessionalData() {
let data = {
professionalClassId: this.form.professionalCategoryId
};
this.$get(this.api.courseProfessional, data).then(res => {
this.ProfessionalList = res.list;
}).catch(err => {
});
},
//
addcourse() {
this.$router.push("/addcurriculum");
},
//
edit(row) {
this.$router.push(`/addcurriculum?cid=${row.cid}`);
},
//
config(row) {
this.$router.push(`/contentSettings?cid=${row.cid}&name=${row.curriculumName}`);
},
//
handleDelete(row) {
this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
this.getData();
this.$message.success("删除成功");
}).catch(err => {})
}).catch(() => {
});
}
}).catch(err => {})
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
delAllSelection() {
if (this.multipleSelection.length) {
let cids = []
this.multipleSelection.forEach(i => {
cids.push('cids=' + i.cid)
});
this.$post(`${this.api.deleteCoursePrompt}?${cids.join('&')}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => i.cid);
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
if(ids.length == this.courseData.length){
if(this.pageNo > 1){
this.pageNo = this.pageNo-1
}
}
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => {})
}).catch(() => {})
}
}).catch(err => {})
} else {
this.$message.warning("请先选择课程 !");
}
},
//
handleCurrentChange(val) {
this.pageNo = val;
this.$router.push(`curriculum?page=${val}`)
this.getData();
},
//
onSearch() {
this.pageNo = 1;
this.getData();
},
//
changeSwitch(value, row) {
this.$post(`${this.api.isShelves}?cid=${row.cid}&isShelves=${value}`).then((res) => {
this.getData(); this.getData();
this.$message.success("修改上下架状态成功!"); this.$message.success("删除成功");
}).catch((res) => { this.$refs.table.clearSelection()
}); }).catch(err => { })
} }).catch(() => { })
}
}).catch(err => { })
} else {
this.$message.warning("请先选择课程 !");
}
},
//
handleCurrentChange (val) {
this.page = val;
this.$router.push(`/curriculum?page=${val}`)
this.getData();
},
//
onSearch () {
this.page = 1;
this.getData();
},
//
changeSwitch (value, row) {
this.$post(`${this.api.isShelves}?cid=${row.cid}&isShelves=${value}`).then((res) => {
this.getData();
this.$message.success("修改上下架状态成功!");
}).catch((res) => {
});
} }
}
}; };
</script> </script>
@ -320,8 +373,5 @@ export default {
.card { .card {
min-height: calc(100vh - 300px); min-height: calc(100vh - 300px);
} }
.mag {
margin-right: 20px;
}
</style> </style>

@ -3,7 +3,7 @@
<el-card shadow="hover" <el-card shadow="hover"
class="mgb20"> class="mgb20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="goBack" <el-page-header @back="back"
:content="name + '/' + (sorting? '编辑排序' : '内容设置')"></el-page-header> :content="name + '/' + (sorting? '编辑排序' : '内容设置')"></el-page-header>
</div> </div>
</el-card> </el-card>
@ -432,11 +432,11 @@ export default {
// //
if (window.history && window.history.pushState) { if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL); history.pushState(null, null, document.URL);
window.addEventListener("popstate", this.goBack, false); window.addEventListener("popstate", this.back, false);
} }
}, },
destroyed () { destroyed () {
window.removeEventListener("popstate", this.goBack, false); window.removeEventListener("popstate", this.back, false);
}, },
methods: { methods: {
getData () { getData () {
@ -452,7 +452,7 @@ export default {
handleSelectionChange (val) { handleSelectionChange (val) {
this.multipleSelection = val this.multipleSelection = val
}, },
goBack () { back () {
// //
if (this.previewing) { if (this.previewing) {
this.closeIframe(); this.closeIframe();
@ -475,7 +475,7 @@ export default {
this.sorting = false this.sorting = false
} }
} else { } else {
this.$router.back() this.$router.push(this.$store.state.referrer || '/curriculum')
} }
} }
}, },

@ -643,6 +643,7 @@
import pdf from '../../components/pdf.vue' import pdf from '../../components/pdf.vue'
import util from '@/utils/util' import util from '@/utils/util'
import axios from 'axios' import axios from 'axios'
import qs from 'qs'
export default { export default {
components: { pdf }, components: { pdf },
data () { data () {
@ -796,9 +797,9 @@ export default {
totalProduct: 0, totalProduct: 0,
form3: { form3: {
orderType: '', orderType: +this.$route.query.orderType || '',
orderStatus: '', orderStatus: +this.$route.query.orderStatus || '',
keyword: '' keyword: this.$route.query.keyword || ''
}, },
// //
orderTypeList: [{ orderTypeList: [{
@ -1188,6 +1189,7 @@ export default {
}, },
// //
toOrderDetail (row) { toOrderDetail (row) {
this.$router.push(`/addcustomer?id=${this.customerId}&type=tab3&${qs.stringify(this.form3)}&page=${this.pageOrder}`)
this.$router.push(`/AddOrder?val=watch&orderId=${row.orderId}&orderStatus=${row.orderStatus === '已完成' ? 1 : 0}`) this.$router.push(`/AddOrder?val=watch&orderId=${row.orderId}&orderStatus=${row.orderStatus === '已完成' ? 1 : 0}`)
}, },
@ -1216,6 +1218,7 @@ export default {
}, },
// //
toOrder (row) { toOrder (row) {
this.$router.push(`/addcustomer?id=${this.customerId}&type=tab5&keyword=${this.bmsKeyword}&page=${this.pageOrder}`)
this.$router.push(`/bmOrder?businessManagerId=${row.businessManagerId}&customerId=${this.customerId}&customerName=${this.form.customerName}&userName=${row.userName}&teamId=${row.teamId}`) this.$router.push(`/bmOrder?businessManagerId=${row.businessManagerId}&customerId=${this.customerId}&customerName=${this.form.customerName}&userName=${row.userName}&teamId=${row.teamId}`)
}, },
@ -1411,7 +1414,7 @@ export default {
}, 1500) }, 1500)
this.$store.commit('schoolIdData', { schoolId: this.form.schoolId }) this.$store.commit('schoolIdData', { schoolId: this.form.schoolId })
this.$message.success('添加成功') this.$message.success('添加成功')
tab ? this.tabChange(tab, 1) : this.backPage() tab ? this.tabChange(tab, 1) : this.router.push('list')
}).catch((res) => { }).catch((res) => {
this.submiting = false this.submiting = false
}) })
@ -1457,7 +1460,7 @@ export default {
} }
}, },
backPage () { backPage () {
this.$router.push(`customer?page=${this.$store.state.customerPage}`) this.$router.push(this.$store.state.referrer || '/customer')
} }
} }
}; };

@ -1,126 +1,179 @@
<template> <template>
<div> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
<div class="flex-between"> class="mgb20">
<div class="per_title" v-preventReClick @click="back"> <div class="flex-between">
<i class="el-icon-arrow-left"></i> <div class="per_title"
<span class="per_back">返回</span> v-preventReClick
<span class="per_school">{{ $route.query.userName }}的订单</span> @click="back">
</div> <i class="el-icon-arrow-left"></i>
</div> <span class="per_back">返回</span>
</el-card> <span class="per_school">{{ $route.query.userName }}的订单</span>
</div>
</div>
</el-card>
<el-card shadow="hover" class="card"> <el-card shadow="hover"
<div class="flex-between mgb20"> class="card">
<div class="flex-center"> <div class="flex-between mgb20">
<p class="hr_tag"></p> <div class="flex-center">
<span>订单列表</span> <p class="hr_tag"></p>
</div> <span>订单列表</span>
<el-input style="width: 300px" placeholder="请输入订单编号/产品名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> </div>
</div> <el-input style="width: 300px"
<el-table :data="orderData" class="table" ref="table" stripe header-align="center" placeholder="请输入订单编号/产品名称"
@selection-change="handleSelectionChange" :row-key="getRowKeys"> prefix-icon="el-icon-search"
<el-table-column type="index" width="100" label="序号" align="center"> v-model="keyword"
</el-table-column> clearable></el-input>
<el-table-column prop="orderNumber" label="订单编号" align="center"> </div>
</el-table-column> <el-table :data="orderData"
<el-table-column prop="customerName" label="客户名称" align="center"> class="table"
<template slot-scope="scope"> ref="table"
{{ customerName }} stripe
</template> header-align="center"
</el-table-column> @selection-change="handleSelectionChange"
<el-table-column prop="productName" label="产品内容" align="center" show-overflow-tooltip></el-table-column> :row-key="getRowKeys">
<el-table-column prop="orderAmount" label="订单金额(元)" align="center"> <el-table-column type="index"
</el-table-column> width="100"
<el-table-column prop="createTime" label="订单日期" align="center"> label="序号"
</el-table-column> align="center">
<el-table-column prop="orderType" label="订单类型" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="orderNumber"
<el-table-column prop="orderStatus" label="订单状态" align="center"> label="订单编号"
</el-table-column> align="center">
<el-table-column prop="orderNature" label="订单性质" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="customerName"
<el-table-column label="操作" align="center"> label="客户名称"
<template slot-scope="scope"> align="center">
<el-button type="text" @click="toDetail(scope.row)">查看</el-button> <template slot-scope="scope">
</template> {{ customerName }}
</el-table-column> </template>
</el-table> </el-table-column>
<div class="pagination"> <el-table-column prop="productName"
<el-pagination background layout="total, prev, pager, next" label="产品内容"
@current-change="handleCurrentChange" :current-page="page" :total="totals"> align="center"
</el-pagination> show-overflow-tooltip></el-table-column>
</div> <el-table-column prop="orderAmount"
</el-card> label="订单金额(元)"
</div> align="center">
</el-table-column>
<el-table-column prop="createTime"
label="订单日期"
align="center">
</el-table-column>
<el-table-column prop="orderType"
label="订单类型"
align="center">
</el-table-column>
<el-table-column prop="orderStatus"
label="订单状态"
align="center">
</el-table-column>
<el-table-column prop="orderNature"
label="订单性质"
align="center">
</el-table-column>
<el-table-column label="操作"
align="center">
<template slot-scope="scope">
<el-button type="text"
@click="toDetail(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
@current-change="handleCurrentChange"
:current-page="page"
:total="totals">
</el-pagination>
</div>
</el-card>
</div>
</template> </template>
<script> <script>
export default { export default {
data() { data () {
return { return {
businessManagerId: this.$route.query.businessManagerId, businessManagerId: this.$route.query.businessManagerId,
teamId: this.$route.query.teamId, teamId: this.$route.query.teamId,
customerId: this.$route.query.customerId, customerId: this.$route.query.customerId,
customerName: this.$route.query.customerName, customerName: this.$route.query.customerName,
keyword: "", keyword: "",
orderData: [], orderData: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 0, totals: 0,
searchTimer: null searchTimer: null
}; };
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
created () {
const { orderParam } = this.$store.state
if (orderParam) {
this.keyword = orderParam.keyword
this.page = orderParam.page
this.$store.commit('setOrderParam', null)
}
this.getData();
},
methods: {
getData () {
let data = {
businessManagerId: this.businessManagerId,
teamId: this.teamId,
keywords: this.keyword,
customerId: this.customerId,
pageNum: this.page,
pageSize: this.pageSize,
};
this.$post(this.api.getBusinessManagerOrder, data).then(({ data }) => {
const { records } = data
records.forEach(e => {
e.orderType = this.orderTypeFn(e.orderType);
e.orderStatus = this.orderStatusFn(e.orderStatus);
e.orderNature = this.orderNatureFn(e.orderNature);
});
this.orderData = records
this.totals = data.total
}).catch(res => { })
}, },
watch: { initData () {
keyword: function(val) { this.page = 1
clearTimeout(this.searchTimer); this.getData()
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
}, },
created() { handleCurrentChange (val) {
this.getData(); this.page = val
this.getData()
}, },
methods: { toDetail (row) {
getData() { this.$store.commit('setOrderParam', {
let data = { keyword: this.keyword,
businessManagerId: this.businessManagerId, page: this.page,
teamId: this.teamId, })
keywords: this.keyword, this.$router.push({
customerId: this.customerId, path: '/AddOrder',
pageNum: this.page, query: {
pageSize: this.pageSize, val: 'watch',
}; orderId: row.orderId,
this.$post(this.api.getBusinessManagerOrder, data).then(({ data }) => { orderStatus: row.orderStatus === '已完成' ? 1 : 0,
const { records } = data
records.forEach(e => {
e.orderType = this.orderTypeFn(e.orderType);
e.orderStatus = this.orderStatusFn(e.orderStatus);
e.orderNature = this.orderNatureFn(e.orderNature);
});
this.orderData = records
this.totals = data.total
}).catch(res => {})
},
initData() {
this.page = 1
this.getData()
},
toDetail(row) {
this.$router.push({
path:'/AddOrder',
query:{
val: 'watch',
orderId: row.orderId,
orderStatus: row.orderStatus === '已完成' ? 1 : 0
}
})
},
back() {
this.$router.back()
} }
})
},
back () {
this.$router.back()
} }
}
}; };
</script> </script>
@ -131,8 +184,8 @@ export default {
.mag { .mag {
margin-right: 20px; margin-right: 20px;
} }
.cell{ .cell {
white-space:pre-wrap; white-space: pre-wrap;
width: 140px; width: 140px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -141,10 +194,11 @@ export default {
line-clamp: 2; line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.tags{ .tags {
border: none; border: none;
background: none;color: #000; background: none;
white-space:pre-wrap; color: #000;
white-space: pre-wrap;
width: 140px; width: 140px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;

@ -176,6 +176,7 @@
import Setting from '@/setting' import Setting from '@/setting'
import axios from 'axios'; import axios from 'axios';
import util from "@/libs/util"; import util from "@/libs/util";
import qs from 'qs'
export default { export default {
name: 'customer', name: 'customer',
data () { data () {
@ -204,10 +205,10 @@ export default {
}], }],
listData: [], listData: [],
form: { form: {
customerType: '', customerType: +this.$route.query.customerType || '',
provinces: '', provinces: +this.$route.query.provinces || '',
city: '', city: +this.$route.query.city || '',
keyword: '' keyword: this.$route.query.keyword || ''
}, },
multipleSelection: [], multipleSelection: [],
provinceList: [], provinceList: [],
@ -227,6 +228,11 @@ export default {
}, },
}, },
mounted () { mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/customer').catch(() => { })
}
this.getData() this.getData()
this.getProvince() this.getProvince()
}, },
@ -258,6 +264,7 @@ export default {
this.$get(this.api.queryProvince).then(res => { this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.list this.provinceList = res.list
this.$store.commit("provinceData", { provinceList: this.provinceList }) this.$store.commit("provinceData", { provinceList: this.provinceList })
this.form.city && this.getCityData()
}).catch(res => { }) }).catch(res => { })
}, },
clearprovince () { clearprovince () {
@ -307,13 +314,20 @@ export default {
util.downloadFileDirect(`客户列表.xlsx`, new Blob([res.data])) util.downloadFileDirect(`客户列表.xlsx`, new Blob([res.data]))
}).catch(res => { }) }).catch(res => { })
}, },
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
},
addcustomer () { addcustomer () {
this.setReferrer()
this.$router.push('addcustomer') this.$router.push('addcustomer')
}, },
edit (row) { edit (row) {
this.setReferrer()
this.$router.push(`addcustomer?id=${row.customerId}`) this.$router.push(`addcustomer?id=${row.customerId}`)
}, },
show (row) { show (row) {
this.setReferrer()
this.$router.push(`addcustomer?id=${row.customerId}&show=true`) this.$router.push(`addcustomer?id=${row.customerId}&show=true`)
}, },
handleDelete (row) { handleDelete (row) {
@ -363,7 +377,6 @@ export default {
}, },
handleCurrentChange (val) { handleCurrentChange (val) {
this.page = val this.page = val
this.$store.commit('SET_C_PAGE', val)
this.$router.push(`customer?page=${val}`) this.$router.push(`customer?page=${val}`)
this.getData() this.getData()
}, },

@ -1,212 +1,261 @@
<template> <template>
<div class="page"> <div class="page">
<!-- <div class="tabs">--> <!-- <div class="tabs">-->
<!-- <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a>--> <!-- <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a>-->
<!-- </div>--> <!-- </div>-->
<div class="btn-wrap"> <div class="btn-wrap">
<el-button v-auth="'内容管理:保存排序'" class="action-btn" type="primary" @click="sortSubmit">保存排序</el-button> <el-button v-auth="'内容管理:保存排序'"
<el-button v-auth="'内容管理:批量删除'" class="action-btn" type="primary" @click="delAllData">批量删除</el-button> class="action-btn"
<el-button v-auth="'内容管理:新增文章'" class="action-btn" type="primary" @click="addArticle">新增文章</el-button> type="primary"
</div> @click="sortSubmit">保存排序</el-button>
<div class="page-content" style="padding-top: 24px"> <el-button v-auth="'内容管理:批量删除'"
<el-table ref="table" :data="list" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> class="action-btn"
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> type="primary"
<el-table-column type="index" width="60" label="序号" align="center"> @click="delAllData">批量删除</el-button>
<template slot-scope="scope"> <el-button v-auth="'内容管理:新增文章'"
{{ scope.$index + (pageNo - 1) * pageSize + 1 }} class="action-btn"
</template> type="primary"
</el-table-column> @click="addArticle">新增文章</el-button>
<el-table-column prop="title" label="标题" show-overflow-tooltip align="center">
</el-table-column>
<el-table-column prop="title" label="栏目" show-overflow-tooltip align="center">
{{ columnName }}
</el-table-column>
<el-table-column prop="name" label="排序值" width="80" align="center">
<template slot-scope="scope">
<el-input class="sort-input" width="120" min="1" v-model.number="scope.row.sort" type="number"></el-input>
<span>{{ scope.row.sort }}</span>
</template>
</el-table-column>
<el-table-column prop="date" label="添加日期" align="center">
<template slot-scope="scope">
{{ transferDate(scope.row.date) }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<el-button v-auth="'内容管理:编辑'" type="text" @click="editArticle(scope)">编辑</el-button>
<el-divider v-auth="'内容管理:编辑'" direction="vertical"></el-divider>
<el-button v-auth="'内容管理:删除'" type="text" @click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="name" label="文章发布状态" width="120" align="center">
<template slot-scope="scope">
<el-switch
v-auth="'内容管理:禁用'"
class="off"
v-model="scope.row.status"
:active-value="0"
:inactive-value="1"
style="margin: 0 5px"
:active-text="scope.row.status ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
<span>{{ scope.row.status ? "禁用" : "启用" }}</span>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
</div>
</div> </div>
<div class="page-content"
style="padding-top: 24px">
<el-table ref="table"
:data="list"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection"
width="80"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="title"
label="标题"
show-overflow-tooltip
align="center">
</el-table-column>
<el-table-column prop="title"
label="栏目"
show-overflow-tooltip
align="center">
{{ columnName }}
</el-table-column>
<el-table-column prop="name"
label="排序值"
width="80"
align="center">
<template slot-scope="scope">
<el-input class="sort-input"
width="120"
min="1"
v-model.number="scope.row.sort"
type="number"></el-input>
<span>{{ scope.row.sort }}</span>
</template>
</el-table-column>
<el-table-column prop="date"
label="添加日期"
align="center">
<template slot-scope="scope">
{{ transferDate(scope.row.date) }}
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="170">
<template slot-scope="scope">
<el-button v-auth="'内容管理:编辑'"
type="text"
@click="editArticle(scope)">编辑</el-button>
<el-divider v-auth="'内容管理:编辑'"
direction="vertical"></el-divider>
<el-button v-auth="'内容管理:删除'"
type="text"
@click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="name"
label="文章发布状态"
width="120"
align="center">
<template slot-scope="scope">
<el-switch v-auth="'内容管理:禁用'"
class="off"
v-model="scope.row.status"
:active-value="0"
:inactive-value="1"
style="margin: 0 5px"
:active-text="scope.row.status ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
<span>{{ scope.row.status ? "禁用" : "启用" }}</span>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="totals"
@current-change="handleCurrentChange"
:current-page="pageNo">
</el-pagination>
</div>
</div>
</div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
export default { export default {
data() { data () {
return { return {
activeName: "first", activeName: "first",
tabs: { tabs: {
first: "栏目内容管理" first: "栏目内容管理"
}, },
columns: this.$parent.menuList, columns: this.$parent.menuList,
columnName: '', columnName: '',
list: [], list: [],
multipleSelection: [], multipleSelection: [],
pageNo: +this.$route.query.page || 1, pageNo: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
totals: 0, totals: 0,
originList: [] originList: []
}; };
},
props: {
columnId: ""
},
watch: {
columnId () {
this.getColumnName(this.$parent.menuList)
this.getData();
}
},
mounted () {
this.getColumnName(this.$parent.menuList)
this.getData();
},
methods: {
getData (id) {
let data = {
columnId: this.columnId
};
this.$get(`${this.api.queryArticleByCondition}/${this.pageNo}/${this.pageSize}`, data).then(({ articleList, total }) => {
this.list = articleList;
this.totals = total;
if (JSON.stringify(this.originList) !== '{}') this.originList = JSON.parse(JSON.stringify(articleList))
if (!this.list.length && this.totals) {
this.pageNo--;
this.getData();
}
}).catch(res => {
});
}, },
props: { handleSelectionChange (val) {
columnId: "" this.multipleSelection = val;
}, },
watch: { handleCurrentChange (val) {
columnId() { this.pageNo = val;
this.getColumnName(this.$parent.menuList) this.$router.push(`/information?page=${val}`)
this.getData(); this.getData();
},
//
getColumnName (data) {
data.map(e => {
if (e.id == this.columnId) {
this.columnName = e.name
} else {
this.getColumnName(e.children)
} }
})
}, },
mounted() { addArticle () {
this.getColumnName(this.$parent.menuList) this.$router.push(`/addArticle?columnId=${this.columnId}&sort=${this.list.length + 1}`);
this.getData(); },
editArticle (scope) {
this.$router.push(`/addArticle?columnId=${this.columnId}&id=${scope.row.id}&sort=${scope.$index + 1}`);
}, },
methods: { delData (row) {
getData(id) { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
let data = { type: "warning"
columnId: this.columnId })
}; .then(() => {
this.$get(`${this.api.queryArticleByCondition}/${this.pageNo}/${this.pageSize}`, data).then(({ articleList, total }) => { this.$del(`${this.api.deleteArticles}?articleIds=${row.id}`).then(res => {
this.list = articleList; util.successMsg("删除成功");
this.totals = total; this.getData();
if (JSON.stringify(this.originList) !== '{}') this.originList = JSON.parse(JSON.stringify(articleList)) }).catch(res => {
if (!this.list.length && this.totals) { });
this.pageNo--; })
this.getData(); .catch(() => {
} });
},
transferDate (date) {
return date.replace(" 00:00:00", "");
},
delAllData () {
if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection;
let delList = newArr.map(item => {
return item.id;
});
let title = newArr[0].title;
if (title.length > 14) {
title = title.substr(0, 14) + "……";
}
this.$confirm(`此批量删除操作不可逆,是否确认删除${title}${newArr.length}个选中项?`, "提示", {
type: "warning"
})
.then(() => {
this.$del(`${this.api.deleteArticles}?articleIds=${delList.join(",")}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => { }).catch(res => {
}); });
}, if (this.multipleSelection.length === this.list.length && this.pageNo > 1) {
handleSelectionChange(val) { this.handleCurrentChange(this.pageNo - 1)
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.pageNo = val;
this.$router.push(`list?page=${val}`)
this.getData();
},
//
getColumnName(data) {
data.map(e => {
if (e.id == this.columnId) {
this.columnName = e.name
} else {
this.getColumnName(e.children)
} }
}) })
}, .catch(() => {
addArticle() { });
this.$router.push(`/addArticle?columnId=${this.columnId}&sort=${this.list.length + 1}`); } else {
}, util.errorMsg("请先选择数据 !");
editArticle(scope) { }
this.$router.push(`/addArticle?columnId=${this.columnId}&id=${scope.row.id}&sort=${scope.$index + 1}`); },
}, switchOff (val, row, index) {
delData(row) { this.$put(`${this.api.enableArticle}/${row.id}/${val}`)
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { .then(res => {
type: "warning" val == 1 ? util.errorMsg("该文章已隐藏,对学生端用户不可见") : util.successMsg("该文章已发布,对学生端用户可见");
}) })
.then(() => { .catch(err => {
this.$del(`${this.api.deleteArticles}?articleIds=${row.id}`).then(res => { });
util.successMsg("删除成功"); },
this.getData(); sortSubmit () {
}).catch(res => { if (this.list.length) {
}); if (this.list.find(n => n.sort < 1)) return util.errorMsg("排序值最小为1");
}) let data = { articleList: this.list };
.catch(() => { this.$post(this.api.articleSort, data).then(res => {
}); util.successMsg("保存成功");
}, this.getData()
transferDate(date) { })
return date.replace(" 00:00:00", ""); .catch(err => {
}, });
delAllData() { } else {
if (this.multipleSelection.length != "") { util.errorMsg("数据为空");
let newArr = this.multipleSelection; }
let delList = newArr.map(item => {
return item.id;
});
let title = newArr[0].title;
if (title.length > 14) {
title = title.substr(0, 14) + "……";
}
this.$confirm(`此批量删除操作不可逆,是否确认删除${title}${newArr.length}个选中项?`, "提示", {
type: "warning"
})
.then(() => {
this.$del(`${this.api.deleteArticles}?articleIds=${delList.join(",")}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
if(this.multipleSelection.length === this.list.length && this.pageNo>1) {
this.handleCurrentChange(this.pageNo - 1)
}
})
.catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
switchOff(val, row, index) {
this.$put(`${this.api.enableArticle}/${row.id}/${val}`)
.then(res => {
val == 1 ? util.errorMsg("该文章已隐藏,对学生端用户不可见") : util.successMsg("该文章已发布,对学生端用户可见");
})
.catch(err => {
});
},
sortSubmit() {
if (this.list.length) {
if (this.list.find(n => n.sort < 1)) return util.errorMsg("排序值最小为1");
let data = { articleList: this.list };
this.$post(this.api.articleSort, data).then(res => {
util.successMsg("保存成功");
this.getData()
})
.catch(err => {
});
} else {
util.errorMsg("数据为空");
}
}
} }
}
}; };
</script> </script>

@ -220,7 +220,7 @@ export default {
this.editing = false this.editing = false
} }
} else { } else {
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`) this.backPage()
} }
}, },
back () { back () {
@ -240,7 +240,7 @@ export default {
} }
}, },
backPage () { backPage () {
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`) this.$router.push(this.$store.state.referrer || '/match')
} }
} }
}; };

@ -1,53 +1,56 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="modal"> <div class="modal">
<el-steps :space="200" :active="4" finish-status="success"> <el-steps :space="200"
<el-step title="大赛信息填写"></el-step> :active="4"
<el-step title="赛程与规则设置"></el-step> finish-status="success">
<el-step title="比赛内容设置"></el-step> <el-step title="大赛信息填写"></el-step>
<el-step title="发布"></el-step> <el-step title="赛程与规则设置"></el-step>
</el-steps> <el-step title="比赛内容设置"></el-step>
<h1>大赛已发布</h1> <el-step title="发布"></el-step>
<div class="btns"> </el-steps>
<el-button type="primary" @click="back">确定</el-button> <h1>大赛已发布</h1>
</div> <div class="btns">
<el-button type="primary"
@click="back">确定</el-button>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
export default { export default {
data() { data () {
return { return {
}; };
}, },
mounted() { mounted () {
}, },
methods: { methods: {
back() { back () {
this.$router.push(`/match?page=${this.$store.state.matchPage}`) this.$router.push(this.$store.state.referrer || '/match')
}
} }
}
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.wrap { .wrap {
height: calc(100vh - 300px); height: calc(100vh - 300px);
background-color: #fefefe; background-color: #fefefe;
} }
.modal { .modal {
width: 500px; width: 500px;
padding-top: 150px; padding-top: 150px;
margin: 0 auto ; margin: 0 auto;
h1 { h1 {
margin: 20px; margin: 20px;
text-align: center; text-align: center;
} }
.btns { .btns {
text-align: center; text-align: center;
} }
} }
</style> </style>

@ -35,7 +35,7 @@
<li> <li>
<el-input placeholder="请输入竞赛名称/创建人" <el-input placeholder="请输入竞赛名称/创建人"
suffix-icon="el-icon-search" suffix-icon="el-icon-search"
v-model="keyword" v-model="form.keyWord"
clearable></el-input> clearable></el-input>
</li> </li>
</ul> </ul>
@ -232,18 +232,16 @@
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from "@/setting";
import { Loading } from 'element-ui'
import Bus from '@/libs/bus' import Bus from '@/libs/bus'
import qs from 'qs'
export default { export default {
name: "match", name: "match",
data () { data () {
return { return {
timer: null, timer: null,
keyword: "",
sourceList: [ sourceList: [
{ {
id: "", id: null,
name: "不限" name: "不限"
}, },
{ {
@ -257,7 +255,7 @@ export default {
], ],
rangeList: [ rangeList: [
{ {
id: "", id: '',
name: "不限" name: "不限"
}, },
{ {
@ -275,12 +273,12 @@ export default {
], ],
matchData: [], matchData: [],
form: { form: {
month: "", keyWord: this.$route.query.keyWord || null,
publishStatus: "", month: +this.$route.query.month || '',
startTime: "", startTime: this.$route.query.startTime || '',
endTime: "", endTime: this.$route.query.endTime || '',
platformSource: +this.$route.query.platformSource || 0, // (01) platformSource: this.$route.query.platformSource === 'null' ? null : (+this.$route.query.platformSource || 0), // (01)
competitionScope: '', // (0: 1: 2.) competitionScope: this.$route.query.competitionScope ? +this.$route.query.competitionScope : '', // (0: 1: 2.)
}, },
multipleSelection: [], multipleSelection: [],
dateList: [ dateList: [
@ -336,12 +334,12 @@ export default {
this.form.startTime = val[0]; this.form.startTime = val[0];
this.form.endTime = val[1]; this.form.endTime = val[1];
} else { } else {
this.form.startTime = ""; this.form.startTime = ''
this.form.endTime = ""; this.form.endTime = ''
} }
this.initData(); this.initData();
}, },
keyword: function (val) { 'form.keyWord': function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData();
@ -349,7 +347,11 @@ export default {
} }
}, },
mounted () { mounted () {
this.$store.commit('SET_M_PAGE', 1) const { query } = this.$route
if (query.page) {
this.$router.push('/match').catch(() => { })
}
// websocket // websocket
Bus.$on('matchSocket', () => { Bus.$on('matchSocket', () => {
this.getData() this.getData()
@ -369,8 +371,8 @@ export default {
pageSize: this.pageSize, pageSize: this.pageSize,
competitionScope: form.competitionScope === '' ? null : form.competitionScope, competitionScope: form.competitionScope === '' ? null : form.competitionScope,
endTime: form.endTime || null, endTime: form.endTime || null,
keyWord: this.keyword || null, keyWord: form.keyWord,
platformSource: form.platformSource === '' ? null : form.platformSource, platformSource: form.platformSource,
startTime: form.startTime || null, startTime: form.startTime || null,
}).then(({ data }) => { }).then(({ data }) => {
const list = data.records const list = data.records
@ -413,7 +415,12 @@ export default {
this.page = 1; this.page = 1;
this.getData(); this.getData();
}, },
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
},
add () { add () {
this.setReferrer()
this.$router.push("/addMatch"); this.$router.push("/addMatch");
}, },
// //
@ -452,6 +459,7 @@ export default {
}, },
// //
manage (row) { manage (row) {
this.setReferrer()
this.$router.push(`/matchManage?id=${row.id}&name=${row.competitionName}`) this.$router.push(`/matchManage?id=${row.id}&name=${row.competitionName}`)
}, },
@ -461,14 +469,6 @@ export default {
}, },
// //
sourceChange (val) { sourceChange (val) {
this.$router.push({
path: '/match',
query: {
...this.$route.query,
platformSource: val
}
})
this.$store.commit('SET_M_SOURCE', val)
this.initData() this.initData()
}, },
delData (row) { delData (row) {
@ -511,7 +511,6 @@ export default {
this.page = val; this.page = val;
this.$router.push(`match?page=${val}`) this.$router.push(`match?page=${val}`)
this.getData(); this.getData();
this.$store.commit('SET_M_PAGE', val)
}, },
transferTime (date, type) { transferTime (date, type) {
if (date == "0000-00-00 00:00:00") return "---"; if (date == "0000-00-00 00:00:00") return "---";

@ -114,7 +114,7 @@ export default {
}, },
// //
backPage () { backPage () {
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`) this.$router.push(this.$store.state.referrer || '/match')
}, },
// tab // tab
tabSwitch (i) { tabSwitch (i) {

@ -56,7 +56,6 @@
</template> </template>
<script> <script>
import util from "@/libs/util";
import Const from '@/const/match' import Const from '@/const/match'
export default { export default {
name: "matchArch", name: "matchArch",
@ -118,10 +117,12 @@ export default {
}, },
// //
toRank (row, i) { toRank (row, i) {
this.$store.commit('setInnerReferrer', this.$route.fullPath)
this.$router.push(`/matchRank?id=${this.id}&stageId=${row.stageId}&index=${i}&method=${row.method}&competitionType=${row.competitionType}&rule=${row.rule}`) this.$router.push(`/matchRank?id=${this.id}&stageId=${row.stageId}&index=${i}&method=${row.method}&competitionType=${row.competitionType}&rule=${row.rule}`)
}, },
// //
toArch (row, i) { toArch (row, i) {
this.$store.commit('setInnerReferrer', this.$route.fullPath)
const cur = this.form.competitionStage[i] const cur = this.form.competitionStage[i]
const showFile = !!(cur.method === 2 && cur.competitionStageContentSetting && cur.competitionStageContentSetting.whetherToUploadFiles) const showFile = !!(cur.method === 2 && cur.competitionStageContentSetting && cur.competitionStageContentSetting.whetherToUploadFiles)
this.$router.push(`/matchArchList?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}&showFile=${showFile}`) this.$router.push(`/matchArchList?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}&showFile=${showFile}`)

@ -3,7 +3,7 @@
<el-card shadow="hover" <el-card shadow="hover"
class="m-b-20 head-card"> class="m-b-20 head-card">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<el-page-header @back="$router.back()" <el-page-header @back="back"
content="成绩管理"></el-page-header> content="成绩管理"></el-page-header>
</div> </div>
@ -291,7 +291,6 @@
</template> </template>
<script> <script>
import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import * as echarts from "echarts"; import * as echarts from "echarts";
import axios from 'axios'; import axios from 'axios';
@ -305,11 +304,11 @@ export default {
competitionType: +this.$route.query.competitionType, competitionType: +this.$route.query.competitionType,
showFile: this.$route.query.showFile === 'true', showFile: this.$route.query.showFile === 'true',
isCompress: util.isCompress, isCompress: util.isCompress,
keyword: "", keyword: this.$route.query.keyword || '',
searchTimer: null, searchTimer: null,
list: [], list: [],
multipleSelection: [], multipleSelection: [],
page: 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
@ -339,6 +338,13 @@ export default {
keyword: function (val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.$router.push({
path: '/matchArchList',
query: {
...this.$route.query,
keyword: val
}
})
this.initData(); this.initData();
}, 500); }, 500);
} }
@ -485,6 +491,13 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
handleCurrentChange (val) { // handleCurrentChange (val) { //
this.$router.push({
path: '/matchArchList',
query: {
...this.$route.query,
page: val
}
})
this.page = val; this.page = val;
this.getData(); this.getData();
}, },
@ -624,6 +637,9 @@ export default {
} }
x.send() x.send()
}, },
back () {
this.$router.push(this.$store.state.innerReferrer)
}
} }
}; };
</script> </script>

@ -4,7 +4,7 @@
class="m-b-20 head-card"> class="m-b-20 head-card">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<el-page-header v-if="grades.length" <el-page-header v-if="grades.length"
@back="$router.back()" @back="back"
:content="grades[index].stageName + '/排名'"></el-page-header> :content="grades[index].stageName + '/排名'"></el-page-header>
</div> </div>
@ -272,9 +272,7 @@
</template> </template>
<script> <script>
import Setting from '@/setting'
import util from "@/libs/util"; import util from "@/libs/util";
import echarts from "echarts";
import axios from 'axios'; import axios from 'axios';
export default { export default {
data () { data () {
@ -286,7 +284,7 @@ export default {
competitionType: +this.$route.query.competitionType, competitionType: +this.$route.query.competitionType,
rule: +this.$route.query.rule, rule: +this.$route.query.rule,
searchTimer: null, searchTimer: null,
keyword: '', keyword: this.$route.query.keyword || '',
teamCalculationMethods: [ teamCalculationMethods: [
{ {
id: 0, id: 0,
@ -307,7 +305,7 @@ export default {
active: '', active: '',
grades: [], grades: [],
list: [], list: [],
page: 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
type: 0, type: 0,
@ -354,6 +352,13 @@ export default {
keyword: function (val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.$router.push({
path: '/matchRank',
query: {
...this.$route.query,
keyword: val
}
})
this.getRank(); this.getRank();
}, 500); }, 500);
} }
@ -552,6 +557,13 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
handleCurrentChange (val) { // handleCurrentChange (val) { //
this.$router.push({
path: '/matchRank',
query: {
...this.$route.query,
page: val
}
})
this.page = val; this.page = val;
this.getData(); this.getData();
}, },
@ -772,6 +784,9 @@ export default {
this.getRank() this.getRank()
this.importVisible = false this.importVisible = false
}, },
back () {
this.$router.push(this.$store.state.innerReferrer)
}
} }
}; };
</script> </script>

@ -345,7 +345,7 @@ export default {
info: { info: {
completeCompetitionSetup: {} completeCompetitionSetup: {}
}, },
isDisable: '', isDisable: this.$route.query.isDisable ? +this.$route.query.isDisable : '',
statusList: [ statusList: [
{ {
id: '', id: '',
@ -360,10 +360,10 @@ export default {
name: '未禁用' name: '未禁用'
} }
], ],
keyword: "", keyword: this.$route.query.keyword || '',
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
page: 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
schoolOrder: '', schoolOrder: '',
@ -813,6 +813,7 @@ export default {
}, },
// //
toInfo (row) { toInfo (row) {
this.$store.commit('setInnerReferrer', `${this.$route.fullPath}&keyword=${this.keyword}&page=${this.page}&isDisable=${this.isDisable}`)
this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`) this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`)
}, },
exportAll () { exportAll () {

@ -9,7 +9,7 @@
<div class="flex-between"> <div class="flex-between">
<div class="per_title" <div class="per_title"
v-preventReClick v-preventReClick
@click="goBack()"> @click="back">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span> <span class="per_back">返回</span>
<span class="per_school">{{ titlesw }}</span> <span class="per_school">{{ titlesw }}</span>
@ -1756,7 +1756,6 @@ export default {
cityId: "", cityId: "",
phone: "", phone: "",
orderAmount: 0, orderAmount: 0,
// orderId: this.$store.state.orderId,
customerName: "",// customerName: "",//
teamId: '', teamId: '',
businessManagerId: '', businessManagerId: '',
@ -2350,7 +2349,7 @@ export default {
this.refreshCache() this.refreshCache()
this.$message.success("修改成功"); this.$message.success("修改成功");
this.loading = false; this.loading = false;
this.$router.back(); this.back();
}).catch(err => { }).catch(err => {
this.loading = false; this.loading = false;
}); });
@ -2359,7 +2358,7 @@ export default {
this.refreshCache() this.refreshCache()
this.$message.success("添加订单成功"); this.$message.success("添加订单成功");
this.loading = false; this.loading = false;
this.renewDisabled ? this.$router.push('/order') : this.$router.back(); this.renewDisabled ? this.$router.push('/order') : this.back();
}).catch(err => { }).catch(err => {
this.loading = false; this.loading = false;
}); });
@ -3005,8 +3004,9 @@ export default {
IPSure () { IPSure () {
this.ipVisible = false; this.ipVisible = false;
}, },
goBack () { back () {
this.$router.go(-1); // this.$router.push(this.$store.state.referrer || '/order')
this.$router.back()
}, },
/** /**
* 添加实训课程产品权限,理论课程 ,数据前瞻平台权限,职站增值应用产品权限,实训课程非集成,实验工具 * 添加实训课程产品权限,理论课程 ,数据前瞻平台权限,职站增值应用产品权限,实训课程非集成,实验工具

@ -1,332 +1,402 @@
<template> <template>
<div> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
<div> class="mgb20">
<div class="flex-center mgb20"> <div>
<p class="hr_tag"></p> <div class="flex-center mgb20">
<span>筛选</span> <p class="hr_tag"></p>
</div> <span>筛选</span>
<div> </div>
<el-form label-width="80px"> <div>
<el-col :span="4"> <el-form label-width="80px">
<el-form-item label="省份"> <el-col :span="4">
<el-select v-model="form.provinces" clearable placeholder="请选择省份" <el-form-item label="省份">
@change="getCity()" @clear="clearprovince()"> <el-select v-model="form.provinceId"
<el-option v-for="(item,index) in provinceList" :key="index" clearable
:label="item.provinceName" :value="item.provinceId"></el-option> placeholder="请选择省份"
</el-select> @change="getCity()"
</el-form-item> @clear="clearprovince()">
</el-col> <el-option v-for="(item,index) in provinceList"
<el-col :span="4"> :key="index"
<el-form-item label="城市"> :label="item.provinceName"
<el-select v-model="form.city" clearable placeholder="请选择城市" :value="item.provinceId"></el-option>
:disabled="form.provinces ? false : true" @change="getData()"> </el-select>
<el-option v-for="(item,index) in cityList" :key="index" </el-form-item>
:label="item.cityName" :value="item.cityId"></el-option> </el-col>
</el-select> <el-col :span="4">
</el-form-item> <el-form-item label="城市">
</el-col> <el-select v-model="form.cityId"
<el-col :span="4"> clearable
<el-form-item label="订单类型"> placeholder="请选择城市"
<el-select v-model="form.orderType" clearable placeholder="请选择订单类型" :disabled="form.provinceId ? false : true"
@change="getData()"> @change="getData()">
<el-option v-for="(item,index) in orderTypeList" :key="index" <el-option v-for="(item,index) in cityList"
:label="item.name" :value="item.value"></el-option> :key="index"
</el-select> :label="item.cityName"
</el-form-item> :value="item.cityId"></el-option>
</el-col> </el-select>
<el-col :span="4"> </el-form-item>
<el-form-item label="订单状态"> </el-col>
<el-select v-model="form.orderStatus" clearable placeholder="请选择订单状态" <el-col :span="4">
@change="getData()"> <el-form-item label="订单类型">
<el-option v-for="(item,index) in orderStatusList" :key="index" <el-select v-model="form.orderType"
:label="item.name" :value="item.value"></el-option> clearable
</el-select> placeholder="请选择订单类型"
</el-form-item> @change="getData()">
</el-col> <el-option v-for="(item,index) in orderTypeList"
<el-col :span="6"> :key="index"
<el-form-item> :label="item.name"
<el-input placeholder="请输入订单号/客户名称/订单名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> :value="item.value"></el-option>
</el-form-item> </el-select>
</el-col> </el-form-item>
</el-form> </el-col>
</div> <el-col :span="4">
</div> <el-form-item label="订单状态">
</el-card> <el-select v-model="form.orderStatus"
clearable
placeholder="请选择订单状态"
@change="getData()">
<el-option v-for="(item,index) in orderStatusList"
:key="index"
:label="item.name"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入订单号/客户名称/订单名称"
prefix-icon="el-icon-search"
v-model="form.customerName"
clearable></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</div>
</el-card>
<el-card shadow="hover" class="card"> <el-card shadow="hover"
<div class="flex-between mgb20"> class="card">
<div class="flex-center"> <div class="flex-between mgb20">
<p class="hr_tag"></p> <div class="flex-center">
<span>订单列表</span> <p class="hr_tag"></p>
</div> <span>订单列表</span>
<div> </div>
<el-button type="primary" round @click="addOrder()" v-auth>新建订单</el-button> <div>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button> <el-button type="primary"
</div> round
</div> @click="addOrder"
<el-table :data="orderData" class="table" ref="table" stripe header-align="center" v-auth>新建订单</el-button>
@selection-change="handleSelectionChange" row-key="orderId"> <el-button type="primary"
<el-table-column type="selection" width="55" align="center" round
:reserve-selection="true"></el-table-column> @click="delAllSelection"
<el-table-column type="index" width="100" label="序号" align="center"> v-auth>批量删除</el-button>
</el-table-column> </div>
<el-table-column prop="orderNumber" label="订单编号" align="center"> </div>
</el-table-column> <el-table :data="orderData"
<el-table-column prop="customerName" label="客户名称" align="center"> class="table"
</el-table-column> ref="table"
<el-table-column prop="orderContent" label="订单内容" align="center" show-overflow-tooltip></el-table-column> stripe
<el-table-column prop="orderAmount" label="订单金额(元)" align="center"> header-align="center"
<template slot-scope="scope"> @selection-change="handleSelectionChange"
{{ scope.row.orderType === '试用' ? 0 : scope.row.orderAmount }} row-key="orderId">
</template> <el-table-column type="selection"
</el-table-column> width="55"
<el-table-column prop="createTime" label="订单日期" align="center"> align="center"
</el-table-column> :reserve-selection="true"></el-table-column>
<el-table-column prop="orderType" label="订单类型" align="center"> <el-table-column type="index"
</el-table-column> width="100"
<el-table-column prop="orderStatus" label="订单状态" align="center"> label="序号"
</el-table-column> align="center">
<el-table-column prop="orderNature" label="订单性质" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="orderNumber"
<el-table-column label="操作" align="center"> label="订单编号"
<template slot-scope="scope"> align="center">
<el-button type="text" v-if="scope.row.isDel!==1" @click="handle('edit',scope.row)" v-auth="'/order:修改'"> </el-table-column>
{{ scope.row.orderStatus === "已完成" ? "修改" : "处理" }} <el-table-column prop="customerName"
</el-button> label="客户名称"
<el-button type="text" @click="handle('watch',scope.row)" v-auth>查看</el-button> align="center">
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button> </el-table-column>
<el-button type="text" v-if="scope.row.orderStatus==='已完成'&&scope.row.isDel!==1" <el-table-column prop="orderContent"
@click="handle('renew',scope.row)" v-auth>续费 label="订单内容"
</el-button> align="center"
</template> show-overflow-tooltip></el-table-column>
</el-table-column> <el-table-column prop="orderAmount"
</el-table> label="订单金额(元)"
<div class="pagination"> align="center">
<el-pagination background layout="total, prev, pager, next" <template slot-scope="scope">
@current-change="handleCurrentChange" :current-page="pageNo" :total="totals"> {{ scope.row.orderType === '试用' ? 0 : scope.row.orderAmount }}
</el-pagination> </template>
</div> </el-table-column>
</el-card> <el-table-column prop="createTime"
</div> label="订单日期"
align="center">
</el-table-column>
<el-table-column prop="orderType"
label="订单类型"
align="center">
</el-table-column>
<el-table-column prop="orderStatus"
label="订单状态"
align="center">
</el-table-column>
<el-table-column prop="orderNature"
label="订单性质"
align="center">
</el-table-column>
<el-table-column label="操作"
align="center">
<template slot-scope="scope">
<el-button type="text"
v-if="scope.row.isDel!==1"
@click="handle('edit',scope.row)"
v-auth="'/order:修改'">
{{ scope.row.orderStatus === "已完成" ? "修改" : "处理" }}
</el-button>
<el-button type="text"
@click="handle('watch',scope.row)"
v-auth>查看</el-button>
<el-button type="text"
@click="handleDelete(scope.row)"
v-auth>删除</el-button>
<el-button type="text"
v-if="scope.row.orderStatus==='已完成'&&scope.row.isDel!==1"
@click="handle('renew',scope.row)"
v-auth>续费
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
@current-change="handleCurrentChange"
:current-page="page"
:total="totals">
</el-pagination>
</div>
</el-card>
</div>
</template> </template>
<script> <script>
import qs from 'qs'
export default { export default {
data() { data () {
return { return {
orderParam: this.$store.state.orderParam, form: {
form: { provinceId: +this.$route.query.provinceId || '',
provinces: "", cityId: +this.$route.query.cityId || '',
city: "", orderType: +this.$route.query.orderType || '',
orderType: "", orderStatus: this.$route.query.orderStatus ? +this.$route.query.orderStatus : '',
orderStatus: "" customerName: this.$route.query.customerName || ''
}, },
keyword: "", orderData: [],
orderData: [], multipleSelection: [],
multipleSelection: [], provinceList: this.$store.state.provinceList,
provinceList: this.$store.state.provinceList, cityList: [],
cityList: [], orderTypeList: [{
orderTypeList: [{ name: "正式",
name: "正式", value: 1
value: 1 },
}, {
{ name: "试用",
name: "试用", value: 2
value: 2 }],
}], orderStatusList: [{
orderStatusList: [{ name: "待发货",
name: "待发货", value: 0
value: 0 },
}, {
{ name: "已完成",
name: "已完成", value: 1
value: 1 },
}, {
{ name: "已取消",
name: "已取消", value: 2
value: 2 }],
}], page: +this.$route.query.page || 1,
pageNo: +this.$route.query.page || 1, pageSize: 10,
pageSize: 10, totals: 0,
totals: 0, searchTimer: null,
searchTimer: null, schools: []
schools: [] };
}; },
watch: {
'form.customerName': function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/order').catch(() => { })
}
this.form.provinceId && this.getCityData()
this.getData()
this.getSchool()
},
methods: {
test (val) {
if (val.length > 5) {
val = 5;
}
},
getData () {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '订单管理')
let data = {
...this.form,
pageNo: this.page,
pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : ''
};
this.$post(this.api.orderList, data).then(res => {
res.orderPage.orders.forEach(e => {
e.orderType = this.orderTypeFn(e.orderType);
e.orderStatus = this.orderStatusFn(e.orderStatus);
e.orderNature = this.orderNatureFn(e.orderNature);
});
this.orderData = res.orderPage.orders;
this.totals = res.orderPage.total;
}).catch(res => { });
},
//
clearprovince () {
this.form.cityId = ''
}, },
watch: { //
keyword: function(val) { getCity () {
clearTimeout(this.searchTimer); this.clearprovince();
this.searchTimer = setTimeout(() => { this.getCityData();
this.initData(); this.page = 1;
}, 500); this.getData();
},
async getCityData () {
const { list } = await this.$get(this.api.queryCity, {
provinceId: this.form.provinceId
})
this.cityList = list
},
// url
setReferrer () {
this.$router.push(`${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
// this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
},
addOrder () {
this.setReferrer()
this.$router.push({
path: '/AddOrder',
query: {
val: 'isAdd',
} }
})
}, },
created() { handle (val, row) {
if (this.orderParam) this.form = this.orderParam this.setReferrer()
this.getData() let orderStatus
this.getSchool() if (row.orderStatus == '已完成') {
orderStatus = 1
} else {
orderStatus = 0
}
this.$router.push({
path: '/AddOrder',
query: {
val: val,
orderId: row.orderId,
orderStatus
}
})
}, },
methods: { //
test(val) { getSchool () {
if (val.length > 5) { let sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理')
val = 5; //
} if (!sid) sid = this.$store.state.dataPer.find(e => e.permissionName === '订单管理')
}, this.$post(this.api.queryCustomer, {
getData() { countries: '中国',
const sid = this.$store.state.dataPer.find(e => e.permissionName === '订单管理') provinceId: '',
let data = { cityId: '',
cityId: this.form.city, searchContent: '',
customerName: this.keyword, page: 1,
orderStatus: this.form.orderStatus, size: 10000,
orderType: this.form.orderType, // supplierId: sid ? sid.supplierId : ''
pageNo: this.pageNo, }).then(res => {
pageSize: this.pageSize, this.schools = res.message.list
provinceId: this.form.provinces, }).catch(res => { })
supplierId: sid ? sid.supplierId : '' },
}; //
this.$post(this.api.orderList, data).then(res => { refreshCache (customerId) {
res.orderPage.orders.forEach(e => { this.$post(`${this.api.refreshCache}?schoolId=${this.schools.find(e => e.customerId == customerId).schoolId}`).then(res => { }).catch(res => { })
e.orderType = this.orderTypeFn(e.orderType); },
e.orderStatus = this.orderStatusFn(e.orderStatus); //
e.orderNature = this.orderNatureFn(e.orderNature); handleDelete (row) {
}); this.$confirm("确定要删除吗?", "提示", {
this.orderData = res.orderPage.orders; type: "warning"
this.totals = res.orderPage.total; }).then(() => {
}).catch(res => { var arr = [];
}); arr.push(row.orderId);
}, this.$post(this.api.orderDelete, { ids: arr }).then(res => {
// this.$message.success("删除成功");
clearprovince() { this.refreshCache(row.customerId)
this.form.city = ""; this.getData();
}, }).catch(res => {
// });
getCity() { }).catch(() => {
this.clearprovince(); });
this.getCityData(); },
this.pageNo = 1; //
this.getData(); handleRenew (row) {
},
getCityData() {
let data = {
provinceId: this.form.provinces
};
this.$get(this.api.queryCity, data).then(res => {
this.cityList = res.list;
}).catch(res => {
});
},
addOrder() {
this.$store.commit("systemData", { order_id: "" });
this.$router.push({
path:'/AddOrder',
query:{
val:'isAdd',
}
})
},
handle(val, row) {
let orderStatus
if(row.orderStatus == '已完成'){
orderStatus = 1
}else{
orderStatus = 0
}
this.$store.commit('setOrderParam', this.form)
this.$router.push({
path:'/AddOrder',
query:{
val:val,
orderId:row.orderId,
orderStatus
}
})
// this.$router.push("/addorder?" + val + "=" + row.orderId+"&orderStatus="+orderStatus);
},
//
getSchool() {
let sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理')
//
if (!sid) sid = this.$store.state.dataPer.find(e => e.permissionName === '订单管理')
this.$post(this.api.queryCustomer, {
countries: '中国',
provinceId: '',
cityId: '',
searchContent: '',
page: 1,
size: 10000,
// supplierId: sid ? sid.supplierId : ''
}).then(res => {
this.schools = res.message.list
}).catch(res => {})
},
//
refreshCache(customerId) {
this.$post(`${this.api.refreshCache}?schoolId=${this.schools.find(e => e.customerId == customerId).schoolId}`).then(res => {}).catch(res => {})
},
//
handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
var arr = [];
arr.push(row.orderId);
this.$post(this.api.orderDelete, { ids: arr }).then(res => {
this.$message.success("删除成功");
this.refreshCache(row.customerId)
this.getData();
}).catch(res => {
});
}).catch(() => {
});
},
//
handleRenew(row) {
}, },
handleSelectionChange(val) { handleSelectionChange (val) {
if (val.length > 0) { if (val.length > 0) {
this.multipleSelection = val.map(e => e.orderId); this.multipleSelection = val.map(e => e.orderId);
} else { } else {
this.multipleSelection = []; this.multipleSelection = [];
} }
}, },
delAllSelection() { delAllSelection () {
const list = this.multipleSelection const list = this.multipleSelection
if (list.length != "") { if (list.length != "") {
// //
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$post(this.api.orderDelete, { ids: list }).then(res => { this.$post(this.api.orderDelete, { ids: list }).then(res => {
const { orderData } = this const { orderData } = this
console.log("🚀 ~ file: Order.vue ~ line 299 ~ this.$post ~ message", list, orderData) console.log("🚀 ~ file: Order.vue ~ line 299 ~ this.$post ~ message", list, orderData)
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.getData();
list.map(e => this.refreshCache(orderData.find(n => n.orderId == e).customerId))
}).catch(err => {
});
}).catch(err => {
});
} else {
this.$message.error("请先选择订单 !");
}
},
initData() {
this.pageNo = 1;
this.getData();
},
handleCurrentChange(val) {
this.pageNo = val;
this.$router.push(`order?page=${val}`)
this.getData(); this.getData();
}, list.map(e => this.refreshCache(orderData.find(n => n.orderId == e).customerId))
// }).catch(err => {
gotoClient() { });
this.$router.push(""); }).catch(err => {
} });
} else {
this.$message.error("请先选择订单 !");
}
},
initData () {
this.page = 1;
this.getData();
},
handleCurrentChange (val) {
this.page = val;
this.$router.push(`order?page=${val}`)
this.getData();
},
//
gotoClient () {
this.$router.push("");
} }
}
}; };
</script> </script>
@ -337,8 +407,8 @@ export default {
.mag { .mag {
margin-right: 20px; margin-right: 20px;
} }
.cell{ .cell {
white-space:pre-wrap; white-space: pre-wrap;
width: 140px; width: 140px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -347,10 +417,11 @@ export default {
line-clamp: 2; line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.tags{ .tags {
border: none; border: none;
background: none;color: #000; background: none;
white-space:pre-wrap; color: #000;
white-space: pre-wrap;
width: 140px; width: 140px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;

@ -1,64 +1,63 @@
<template> <template>
<div class="page system" style="padding: 0"> <div class="page system"
<div class="tabs"> style="padding: 0">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a> <div class="tabs">
</div> <a class="item"
v-for="(item,index) in tabs"
<staff v-if="active == 'staff'"></staff> :key="index"
<pc-role v-if="active == 'pcRole'"></pc-role> :class="{active: index == active}"
<mobile-role v-if="active == 'mobileRole'"></mobile-role> @click="tabChange(index)">{{ item }}</a>
</div> </div>
<learn v-if="active == 'learn'" />
<info v-if="active == 'info'" />
<plan v-if="active == 'plan'" />
</div>
</template> </template>
<script> <script>
import Setting from "@/setting"; import Setting from "@/setting";
import staff from "./staff"; import learn from "./learn";
import pcRole from "./pcRole"; import info from "./info";
import mobileRole from "./mobileRole"; import plan from "./plan";
export default { export default {
data() { data () {
return { return {
active: this.$route.query.type || 'staff', active: this.$route.query.type || 'learn',
tabs: { tabs: {
staff: "合伙人学习管理", learn: "合伙人学习管理",
pcRole: "合伙人资讯管理", info: "合伙人资讯管理",
mobileRole: "方案管理" plan: "方案管理"
} }
}; };
}, },
components: { components: {
staff, learn,
pcRole, info,
mobileRole plan
}, },
created() { created () {
Setting.dynamicRoute && this.initTabs(); Setting.dynamicRoute && this.initTabs();
},
methods: {
tabChange (index) {
this.active = index
this.$router.push(`/parnerOperation?type=${index}`)
}, },
methods: { initTabs () {
tabChange(index) { const btns = this.$store.state.btns
this.active = index const tab1 = btns.includes('/parnerOperation:合伙人学习管理')
this.$router.push({ const tab2 = btns.includes('/parnerOperation:合伙人资讯管理')
path: 'parnerOperation', const tab3 = btns.includes('/parnerOperation:方案管理')
query: {
...this.$route.query,
type: index
}
})
},
initTabs() {
const btns = this.$store.state.btns
const tab1 = btns.includes('/parnerOperation:合伙人学习管理')
const tab2 = btns.includes('/parnerOperation:合伙人资讯管理')
const tab3 = btns.includes('/parnerOperation:方案管理')
tab1 || delete this.tabs.staff tab1 || delete this.tabs.learn
tab2 || delete this.tabs.pcRole tab2 || delete this.tabs.info
tab3 || delete this.tabs.mobileRole tab3 || delete this.tabs.plan
const type = this.$route.query.type const type = this.$route.query.type
const keys = Object.keys(this.tabs) const keys = Object.keys(this.tabs)
this.active = keys.includes(type) ? type : keys[0] this.active = keys.includes(type) ? type : keys[0]
}
} }
}
}; };
</script> </script>

@ -0,0 +1,339 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field"
@change="initData">
<el-option v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword"
:placeholder="'请输入' + keywords.find(e => e.id === field).name"
v-model.trim="keyword"
clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:合伙人资讯管理:批量删除'"
@click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:合伙人资讯管理:新增文章'"
type="primary"
@click="add">新增文章</el-button>
</div>
</div>
<el-table :data="list"
class="table"
ref="table"
header-align="center"
@selection-change="handleSelectionChange"
row-key="id"
@sort-change="sortChange">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center"></el-table-column>
<el-table-column show-overflow-tooltip
prop="title"
label="标题"
align="center"
min-width="150"></el-table-column>
<el-table-column prop="classificationName"
label="所属分类"
align="center"
min-width="120"
sortable="custom"></el-table-column>
<el-table-column prop="founderName"
label="录入人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="editorName"
label="修改人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="updateTime"
label="修改日期"
align="center"
min-width="150"
sortable="custom"></el-table-column>
<el-table-column prop="releaseTime"
label="发布日期"
align="center"
min-width="100"
sortable="custom"></el-table-column>
<el-table-column prop="learnerNumber"
label="总浏览"
align="center"
min-width="70"></el-table-column>
<el-table-column prop="workNumber"
label="状态"
align="center"
min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column prop="sequence"
label="置顶"
align="center"
min-width="80"
sortable="custom">
<template slot-scope="scope">
<i v-if="scope.row.isRelease"
:class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']"
@click="sticky(scope.row)"></i>
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="210">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:合伙人资讯管理:编辑'"
type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:合伙人资讯管理:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
<el-switch v-auth="'/parnerOperation:合伙人资讯管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
@current-change="currentChange"
:current-page="page"
layout="total, prev, pager, next"
:total="total"></el-pagination>
</div>
</div>
</template>
<script>
import util from '@/libs/util'
export default {
data () {
return {
field: this.$route.query.field || 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: this.$route.query.keyword || '',
list: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
topSort: '',
classificationNameSort: '',
releaseDateSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/parnerOperation?type=info').catch(() => { })
}
this.getData()
},
methods: {
//
getData () {
const { keyword } = this
this.$post(this.api.partnerOperatingList, {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
topSort: this.topSort,
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
typeId: 2, // (1.2.)
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}).then(({ page, total }) => {
page.forEach(e => {
e.editing = false
})
this.list = page
this.total = total
}).catch(err => { })
},
currentChange (val) {
this.page = val
this.getData()
},
handleSelectionChange (val) {
this.multipleSelection = val
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel () {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => { })
}).catch(() => { })
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete (row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => { })
}).catch(() => { })
},
//
switchOff (val, row) {
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => { }).catch((res) => { })
},
//
sortChange (column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'releaseTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.topSort = ''
}
}
if (column.prop === 'sequence') {
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
//
submitSequence (row) {
if (!row.sequence) return Util.errorMsg('请输入排序')
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => {
this.initData()
}).catch(res => { })
},
//
editSequence (row) {
this.list.forEach(e => {
e.editing = false
})
row.editing = true
},
//
sticky (row) {
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
this.initData()
}).catch(res => { })
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.fullPath}&keyword=${this.keyword}&field=${this.field}&page=${this.page}`)
},
//
add () {
this.setReferrer()
this.$router.push(`/learnMg?type=2`)
},
//
edit (row) {
this.setReferrer()
this.$router.push(`/learnMg?id=${row.id}&type=2`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
.squ-icon {
font-size: 16px;
font-weight: 600;
cursor: pointer;
color: #f70000;
&.el-icon-check {
color: #05991e;
}
}
/deep/.squ-input {
width: auto;
.el-input__inner {
width: 60px;
padding: 0 10px;
}
}
</style>

@ -0,0 +1,339 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field"
@change="initData">
<el-option v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword"
:placeholder="'请输入' + keywords.find(e => e.id === field).name"
v-model.trim="keyword"
clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:合伙人学习管理:批量删除'"
@click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:合伙人学习管理:新增文章'"
type="primary"
@click="add">新增文章</el-button>
</div>
</div>
<el-table :data="list"
class="table"
ref="table"
header-align="center"
@selection-change="handleSelectionChange"
row-key="id"
@sort-change="sortChange">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center"></el-table-column>
<el-table-column show-overflow-tooltip
prop="title"
label="标题"
align="center"
min-width="150"></el-table-column>
<el-table-column prop="classificationName"
label="所属分类"
align="center"
min-width="120"
sortable="custom"></el-table-column>
<el-table-column prop="founderName"
label="录入人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="editorName"
label="修改人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="updateTime"
label="修改日期"
align="center"
min-width="150"
sortable="custom"></el-table-column>
<el-table-column prop="releaseTime"
label="发布日期"
align="center"
min-width="100"
sortable="custom"></el-table-column>
<el-table-column prop="learnerNumber"
label="已学习人数"
align="center"
min-width="70"></el-table-column>
<el-table-column prop="workNumber"
label="状态"
align="center"
min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column prop="sequence"
label="置顶"
align="center"
min-width="80"
sortable="custom">
<template slot-scope="scope">
<i v-if="scope.row.isRelease"
:class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']"
@click="sticky(scope.row)"></i>
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="210">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:合伙人学习管理:编辑'"
type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:合伙人学习管理:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
<el-switch v-auth="'/parnerOperation:合伙人学习管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
@current-change="currentChange"
:current-page="page"
layout="total, prev, pager, next"
:total="total"></el-pagination>
</div>
</div>
</template>
<script>
import util from '@/libs/util'
export default {
data () {
return {
field: this.$route.query.field || 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: this.$route.query.keyword || '',
list: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
topSort: '',
classificationNameSort: '',
releaseDateSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/parnerOperation?type=learn').catch(() => { })
}
this.getData()
},
methods: {
//
getData () {
const { keyword } = this
this.$post(this.api.partnerOperatingList, {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
topSort: this.topSort,
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
typeId: 1, // (1.2.)
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}).then(({ page, total }) => {
page.forEach(e => {
e.editing = false
})
this.list = page
this.total = total
}).catch(err => { })
},
currentChange (val) {
this.page = val
this.getData()
},
handleSelectionChange (val) {
this.multipleSelection = val
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel () {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => { })
}).catch(() => { })
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete (row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => { })
}).catch(() => { })
},
//
switchOff (val, row) {
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => { }).catch((res) => { })
},
//
sortChange (column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'releaseTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.topSort = ''
}
}
if (column.prop === 'sequence') {
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
//
submitSequence (row) {
if (!row.sequence) return Util.errorMsg('请输入排序')
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => {
this.initData()
}).catch(res => { })
},
//
editSequence (row) {
this.list.forEach(e => {
e.editing = false
})
row.editing = true
},
//
sticky (row) {
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
this.initData()
}).catch(res => { })
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.fullPath}&keyword=${this.keyword}&field=${this.field}&page=${this.page}`)
},
//
add () {
this.setReferrer()
this.$router.push(`/learnMg?type=1`)
},
//
edit (row) {
this.setReferrer()
this.$router.push(`/learnMg?id=${row.id}&type=1`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
.squ-icon {
font-size: 16px;
font-weight: 600;
cursor: pointer;
color: #f70000;
&.el-icon-check {
color: #05991e;
}
}
/deep/.squ-input {
width: auto;
.el-input__inner {
width: 60px;
padding: 0 10px;
}
}
</style>

@ -660,6 +660,9 @@ export default {
preview () { preview () {
window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${this.form.id}&siteId=${this.form.siteId}&id=${this.form.columnId}`) window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${this.form.id}&siteId=${this.form.siteId}&id=${this.form.columnId}`)
}, },
backPage () {
this.$router.push(this.$store.state.referrer || '/parnerOperation')
},
// //
back () { back () {
this.pass = true this.pass = true
@ -671,17 +674,16 @@ export default {
}).then(() => { }).then(() => {
this.submit(this.form.isRelease) this.submit(this.form.isRelease)
}).catch(() => { }).catch(() => {
this.$router.back() this.backPage()
}) })
} else { } else {
this.$router.back() this.backPage()
} }
}, },
// //
submit (isRelease, next) { submit (isRelease, next) {
if (this.submiting) return false if (this.submiting) return false
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
console.log('form=>', form)
if (!form.title) return Util.errorMsg('请填写标题') if (!form.title) return Util.errorMsg('请填写标题')
if (this.nameRepeat) return Util.errorMsg('该标题已重复!') if (this.nameRepeat) return Util.errorMsg('该标题已重复!')
// //
@ -702,7 +704,7 @@ export default {
delete form.children delete form.children
this.$post(this.api.updateParnerArticle, form).then(res => { this.$post(this.api.updateParnerArticle, form).then(res => {
Util.successMsg('修改成功') Util.successMsg('修改成功')
next ? next() : this.$router.back() next ? next() : this.backPage()
}).catch(err => { }).catch(err => {
this.submiting = false this.submiting = false
}) })

@ -1,221 +0,0 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field" @change="initData">
<el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:方案管理:批量删除'" @click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:方案管理:新增文章'" type="primary" @click="add" >新增文章</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column>
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120" sortable="custom"></el-table-column>
<el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column>
<el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column>
<el-table-column prop="updateTime" label="修改日期" align="center" min-width="150" sortable="custom"></el-table-column>
<el-table-column prop="createTime" label="发布日期" align="center" min-width="100" sortable="custom"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:方案管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:方案管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
v-auth="'/parnerOperation:方案管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
</div>
</template>
<script>
import util from '@/libs/util'
export default {
data() {
return {
field: 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: '',
list: [],
page: 1,
pageSize: 10,
total: 0,
modifiedTimeSort: '',
releaseDateSort: 'desc',
classificationNameSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() {
this.getData()
},
methods: {
//
getData() {
const { keyword } = this
const data = {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
createTimeSort: this.releaseDateSort,
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}
this.$post(this.api.schemeList, data).then(({ data }) => {
this.list = data.records
this.total = +data.total
}).catch(err => {})
},
currentChange(val) {
this.page = val
this.getData()
},
handleSelectionChange(val) {
this.multipleSelection = val
},
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel() {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionScheme}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionScheme}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
//
switchOff(val, row) {
this.$post(`${this.api.enableOrDisableScheme}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {})
},
//
add() {
this.$router.push(`/schemeSet`)
},
//
sortChange(column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'createTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'sequence') {
this.sequenceSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
//
edit(row) {
this.$router.push(`/schemeSet?id=${row.id}`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
</style>

@ -1,269 +0,0 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field" @change="initData">
<el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:合伙人资讯管理:批量删除'" @click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:合伙人资讯管理:新增文章'" type="primary" @click="add" >新增文章</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column>
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120" sortable="custom"></el-table-column>
<el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column>
<el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column>
<el-table-column prop="updateTime" label="修改日期" align="center" min-width="150" sortable="custom"></el-table-column>
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100" sortable="custom"></el-table-column>
<el-table-column prop="learnerNumber" label="总浏览" align="center" min-width="70"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column prop="sequence" label="置顶" align="center" min-width="80" sortable="custom">
<template slot-scope="scope">
<i v-if="scope.row.isRelease" :class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']" @click="sticky(scope.row)"></i>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="210">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:合伙人资讯管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:合伙人资讯管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
v-auth="'/parnerOperation:合伙人资讯管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
</div>
</template>
<script>
import Setting from '@/setting'
import util from '@/libs/util'
import { mapMutations } from 'vuex'
export default {
data() {
return {
field: 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: '',
list: [],
page: 1,
pageSize: 10,
total: 0,
topSort: '',
classificationNameSort: '',
releaseDateSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() {
this.getData()
},
methods: {
//
getData() {
const { keyword } = this
this.$post(this.api.partnerOperatingList, {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
topSort: this.topSort,
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
typeId: 2, // (1.2.)
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}).then(({ page, total }) => {
page.forEach(e => {
e.editing = false
})
this.list = page
this.total = total
}).catch(err => {})
},
currentChange(val) {
this.page = val
this.getData()
},
handleSelectionChange(val) {
this.multipleSelection = val
},
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel() {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
//
switchOff(val, row) {
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {})
},
//
add() {
this.$router.push(`/learnMg?type=2`)
},
//
sortChange(column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'releaseTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.topSort = ''
}
}
if (column.prop === 'sequence') {
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
//
submitSequence(row) {
if (!row.sequence) return Util.errorMsg('请输入排序')
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => {
this.initData()
}).catch(res => {})
},
//
editSequence(row) {
this.list.forEach(e => {
e.editing = false
})
row.editing = true
},
//
sticky(row) {
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
this.initData()
}).catch(res => {})
},
//
edit(row) {
this.$router.push(`/learnMg?id=${row.id}&type=2`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
.squ-icon {
font-size: 16px;
font-weight: 600;
cursor: pointer;
color: #f70000;
&.el-icon-check {
color: #05991e;
}
}
/deep/.squ-input {
width: auto;
.el-input__inner {
width: 60px;
padding: 0 10px;
}
}
</style>

@ -0,0 +1,279 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field"
@change="initData">
<el-option v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword"
:placeholder="'请输入' + keywords.find(e => e.id === field).name"
v-model.trim="keyword"
clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:方案管理:批量删除'"
@click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:方案管理:新增文章'"
type="primary"
@click="add">新增文章</el-button>
</div>
</div>
<el-table :data="list"
class="table"
ref="table"
header-align="center"
@selection-change="handleSelectionChange"
row-key="id"
@sort-change="sortChange">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center"></el-table-column>
<el-table-column show-overflow-tooltip
prop="title"
label="标题"
align="center"
min-width="150"></el-table-column>
<el-table-column prop="classificationName"
label="所属分类"
align="center"
min-width="120"
sortable="custom"></el-table-column>
<el-table-column prop="founderName"
label="录入人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="editorName"
label="修改人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="updateTime"
label="修改日期"
align="center"
min-width="150"
sortable="custom"></el-table-column>
<el-table-column prop="createTime"
label="发布日期"
align="center"
min-width="100"
sortable="custom"></el-table-column>
<el-table-column prop="workNumber"
label="状态"
align="center"
min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="170">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:方案管理:编辑'"
type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:方案管理:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
<el-switch v-auth="'/parnerOperation:方案管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
@current-change="currentChange"
:current-page="page"
layout="total, prev, pager, next"
:total="total"></el-pagination>
</div>
</div>
</template>
<script>
import util from '@/libs/util'
export default {
data () {
return {
field: this.$route.query.field || 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: this.$route.query.keyword || '',
list: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
modifiedTimeSort: '',
releaseDateSort: 'desc',
classificationNameSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted () {
this.getData()
},
methods: {
//
getData () {
const { keyword } = this
const data = {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
createTimeSort: this.releaseDateSort,
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}
this.$post(this.api.schemeList, data).then(({ data }) => {
this.list = data.records
this.total = +data.total
}).catch(err => { })
},
currentChange (val) {
this.page = val
this.getData()
},
handleSelectionChange (val) {
this.multipleSelection = val
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel () {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionScheme}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => { })
}).catch(() => { })
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete (row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionScheme}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => { })
}).catch(() => { })
},
//
switchOff (val, row) {
this.$post(`${this.api.enableOrDisableScheme}?id=${row.id}&isDisable=${val}`).then(res => { }).catch((res) => { })
},
//
sortChange (column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'createTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'sequence') {
this.sequenceSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.fullPath}&keyword=${this.keyword}&field=${this.field}&page=${this.page}`)
},
//
add () {
this.setReferrer()
this.$router.push(`/schemeSet`)
},
//
edit (row) {
this.setReferrer()
this.$router.push(`/schemeSet?id=${row.id}`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
</style>

@ -574,6 +574,9 @@ export default {
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
) )
}, },
backPage () {
this.$router.push(this.$store.state.referrer || '/parnerOperation?type=plan')
},
// //
back () { back () {
this.pass = true this.pass = true
@ -585,10 +588,10 @@ export default {
}).then(() => { }).then(() => {
this.submit(this.form.isRelease) this.submit(this.form.isRelease)
}).catch(() => { }).catch(() => {
this.$router.back() this.backPage()
}) })
} else { } else {
this.$router.back() this.backPage()
} }
}, },
// //
@ -622,7 +625,7 @@ export default {
if (form.id) { if (form.id) {
this.$post(this.api.updateScheme, form).then(res => { this.$post(this.api.updateScheme, form).then(res => {
Util.successMsg('修改成功') Util.successMsg('修改成功')
next ? next() : this.$router.back() next ? next() : this.backPage()
}).catch(err => { }).catch(err => {
this.submiting = false this.submiting = false
}) })

@ -1,268 +0,0 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field" @change="initData">
<el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:合伙人学习管理:批量删除'" @click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:合伙人学习管理:新增文章'" type="primary" @click="add" >新增文章</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column>
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120" sortable="custom"></el-table-column>
<el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column>
<el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column>
<el-table-column prop="updateTime" label="修改日期" align="center" min-width="150" sortable="custom"></el-table-column>
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100" sortable="custom"></el-table-column>
<el-table-column prop="learnerNumber" label="已学习人数" align="center" min-width="70"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column prop="sequence" label="置顶" align="center" min-width="80" sortable="custom">
<template slot-scope="scope">
<i v-if="scope.row.isRelease" :class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']" @click="sticky(scope.row)"></i>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="210">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:合伙人学习管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:合伙人学习管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
v-auth="'/parnerOperation:合伙人学习管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
</div>
</template>
<script>
import Setting from '@/setting'
import util from '@/libs/util'
export default {
data() {
return {
field: 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: '',
list: [],
page: 1,
pageSize: 10,
total: 0,
topSort: '',
classificationNameSort: '',
releaseDateSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() {
this.getData()
},
methods: {
//
getData() {
const { keyword } = this
this.$post(this.api.partnerOperatingList, {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
topSort: this.topSort,
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
typeId: 1, // (1.2.)
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}).then(({ page, total }) => {
page.forEach(e => {
e.editing = false
})
this.list = page
this.total = total
}).catch(err => {})
},
currentChange(val) {
this.page = val
this.getData()
},
handleSelectionChange(val) {
this.multipleSelection = val
},
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel() {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
//
switchOff(val, row) {
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {})
},
//
add() {
this.$router.push(`/learnMg?type=1`)
},
//
sortChange(column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'releaseTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.topSort = ''
}
}
if (column.prop === 'sequence') {
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
//
submitSequence(row) {
if (!row.sequence) return Util.errorMsg('请输入排序')
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => {
this.initData()
}).catch(res => {})
},
//
editSequence(row) {
this.list.forEach(e => {
e.editing = false
})
row.editing = true
},
//
sticky(row) {
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
this.initData()
}).catch(res => {})
},
//
edit(row) {
this.$router.push(`/learnMg?id=${row.id}&type=1`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
.squ-icon {
font-size: 16px;
font-weight: 600;
cursor: pointer;
color: #f70000;
&.el-icon-check {
color: #05991e;
}
}
/deep/.squ-input {
width: auto;
.el-input__inner {
width: 60px;
padding: 0 10px;
}
}
</style>

@ -12,27 +12,27 @@
<div> <div>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="系统归属"> <el-form-item label="系统归属">
<el-select v-model="systemAttribution" <el-select v-model="form.belong"
clearable clearable
placeholder="请选择系统归属" placeholder="请选择系统归属"
@change="initData"> @change="initData">
<el-option v-for="(item,index) in systemBelongList" <el-option v-for="(item, i) in belongs"
:key="index" :key="i"
:label="item.label" :label="item"
:value="item.value"></el-option> :value="i"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="系统类型"> <el-form-item label="系统类型">
<el-select v-model="systemType" <el-select v-model="form.type"
clearable clearable
placeholder="请选择系统类型" placeholder="请选择系统类型"
@change="initData"> @change="initData">
<el-option v-for="(item,index) in systemTypeList" <el-option v-for="(item, i) in types"
:key="index" :key="i"
:label="item.label" :label="item"
:value="item.value"></el-option> :value="i"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -41,7 +41,7 @@
<el-form-item> <el-form-item>
<el-input placeholder="请输入系统名称" <el-input placeholder="请输入系统名称"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
v-model.trim="systemSearch" v-model.trim="form.systemName"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -56,7 +56,7 @@
<p class="hr_tag"></p> <p class="hr_tag"></p>
<span>服务列表</span> <span>服务列表</span>
</div> </div>
<el-table :data="systemData" <el-table :data="list"
class="table" class="table"
stripe stripe
header-align="center"> header-align="center">
@ -73,7 +73,7 @@
label="系统类型" label="系统类型"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ systemTypeKeys[scope.row.type] }} {{ types[scope.row.type] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="supplierName" <el-table-column prop="supplierName"
@ -83,14 +83,14 @@
label="系统归属" label="系统归属"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ systemBelongKeys[scope.row.belong] }} {{ belongs[scope.row.belong] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="state" <el-table-column prop="state"
label="系统状态" label="系统状态"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ systemStatusKeys[scope.row.state] }} {{ states[scope.row.state] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="payamount" <el-table-column prop="payamount"
@ -126,8 +126,8 @@
<el-pagination background <el-pagination background
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:current-page="pageNo" :current-page="page"
:total="totals"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -136,56 +136,32 @@
<script> <script>
import Setting from "@/setting"; import Setting from "@/setting";
import Cookie from 'js-cookie' import qs from 'qs'
export default { export default {
data () { data () {
return { return {
userId: this.$store.state.userLoginId, userId: this.$store.state.userLoginId,
token: btoa(sessionStorage.getItem('token')), token: btoa(sessionStorage.getItem('token')),
systemAttribution: "", form: {
systemType: "", belong: this.$route.query.belong || '',
systemSearch: "", type: this.$route.query.type ? +this.$route.query.type : '',
systemName: this.$route.query.systemName || ''
},
searchTimer: null, searchTimer: null,
systemData: [], list: [],
totals: 0, total: 0,
systemBelongList: [ belongs: {
{
label: "外部产品",
value: 1
},
{
label: "内部系统",
value: 0
}
],
systemBelongKeys: {
1: '外部产品', 1: '外部产品',
0: '内部系统' 0: '内部系统'
}, },
systemTypeList: [ types: ['编程类', '流程类'],
{ states: ['运行中', '默认'],
label: "编程类", page: +this.$route.query.page || 1,
value: 0
},
{
label: "流程类",
value: 1
}
],
systemTypeKeys: {
0: '编程类',
1: '流程类'
},
systemStatusKeys: {
0: '运行中',
1: '默认'
},
pageNo: +this.$route.query.page || 1,
pageSize: 10 pageSize: 10
}; };
}, },
watch: { watch: {
systemSearch: function (val) { 'form.systemName': function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData();
@ -193,40 +169,44 @@ export default {
} }
}, },
mounted () { mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/configure').catch(() => { })
}
this.getData(); this.getData();
}, },
methods: { methods: {
initData () { initData () {
this.pageNum = 1; this.page = 1;
this.getData(); this.getData();
}, },
getData () { getData () {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '服务配置') const sid = this.$store.state.dataPer.find(e => e.permissionName === '服务配置')
let data = { let data = {
belong: this.systemAttribution, ...this.form,
type: this.systemType, pageNum: this.page,
systemName: this.systemSearch,
pageNum: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : '' supplierId: sid ? sid.supplierId : ''
}; };
this.$post(this.api.queryServiceConfig, data).then(res => { this.$post(this.api.queryServiceConfig, data).then(res => {
this.systemData = res.serviceList.records; this.list = res.serviceList.records;
this.totals = res.serviceList.total; this.total = res.serviceList.total;
}).catch(res => { }).catch(res => {
}); });
}, },
handleCurrentChange (val) { handleCurrentChange (val) {
this.pageNo = val; this.page = val;
this.$router.push(`configure?page=${val}`) this.$router.push(`configure?page=${val}`)
this.getData(); this.getData();
}, },
edit (row) { // url
this.$store.commit("configData", { config_id: row.systemId }); setReferrer () {
this.$router.push("/addconfigure"); this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
}, },
// //
toBackstage (row) { toBackstage (row) {
this.setReferrer()
if (row.systemId == 19) { if (row.systemId == 19) {
location.href = `${Setting.sandPath}/#/config?token=${sessionStorage.getItem('token')}&admin=1&referrer=${encodeURIComponent(location.href)}` location.href = `${Setting.sandPath}/#/config?token=${sessionStorage.getItem('token')}&admin=1&referrer=${encodeURIComponent(location.href)}`
} else { } else {
@ -234,21 +214,13 @@ export default {
} }
}, },
getIntoProject (row) { getIntoProject (row) {
this.setReferrer()
this.$router.push(`/projectList?systemId=${row.systemId}&show=1&name=${row.systemName}`) this.$router.push(`/projectList?systemId=${row.systemId}&show=1&name=${row.systemName}`)
}, },
getIntoJudgement (row) { getIntoJudgement (row) {
// console.log(`${Setting.jumpPath}#/?systemId=${row.systemId}&token=${this.token}&referrer=${btoa(location.href)}`); this.setReferrer()
location.href = `${Setting.jumpPath}#/?systemId=${row.systemId}&token=${this.token}&referrer=${btoa(location.href)}`; location.href = `${Setting.jumpPath}#/?systemId=${row.systemId}&token=${this.token}&referrer=${btoa(location.href)}`;
}, },
setCookie (name, value) {
if (value) {
var days = 1;//
var exp = new Date();
exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000);
//Cookie,toGMTString
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString + ";path=/;";
}
}
} }
}; };
</script> </script>

@ -57,7 +57,7 @@ export default {
}) })
}, },
back () { back () {
this.$router.push('/configure') this.$router.push(this.$store.state.referrer || '/configure')
} }
} }
}; };

@ -106,7 +106,6 @@
</template> </template>
<script> <script>
import org from "./modelType" import org from "./modelType"
import Setting from '@/setting'
import Bus from '@/libs/bus' import Bus from '@/libs/bus'
export default { export default {
data () { data () {
@ -114,7 +113,7 @@ export default {
systemId: this.$route.query.systemId, systemId: this.$route.query.systemId,
isTopLevel: true, // isTopLevel: true, //
listData: [], listData: [],
keyword: '', keyword: this.$route.query.keyword || '',
page: +this.$route.query.page || 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
@ -132,6 +131,13 @@ export default {
keyword: function (val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
keyword: val
}
})
this.initData() this.initData()
}, 500) }, 500)
} }

@ -144,7 +144,7 @@ export default {
systemId: this.$route.query.systemId, systemId: this.$route.query.systemId,
isTopLevel: true, // isTopLevel: true, //
listData: [], listData: [],
keyword: "", keyword: this.$route.query.keyword || '',
page: +this.$route.query.page || 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
@ -169,6 +169,13 @@ export default {
keyword: function (val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
keyword: val
}
})
this.initData() this.initData()
}, 500) }, 500)
} }

@ -614,7 +614,7 @@ export default {
} else { } else {
this.$message.success('更新实验项目成功') this.$message.success('更新实验项目成功')
} }
this.$router.back(); this.toList();
} }
}).catch(err => { }).catch(err => {
this.submiting = false this.submiting = false
@ -887,7 +887,7 @@ export default {
}, },
// //
toList () { toList () {
this.$router.back() this.$router.push(this.$store.state.innerReferrer)
}, },
// //
back () { back () {

@ -4,7 +4,7 @@
shadow="hover" shadow="hover"
class="mgb20"> class="mgb20">
<el-page-header :content="'实验项目管理 / '+titleName" <el-page-header :content="'实验项目管理 / '+titleName"
@back="goBack"></el-page-header> @back="back"></el-page-header>
</el-card> </el-card>
<el-card shadow="hover" <el-card shadow="hover"
@ -19,7 +19,7 @@
<el-form label-width="80px"> <el-form label-width="80px">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="来源"> <el-form-item label="来源">
<el-select v-model="queryData.founder" <el-select v-model="form.founder"
clearable clearable
placeholder="请选择创建人" placeholder="请选择创建人"
@change="initData"> @change="initData">
@ -32,7 +32,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="状态"> <el-form-item label="状态">
<el-select v-model="queryData.state" <el-select v-model="form.state"
clearable clearable
placeholder="请选择状态" placeholder="请选择状态"
@change="initData"> @change="initData">
@ -45,7 +45,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="用途"> <el-form-item label="用途">
<el-select v-model="queryData.permissions" <el-select v-model="form.permissions"
placeholder="请选择" placeholder="请选择"
@change="initData"> @change="initData">
<el-option v-for="item in permissionsList" <el-option v-for="item in permissionsList"
@ -59,7 +59,7 @@
<el-form-item> <el-form-item>
<el-input placeholder="请输入项目名称" <el-input placeholder="请输入项目名称"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
v-model="keyword" v-model="form.projectName"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -84,7 +84,7 @@
@click="delAllData">批量删除</el-button> @click="delAllData">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="listData" <el-table :data="list"
class="table" class="table"
ref="table" ref="table"
stripe stripe
@ -117,7 +117,7 @@
min-width="140" min-width="140"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ queryData.founder == 1 ? scope.row.schoolName : scope.row.creator }} {{ form.founder == 1 ? scope.row.schoolName : scope.row.creator }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="用途" <el-table-column label="用途"
@ -196,23 +196,21 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from 'vuex'; import qs from 'qs'
import Setting from "@/setting";
export default { export default {
data () { data () {
return { return {
showBack: Boolean(this.$route.query.show), showBack: Boolean(this.$route.query.show),
systemId: this.$route.query.systemId, systemId: this.$route.query.systemId,
titleName: this.$route.query.name, titleName: this.$route.query.name,
queryData: { form: {
platformId: 3, // :1 :3 platformId: 3, // :1 :3
founder: 0, // (0: 1:) founder: this.$route.query.founder ? +this.$route.query.founder : 0, // (0: 1:)
state: "", // (0:稿 1:) state: this.$route.query.state ? +this.$route.query.state : '', // (0:稿 1:)
permissions: "", // (0: 1: 2:) permissions: this.$route.query.permissions ? +this.$route.query.permissions : '', // (0: 1: 2:)
projectName: this.$route.query.projectName || ''
}, },
keyword: '', list: [],
status: '',
listData: [],
total: 0, total: 0,
permissionsList: [{ permissionsList: [{
value: '', value: '',
@ -273,7 +271,7 @@ export default {
}; };
}, },
watch: { watch: {
keyword: function (val) { 'form.projectName': function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData();
@ -281,28 +279,25 @@ export default {
} }
}, },
mounted () { mounted () {
if (this.$route.query.founder && this.$route.query.founder != 'undefined') { const { query } = this.$route
this.queryData.founder = +this.$route.query.founder if (query.page) {
} else { this.$router.push(`/projectList?systemId=${query.systemId}&show=${query.show}&name=${query.name}`).catch(() => { })
this.queryData.founder = 0
} }
this.getData(); this.getData();
}, },
methods: { methods: {
getData () { getData () {
let data = { let data = {
...this.queryData, ...this.form,
projectName: this.keyword,
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
systemId: this.systemId systemId: this.systemId
}; };
this.$post(this.api.queryProjectManage, data).then(res => { this.$post(this.api.queryProjectManage, data).then(res => {
this.listData = res.data.records; this.list = res.data.records;
this.total = res.data.total; this.total = res.data.total;
}).catch(err => { }).catch(err => { });
console.log(err);
});
}, },
initData () { initData () {
this.page = 1; this.page = 1;
@ -310,20 +305,19 @@ export default {
}, },
handleCurrentChange (val) { // handleCurrentChange (val) { //
this.page = val; this.page = val;
this.$router.replace({
path: 'projectList',
query: {
...this.$route.query,
page: val
}
})
this.getData(); this.getData();
}, },
// url
setReferrer () {
this.$store.commit('setInnerReferrer', `${this.$route.path}?${qs.stringify(this.$route.query)}&${qs.stringify(this.form)}&page=${this.page}`)
},
add () { // add () { //
this.$router.push(`/projectAdd?systemId=${this.systemId}&founder=${this.queryData.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`); this.setReferrer()
this.$router.push(`/projectAdd?systemId=${this.systemId}&founder=${this.form.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`);
}, },
edit (row) { // edit (row) { //
this.$router.push(`/projectAdd?systemId=${this.systemId}&projectId=${row.projectId}&founder=${this.queryData.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`); this.setReferrer()
this.$router.push(`/projectAdd?systemId=${this.systemId}&projectId=${row.projectId}&founder=${this.form.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`);
}, },
handleSelectionChange (val) { // handleSelectionChange (val) { //
this.multipleSelection = val; this.multipleSelection = val;
@ -343,8 +337,7 @@ export default {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => { this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.form.platformId}`).then(res => {
console.log(ids)
if (res.status == 200) { if (res.status == 200) {
let delList = [] let delList = []
if (isNaN(ids) == 'NaN') { if (isNaN(ids) == 'NaN') {
@ -352,7 +345,7 @@ export default {
} else { } else {
delList.push(ids) delList.push(ids)
} }
if (delList.length == this.listData.length) { if (delList.length == this.list.length) {
if (this.page > 1) { if (this.page > 1) {
this.page = this.page - 1 this.page = this.page - 1
} }
@ -372,7 +365,7 @@ export default {
}); });
}, },
switchOff (row) { // switchOff (row) { //
this.$get(`${this.api.updateIsOpen}?isOpen=${row.ztOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => { this.$get(`${this.api.updateIsOpen}?isOpen=${row.ztOpen}&projectId=${row.projectId}&platformId=${this.form.platformId}`).then(res => {
if (res.status === 200) { if (res.status === 200) {
this.$message.success('更新启用状态成功'); this.$message.success('更新启用状态成功');
this.getData(); this.getData();
@ -430,19 +423,17 @@ export default {
}); });
this.$post(`${this.api.copyProjectManage}`, this.currentRow).then(res => { this.$post(`${this.api.copyProjectManage}`, this.currentRow).then(res => {
if (res.status === 200) { if (res.status === 200) {
this.queryData.founder = 0 this.form.founder = 0
this.initData(); this.initData();
this.$message.success("复制实验项目成功"); this.$message.success("复制实验项目成功");
this.copyVisible = false; this.copyVisible = false;
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
} }
}).catch(err => { }).catch(err => { });
console.log(err);
});
}, },
goBack () { // back () { //
this.$router.back() this.$router.push(this.$store.state.referrer || '/configure')
} }
} }
}; };

@ -1563,7 +1563,7 @@ export default {
this.pass = true this.pass = true
this.submiting = false; this.submiting = false;
Util.successMsg("修改成功"); Util.successMsg("修改成功");
next ? next() : this.$router.back() next ? next() : this.backPage()
}).catch(err => { }).catch(err => {
this.submiting = false; this.submiting = false;
}); });
@ -1591,12 +1591,15 @@ export default {
}).then(() => { }).then(() => {
this.submit(this.form.mall.state) this.submit(this.form.mall.state)
}).catch(() => { }).catch(() => {
this.$router.back() this.backPage()
}) })
} else { } else {
this.$router.back() this.backPage()
} }
}, },
backPage () {
this.$router.push(this.$store.state.referrer || '/shop')
}
} }
}; };
</script> </script>

@ -1,14 +1,17 @@
<template> <template>
<!-- 理论课程管理 --> <div class="page">
<div class="page"> <div class="tabs">
<div class="tabs"> <a class="item"
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a> v-for="(item,index) in tabs"
</div> :key="index"
<div class="page-content"> :class="{active: index == active}"
<product v-if="active == 'first'" /> @click="tabChange(index)">{{ item }}</a>
<market v-if="active == 'second'" />
</div>
</div> </div>
<div class="page-content">
<product v-if="active == 'first'" />
<market v-if="active == 'second'" />
</div>
</div>
</template> </template>
<script> <script>
@ -16,39 +19,37 @@ import Setting from "@/setting";
import product from "./product"; import product from "./product";
import market from "./market"; import market from "./market";
export default { export default {
name: "course", components: {
components: { product,
product, market,
market, },
}, data () {
data() { return {
return { active: "first", //
active: "first", // tabs: {
tabs: { first: "产品管理",
first: "产品管理", second: "营销推广管理",
second: "营销推广管理", },
}, showTabs: true
showTabs: true };
}; },
mounted () {
Setting.dynamicRoute && this.initTabs();
},
methods: {
tabChange (index) {
this.active = index;
}, },
mounted() { initTabs () {
Setting.dynamicRoute && this.initTabs(); const { btns } = this.$store.state
}, const tab1 = btns.includes('/shop:产品管理')
methods: { const tab2 = btns.includes('/shop:营销推广管理')
tabChange(index) { tab1 || delete this.tabs.first
this.active = index; tab2 || delete this.tabs.second
},
initTabs() {
const { btns } = this.$store.state
const tab1 = btns.includes('/shop:产品管理')
const tab2 = btns.includes('/shop:营销推广管理')
tab1 || delete this.tabs.first
tab2 || delete this.tabs.second
}
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>

@ -181,7 +181,6 @@
<script> <script>
import Util from "@/libs/util"; import Util from "@/libs/util";
import Setting from '@/setting'
import qs from 'qs' import qs from 'qs'
export default { export default {
data () { data () {
@ -190,11 +189,11 @@ export default {
form: { form: {
hotTag: 1, hotTag: 1,
sort: 0, sort: 0,
categoryId: '', categoryId: +this.$route.query.categoryId || '',
productClassification: '', productClassification: +this.$route.query.productClassification || '',
productName: '', productName: this.$route.query.productName || '',
professionalCategoryId: '', professionalCategoryId: +this.$route.query.professionalCategoryId || '',
professionalId: '', professionalId: +this.$route.query.professionalId || '',
}, },
subjectList: [], // subjectList: [], //
professionalClassList: [], // professionalClassList: [], //
@ -216,9 +215,14 @@ export default {
} }
}, },
mounted () { mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/shop').catch(() => { })
}
this.getSubject() this.getSubject()
this.getCategory() this.getCategory()
this.initData() this.getData()
}, },
methods: { methods: {
getData () { getData () {
@ -291,10 +295,16 @@ export default {
}).catch(err => { }).catch(err => {
}); });
}, },
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
},
addCourse () { addCourse () {
this.setReferrer()
this.$router.push("/shop/addProduct"); this.$router.push("/shop/addProduct");
}, },
edit (row, show = 0) { edit (row, show = 0) {
this.setReferrer()
this.$router.push(`/shop/addProduct?id=${row.mallId}&show=${show}`) this.$router.push(`/shop/addProduct?id=${row.mallId}&show=${show}`)
}, },
handleDelete (row) { handleDelete (row) {

@ -501,7 +501,7 @@ export default {
this.$post(this.api.updateTheoreticalCourse, form).then(res => { this.$post(this.api.updateTheoreticalCourse, form).then(res => {
this.submiting = false; this.submiting = false;
util.successMsg("修改成功"); util.successMsg("修改成功");
this.$router.back(); this.backPage();
}).catch(err => { }).catch(err => {
this.submiting = false; this.submiting = false;
}); });
@ -516,7 +516,7 @@ export default {
}).then(() => { }).then(() => {
this.$router.replace(`/setTheoreticalCourse?id=${courseId}`); this.$router.replace(`/setTheoreticalCourse?id=${courseId}`);
}).catch(() => { }).catch(() => {
this.$router.back(); this.$router.push('/theoreticalCourse');
}); });
}).catch(err => { }).catch(err => {
this.submiting = false; this.submiting = false;
@ -527,7 +527,7 @@ export default {
}, },
// //
backPage () { backPage () {
this.$router.back() this.$router.push(this.$store.state.referrer || '/theoreticalCourse')
}, },
back () { back () {
const { id } = this.form const { id } = this.form

@ -3,7 +3,7 @@
<el-card shadow="hover" <el-card shadow="hover"
class="m-b-20"> class="m-b-20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="goBack" <el-page-header @back="back"
:content="'课程内容/' + (sorting ? '更改排序' : '内容设置')"></el-page-header> :content="'课程内容/' + (sorting ? '更改排序' : '内容设置')"></el-page-header>
</div> </div>
</el-card> </el-card>
@ -415,11 +415,11 @@ export default {
// //
if (window.history && window.history.pushState) { if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL); history.pushState(null, null, document.URL);
window.addEventListener("popstate", this.goBack, false); window.addEventListener("popstate", this.back, false);
} }
}, },
destroyed () { destroyed () {
window.removeEventListener("popstate", this.goBack, false); window.removeEventListener("popstate", this.back, false);
}, },
methods: { methods: {
getData () { getData () {
@ -427,11 +427,9 @@ export default {
.then(res => { .then(res => {
this.chapters = res.chapterList; this.chapters = res.chapterList;
}) })
.catch(err => { .catch(err => { });
});
}, },
goBack () { back () {
// //
if (this.previewing) { if (this.previewing) {
this.closeIframe(); this.closeIframe();
@ -442,7 +440,7 @@ export default {
if (this.moved) { if (this.moved) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning', type: 'warning',
closeOnClickModal: false closeOnClickModal: false
}).then(() => { }).then(() => {
this.saveSort() this.saveSort()
this.moved = false this.moved = false
@ -454,7 +452,7 @@ export default {
this.sorting = false this.sorting = false
} }
} else { } else {
this.$router.back() this.$router.push(this.$store.state.referrer || '/theoreticalCourse')
} }
} }
}, },
@ -497,11 +495,6 @@ export default {
this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1); this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1);
this.showProgress = true this.showProgress = true
}, },
handleExceed (files, fileList) {
util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
uploadSuccess (file) { uploadSuccess (file) {
this.uploading = false; this.uploading = false;
this.fileId = '' this.fileId = ''
@ -509,31 +502,6 @@ export default {
this.fileUrl = file.url; this.fileUrl = file.url;
this.fileName = file.name; this.fileName = file.name;
}, },
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove (file, fileList) {
if ((file.size / 1024 / 1024) < 10) {
return this.$confirm(`确定移除 ${file.name}`);
}
},
handleRemove (file, fileList) {
this.uploadList = fileList;
},
uploadSure () {
this.importVisible = false;
this.pageNo = 1;
this.staffGradeId = "";
this.keyword = "";
this.getTeacher();
},
goback () {
this.$router.push("course");
},
transferType (ext) { transferType (ext) {
const suf = ext.toLowerCase() const suf = ext.toLowerCase()
if ("jpg,jpeg,png,gif,svg,psd".includes(suf)) return "图片"; if ("jpg,jpeg,png,gif,svg,psd".includes(suf)) return "图片";

@ -48,7 +48,7 @@
<label>搜索</label> <label>搜索</label>
<el-input placeholder="请输入理论课程名称/创建人" <el-input placeholder="请输入理论课程名称/创建人"
suffix-icon="el-icon-search" suffix-icon="el-icon-search"
v-model="keyword" v-model="form.keyWord"
clearable clearable
size="small"></el-input> size="small"></el-input>
</li> </li>
@ -166,10 +166,10 @@
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from '@/setting' import Setting from '@/setting'
import qs from 'qs'
export default { export default {
data () { data () {
return { return {
timer: null,
regionName: ['本校内', '全平台可见', '指定院校区域'], regionName: ['本校内', '全平台可见', '指定院校区域'],
regions: [ regions: [
{ {
@ -200,11 +200,11 @@ export default {
} }
], ],
form: { form: {
visibleRange: '', keyWord: this.$route.query.keyWord || '',
categoryId: '', visibleRange: +this.$route.query.visibleRange || '',
courseType: '' categoryId: +this.$route.query.categoryId || '',
courseType: this.$route.query.courseType ? +this.$route.query.courseType : '',
}, },
keyword: "",
classificationId: "", classificationId: "",
list: [], list: [],
multipleSelection: [], multipleSelection: [],
@ -215,7 +215,7 @@ export default {
}; };
}, },
watch: { watch: {
keyword: function (val) { 'form.keyWord': function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData();
@ -223,22 +223,23 @@ export default {
} }
}, },
mounted () { mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/theoreticalCourse').catch(() => { })
}
this.getClassification(); this.getClassification();
this.getData(); this.getData();
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
})
}, },
methods: { methods: {
//: //:
// //
// 使 // 使
//1. //1.
getList () { getData () {
this.$post(this.api.listTheoreticalCourse, { this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
keyWord: this.keyword,
createPlatform: 0, createPlatform: 0,
platformSource: Setting.platformSource, platformSource: Setting.platformSource,
...this.form ...this.form
@ -252,19 +253,6 @@ export default {
}).catch(res => { }).catch(res => {
}); });
}, },
// redis
getRedis () {
this.$post(this.api.getRedisCache).then(({ data }) => {
data && this.getList()
}).catch(res => { })
},
getData () {
this.getList()
// if (!Setting.isDev) {
// clearInterval(this.timer)
// this.timer = setInterval(this.getRedis, 1000)
// }
},
initData () { initData () {
this.page = 1; this.page = 1;
this.getData(); this.getData();
@ -282,16 +270,24 @@ export default {
this.classificationId = type; this.classificationId = type;
this.initData(); this.initData();
}, },
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}&tab=first`)
},
preview (row) { preview (row) {
this.setReferrer()
this.$router.push(`/previewTheoreticalCourse?id=${row.id}`); this.$router.push(`/previewTheoreticalCourse?id=${row.id}`);
}, },
config (row) { config (row) {
this.setReferrer()
this.$router.push(`/setTheoreticalCourse?id=${row.id}`); this.$router.push(`/setTheoreticalCourse?id=${row.id}`);
}, },
addCourse () { addCourse () {
this.setReferrer()
this.$router.push("/addTheoreticalCourse"); this.$router.push("/addTheoreticalCourse");
}, },
editCourse (row) { editCourse (row) {
this.setReferrer()
this.$router.push(`/addTheoreticalCourse?id=${row.id}`); this.$router.push(`/addTheoreticalCourse?id=${row.id}`);
}, },
handleDelete (row) { handleDelete (row) {

@ -1,285 +1,349 @@
<template> <template>
<!-- 院校创建 --> <!-- 院校创建 -->
<div style="padding-top: 24px"> <div style="padding-top: 24px">
<div class="tool"> <div class="tool">
<ul class="filter" style="align-items: flex-start"> <ul class="filter"
<li> style="align-items: flex-start">
<label>可见范围</label> <li>
<el-select v-model="form.visibleRange" clearable placeholder="请选择可见范围" @change="getData"> <label>可见范围</label>
<el-option v-for="(item,index) in regions" :key="index" :label="item.name" :value="item.id"></el-option> <el-select v-model="form.visibleRange"
</el-select> clearable
</li> placeholder="请选择可见范围"
<li> @change="getData">
<label>课程分类</label> <el-option v-for="(item,index) in regions"
<el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData"> :key="index"
<el-option label="不限" value=""></el-option> :label="item.name"
<el-option v-for="(item,index) in classificationList" :key="index" :label="item.typeName" :value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>课程类型</label> <label>课程分类</label>
<el-select v-model="form.courseType" clearable placeholder="请选择课程类型" @change="getData"> <el-select v-model="form.categoryId"
<el-option v-for="(item,index) in types" :key="index" :label="item.name" :value="item.id"></el-option> clearable
</el-select> placeholder="请选择课程分类"
</li> @change="getData">
<li> <el-option label="不限"
<label>搜索</label> value=""></el-option>
<el-input placeholder="请输入理论课程名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input> <el-option v-for="(item,index) in classificationList"
</li> :key="index"
</ul> :label="item.typeName"
<div> :value="item.id"></el-option>
<!-- <el-button v-auth="'院校创建:新增'" type="primary" round @click="addCourse">新增</el-button> --> </el-select>
<el-button v-auth="'院校创建:批量删除'" type="primary" round @click="delAllData">批量删除</el-button> </li>
</div> <li>
</div> <label>课程类型</label>
<el-select v-model="form.courseType"
clearable
placeholder="请选择课程类型"
@change="getData">
<el-option v-for="(item,index) in types"
:key="index"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入理论课程名称/创建人"
suffix-icon="el-icon-search"
v-model="form.keyWord"
clearable
size="small"></el-input>
</li>
</ul>
<div>
<!-- <el-button v-auth="'院校创建:新增'" type="primary" round @click="addCourse">新增</el-button> -->
<el-button v-auth="'院校创建:批量删除'"
type="primary"
round
@click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table :data="list"
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> class="table"
<el-table-column type="index" width="100" label="序号" align="center"> ref="table"
<template slot-scope="scope"> stripe
{{ scope.$index + (page - 1) * pageSize + 1 }} header-align="center"
</template> @selection-change="handleSelectionChange"
</el-table-column> row-key="id">
<el-table-column prop="courseName" label="课程名称" align="center"> <el-table-column type="selection"
</el-table-column> width="80"
<el-table-column label="可见范围" align="center"> align="center"
<template slot-scope="scope"> :reserve-selection="true"></el-table-column>
{{ regionName[scope.row.visibleRange] }} <el-table-column type="index"
</template> width="100"
</el-table-column> label="序号"
<el-table-column prop="createTime" label="创建时间" align="center"> align="center">
</el-table-column> <template slot-scope="scope">
<el-table-column prop="courseClassification" label="课程类型" align="center"> {{ scope.$index + (page - 1) * pageSize + 1 }}
<template slot-scope="scope"> </template>
{{ scope.row.courseType == 1 ? '付费' : '免费' }} </el-table-column>
</template> <el-table-column prop="courseName"
</el-table-column> label="课程名称"
<el-table-column prop="founder" label="创建人" align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column prop="courseClassification" label="课程分类" align="center" show-overflow-tooltip> <el-table-column label="可见范围"
</el-table-column> align="center">
<el-table-column label="操作" align="center" width="250"> <template slot-scope="scope">
<template slot-scope="scope"> {{ regionName[scope.row.visibleRange] }}
<el-button v-auth="'院校创建:编辑信息'" type="text" @click="editCourse(scope.row)">编辑信息</el-button> </template>
<el-divider v-auth="'院校创建:编辑信息'" direction="vertical"></el-divider> </el-table-column>
<el-button v-auth="'院校创建:内容设置'" type="text" @click="config(scope.row)">内容设置</el-button> <el-table-column prop="createTime"
<el-divider v-auth="'院校创建:内容设置'" direction="vertical"></el-divider> label="创建时间"
<el-button v-auth="'院校创建:预览'" type="text" @click="preview(scope.row)">预览</el-button> align="center">
<el-divider v-auth="'院校创建:预览'" direction="vertical"></el-divider> </el-table-column>
<el-button v-auth="'院校创建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-table-column prop="courseClassification"
</template> label="课程类型"
</el-table-column> align="center">
<el-table-column label="可授权状态" align="center" width="120"> <template slot-scope="scope">
<template slot-scope="scope"> {{ scope.row.courseType == 1 ? '付费' : '免费' }}
<el-switch </template>
v-auth="'院校创建:禁用'" </el-table-column>
v-model="scope.row.ztOpen" <el-table-column prop="founder"
:active-value="0" label="创建人"
:inactive-value="1" align="center">
style="margin: 0 10px 0 5px" </el-table-column>
:active-text="scope.row.ztOpen ? '关' : '开'" <el-table-column prop="courseClassification"
@change="switchOff($event,scope.row,scope.$index)" label="课程分类"
></el-switch> align="center"
</template> show-overflow-tooltip>
</el-table-column> </el-table-column>
</el-table> <el-table-column label="操作"
<div class="pagination"> align="center"
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> width="250">
</el-pagination> <template slot-scope="scope">
</div> <el-button v-auth="'院校创建:编辑信息'"
type="text"
@click="editCourse(scope.row)">编辑信息</el-button>
<el-divider v-auth="'院校创建:编辑信息'"
direction="vertical"></el-divider>
<el-button v-auth="'院校创建:内容设置'"
type="text"
@click="config(scope.row)">内容设置</el-button>
<el-divider v-auth="'院校创建:内容设置'"
direction="vertical"></el-divider>
<el-button v-auth="'院校创建:预览'"
type="text"
@click="preview(scope.row)">预览</el-button>
<el-divider v-auth="'院校创建:预览'"
direction="vertical"></el-divider>
<el-button v-auth="'院校创建:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="可授权状态"
align="center"
width="120">
<template slot-scope="scope">
<el-switch v-auth="'院校创建:禁用'"
v-model="scope.row.ztOpen"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div> </div>
</div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from '@/setting' import Setting from '@/setting'
import qs from 'qs'
export default { export default {
data() { data () {
return { return {
timer: null, regionName: ['本校内', '全平台可见', '指定院校区域'],
regionName: ['本校内', '全平台可见', '指定院校区域'], regions: [
regions: [ {
{ id: '',
id: '', name: '不限'
name: '不限'
},
{
id: 0,
name: '本校内'
},
{
id: 1,
name: '全平台'
},
{
id: 2,
name: '指定院校区域'
}
],
types: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '付费'
},
{
id: 0,
name: '免费'
}
],
form: {
visibleRange: '',
categoryId: '',
courseType: ''
},
keyword: "",
classificationId: "",
list: [],
multipleSelection: [],
classificationList: [],
page: +this.$route.query.page || 1, //
pageSize: 10,
total: 0
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
this.getClassification();
this.getData();
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
})
},
methods: {
//:
//
// 使
//1.
getList() {
this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page,
pageSize: this.pageSize,
keyWord: this.keyword,
createPlatform: 1,
platformSource: Setting.platformSource,
...this.form
}).then(({ page }) => {
this.list = page.records;
this.total = page.total;
if (!this.list.length && this.total) {
this.page--;
this.getData();
}
}).catch(res => {
});
}, },
// redis {
getRedis() { id: 0,
this.$post(this.api.getRedisCache).then(({ data }) => { name: '本校内'
data && this.getList()
}).catch(res => {})
}, },
getData() { {
this.getList() id: 1,
if (!Setting.isDev) { name: '全平台'
clearInterval(this.timer)
this.timer = setInterval(this.getRedis, 1000)
}
}, },
initData() { {
this.page = 1; id: 2,
this.getData(); name: '指定院校区域'
}
],
types: [
{
id: '',
name: '不限'
}, },
getClassification() { {
this.$post(this.api.queryAllCategoriesOfSchools).then(({ data }) => { id: 1,
data.map((e, i) => { name: '付费'
const name = e.classificationName
e.typeName = name
if (data.filter((n, j) => n.classificationName === name).length > 1) e.typeName = name + '(' + e.schoolName + ')'
})
this.classificationList = data
}).catch(res => {})
}, },
changeType(type) { {
this.classificationId = type; id: 0,
name: '免费'
}
],
form: {
keyWord: this.$route.query.keyWord || '',
visibleRange: this.$route.query.visibleRange ? +this.$route.query.visibleRange : '',
categoryId: +this.$route.query.categoryId || '',
courseType: this.$route.query.courseType ? +this.$route.query.courseType : '',
},
classificationId: "",
list: [],
multipleSelection: [],
classificationList: [],
page: +this.$route.query.page || 1, //
pageSize: 10,
total: 0
};
},
watch: {
'form.keyWord': function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/theoreticalCourse').catch(() => { })
}
this.getClassification();
this.getData();
},
methods: {
//:
//
// 使
//1.
getData () {
this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page,
pageSize: this.pageSize,
createPlatform: 1,
platformSource: Setting.platformSource,
...this.form
}).then(({ page }) => {
this.list = page.records;
this.total = page.total;
if (!this.list.length && this.total) {
this.page--;
this.getData();
}
}).catch(res => {
});
},
initData () {
this.page = 1;
this.getData();
},
getClassification () {
this.$post(this.api.queryAllCategoriesOfSchools).then(({ data }) => {
data.map((e, i) => {
const name = e.classificationName
e.typeName = name
if (data.filter((n, j) => n.classificationName === name).length > 1) e.typeName = name + '(' + e.schoolName + ')'
})
this.classificationList = data
}).catch(res => { })
},
changeType (type) {
this.classificationId = type;
this.initData();
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}&tab=second`)
},
preview (row) {
this.setReferrer()
this.$router.push(`/previewTheoreticalCourse?id=${row.id}`);
},
config (row) {
this.setReferrer()
this.$router.push(`/setTheoreticalCourse?id=${row.id}`);
},
addCourse () {
this.setReferrer()
this.$router.push("/addTheoreticalCourse");
},
editCourse (row) {
this.setReferrer()
this.$router.push(`/addTheoreticalCourse?id=${row.id}`);
},
handleDelete (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$post(`${this.api.delTheoreticalCourse}?ids=${row.id}`).then(res => {
util.successMsg("删除成功");
this.initData(); this.initData();
}, }).catch(res => {
preview(row) { });
this.$router.push(`/previewTheoreticalCourse?id=${row.id}`); })
}, .catch(() => {
config(row) { });
this.$router.push(`/setTheoreticalCourse?id=${row.id}`); },
}, handleSelectionChange (val) {
addCourse() { this.multipleSelection = val;
this.$router.push("/addTheoreticalCourse"); },
}, delAllData () {
editCourse(row) { const list = this.multipleSelection
this.$router.push(`/addTheoreticalCourse?id=${row.id}`); if (list.length != "") {
}, this.$confirm(`确定要删除吗?`, "提示", {
handleDelete(row) { type: "warning"
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { })
type: "warning" .then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
}) })
.then(() => { this.$post(`${this.api.delTheoreticalCourse}?${data.join('&')}`).then(res => {
this.$post(`${this.api.delTheoreticalCourse}?ids=${row.id}`).then(res => { this.$refs.table.clearSelection();
util.successMsg("删除成功"); util.successMsg("删除成功");
this.initData(); this.initData();
}).catch(res => { }).catch(res => {
}); });
}) }).catch(() => {
.catch(() => { });
}); } else {
}, util.errorMsg("请先选择数据 !");
handleSelectionChange(val) { }
this.multipleSelection = val; },
}, handleCurrentChange (val) {
delAllData() { this.page = val;
const list = this.multipleSelection this.getData();
if (list.length != "") { },
this.$confirm(`确定要删除吗?`, "提示", { switchOff (val, row) {
type: "warning" this.$post(this.api.disabledTheoreticalCourse, {
}) courseId: row.id,
.then(() => { isOpen: val,
const data = [] type: 0 // (01)
list.map(e => { }).then(res => {
data.push('ids=' + e.id) val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
}) }).catch(err => { })
this.$post(`${this.api.delTheoreticalCourse}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.initData();
}).catch(res => {
});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
switchOff(val, row) {
this.$post(this.api.disabledTheoreticalCourse, {
courseId: row.id,
isOpen: val,
type: 0 // (01)
}).then(res => {
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
}).catch(err => {})
}
} }
}
}; };
</script> </script>

@ -1,18 +1,22 @@
<template> <template>
<!-- 理论课程管理 --> <!-- 理论课程管理 -->
<div class="page"> <div class="page">
<div class="tabs"> <div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a> <a class="item"
</div> v-for="(item, i) in tabs"
<div class="page-content"> :key="i"
<!-- 平台自建 --> :class="{active: i == active}"
<buildPlatform v-if="active == 'first'" /> @click="tabChange(i)">{{ item }}</a>
<!-- 院校创建 -->
<CourseManagement v-if="active == 'second'" />
<!-- 分类管理 -->
<SortManagement v-if="active == 'third'" />
</div>
</div> </div>
<div class="page-content">
<!-- 平台自建 -->
<buildPlatform v-if="active == 'first'" />
<!-- 院校创建 -->
<CourseManagement v-if="active == 'second'" />
<!-- 分类管理 -->
<SortManagement v-if="active == 'third'" />
</div>
</div>
</template> </template>
<script> <script>
@ -20,45 +24,42 @@ import Setting from "@/setting";
import buildPlatform from "./buildPlatform"; import buildPlatform from "./buildPlatform";
import CourseManagement from "./courseManagement"; import CourseManagement from "./courseManagement";
import SortManagement from "./sortManagement"; import SortManagement from "./sortManagement";
export default { export default {
name: "course", components: {
components: { buildPlatform,
buildPlatform, CourseManagement,
CourseManagement, SortManagement
SortManagement },
}, data () {
data() { return {
return { active: this.$route.query.tab || 'first',
active: "first", // tabs: {
tabs: { first: "平台自建",
first: "平台自建", second: "院校创建",
second: "院校创建", third: "分类管理"
third: "分类管理" },
}, };
showTabs: true },
}; mounted () {
Setting.dynamicRoute && this.initTabs();
},
methods: {
tabChange (i) {
this.active = i;
this.$router.push(`/theoreticalCourse?tab=${this.active}`).catch(() => { })
}, },
mounted() { initTabs () {
Setting.dynamicRoute && this.initTabs(); const { btns } = this.$store.state
}, const tab1 = btns.includes('/theoreticalCourse:平台自建')
methods: { const tab2 = btns.includes('/theoreticalCourse:院校创建')
tabChange(index) { const tab3 = btns.includes('/theoreticalCourse:分类管理')
this.active = index; tab1 || delete this.tabs.first
}, tab2 || delete this.tabs.second
initTabs() { tab3 || delete this.tabs.third
const { btns } = this.$store.state
const tab1 = btns.includes('/theoreticalCourse:平台自建')
const tab2 = btns.includes('/theoreticalCourse:院校创建')
const tab3 = btns.includes('/theoreticalCourse:分类管理')
tab1 || delete this.tabs.first
tab2 || delete this.tabs.second
tab3 || delete this.tabs.third
}
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>

@ -4,7 +4,7 @@
<el-card shadow="hover" <el-card shadow="hover"
class="m-b-20"> class="m-b-20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="goBack" <el-page-header @back="back"
:content="'课程预览'"></el-page-header> :content="'课程预览'"></el-page-header>
</div> </div>
</el-card> </el-card>
@ -185,9 +185,6 @@ export default {
this.getChapter(); this.getChapter();
}, },
methods: { methods: {
goBack () {
this.$router.back();
},
async getData () { async getData () {
let res = await this.$post(`${this.api.findTheoreticalCourse}?id=${this.id}`); let res = await this.$post(`${this.api.findTheoreticalCourse}?id=${this.id}`);
this.courseName = res.data.courseName; this.courseName = res.data.courseName;
@ -313,7 +310,10 @@ export default {
}, },
loadPdfHandler (e) { loadPdfHandler (e) {
this.currentPage = 1; this.currentPage = 1;
} },
back () {
this.$router.push(this.$store.state.referrer || '/theoreticalCourse')
},
} }
}; };
</script> </script>

@ -1,250 +1,278 @@
<template> <template>
<div> <div>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
<div class="flex-between"> class="mgb20">
<div class="per_title" @click="goback()"> <div class="flex-between">
<i class="el-icon-arrow-left"></i> <div class="per_title"
<span class="per_back">返回</span> @click="goback">
<span class="per_school">{{ isDetail ? '查看' : '编辑' }}用户信息</span> <i class="el-icon-arrow-left"></i>
</div> <span class="per_back">返回</span>
</div> <span class="per_school">{{ isDetail ? '查看' : '编辑' }}用户信息</span>
</el-card> </div>
</div>
</el-card>
<!-- 账号信息 --> <!-- 账号信息 -->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
<div> class="mgb20">
<div class="flex-between mgb20 user_header"> <div>
<div class="flex-center"> <div class="flex-between mgb20 user_header">
<p class="addhr_tag"></p> <div class="flex-center">
<span>账号信息</span> <p class="addhr_tag"></p>
</div> <span>账号信息</span>
</div> </div>
</div>
<div> <div>
<el-form <el-form ref="form"
ref="form" :model="form"
:model="form" :rules="rules"
:rules="rules" label-width="120px"
label-width="120px" :disabled="isDetail">
:disabled="isDetail" <el-col :span="24">
> <el-col :span="6"
<el-col :span="24"> :offset="5">
<el-col :span="6" :offset="5"> <el-form-item prop="phone"
<el-form-item prop="phone" label="个人手机"> label="个人手机">
<el-input <el-input v-model="form.phone"
v-model="form.phone" placeholder="请输入手机号"
placeholder="请输入手机号" maxlength="11"></el-input>
maxlength="11" </el-form-item>
></el-input> <el-form-item prop="email"
</el-form-item> label="邮箱">
<el-form-item prop="email" label="邮箱"> <el-input v-model="form.email"
<el-input placeholder="请输入邮箱"
v-model="form.email" maxlength="11"></el-input>
placeholder="请输入邮箱" </el-form-item>
maxlength="11" </el-col>
></el-input>
</el-form-item>
</el-col>
<el-col :span="6" :offset="2"> <el-col :span="6"
<el-form-item label="唯一识别码"> :offset="2">
<el-input v-model="form.uniqueIdentification" disabled></el-input> <el-form-item label="唯一识别码">
</el-form-item> <el-input v-model="form.uniqueIdentification"
</el-col> disabled></el-input>
</el-col> </el-form-item>
</el-form> </el-col>
</div> </el-col>
</div> </el-form>
</el-card> </div>
</div>
</el-card>
<!-- 个人信息 --> <!-- 个人信息 -->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
<div> class="mgb20">
<div class="flex-between mgb20 user_header"> <div>
<div class="flex-center"> <div class="flex-between mgb20 user_header">
<p class="addhr_tag"></p> <div class="flex-center">
<span>实名认证信息未实名认证</span> <p class="addhr_tag"></p>
</div> <span>实名认证信息未实名认证</span>
</div> </div>
</div>
<div> <div>
<el-form <el-form ref="form"
ref="form" :model="form"
:model="form" :rules="rules"
:rules="rules" label-width="120px"
label-width="120px" :disabled="isDetail">
:disabled="isDetail" <el-col :span="6"
> :offset="5">
<el-col :span="6" :offset="5"> <el-form-item prop="userName"
<el-form-item prop="userName" label="用户姓名"> label="用户姓名">
<el-input v-model="form.userName" placeholder="请输入"></el-input> <el-input v-model="form.userName"
</el-form-item> placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="证件类型" prop="documentType"> <el-form-item label="证件类型"
<el-select prop="documentType">
value="1" <el-select value="1"
clearable clearable
placeholder="请选择证件类型" placeholder="请选择证件类型"
style="width: 100%" style="width: 100%">
> <el-option label="身份证"
<el-option value="1"></el-option>
label="身份证" </el-select>
value="1" </el-form-item>
></el-option> </el-col>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" :offset="2"> <el-col :span="6"
<el-form-item prop="phone" label="手机号"> :offset="2">
<el-input <el-form-item prop="phone"
v-model="form.phone" label="手机号">
placeholder="请输入手机号" <el-input v-model="form.phone"
maxlength="11" placeholder="请输入手机号"
></el-input> maxlength="11"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="idNumber" label="证件号码"> <el-form-item prop="idNumber"
<el-input label="证件号码">
v-model="form.idNumber" <el-input v-model="form.idNumber"
placeholder="请输入证件号码" placeholder="请输入证件号码"
maxlength="18" maxlength="18"></el-input>
></el-input> </el-form-item>
</el-form-item> </el-col>
</el-col> </el-form>
</el-form> </div>
</div> </div>
</div> </el-card>
</el-card>
<!-- 已绑定系统 --> <!-- 已绑定系统 -->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
<div class="flex-between mgb20"> class="mgb20">
<div class="flex-center"> <div class="flex-between mgb20">
<p class="addhr_tag"></p> <div class="flex-center">
<span>已绑定的平台和用户信息</span> <p class="addhr_tag"></p>
</div> <span>已绑定的平台和用户信息</span>
</div> </div>
</div>
<el-table <el-table :data="platformList"
:data="platformList" class="table"
class="table" stripe
stripe header-align="center"
header-align="center" row-key="accountId">
row-key="accountId" <el-table-column type="index"
> width="100"
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> label="序号"
<el-table-column prop="platformName" label="平台名称" align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="schoolName" label="绑定组织名称" align="center"></el-table-column> <el-table-column prop="platformName"
<el-table-column prop="userName" label="姓名" align="center"></el-table-column> label="平台名称"
<el-table-column prop="workNumber" label="工号/学号" align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="roleName" label="角色" align="center"></el-table-column> <el-table-column prop="schoolName"
<el-table-column prop="phoneBindingTime" label="绑定时间" align="center"></el-table-column> label="绑定组织名称"
<el-table-column prop="logInNumber" label="登录次数" align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="lastLoginTime" label="上一次的登录时间" align="center"></el-table-column> <el-table-column prop="userName"
<el-table-column label="操作" align="center"> label="姓名"
<template slot-scope="scope"> align="center"></el-table-column>
<el-button type="text" @click="show(scope.row)">查看</el-button> <el-table-column prop="workNumber"
<el-button type="text" @click="del(scope.row)">删除</el-button> label="工号/学号"
<el-switch v-if="scope.row.userId!==1" v-model="scope.row.isEnable" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" :active-text="scope.row.isEnable ? '启用' : '禁用'" @change="switchUser($event,scope.row,scope.$index)" v-auth="'/user:启用'"></el-switch> align="center"></el-table-column>
</template> <el-table-column prop="roleName"
</el-table-column> label="角色"
</el-table> align="center"></el-table-column>
</el-card> <el-table-column prop="phoneBindingTime"
</el-col> label="绑定时间"
</el-row> align="center"></el-table-column>
</div> <el-table-column prop="logInNumber"
label="登录次数"
align="center"></el-table-column>
<el-table-column prop="lastLoginTime"
label="上一次的登录时间"
align="center"></el-table-column>
<el-table-column label="操作"
align="center">
<template slot-scope="scope">
<el-button type="text"
@click="show(scope.row)">查看</el-button>
<el-button type="text"
@click="del(scope.row)">删除</el-button>
<el-switch v-if="scope.row.userId!==1"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
style="margin: 0 10px 0 5px"
:active-text="scope.row.isEnable ? '启用' : '禁用'"
@change="switchUser($event,scope.row,scope.$index)"
v-auth="'/user:启用'"></el-switch>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
</div>
</template> </template>
<script> <script>
import * as md5 from 'blueimp-md5' import * as md5 from 'blueimp-md5'
export default { export default {
name: 'baseform', name: 'baseform',
data() { data () {
return { return {
userId: this.$route.query.userId, userId: this.$route.query.userId,
isDetail: this.$route.query.show === '1', // isDetail: this.$route.query.show === '1', //
form: { form: {
// //
userId: '', userId: '',
userName: '', // userName: '', //
uniqueIdentification: '', // uniqueIdentification: '', //
idNumber: '', // idNumber: '', //
dateBirth: '', // dateBirth: '', //
phone: '', // phone: '', //
}, },
rules: { rules: {
userName: [{ required: true, message: '请输入用户姓名', trigger: 'blur' }] userName: [{ required: true, message: '请输入用户姓名', trigger: 'blur' }]
}, },
platformList: [], // platformList: [], //
}; };
},
mounted () {
this.userId && this.getdata()
},
methods: {
getdata () {
this.$get(this.api.viewUserDetailsforNakadai, { userId: this.userId }).then(({ result }) => {
const info = result.hrUserInfo
info.phone = result.userAccount.phone
// MD51313
if (info.phone) info.uniqueIdentification = md5(info.phone).slice(0, 13)
this.form = info
this.platformList = result.bindingPlatformAndUserList
}).catch((res) => { })
}, },
mounted() { goback () {
this.userId && this.getdata() this.$router.push(this.$store.state.referrer || '/user')
}, },
methods: { //
getdata() { switchUser (val, row) {
this.$get(this.api.viewUserDetailsforNakadai, { userId: this.userId }).then(({ result }) => { this.$get(this.api.updateAccountEnable, {
const info = result.hrUserInfo id: row.accountId,
info.phone = result.userAccount.phone isEnable: val
// MD51313 }).then(res => {
if (info.phone) info.uniqueIdentification = md5(info.phone).slice(0, 13) this.$message.success(val ? '启用成功' : '禁用成功')
this.form = info }).catch(res => {
this.platformList = result.bindingPlatformAndUserList row.isEnable = 0
}).catch((res) => {}) })
}, },
goback(){ show (row) {
this.$router.back() this.$router.push(`/info?userId=${row.userId}&platformName=${row.platformName}`)
}, },
// //
switchUser(val,row) { del (row) {
this.$get(this.api.updateAccountEnable, { this.$confirm('确定要删除吗?', '提示', {
id: row.accountId, type: 'warning'
isEnable: val }).then(() => {
}).then(res => { this.$post(this.api.delUserAccounts, [row.userId]).then(res => {
this.$message.success(val ? '启用成功' : '禁用成功') this.$message.success('删除成功')
}).catch(res => { this.getData()
row.isEnable = 0 }).catch(res => { })
}) }).catch(() => { })
}, },
show(row) { }
this.$router.push(`/info?userId=${row.userId}&platformName=${row.platformName}`)
},
//
del(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts, [row.userId]).then(res => {
this.$message.success('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.fold{ .fold {
margin-top: 20px; margin-top: 20px;
text-align: center; text-align: center;
img{ img {
cursor: pointer; cursor: pointer;
&:hover{ &:hover {
opacity: .8; opacity: 0.8;
} }
} }
} }
.arrowTransform{ .arrowTransform {
transition: 0.5s; transition: 0.5s;
transform-origin: center; transform-origin: center;
transform: rotateZ(180deg); transform: rotateZ(180deg);
} }
.arrowTransformReturn{ .arrowTransformReturn {
transition: 0.5s; transition: 0.5s;
transform-origin: center; transform-origin: center;
transform: rotateZ(0deg); transform: rotateZ(0deg);
@ -265,10 +293,10 @@ export default {
.region ::v-deep .el-input { .region ::v-deep .el-input {
width: 30%; width: 30%;
} }
.numberInput{ .numberInput {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
span{ span {
white-space: nowrap; white-space: nowrap;
} }
} }
@ -323,30 +351,30 @@ export default {
color: rgb(155, 179, 245); color: rgb(155, 179, 245);
font-size: 14px; font-size: 14px;
} }
.school-item{ .school-item {
margin-bottom: 20px; margin-bottom: 20px;
.school-name{ .school-name {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
.port{ .port {
.port-name{ .port-name {
margin: 10px 0; margin: 10px 0;
font-size: 15px; font-size: 15px;
color: #9076FF; color: #9076ff;
} }
.fields{ .fields {
.line{ .line {
display: flex; display: flex;
margin-bottom: 10px; margin-bottom: 10px;
li{ li {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 80px; margin-right: 80px;
.name{ .name {
font-size: 14px; font-size: 14px;
} }
.val{ .val {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
} }
@ -373,7 +401,7 @@ export default {
border-radius: 0; border-radius: 0;
background: #dddddd; background: #dddddd;
} }
/deep/.el-input__inner{ /deep/.el-input__inner {
height: 40px !important; height: 40px !important;
} }
</style> </style>

@ -12,13 +12,6 @@
<el-form label-width="80px"> <el-form label-width="80px">
<el-row> <el-row>
<el-col :span="5"> <el-col :span="5">
<!--
<el-form-item label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</el-form-item>
-->
<el-form-item label="省份"> <el-form-item label="省份">
<el-select v-model="form.provinces" <el-select v-model="form.provinces"
clearable clearable
@ -212,6 +205,7 @@
<script> <script>
import Setting from '@/setting' import Setting from '@/setting'
import qs from 'qs'
export default { export default {
name: 'user', name: 'user',
data () { data () {
@ -219,18 +213,17 @@ export default {
platformId: Setting.platformId, platformId: Setting.platformId,
searchTimer: null, searchTimer: null,
form: { form: {
name: '',
countries: '中国', countries: '中国',
provinces: '', provinces: +this.$route.query.provinces || '',
city: '', city: +this.$route.query.provinces || '',
platformId: '', platformId: +this.$route.query.platformId || '',
schoolId: '', schoolId: +this.$route.query.schoolId || '',
accountRole: '', accountRole: '',
keyword: '', keyword: this.$route.query.keyword || '',
date: '', date: this.$route.query.startTime ? [this.$route.query.startTime, this.$route.query.endTime] : [],
startTime: '', startTime: this.$route.query.startTime || '',
endTime: '', endTime: this.$route.query.endTime || '',
month: '' month: +this.$route.query.month || ''
}, },
accountRoleList: [{ accountRoleList: [{
name: '超级管理员', name: '超级管理员',
@ -323,6 +316,11 @@ export default {
} }
}, },
mounted () { mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/user').catch(() => { })
}
this.getData() this.getData()
this.getSchoolData(); this.getSchoolData();
}, },
@ -418,6 +416,7 @@ export default {
this.getData() this.getData()
}, },
toDetail (row, detail) { toDetail (row, detail) {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
this.$router.push(`/adduser?userId=${row.userId}${detail ? '&show=1' : ''}`) this.$router.push(`/adduser?userId=${row.userId}${detail ? '&show=1' : ''}`)
}, },
handleDelete (row) { handleDelete (row) {

Loading…
Cancel
Save