费率等联调

dev_202303
yujialong 2 years ago
parent 63849c7c7f
commit d4366a467a
  1. 12
      src/assets/css/main.css
  2. 2
      src/setting.js
  3. 9
      src/utils/api.js
  4. 46
      src/views/join/index.vue
  5. 10
      src/views/parner/index.vue
  6. 524
      src/views/parner/rate.vue
  7. 194
      src/views/parner/staff.vue
  8. 26
      src/views/parnerOperation/learnMg.vue
  9. 91
      src/views/parnerOperation/mobileRole.vue
  10. 149
      src/views/parnerOperation/pcRole.vue
  11. 466
      src/views/parnerOperation/schemeSet.vue
  12. 40
      src/views/parnerOperation/staff.vue

@ -478,4 +478,16 @@ li {
.mce-content-body:not([dir=rtl]) blockquote {
border-left: 0;
background-color: #ccc;
}
.search-wrap {
display: flex;
}
.search-wrap .el-select {
width: 140px;
}
.search-wrap .keyword .el-input__inner {
border-left: 0;
}
.search-wrap .el-input__inner {
border-radius: 0;
}

@ -12,7 +12,7 @@ if (isDev) {
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
host = 'http://192.168.31.151:9000/'// 榕
host = 'http://192.168.31.116:9000/'// 赓
// host = 'http://192.168.31.116:9000/'// 赓
} else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
}

@ -99,6 +99,9 @@ export default {
updateModelClass: `nakadai/nakadai/model/reference/updateModelClass`,
checkIsShowBySystemId: `nakadai/nakadai/model/reference/checkIsShowBySystemId`,
modifyIsShowState: `nakadai/nakadai/model/reference/modifyIsShowState`,
editProvinceCity: `nakadai/nakadai/partner-team/editProvinceCity`,
editPartnerTeamRates: `nakadai/nakadai/partner-team/editPartnerTeamRates`,
teamPartnerList: `nakadai/nakadai/partnerAccount/teamPartnerList`,
delModelInfoBySystemId: `nakadai/nakadai/model/reference/demo/delModelInfoBySystemId`,
deleteReferenceDemo: `nakadai/nakadai/model/reference/demo/deleteReferenceDemo`,
@ -420,4 +423,10 @@ export default {
saveParnerFile: `nakadai/nakadai/partner/article/file/save`,
theAttachmentUnderTheQueryColumn: `nakadai/nakadai/partner/article/file/theAttachmentUnderTheQueryColumn`,
updateParnerFile: `nakadai/nakadai/partner/article/file/update`,
batchDeletionScheme: `nakadai/nakadai/partner/schemeManagement/batchDeletion`,
enableOrDisableScheme: `nakadai/nakadai/partner/schemeManagement/enableOrDisable`,
findByIdScheme: `nakadai/nakadai/partner/schemeManagement/findById`,
saveScheme: `nakadai/nakadai/partner/schemeManagement/save`,
schemeList: `nakadai/nakadai/partner/schemeManagement/schemeList`,
updateScheme: `nakadai/nakadai/partner/schemeManagement/update`,
};

@ -11,15 +11,22 @@
</div>
<div class="inner">
<el-form class="form" ref="form" :model="form" :rules="rules">
<el-form-item prop="provinceId">
<el-select style="width: 100%" v-model="form.provinceId" placeholder="请选择省份" @change="getCity">
<el-option v-for="(item,index) in provinces" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="cityId">
<el-select style="width: 100%" v-model="form.cityId" placeholder="请选择城市" :disabled="form.provinceId ? false : true">
<el-option v-for="(item,index) in cities" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="phone">
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11" @change="phoneChange"></el-input>
</el-form-item>
<el-form-item prop="userName">
<el-input v-model.trim="form.userName" placeholder="请输入姓名" :disabled="repeat"></el-input>
</el-form-item>
<el-form-item prop="account">
<el-input v-model.trim="form.account" placeholder="请设置你的账号" :disabled="repeat"></el-input>
</el-form-item>
<el-form-item prop="code">
<div class="ver-code">
<el-input v-model="form.code" placeholder="请输入验证码" maxlength="6"></el-input>
@ -39,6 +46,8 @@ import Setting from "@/setting"
export default {
data() {
return {
provinces: [],
cities: [],
isMobile: util.isMobile(),
userName: this.$route.query.userName,
teamName: this.$route.query.teamName,
@ -47,14 +56,18 @@ export default {
id: this.$route.query.accountId,
partnerClassificationId: this.$route.query.id,
isTeam: this.$route.query.isTeam, // (0)pc(1)
account: '',
phone: '',
code: '',
userName: ''
userName: '',
provinceId: +this.$route.query.provinceId || '',
cityId: +this.$route.query.cityId || ''
},
rules: {
account: [
{ required: true, message: '请输入账号', trigger: 'blur' }
provinceId: [
{ required: true, message: '请选择省份', trigger: "change" }
],
cityId: [
{ required: true, message: '请选择城市', trigger: "change" }
],
userName: [
{ required: true, message: '请输入用户名', trigger: "blur" }
@ -75,9 +88,25 @@ export default {
};
},
mounted() {
this.getProvince()
this.form.cityId && this.getCity()
},
methods: {
//
getProvince(){
this.$get(this.api.queryProvince).then(res => {
this.provinces = res.list
}).catch(res => {})
},
//
getCity(val){
this.$get(this.api.queryCity,{
provinceId: val
}).then(res => {
this.cities = res.list
if (val) this.form.cityId = ''
}).catch(res => {})
},
//
verifyPhone(phone) {
if (!phone) {
@ -146,7 +175,6 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
if (this.accountReapeat) return util.warningMsg("该账号已存在")
if (this.phoneRepeat) return util.warningMsg("该手机号已存在")
if (this.emailRepeat) return util.warningMsg("该邮箱已存在")
const { form } = this

@ -7,6 +7,7 @@
<staff v-if="active == 'staff'"></staff>
<pc-role v-if="active == 'pcRole'"></pc-role>
<mobile-role v-if="active == 'mobileRole'"></mobile-role>
<rate v-if="active == 'rate'"></rate>
</div>
</template>
@ -15,6 +16,7 @@ import Setting from "@/setting";
import staff from "./staff";
import pcRole from "./pcRole";
import mobileRole from "./mobileRole";
import rate from "./rate";
export default {
data() {
return {
@ -22,14 +24,16 @@ export default {
tabs: {
staff: "账号管理",
pcRole: "pc角色权限",
mobileRole: "小程序角色权限"
mobileRole: "小程序角色权限",
rate: "费率管理",
}
};
},
components: {
staff,
pcRole,
mobileRole
mobileRole,
rate
},
created() {
Setting.dynamicRoute && this.initTabs();
@ -50,10 +54,12 @@ export default {
const tab1 = btns.includes('/parner:账号管理')
const tab2 = btns.includes('/parner:pc角色权限')
const tab3 = btns.includes('/parner:小程序角色权限')
const tab4 = btns.includes('/parner:费率管理')
tab1 || delete this.tabs.staff
tab2 || delete this.tabs.pcRole
tab3 || delete this.tabs.mobileRole
tab4 || delete this.tabs.rate
const type = this.$route.query.type
const keys = Object.keys(this.tabs)
this.active = keys.includes(type) ? type : keys[0]

@ -0,0 +1,524 @@
<template>
<div class="wrap">
<!-- 左边的组织 -->
<div class="side">
<div>
<div class="flex-between">
<h6 class="p-title" style="margin-bottom: 0">城市合伙人区域管理</h6>
<el-button type="text" @click="addOrg" v-auth="'/parner:账号管理:添加分类'">添加分类</el-button>
</div>
<div style="height: 504px; max-height: 504px; overflow: auto">
<el-tree
:data="orgList"
default-expand-all
ref="orgTree"
node-key="id"
highlight-current
:expand-on-click-node="false"
@node-click="handleNodeClick"
:props="{children: 'children', label: 'partnerClassificationName', isLeaf: 'leaf'}"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span class="org-name">{{ node.label }}</span>
<span>
<!-- isTeam 0: 分类1: 团队 -->
<el-button
v-auth="'/parner:账号管理:添加分类'"
v-if="!data.isTeam"
type="text"
icon="el-icon-circle-plus-outline"
@click="() => addOrg(node, data)">
</el-button>
<el-button
v-auth="'/parner:账号管理:编辑分类'"
type="text"
icon="el-icon-edit-outline"
@click="() => editOrg(node, data)">
</el-button>
<el-button
v-auth="'/parner:账号管理:删除分类'"
type="text"
icon="el-icon-delete"
@click="() => delOrg(node, data)">
</el-button>
</span>
</span>
</el-tree>
</div>
</div>
<el-dialog
:title="typeForm.id ? '编辑' : '新增' + '分类'"
:visible.sync="orgVisible"
:close-on-click-modal="false"
width="50%"
@close="closeType"
>
<el-form v-if="orgVisible" ref="typeForm" :model="typeForm" :rules="orgRules" label-width="100px">
<el-form-item label="分类名称" prop="partnerClassificationName">
<el-input v-model.trim="typeForm.partnerClassificationName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="上级部门">
<span v-if="typeForm.parentName">{{ typeForm.parentName }}</span>
<el-cascader
v-else
:options="orgListDia"
v-model="cascaderValue"
:props="cascaderProps"
clearable
style="width: 100%"
>
</el-cascader>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeOrg"> </el-button>
<el-button type="primary" @click="orgSubmit"> </el-button>
</span>
</el-dialog>
</div>
<!-- 右边的员工 -->
<div class="right">
<!-- <h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<el-input style="width: 250px;" placeholder="请输入员工姓名/手机号" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input>
</li>
</ul>
</div> -->
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<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 prop="teamName" label="团队名称" align="center" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="userName" label="团队负责人" align="center" min-width="100"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center" min-width="120"></el-table-column>
<el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column>
<el-table-column prop="invitationAccount" label="邀请人" align="center" min-width="120"></el-table-column>
<el-table-column prop="phone" label="团队年费" align="center" min-width="120">
<template slot-scope="scope">
固定年费{{ scope.row.annualTeamFee}}w
<el-button type="primary" size="mini" @click="editAnnualTeamFee(scope.row)">修改</el-button>
</template>
</el-table-column>
<el-table-column prop="phone" label="市场服务年费" align="center" min-width="120">
<template slot-scope="scope">
项目抽成{{ scope.row.annualMarketingFee}}%
<el-button type="primary" size="mini" @click="editAnnualMarketingFee(scope.row)">修改</el-button>
</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>
<el-dialog title="请设置费率" :visible.sync="annualTeamFeeVisible" width="300px" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="75px" style='margin-right: 0;'>
<el-form-item label="固定年费">
<el-input style="width: 150px;" type="number" v-model.trim="annualTeamFee" placeholder="请输入数字"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="annualTeamFeeVisible = false">取消</el-button>
<el-button type="primary" @click="submitAnnualTeamFee">确定</el-button>
</span>
</el-dialog>
<el-dialog title="请设置费率" :visible.sync="annualMarketingFeeVisible" width="300px" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="75px" style='margin-right: 0;'>
<el-form-item label="固定年费">
<el-input style="width: 150px;" type="number" v-model.trim="annualMarketingFee" placeholder="请输入数字"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="annualMarketingFeeVisible = false">取消</el-button>
<el-button type="primary" @click="submitAnnualMarketingFee">确定</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import util from "@/libs/util";
import Setting from "@/setting";
import OrgTree from "@/components/org-tree/src/tree";
import clipboard from '@/libs/clipboard'
import axios from 'axios'
export default {
components: { OrgTree },
data() {
return {
accountId: this.$store.state.accountId,
userName: this.$store.state.userName,
type: 1,
orgList: [],
orgListDia: [],
orgVisible: false, //
typeForm: {
id: '',
partnerClassificationName: ''
},
cascaderValue: [], //
cascaderProps: {
checkStrictly: true,
label: "partnerClassificationName",
value: "id"
},
treeVisible: true,
treeNode: {},
treeResolve: [],
isDetail: false,
keyWord: '',
listData: [],
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
orgRules: {
partnerClassificationName: [
{ required: true, message: "请输入部门名称", trigger: "blur" }
]
},
parnerVisible: false,
casProps: {
multiple: true,
checkStrictly: true,
label: 'partnerClassificationName',
value: 'id',
isLeaf: 'leaf'
},
link: '',
qrcode: '',
expireTime: '',
curTeamId: '',
submiting: false, //
setKey: '',
transferVisible: false,
chooseVisible: false,
members: [],
choosePartnerId: '',
curRow: '',
annualTeamFeeVisible: false,
annualTeamFee: '',
annualMarketingFeeVisible: false,
annualMarketingFee: '',
};
},
watch: {
keyWord: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(this.initData, 500);
}
},
mounted() {
this.getOrg()
},
methods: {
//
async getOrg() {
const res = await this.$post(this.api.listParner)
const list = res.treeList
// children
const handleLeaf = (list, ids) => {
list.map(e => {
e.ids = ids ? [...ids, e.id] : [e.id]
if (e.children.length) {
if (e.isTeam) {
delete e.children
} else {
handleLeaf(e.children, e.ids)
}
} else {
delete e.children
}
})
}
handleLeaf(list)
this.orgList = list
//
this.setKey && this.$nextTick(() => {
this.$refs.orgTree.setCurrentKey(this.setKey)
})
this.getList()
},
//
typeChange() {
this.$refs.orgTree.setCurrentKey(null)
this.curTeamId = ''
this.initData()
},
//
addOrg(node, data) {
const list = JSON.parse(JSON.stringify(this.orgList))
this.handleOrg(list)
this.orgListDia = list
this.typeForm = {
id: '',
parentId: data ? data.id : 1,
level: data ? data.level + 1 : 1,
parentName: data ? data.partnerClassificationName : '',
partnerClassificationName: ''
}
this.cascaderValue = []
this.orgVisible = true
},
//
editOrg(node, data) {
const list = JSON.parse(JSON.stringify(this.orgList))
this.handleOrg(list)
this.orgListDia = list
this.typeForm = {
id: data.id,
partnerClassificationName: data.partnerClassificationName,
isTeam: data.isTeam
}
this.orgVisible = true
const { ids } = data
ids.splice(ids.length - 1, 1)
this.cascaderValue = ids
},
//
closeType() {
this.typeForm = {
id: '',
partnerClassificationName: ''
}
},
//
handleOrg(list) {
for (const i in list) {
const e = list[i]
//
if (e.isTeam) {
e.disabled = true
} else {
this.handleOrg(e.children)
}
}
},
//
delOrg(node, data) {
this.$confirm(data.isTeam ? '确定删除该城市合伙人?删除后,该团队同步解散,且不可恢复!' : '确定要删除吗?', "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteParner}?id=${data.id}`).then(res => {
util.successMsg("删除成功")
this.getOrg()
}).catch(res => {})
}).catch(() => {})
},
// /
orgSubmit() {
this.$refs.typeForm.validate((valid) => {
if (valid) {
const form = this.typeForm
const cas = this.cascaderValue
const len = cas.length
if (cas && len) {
this.typeForm.parentId = cas[len - 1]
this.typeForm.level = len + 1
}
if (!form.id) {
//
this.$post(this.api.saveParner, form).then(res => {
util.successMsg("新增成功!")
this.closeOrg()
}).catch(err => {})
} else {
//
this.$post(this.api.updateParner, form).then(res => {
util.successMsg("编辑成功!")
this.setKey = form.id
this.closeOrg()
}).catch(err => {})
}
}
});
},
// id
getTeamId(list) {
for (const i in list) {
const e = list[i]
if (e.isTeam && !this.curTeamId) {
this.curTeamId = e.id
break
} else {
this.getTeamId(e.children)
}
}
},
//
handleNodeClick(data) {
this.type = ''
this.curTeamId = ''
if (data.isTeam) {
this.curTeamId = data.id
} else {
// this.getTeamId(data.children)
}
if (!this.curTeamId) this.curTeamId = data.id
this.initData()
this.$refs.table.clearSelection()
},
//
closeOrg() {
this.orgVisible = false
this.cascaderValue = []
this.getOrg()
},
//
getAll() {
this.curTeamId = ''
this.getList()
},
//
getList() {
this.$post(this.api.teamPartnerList, {
type: this.type || 1,
partnerClassificationId: this.curTeamId,
keyWord: this.keyWord,
pageNum: this.page,
pageSize: this.pageSize
}).then(({ pageList }) => {
pageList.records.forEach((e, i) => {
e.id = i
})
this.listData = pageList.records
console.log("🚀 ~ file: staff.vue:479 ~ getList ~ this.listData:", this.listData)
this.total = pageList.total
}).catch(err => {})
},
//
currentChange(val) {
this.page = val
this.getList()
},
handleSelectionChange(val) { //
this.multipleSelection = val
},
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getList()
},
//
editAnnualTeamFee(row) {
this.curRow = row
this.annualTeamFee = row.annualTeamFee
this.annualTeamFeeVisible = true
},
//
submitAnnualTeamFee() {
this.$post(this.api.editPartnerTeamRates, {
annualTeamFee: this.annualTeamFee,
partnerId: this.curRow.partnerId,
teamId: this.curRow.teamId,
}).then(res => {
this.annualTeamFeeVisible = false
util.successMsg('修改成功')
this.getList()
}).catch(res => {})
},
//
editAnnualMarketingFee(row) {
this.curRow = row
this.annualMarketingFee = row.annualMarketingFee
this.annualMarketingFeeVisible = true
},
//
submitAnnualMarketingFee() {
this.$post(this.api.editPartnerTeamRates, {
annualMarketingFee: this.annualMarketingFee,
partnerId: this.curRow.partnerId,
teamId: this.curRow.teamId,
}).then(res => {
this.annualMarketingFeeVisible = false
util.successMsg('修改成功')
this.getList()
}).catch(res => {})
},
}
};
</script>
<style lang="scss" scoped>
.m-b-20 {
margin-bottom: 20px;
}
.org-name {
margin-right: 20px;
}
.w-100 {
width: 100%;
}
.wrap {
display: flex;
padding: 0 24px;
.side {
width: 300px;
padding: 24px 10px 24px 0;
margin-right: 24px;
border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.right {
width: calc(100% - 324px);
padding: 24px 0;
}
}
.add-dia {
.tips {
font-size: 12px;
color: #f00;
}
.title {
margin: 10px 0;
font-size: 14px;
em {
font-style: normal;
}
}
.des {
font-size: 13px;
color: #7a7a7a;
}
.link-wrap {
display: flex;
align-items: center;
margin: 10px 0 20px;
}
.link {
padding: 10px;
margin-right: 15px;
background-color: #e7f5ff;
border-radius: 4px;
}
}
/deep/.choose-dia {
.member-list {
li {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.info {
display: inline-flex;
align-items: center;
}
img {
width: 40px;
height: 40px;
}
.name {
margin-left: 10px;
}
.el-radio__label {
display: none;
}
}
}
</style>

@ -104,16 +104,28 @@
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="accountId">
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<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 prop="userName" label="姓名" align="center" min-width="100"></el-table-column>
<el-table-column prop="userName" label="团队负责人" align="center" min-width="100"></el-table-column>
<el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center" width="120"></el-table-column>
<el-table-column prop="partnerClassificationName" label="团队名称" align="center" min-width="200" show-overflow-tooltip></el-table-column>
<el-table-column v-if="!type" prop="roleName" label="授权角色" align="center" min-width="200" show-overflow-tooltip></el-table-column>
<el-table-column prop="phone" label="手机号" align="center" min-width="120"></el-table-column>
<el-table-column prop="invitationAccount" label="邀请人" align="center" min-width="120"></el-table-column>
<el-table-column prop="partnerClassificationName" label="团队名称" align="center" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="provinceName" label="省份" align="center" min-width="80"></el-table-column>
<el-table-column prop="cityName" label="城市" align="center" min-width="80"></el-table-column>
<el-table-column v-if="!type" prop="roleName" label="授权角色" align="center" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="phone" label="费率" align="center" min-width="120">
<template slot-scope="scope">
团队年费{{ scope.row.annualTeamFee}},
市场服务年费{{ scope.row.annualMarketingFee}}
</template>
</el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center" width="120"></el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center" width="120"></el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button v-if="!type" type="text" v-auth="'/parner:账号管理:重置密码'" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" v-auth="'/parner:账号管理:重置密码'" @click="resetPassword(scope.row)">重置密码</el-button>
<el-button v-if="type" type="text" v-auth="'/parner:账号管理:删除合伙人'" @click="del(scope.row)">删除</el-button>
<el-button v-else-if="scope.row.isTeam == 1" type="text" v-auth="'/parner:账号管理:转让超管'" @click="transfer(scope.row)">转让超管</el-button>
@ -160,6 +172,40 @@
<el-button size="small" type="primary" @click="chooseSubmit"> </el-button>
</span>
</el-dialog>
<el-dialog title="编辑合伙人'" :visible.sync="editVisible" width="400px" class="dialog" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="60px" style='margin-right: 0;'>
<el-form-item prop="userName" label="姓名">
<el-input v-model.trim="form.userName" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item prop="roleList" label="角色">
<el-select class="w-100" v-model="form.roleList" multiple>
<template v-for="item in roleList">
<!-- 不显示超管 -->
<el-option
:key="item.id"
:label="item.roleName"
:value="item.id">
</el-option>
</template>
</el-select>
</el-form-item>
<el-form-item prop="provinceId" label="省份">
<el-select style="width: 100%" v-model="form.provinceId" placeholder="请选择省份" @change="getCity">
<el-option v-for="(item,index) in provinces" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="cityId" label="城市">
<el-select style="width: 100%" v-model="form.cityId" placeholder="请选择城市" :disabled="form.provinceId ? false : true">
<el-option v-for="(item,index) in cities" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editVisible = false">取消</el-button>
<el-button type="primary" @click="submitEdit">确定</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
@ -173,45 +219,6 @@ import axios from 'axios'
export default {
components: { OrgTree },
data() {
const accountPass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入账号'))
} else {
const pattern = /^[A-Za-z0-9]*$/
if(pattern.test(value)){
this.accountChange()
callback()
}else{
callback(new Error('请输入正确账号格式'))
}
}
}
const phonePass = (rule, value, callback) => {
if (value) {
const pattern = /^1[3456789]\d{9}$/
if(pattern.test(value)){
// this.phoneChange()
callback()
}else{
callback(new Error('请输入正确手机号格式'))
}
} else {
callback()
}
}
const emailPass = (rule, value, callback) => {
if (value) {
const pattern = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/
if(pattern.test(value)){
// this.emailChange()
callback()
}else{
callback(new Error('请输入正确邮箱格式'))
}
} else {
callback()
}
}
return {
accountId: this.$store.state.accountId,
userName: this.$store.state.userName,
@ -236,28 +243,23 @@ export default {
keyWord: '',
form: {
userName: '',
phone: '',
email: '',
account: ''
},
orgRules: {
partnerClassificationName: [
{ required: true, message: "请输入部门名称", trigger: "blur" }
]
provinceId: '',
cityId: '',
roleList: []
},
rules: {
account: [
{ required: true,validator: accountPass, trigger: 'blur' }
],
userName: [
{ required: true, message: "请输入姓名", trigger: "blur" }
],
phone: [
{ validator: phonePass, trigger: 'blur' }
provinceId: [
{ required: true, message: '请选择省份', trigger: "change" }
],
cityId: [
{ required: true, message: '请选择城市', trigger: "change" }
],
roleList: [
{ required: true, message: '请选择角色', trigger: "change" }
],
email: [
{ validator: emailPass, trigger: 'blur' }
]
},
listData: [],
page: 1,
@ -265,6 +267,11 @@ export default {
total: 0,
multipleSelection: [],
orgRules: {
partnerClassificationName: [
{ required: true, message: "请输入部门名称", trigger: "blur" }
]
},
parnerVisible: false,
casProps: {
multiple: true,
@ -283,7 +290,10 @@ export default {
chooseVisible: false,
members: [],
choosePartnerId: '',
curRow: ''
curRow: '',
provinces: [],
cities: [],
editVisible: false
};
},
watch: {
@ -294,6 +304,8 @@ export default {
},
mounted() {
this.getOrg()
this.getProvince()
this.getRole()
},
methods: {
//
@ -462,7 +474,12 @@ export default {
pageNum: this.page,
pageSize: this.pageSize
}).then(({ pageList }) => {
pageList.records.forEach((e, i) => {
e.id = i
})
this.listData = pageList.records
console.log("🚀 ~ file: staff.vue:479 ~ getList ~ this.listData:", this.listData)
this.total = pageList.total
}).catch(err => {})
},
@ -479,6 +496,21 @@ export default {
this.page = 1
this.getList()
},
//
getProvince(){
this.$get(this.api.queryProvince).then(res => {
this.provinces = res.list
}).catch(res => {})
},
//
getCity(val){
this.$get(this.api.queryCity,{
provinceId: this.form.provinceId
}).then(res => {
this.cities = res.list
if (val) this.form.cityId = ''
}).catch(res => {})
},
//
del(row) {
this.$confirm("确定要删除吗?", "提示", {
@ -509,6 +541,44 @@ export default {
this.curRow = row
this.transferVisible = true
},
getRole() {
// platformId 4setting.jsport: pc01
this.$get(`${this.api.roleList}?page=1&size=10000&platformId=4&port=1&name=`).then(res => {
this.roleList = res.rolePage.records;
}).catch(res => {});
},
//
edit(row) {
if (!row.provinceId) row.provinceId = ''
if (!row.cityId) row.cityId = ''
row.roleList = row.roleId.split(',').map(e => +e)
this.editVisible = true
this.form = JSON.parse(JSON.stringify(row))
row.cityId && this.getCity()
},
//
submitEdit() {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
this.submiting = true
const form = JSON.parse(JSON.stringify(this.form))
form.classificationId = form.partnerClassificationId
this.$post(this.api.editProvinceCity, form).then(res => {
this.getList()
util.successMsg("编辑成功!")
this.editVisible = false
setTimeout(() => {
this.submiting = false
}, 2000)
}).catch(res => {
setTimeout(() => {
this.submiting = false
}, 2000)
})
}
})
},
//
resetPassword(row) {
const newPwd = Setting.initialPassword
@ -609,7 +679,7 @@ export default {
border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.right {
flex: 1;
width: calc(100% - 324px);
padding: 24px 0;
}
}

@ -226,25 +226,11 @@ import Axios from 'axios'
export default {
data() {
return {
typeId: +this.$route.query.type,
headers: {
token: sessionStorage.getItem('token')
},
nameRepeat: false,
sites: [],
detailStyle: [],
columns: [],
articles: [],
otherArticles: [],
columnProps: {
checkStrictly: true,
value: 'id',
label: 'columnName'
},
links: [],
article: '',
otherColumns: [],
otherLink: [],
otherArticle: '',
form: {
id: this.$route.query.id || '',
author: '',
@ -260,7 +246,7 @@ export default {
summary : '',
title: '',
fileList: [],
typeId: 1
typeId: +this.$route.query.type
},
rules: {
title: [
@ -344,7 +330,7 @@ export default {
},
//
getClassification() {
this.$post(`${this.api.queryClassificationByType}?typeId=1`).then(({ data }) => {
this.$post(`${this.api.queryClassificationByType}?typeId=${this.typeId}`).then(({ data }) => {
this.classifications = data
}).catch(err => {})
},
@ -382,10 +368,10 @@ export default {
//
submitClass(row, showMsg = 1) {
if (!row.classificationName) return Util.errorMsg('请输入分类名称')
this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=1&classificationId=${row.id}`).then(res => {
this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=${this.typeId}&classificationId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], {
classificationName: row.classificationName,
typeId: 1, // (1.2.)
typeId: this.typeId, // (1.2.)
id: row.id,
}).then(res => {
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功')
@ -489,7 +475,7 @@ export default {
const { title, id } = this.form
if(title && title !== this.originalName){
this.$post(this.api.checkIfTheTitleIsRepeat, {
typeId: 1,
typeId: this.typeId,
title,
id: id || ''
}).then(res => {

@ -2,7 +2,15 @@
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-input class="keyword" placeholder="请输入标题" v-model.trim="keyword" clearable></el-input>
<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="'/site/list:内容管理:文章管理:删除'" @click="batchDel">批量删除</el-button>
@ -17,8 +25,8 @@
<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"></el-table-column>
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100"></el-table-column>
<el-table-column prop="totalBrowsing" label="已学习人数" align="center" min-width="70"></el-table-column>
<el-table-column prop="createTime" label="发布日期" align="center" min-width="100"></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 ? '已发布' : '草稿' }}
@ -51,6 +59,21 @@ import { mapMutations } from 'vuex'
export default {
data() {
return {
field: 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: '',
list: [],
page: 1,
@ -58,7 +81,8 @@ export default {
total: 0,
modifiedTimeSort: '',
publicationTimeSort: '',
ordinalSort: 0,
classificationNameSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
@ -71,7 +95,7 @@ export default {
}
},
mounted() {
// this.getData()
this.getData()
},
methods: {
//
@ -80,15 +104,15 @@ export default {
const data = {
pageNum: this.page,
pageSize: this.pageSize,
ordinalSort: this.ordinalSort,
querySource: 3, //(3. 4.)
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
title: this.field === 'title' ? keyword : '',
founder: this.field === 'founder' ? keyword : '',
column: this.field === 'column' ? keyword : '',
editor: this.field === 'editor' ? keyword : ''
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}
if (this.modifiedTimeSort !== '') data.modifiedTimeSort = this.modifiedTimeSort
if (this.publicationTimeSort !== '') data.publicationTimeSort = this.publicationTimeSort
this.$post(this.api.queryArticle, data).then(({ data }) => {
this.$post(this.api.schemeList, data).then(({ data }) => {
this.list = data.records
this.total = +data.total
}).catch(err => {})
@ -116,7 +140,7 @@ export default {
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.deleteArticle}?${data.join('&')}`).then(res => {
this.$post(`${this.api.batchDeletionScheme}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
@ -131,7 +155,7 @@ export default {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.deleteArticle}?ids=${row.id}`).then(res => {
this.$post(`${this.api.batchDeletionScheme}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
@ -139,7 +163,7 @@ export default {
},
//
switchOff(val, row) {
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {})
this.$post(`${this.api.enableOrDisableScheme}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {})
},
//
add() {
@ -149,39 +173,50 @@ export default {
sortChange(column) {
const { order } = column
// 1
// 0 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.modifiedTimeSort = order ? order === 'ascending' ? 1 : 0 : ''
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.publicationTimeSort = ''
this.ordinalSort = ''
this.classificationNameSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'releaseTime') {
this.publicationTimeSort = order ? order === 'ascending' ? 1 : 0 : ''
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.modifiedTimeSort = ''
this.ordinalSort = ''
this.editTimeSort = ''
this.classificationNameSort = ''
this.sequenceSort = ''
}
}
// 0 1
if (column.prop === 'sequence') {
this.ordinalSort = order ? order === 'ascending' ? 0 : 1 : ''
this.sequenceSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.publicationTimeSort = ''
this.modifiedTimeSort = ''
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
//
edit(row) {
this.$router.push(`add?id=${row.id}&columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`)
this.$router.push(`/schemeSet?id=${row.id}`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
</style>

@ -2,7 +2,15 @@
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-input class="keyword" placeholder="请输入标题" v-model.trim="keyword" clearable></el-input>
<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="'/site/list:内容管理:文章管理:删除'" @click="batchDel">批量删除</el-button>
@ -13,12 +21,24 @@
<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="sequence" label="文章排序" align="center" min-width="110" sortable="custom">
<template slot-scope="scope">
<el-input
v-if="scope.row.editing"
class="squ-input"
v-model="scope.row.sequence"
></el-input>
<span v-else>{{ scope.row.sequence }}</span>
<i v-if="scope.row.editing" class="el-icon-check squ-icon" @click="submitSequence(scope.row)"></i>
<i v-else class="el-icon-edit squ-icon" @click="editSequence(scope.row)"></i>
</template>
</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"></el-table-column>
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100"></el-table-column>
<el-table-column prop="totalBrowsing" label="总浏览" align="center" min-width="70"></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 ? '已发布' : '草稿' }}
@ -26,6 +46,7 @@
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<el-button type="text" @click="sticky(scope.row)">置顶</el-button>
<el-button v-auth="'/site/list:内容管理:文章管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/site/list:内容管理:文章管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
@ -51,14 +72,30 @@ 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,
modifiedTimeSort: '',
publicationTimeSort: '',
ordinalSort: 0,
sequenceSort: '',
classificationNameSort: '',
releaseDateSort: '',
editTimeSort: 'desc',
multipleSelection: [],
};
},
@ -71,24 +108,28 @@ export default {
}
},
mounted() {
// this.getData()
this.getData()
},
methods: {
//
getData() {
const { keyword } = this
const data = {
this.$post(this.api.partnerOperatingList, {
pageNum: this.page,
pageSize: this.pageSize,
ordinalSort: this.ordinalSort,
querySource: 3, //(3. 4.)
sequenceSort: this.sequenceSort,
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
typeId: 2, // (1.2.)
title: this.field === 'title' ? keyword : '',
founder: this.field === 'founder' ? keyword : '',
column: this.field === 'column' ? keyword : '',
editor: this.field === 'editor' ? keyword : ''
}
if (this.modifiedTimeSort !== '') data.modifiedTimeSort = this.modifiedTimeSort
if (this.publicationTimeSort !== '') data.publicationTimeSort = this.publicationTimeSort
this.$post(this.api.queryArticle, data).then(({ data }) => {
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}).then(({ data }) => {
data.records.forEach(e => {
e.editing = false
})
this.list = data.records
this.total = +data.total
}).catch(err => {})
@ -116,7 +157,7 @@ export default {
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.deleteArticle}?${data.join('&')}`).then(res => {
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
@ -131,7 +172,7 @@ export default {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.deleteArticle}?ids=${row.id}`).then(res => {
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
@ -143,45 +184,87 @@ export default {
},
//
add() {
this.$router.push(`/learnMg`)
this.$router.push(`/learnMg?type=2`)
},
//
sortChange(column) {
const { order } = column
// 1
// 0 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.modifiedTimeSort = order ? order === 'ascending' ? 1 : 0 : ''
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.publicationTimeSort = ''
this.ordinalSort = ''
this.classificationNameSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'releaseTime') {
this.publicationTimeSort = order ? order === 'ascending' ? 1 : 0 : ''
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.modifiedTimeSort = ''
this.ordinalSort = ''
this.editTimeSort = ''
this.classificationNameSort = ''
this.sequenceSort = ''
}
}
// 0 1
if (column.prop === 'sequence') {
this.ordinalSort = order ? order === 'ascending' ? 0 : 1 : ''
this.sequenceSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.publicationTimeSort = ''
this.modifiedTimeSort = ''
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.modifiedSort}?articleId=${row.id}&sequenceNumber=1`).then(res => {
this.initData()
}).catch(res => {})
},
//
edit(row) {
this.$router.push(`add?id=${row.id}&columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`)
this.$router.push(`/learnMg?id=${row.id}&type=2`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
.squ-icon {
margin-left: 5px;
cursor: pointer;
}
/deep/.squ-input {
width: auto;
.el-input__inner {
width: 60px;
padding: 0 10px;
}
}
</style>

@ -3,16 +3,16 @@
<p class="page-name mb">方案设置</p>
<el-form :model="form" :rules="rules" class="input-form model" label-width="140px">
<div class="item-line">
<el-form-item prop="source" label="标题">
<el-form-item prop="title" label="标题">
<el-input
placeholder="请输入标题"
v-model.trim="form.source"
v-model.trim="form.title"
clearable
maxlength="30"
class="inline-input"
></el-input>
</el-form-item>
<el-form-item prop="author" label="所属分类">
<el-form-item prop="classificationId" label="所属分类">
<el-select style="width: 234px;" v-model="form.classificationId">
<template v-for="item in classifications">
<el-option
@ -26,31 +26,30 @@
<el-button class="set-btn" type="primary" @click="setClass">设置</el-button>
</el-form-item>
</div>
<el-form-item prop="summary" label="适用专业">
<el-form-item prop="applicableMajor" label="适用专业">
<el-input
style="width: 940px"
type="textarea"
v-model.trim="form.summary"
v-model.trim="form.applicableMajor"
:rows="3"
clearable
></el-input>
</el-form-item>
<el-form-item prop="summary" label="产品">
<el-form-item prop="product" label="产品">
<el-input
style="width: 940px"
type="textarea"
v-model.trim="form.summary"
v-model.trim="form.product"
:rows="3"
clearable
></el-input>
</el-form-item>
<el-form-item prop="file" label="文件上传">
<el-form-item prop="schemeFile" label="方案文件">
<el-upload
:before-upload="fileBeforeUpload"
:on-remove="handleRemove"
:on-success="uploadSuccessFile"
:action="this.api.fileupload"
:file-list="form.fileList"
:action="this.api.fileUploadNakadai"
:file-list="fileList"
:headers="headers"
>
<el-button>上传</el-button>
@ -62,16 +61,6 @@
<el-button @click="submit(0)">保存草稿</el-button>
<el-button @click="back">取消</el-button>
</div>
<!-- 剪裁组件弹窗 -->
<el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false">
<Cropper
ref="cropper"
:img-file.sync="file"
:is-upload="isUpload"
:fixed="true"
:fixedNumber.sync="fixedNumber"
@upload="customUpload" />
</el-dialog>
<el-dialog title="所属分类设置" :visible.sync="classVisible" width="500px" :close-on-click-modal="false" class="manage-dia" :before-close="closeClass">
<div class="plus">
@ -104,44 +93,11 @@
<el-button @click="closeClass">返回</el-button>
</span>
</el-dialog>
<el-dialog title="主题标签设置" :visible.sync="labelVisible" width="500px" :close-on-click-modal="false" class="manage-dia" :before-close="closeLabel">
<div class="plus">
<i class="el-icon-circle-plus-outline" @click="addLabel"></i>
</div>
<el-table :data="labels" ref="table" header-align="center" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="labelName" label="主题名称" align="center" min-width="130">
<template slot-scope="scope">
<el-input
v-if="scope.row.edit"
placeholder="请输入主题名称"
v-model="scope.row.labelName"
clearable
maxlength="30"
></el-input>
<span v-else>{{ scope.row.labelName }}</span>
</template>
</el-table-column>
<el-table-column prop="updateTime1" label="是否引用" align="center" min-width="60"></el-table-column>
<el-table-column label="操作" align="center" min-width="60">
<template slot-scope="scope">
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitLabel(scope.row)"></i>
<i v-else class="el-icon-edit edit" @click="editLabel(scope.row)"></i>
<i class="el-icon-delete del" @click="delLabel(scope.row, scope.$index)"></i>
</template>
</el-table-column>
</el-table>
<span slot="footer">
<el-button @click="closeLabel">返回</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Setting from '@/setting'
import Util from '@/libs/util'
import { mapState } from 'vuex'
import Editor from '@tinymce/tinymce-vue'
import editorConfig from './editor'
import Cropper from '@/components/img-upload/Cropper'
@ -153,98 +109,32 @@ export default {
token: sessionStorage.getItem('token')
},
nameRepeat: false,
sites: [],
detailStyle: [],
columns: [],
articles: [],
otherArticles: [],
columnProps: {
checkStrictly: true,
value: 'id',
label: 'columnName'
},
links: [],
article: '',
otherColumns: [],
otherLink: [],
otherArticle: '',
form: {
id: this.$route.query.id || '',
templateStatus: 0,
articleTemplate: '',
doi: '',
quote: '',
articleKeyWord: '',
publicationTypeId: '',
publicationYear: '',
periodicalName: '',
reel: '',
documentNumber: '',
activityEndTime: '',
activityStartTime: '',
time: '',
lectureSeries: '',
onlineLocation: '',
offlineLocation: '',
keynoteSpeaker: '',
eventProfile: '',
author: '',
edit: '',
audit: '',
bannerImg: '',
lableId: [],
applicableMajor: '',
classificationId: '',
columnId: +this.$route.query.columnId,
file: '',
isRelease: 0,
mainBody: '',
releaseTime: new Date(),
source: '',
summary : '',
product: '',
schemeFile: '',
title: '',
titleImg: '',
connectionType : 1,
linkAddress: '',
siteSelection: '',
fileList: [],
isOpen: 1
},
fileList: [],
rules: {
title: [
{ required: true, message: '请输入标题', trigger: 'blur' }
],
columnId: [
{ required: true, message: '请选择所属栏目', trigger: 'change' }
],
time: [
{ required: true, message: '请选择起始时间', trigger: 'change' }
],
classificationId: [
{ required: false, message: '请选择所属分类', trigger: 'change' }
],
keynoteSpeaker: [
{ required: true, message: '请输入主讲人', trigger: 'blur' }
],
eventProfile: [
{ required: true, message: '请输入活动简介', trigger: 'blur' }
{ required: true, message: '请选择所属分类', trigger: 'change' }
],
releaseTime: [
{ required: true, message: '请选择发布日期', trigger: 'change' }
applicableMajor: [
{ required: true, message: '请输入适用专业', trigger: 'blur' }
],
publicationYear: [
{ required: true, message: '请选择出版年份', trigger: 'change' }
product: [
{ required: true, message: '请输入产品', trigger: 'blur' }
],
titleImg: [
{ required: true, message: '请上传封面图', trigger: 'change' }
],
mainBody: [
{ required: true, message: '请输入正文', trigger: 'blur' }
],
connectionType: [
{ required: true, message: '请选择连接类型', trigger: 'blur' }
schemeFile: [
{ required: true, message: '请选择方案文件', trigger: 'change' }
],
},
columnInfo: {},
editorConfig,
submiting: false, //
pass: false,
@ -254,7 +144,6 @@ export default {
isUpload: false,
fixedNumber: [1.76, 1],
file: {}, //
isBanner: 0,
classifications: [],
classVisible: false,
labels: [],
@ -262,7 +151,7 @@ export default {
};
},
components: {
// Editor,
Editor,
Cropper
},
watch: {
@ -296,24 +185,21 @@ export default {
}
},
mounted() {
this.getClassification()
this.getArticle()
this.getLabel()
},
methods: {
//
//
getArticle() {
this.$post(this.api.queryArticle, {
pageNum: 1,
pageSize: 1000,
title: '',
isDisable: 0
}).then(({ data }) => {
this[inner ? 'articles' : 'otherArticles'] = data.records.filter(e => e.isRelease) //
const { id } = this.form
id && this.$post(`${this.api.findByIdScheme}?id=${id}`).then(({ data }) => {
if (data.schemeFile) this.fileList = [{name: data.schemeFile, url: data.schemeFile}]
this.form = data
}).catch(err => {})
},
//
getClassification() {
this.$post(`${this.api.queryClassif}?siteId=${this.site.id}&templateId=${this.columnInfo.templateId}`).then(({ data }) => {
this.$post(`${this.api.queryClassificationByType}?typeId=3`).then(({ data }) => {
this.classifications = data
}).catch(err => {})
},
@ -339,7 +225,7 @@ export default {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.delClassif}?id=${row.id}`).then(res => {
this.$post(`${this.api.batchDeletionParnerClass}?ids=${row.id}`).then(res => {
Util.successMsg('删除成功')
this.getClassification()
}).catch(res => {})
@ -351,14 +237,11 @@ export default {
//
submitClass(row, showMsg = 1) {
if (!row.classificationName) return Util.errorMsg('请输入分类名称')
this.$post(`${this.api.checkClassif}?classificationName=${row.classificationName}&siteId=${this.site.id}&classificationId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateClassif' : 'saveClassif'], {
this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=1&classificationId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], {
classificationName: row.classificationName,
templateId: this.columnInfo.templateId,
typeId: 3, // (1.2.)
id: row.id,
siteId: this.site.id,
editorId: this.userId,
founderId: this.userId
}).then(res => {
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getClassification()
@ -384,224 +267,13 @@ export default {
}
},
//
getLabel() {
this.$post(`${this.api.queryLabel}?siteId=${this.site.id}`).then(({ data }) => {
this.labels = data
}).catch(err => {})
},
//
setLabel() {
this.labelVisible = true
},
//
addLabel() {
this.labels.push({
edit: true,
id: '',
labelName: ''
})
},
//
editLabel(row) {
this.$set(row, 'edit', 1)
},
//
delLabel(row, i) {
if (row.id) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.delLabel}?id=${row.id}`).then(res => {
Util.successMsg('删除成功')
this.getLabel()
}).catch(res => {})
}).catch(() => {})
} else {
this.labels.splice(i, 1)
}
},
//
submitLabel(row, showMsg = 1) {
if (!row.labelName) return Util.errorMsg('请输入主题名称')
this.$post(`${this.api.checkLabel}?labelName=${row.labelName}&siteId=${this.site.id}&labelId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateLabel' : 'saveLabel'], {
labelName: row.labelName,
id: row.id,
siteId: this.site.id,
editorId: this.userId,
founderId: this.userId
}).then(res => {
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getLabel()
}).catch(res => {})
}).catch(res => {})
},
//
closeLabel() {
const list = this.labels
if (list.find(e => e.edit && e.labelName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
type: 'warning'
}).then(() => {
list.map(e => {
e.edit && e.labelName && this.submitLabel(e, 0)
})
this.labelVisible = false
}).catch(() => {
this.labelVisible = false
})
} else {
this.labelVisible = false
}
},
//
nameChange(){
const { title, level, id } = this.form
if(title && title !== this.originalName){
this.$post(this.api.checkIfTheTitleIsRepeat, {
siteId: this.site.id,
title,
id: id || ''
}).then(res => {
this.nameRepeat = false
}).catch(res => {
this.nameRepeat = true
})
}else{
this.nameRepeat = false
}
},
//
customUpload(data) {
const formData = new FormData()
formData.append('file', data, this.file.name)
this.imgUpload(formData)
},
//
compress(img) {
const canvas = document.createElement('canvas')
const ctx = canvas.getContext('2d')
// let initSize = img.src.length;
const width = img.width
const height = img.height
canvas.width = width
canvas.height = height
//
ctx.fillStyle = '#fff'
ctx.fillRect(0, 0, canvas.width, canvas.height)
ctx.drawImage(img, 0, 0, width, height)
//
const ndata = canvas.toDataURL('image/jpeg', 0.8)
return ndata
},
// base64bolb
dataURItoBlob(base64Data) {
let byteString
if (base64Data.split(',')[0].indexOf('base64') >= 0) {
byteString = atob(base64Data.split(',')[1])
} else {
byteString = unescape(base64Data.split(',')[1])
}
const mimeString = base64Data
.split(',')[0]
.split(':')[1]
.split(';')[0]
const ia = new Uint8Array(byteString.length)
for (let i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i)
}
return new Blob([ia], {
type: mimeString
})
},
//
imgUpload(formData) {
this.isUpload = true
Axios({
method: 'post',
url: this.api.upload,
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
token: Util.local.get(Setting.tokenKey)
},
}).then(({ data }) => {
let url = this.form[this.isBanner ? 'bannerImg' : 'titleImg']
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => {}).catch(e => {}) //
this.form[this.isBanner ? 'bannerImg' : 'titleImg'] = data.url
}).catch(res => {})
this.$refs.cropper.isDisabled = false
this.isUpload = false
this.cropperModel = false
},
//
changeFile(file, isBanner) {
this.fixedNumber = isBanner ? [1, 0.26] : [1.76, 1]
this.isBanner = isBanner
const { size, name } = file
const ext = name.substring(name.lastIndexOf('.') + 1)
if (!Util.isImg(ext)) {
this.$message.error('请上传图片!')
return false
}
// if (size / 1024 / 1024 > 5) {
// this.$message.error('5M')
// return false
// }
this.file = file
this.cropperModel = true
this.$nextTick(() => {
this.$refs.cropper.updateImg({
url: window.URL.createObjectURL(file.raw),
size: file.size
})
})
},
//
handleRemove(e, fileList) {
e.id ? this.$post(`${this.api.delContentFile}?id=${e.id}`).then(res => {
this.form.fileList = fileList
}).catch(res => {}) : (this.form.fileList = fileList)
},
// banner
uploadSuccessBanner(res) {
let url = this.form.bannerImg
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => {}).catch(e => {})
this.form.bannerImg = res.url
},
//
fileBeforeUpload(file) {
this.uploading++
},
//
uploadSuccessFile(res) {
this.uploading--
this.form.id ?
this.$post(this.api.saveContentFile, {
contentId: this.form.id,
editorId: this.userId,
founderId: this.userId,
id: '',
fileName: res.original,
filePath: res.url
}).then(({ data }) => {
this.form.fileList.push({
name: res.original,
url: res.url,
id: data
})
}).catch(res => {}) :
this.form.fileList.push({
name: res.original,
url: res.url
})
},
//
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}`)
this.form.schemeFile = res.filesResult.fileUrl
},
//
back() {
@ -637,78 +309,26 @@ export default {
const form = JSON.parse(JSON.stringify(this.form))
if (!form.title) return Util.errorMsg('请填写标题')
if (this.nameRepeat) return Util.errorMsg('该标题已重复!')
if (typeof form.fatherId === 'object') form.fatherId = form.fatherId[form.fatherId.length - 1]
const tId = form.articleTemplate
//
if (isRelease) {
if (tId !== 25) {
if (!form.releaseTime) return Util.errorMsg('请选择发布日期')
}
if (tId === 22 || tId === 23 || tId === 24) {
if (!form.titleImg ) return Util.errorMsg('请上传封面')
}
if (tId === 25) {
if ((!form.time || !form.time.length) && isRelease) return Util.errorMsg('请选择起止时间')
form.activityStartTime = form.time[0]
form.activityEndTime = form.time[1]
}
if (tId === 24 && form.connectionType !== 2) {
if (form.connectionType === 1) {
if (!this.links.length) return Util.errorMsg('请选择站内链接')
}
if (!this.otherLink.length && form.connectionType === 3) {
if (!this.otherLink.length) return Util.errorMsg('请选择栏目')
}
}
if ((tId === 22 || tId === 23 || tId === 25) && !form.mainBody) return Util.errorMsg('请输入正文')
// if (!form.releaseTime) return Util.errorMsg('')
// if (!form.bannerImg ) return Util.errorMsg('')
// if (!form.mainBody) return Util.errorMsg('')
}
if (this.uploading) return Util.errorMsg('文件正在上传,请上传完成后再发布')
if (form.connectionType === 1) {
form.linkAddress = this.links.join()
if (this.article) form.linkAddress += '-' + this.article
} else if (form.connectionType === 3) {
form.linkAddress = this.otherLink.join()
if (this.otherArticle) form.linkAddress += '-' + this.otherArticle
}
const { columnId, bannerImg, fileList, titleImg } = form
const fileId = []
if (typeof columnId === 'object') form.columnId = columnId[columnId.length - 1] // id
// idurlid
if (bannerImg) fileId.push(bannerImg.substr(bannerImg.lastIndexOf('/') + 1))
if (titleImg) fileId.push(titleImg.substr(titleImg.lastIndexOf('/') + 1))
fileList && fileList.map(e => {
fileId.push(e[e.url ? 'url' : 'filePath'].substr(e[e.url ? 'url' : 'filePath'].lastIndexOf('/') + 1))
})
form.lableId = form.lableId.join(',')
form.releaseTime = Util.formatDate('yyyy-MM-dd', new Date(form.releaseTime)) //
// if (this.uploading) return Util.errorMsg('')
form.isRelease = isRelease
this.submiting = true
if (form.id) {
delete form.children
form.editorId = +this.$store.state.user.userId
this.$post(this.api.updateArticle, form).then(res => {
this.updateFile(fileId, form, form.id)
this.$post(this.api.updateScheme, form).then(res => {
Util.successMsg('修改成功')
next ? next() : this.$router.push(`list?columnId=` + form.columnId)
next ? next() : this.$router.back()
}).catch(err => {
this.submiting = false
})
} else {
this.$post(this.api.saveArticle, form).then(({ data }) => {
this.updateFile(fileId, form, data)
//
form.fileList.map(e => {
this.$post(this.api.saveContentFile, {
contentId: data,
editorId: this.userId,
founderId: this.userId,
id: '',
fileName: e.name,
filePath: e.url
}).then(res => {}).catch(err => {})
})
this.$post(this.api.saveScheme, form).then(({ data }) => {
Util.successMsg('创建成功')
next ? next() : this.$router.back()
}).catch(err => {
@ -826,7 +446,7 @@ $upload-lg-height: 102px;
.plus {
margin-bottom: 10px;
font-size: 18px;
color: #2962FF;
color: #9278FF;
text-align: right;
cursor: pointer;
}
@ -844,7 +464,7 @@ $upload-lg-height: 102px;
}
.input-form {
&.model {
height: calc(100vh - 200px);
height: calc(100vh - 250px);
padding-right: 20px;
overflow: auto;
.el-form-item__label {

@ -2,7 +2,15 @@
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-input class="keyword" placeholder="请输入标题" v-model.trim="keyword" clearable></el-input>
<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="'/site/list:内容管理:文章管理:删除'" @click="batchDel">批量删除</el-button>
@ -60,19 +68,32 @@
<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,
sequenceSort: '',
modifiedTimeSort: '',
publicationTimeSort: '',
classificationNameSort: '',
releaseDateSort: '',
editTimeSort: 'desc',
multipleSelection: [],
};
@ -91,6 +112,7 @@ export default {
methods: {
//
getData() {
const { keyword } = this
this.$post(this.api.partnerOperatingList, {
pageNum: this.page,
pageSize: this.pageSize,
@ -99,8 +121,10 @@ export default {
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
title: this.keyword,
typeId: 1 // (1.2.)
typeId: 1, // (1.2.)
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}).then(({ data }) => {
data.records.forEach(e => {
e.editing = false
@ -159,7 +183,7 @@ export default {
},
//
add() {
this.$router.push(`/learnMg`)
this.$router.push(`/learnMg?type=1`)
},
//
sortChange(column) {
@ -221,7 +245,7 @@ export default {
},
//
edit(row) {
this.$router.push(`/learnMg?id=${row.id}`)
this.$router.push(`/learnMg?id=${row.id}&type=1`)
},
}
};

Loading…
Cancel
Save