|
|
@@ -1,24 +1,45 @@ |
|
|
|
<template> |
|
|
|
<div class="box-center"> |
|
|
|
<!-- 头 --> |
|
|
|
<div class="app-top" v-if="cus_sou_add || cus_sou_downLoad"> |
|
|
|
<div class="app-top"> |
|
|
|
<template v-if="role"> |
|
|
|
<div class="app-titel" style="margin: 0 0 10px 10px;"> |
|
|
|
<div class="titel-text">项目选择:</div> |
|
|
|
<div style="margin-left: 26px"> |
|
|
|
<el-select |
|
|
|
v-model="paramsList.houseId" |
|
|
|
filterable |
|
|
|
placeholder="请选择" |
|
|
|
@change="houseChange" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in houseList" |
|
|
|
:key="item.id" |
|
|
|
:label="item.propertyName" |
|
|
|
:value="item.id" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<div style="margin-left: 20px; display: flex"> |
|
|
|
<el-button v-if="cus_sou_add" @click="editorinfo()" type="primary" |
|
|
|
>新增</el-button |
|
|
|
> |
|
|
|
<div |
|
|
|
style="margin-left: auto; margin-right: 10px" |
|
|
|
v-if="cus_sou_downLoad" |
|
|
|
> |
|
|
|
<el-button @click="downLoad" icon="el-icon-download">导出</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 表格 --> |
|
|
|
<div class="cen-tab"> |
|
|
|
<el-table :data="tableData" stripe style="width: 100%" row-key="id" :header-cell-style="{background:'#F5F7FA',color:'#333333'}"> |
|
|
|
<el-table-column label="序号" align="center"> |
|
|
|
<el-table |
|
|
|
:data="tableData" |
|
|
|
stripe |
|
|
|
style="width: 100%" |
|
|
|
row-key="id" |
|
|
|
:header-cell-style="{ background: '#F5F7FA', color: '#333333' }" |
|
|
|
> |
|
|
|
<el-table-column label="序号" width="150" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.$index + 1 }} |
|
|
|
</template> |
|
|
@@ -28,9 +49,11 @@ |
|
|
|
<el-table-column prop="customerCount" label="关联客户" align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
<template slot-scope="scope" style=""> |
|
|
|
<el-button type="text" @click="bianji(scope.row)">编辑</el-button> |
|
|
|
<el-button type="text" @click="del(scope.row)">删除</el-button> |
|
|
|
<template slot-scope="{ row }"> |
|
|
|
|
|
|
|
<el-button v-if="cus_sou_edit" type="text" @click="bianji(row)">编辑</el-button> |
|
|
|
|
|
|
|
<el-button v-if="cus_sou_del" type="text" @click="del(row)">删除</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@@ -112,7 +135,6 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
import { exportMethodPost } from "@/util/util"; |
|
|
|
import Sortable from "sortablejs"; |
|
|
|
export default { |
|
|
|
data() { |
|
|
@@ -133,6 +155,7 @@ export default { |
|
|
|
}, |
|
|
|
houseId: "", |
|
|
|
houseList: [], |
|
|
|
|
|
|
|
Page: 1, |
|
|
|
size: 10, |
|
|
|
words: "", |
|
|
@@ -147,8 +170,7 @@ export default { |
|
|
|
// 列表入参 |
|
|
|
id: "", |
|
|
|
sourceName: "", // 资源名称 |
|
|
|
houseId: |
|
|
|
localStorage.getItem("houseId"), // 项目id |
|
|
|
houseId: localStorage.getItem("houseId"), // 项目id |
|
|
|
sort: "", // 顺序 |
|
|
|
}, |
|
|
|
|
|
|
@@ -156,8 +178,7 @@ export default { |
|
|
|
// 删除入参 |
|
|
|
id: "", |
|
|
|
newSourceId: "", |
|
|
|
houseId: |
|
|
|
localStorage.getItem("houseId"), // 项目id |
|
|
|
houseId: localStorage.getItem("houseId"), // 项目id |
|
|
|
}, |
|
|
|
delIdList: [], // 要转移的数据位置 |
|
|
|
|
|
|
@@ -170,18 +191,44 @@ export default { |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapGetters(["permissions"]), |
|
|
|
role() { |
|
|
|
return localStorage.getItem("orgType") != 3; |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.cus_sou_add = this.permissions["cus_sou_add"]; |
|
|
|
this.cus_sou_downLoad = this.permissions["cus_sou_downLoad"]; |
|
|
|
this.cus_sou_del = this.permissions["cus_sou_del"]; |
|
|
|
this.cus_sou_edit = this.permissions["cus_sou_edit"]; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.rowDrop(); |
|
|
|
this.getList(); |
|
|
|
async mounted() { |
|
|
|
await this.initPage() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async initPage() { |
|
|
|
if (this.role) { |
|
|
|
await this.zkhousePage(); |
|
|
|
await this.getList(); |
|
|
|
} else { |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
this.rowDrop(); // 拖拽方法 |
|
|
|
}, |
|
|
|
|
|
|
|
//获取项目 |
|
|
|
async zkhousePage() { |
|
|
|
try { |
|
|
|
let res = await this.$api.api.findHouseByUser({ |
|
|
|
orgType: localStorage.getItem("orgType"), |
|
|
|
houseTypes: "", |
|
|
|
}); |
|
|
|
this.houseList = res.data; |
|
|
|
this.paramsList.houseId = res.data[0].id; |
|
|
|
this.deleteParams.houseId = res.data[0].id; |
|
|
|
} catch (e) { |
|
|
|
console.log(e); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/*判断类型选择使用方法*/ |
|
|
|
addForm() { |
|
|
|
if (!this.editFlag) this.addCustomer(); |
|
|
@@ -228,7 +275,11 @@ export default { |
|
|
|
// 编辑 |
|
|
|
editCustomer() { |
|
|
|
this.$refs.ruleForm.validate((valid) => { |
|
|
|
this.$api.api.setSourceUpdate(this.ruleForm).then((res) => { |
|
|
|
let obj = { |
|
|
|
...this.ruleForm, |
|
|
|
houseId: this.paramsList.houseId |
|
|
|
} |
|
|
|
this.$api.api.setSourceUpdate(obj).then((res) => { |
|
|
|
console.log(res); |
|
|
|
if (res.code == 10000) { |
|
|
|
this.dialogVisible = false; |
|
|
@@ -269,13 +320,15 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取列表 |
|
|
|
getList() { |
|
|
|
this.$api.api.getSourceList(this.paramsList).then((res) => { |
|
|
|
async getList() { |
|
|
|
try { |
|
|
|
let res = await this.$api.api.getSourceList(this.paramsList); |
|
|
|
if (res.code == 10000) { |
|
|
|
console.log(res, "list"); |
|
|
|
this.tableData = res.data; |
|
|
|
} |
|
|
|
}); |
|
|
|
} catch (e) { |
|
|
|
console.log(e); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//行拖拽 |
|
|
@@ -315,51 +368,15 @@ export default { |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
downLoad() { |
|
|
|
let obj = { |
|
|
|
houseId: this.houseId, |
|
|
|
words: this.words, |
|
|
|
}; |
|
|
|
// exportMethodPost() |
|
|
|
exportMethodPost("autoSR/sensitivewords/export", "禁忌话术", obj); |
|
|
|
}, |
|
|
|
houseChange() { |
|
|
|
houseChange(e) { |
|
|
|
this.deleteParams.houseId = e |
|
|
|
this.Page = 1; |
|
|
|
this.words = ""; |
|
|
|
this.taboofindbypagelist(); |
|
|
|
}, |
|
|
|
zkhousePage() { |
|
|
|
this.$api.api |
|
|
|
.findHouseByUser({ |
|
|
|
orgType: localStorage.getItem("orgType"), |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
this.houseList = res.data; |
|
|
|
if (localStorage.getItem("orgType") == 3) { |
|
|
|
this.houseId = localStorage.getItem("houseId"); |
|
|
|
} else { |
|
|
|
this.houseId = res.data[0].id; |
|
|
|
} |
|
|
|
// this.houseId = res.data[0].id; |
|
|
|
this.taboofindbypagelist(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
taboofindbypagelist() { |
|
|
|
let obj = { |
|
|
|
current: this.Page, |
|
|
|
size: this.size, |
|
|
|
houseId: this.houseId, |
|
|
|
words: this.words, |
|
|
|
}; |
|
|
|
this.$api.http.taboofindbypage(obj).then((res) => { |
|
|
|
console.log(res); |
|
|
|
this.tableData = res.data.records; |
|
|
|
this.total = res.data.total; |
|
|
|
}); |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
screening() { |
|
|
|
this.Page = 1; |
|
|
|
this.taboofindbypagelist(); |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
//删除 |
|
|
|
del(item) { |
|
|
@@ -398,8 +415,8 @@ export default { |
|
|
|
if (this.editFlag == false) { |
|
|
|
this.$api.http |
|
|
|
.tabooadd({ |
|
|
|
houseId: this.houseId, |
|
|
|
words: this.ruleForm.words, |
|
|
|
houseId: this.paramsList.houseId, |
|
|
|
words: this.ruleForm.sourceName, |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
if (res.code == 0) { |
|
|
@@ -411,7 +428,7 @@ export default { |
|
|
|
this.$refs.ruleForm.resetFields(); |
|
|
|
this.Page = 1; |
|
|
|
this.words = ""; |
|
|
|
this.taboofindbypagelist(); |
|
|
|
this.getList(); |
|
|
|
} else { |
|
|
|
this.$message.error(res.message); |
|
|
|
} |
|
|
@@ -419,8 +436,9 @@ export default { |
|
|
|
} else { |
|
|
|
this.$api.http |
|
|
|
.tabooupdate({ |
|
|
|
houseId: this.paramsList.houseId, |
|
|
|
id: this.ruleForm.id, |
|
|
|
words: this.ruleForm.words, |
|
|
|
sourceName: this.ruleForm.sourceName, |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
if (res.code == 0) { |
|
|
@@ -432,7 +450,7 @@ export default { |
|
|
|
this.$refs.ruleForm.resetFields(); |
|
|
|
this.Page = 1; |
|
|
|
this.words = ""; |
|
|
|
this.taboofindbypagelist(); |
|
|
|
this.getList(); |
|
|
|
} else { |
|
|
|
this.$message.error(res.message); |
|
|
|
} |
|
|
@@ -443,16 +461,6 @@ export default { |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleSizeChange(val) { |
|
|
|
console.log(`每页 ${val} 条`); |
|
|
|
this.size = val; |
|
|
|
this.taboofindbypagelist(); |
|
|
|
}, |
|
|
|
handleCurrentChange(val) { |
|
|
|
console.log(`当前页: ${val}`); |
|
|
|
this.Page = val; |
|
|
|
this.taboofindbypagelist(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
@@ -511,27 +519,27 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/deep/ .el-table__header-wrapper{ |
|
|
|
thead{ |
|
|
|
tr{ |
|
|
|
th{ |
|
|
|
background: #F5F7FA; |
|
|
|
/deep/ .el-table__header-wrapper { |
|
|
|
thead { |
|
|
|
tr { |
|
|
|
th { |
|
|
|
background: #f5f7fa; |
|
|
|
color: #333333; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/deep/ .el-dialog--center{ |
|
|
|
/deep/ .el-dialog--center { |
|
|
|
border-radius: 8px; |
|
|
|
.el-dialog__title{ |
|
|
|
.el-dialog__title { |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
|
} |
|
|
|
/deep/ .el-button--primary{ |
|
|
|
background: #2671E2 !important; |
|
|
|
border: 1px solid #2671E2 !important; |
|
|
|
/deep/ .el-button--primary { |
|
|
|
background: #2671e2 !important; |
|
|
|
border: 1px solid #2671e2 !important; |
|
|
|
} |
|
|
|
/deep/ .el-button--text{ |
|
|
|
color: #2671E2; |
|
|
|
/deep/ .el-button--text { |
|
|
|
color: #2671e2; |
|
|
|
} |
|
|
|
</style> |