|
@@ -18,39 +18,22 @@ |
|
|
<!-- 表格 --> |
|
|
<!-- 表格 --> |
|
|
<div class="cen-tab"> |
|
|
<div class="cen-tab"> |
|
|
<el-table :data="tableData" stripe style="width: 100%" row-key="id"> |
|
|
<el-table :data="tableData" stripe style="width: 100%" row-key="id"> |
|
|
<el-table-column prop="words" label="序号" align="center"> |
|
|
|
|
|
|
|
|
<el-table-column label="序号" align="center"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ scope.$index + 1 }} |
|
|
|
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="houseName" label="来源" align="center"> |
|
|
|
|
|
|
|
|
<el-table-column prop="sourceName" label="来源" align="center"> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="createDate" label="关联客户" align="center"> |
|
|
|
|
|
|
|
|
<el-table-column prop="customerCount" label="关联客户" align="center"> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<!-- scope --> |
|
|
|
|
|
<el-table-column label="操作" align="center"> |
|
|
<el-table-column label="操作" align="center"> |
|
|
<template slot-scope="scope" style=""> |
|
|
<template slot-scope="scope" style=""> |
|
|
<el-button |
|
|
|
|
|
v-if="cus_sou_edit" |
|
|
|
|
|
type="text" |
|
|
|
|
|
@click="bianji(scope.row)" |
|
|
|
|
|
>编辑</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button v-if="cus_sou_del" type="text" @click="del(scope.row)" |
|
|
|
|
|
>删除</el-button |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<el-button type="text" @click="bianji(scope.row)">编辑</el-button> |
|
|
|
|
|
<el-button type="text" @click="del(scope.row)">删除</el-button> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
<div style="display: flex; justify-content: flex-end; margin-top: 10px"> |
|
|
|
|
|
<el-pagination |
|
|
|
|
|
@size-change="handleSizeChange" |
|
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
|
:current-page="Page" |
|
|
|
|
|
:page-sizes="[10, 30, 50]" |
|
|
|
|
|
:page-size="size" |
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
|
|
:total="total" |
|
|
|
|
|
> |
|
|
|
|
|
</el-pagination> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<el-dialog |
|
|
<el-dialog |
|
@@ -66,9 +49,9 @@ |
|
|
label-width="140px" |
|
|
label-width="140px" |
|
|
style="width: 60%; margin: 0 auto" |
|
|
style="width: 60%; margin: 0 auto" |
|
|
> |
|
|
> |
|
|
<el-form-item label="客户来源" prop="source"> |
|
|
|
|
|
|
|
|
<el-form-item label="客户来源" prop="sourceName"> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="ruleForm.source" |
|
|
|
|
|
|
|
|
v-model="ruleForm.sourceName" |
|
|
maxlength="8" |
|
|
maxlength="8" |
|
|
clearable |
|
|
clearable |
|
|
></el-input> |
|
|
></el-input> |
|
@@ -76,17 +59,20 @@ |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button @click="dialogVisible = false">取 消</el-button> |
|
|
<el-button @click="dialogVisible = false">取 消</el-button> |
|
|
<el-button type="primary" :loading="loadingFlag" @click="editor()" |
|
|
|
|
|
|
|
|
<el-button type="primary" :loading="loadingFlag" @click="addForm" |
|
|
>保存</el-button |
|
|
>保存</el-button |
|
|
> |
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<el-dialog |
|
|
<el-dialog |
|
|
title="删除来源" |
|
|
title="删除来源" |
|
|
:visible.sync="delVisible" |
|
|
:visible.sync="delVisible" |
|
|
@close="$refs.ruleForm.resetFields()" |
|
|
@close="$refs.ruleForm.resetFields()" |
|
|
> |
|
|
> |
|
|
<div style="text-align:center;margin-bottom:20px;">请将此来源的客户转移到以下来源</div> |
|
|
|
|
|
|
|
|
<div style="text-align: center; margin-bottom: 20px"> |
|
|
|
|
|
请将此来源的客户转移到以下来源 |
|
|
|
|
|
</div> |
|
|
<el-form |
|
|
<el-form |
|
|
:model="ruleForm" |
|
|
:model="ruleForm" |
|
|
label-position="labelPosition" |
|
|
label-position="labelPosition" |
|
@@ -95,18 +81,28 @@ |
|
|
label-width="140px" |
|
|
label-width="140px" |
|
|
style="width: 60%; margin: 0 auto" |
|
|
style="width: 60%; margin: 0 auto" |
|
|
> |
|
|
> |
|
|
<el-form-item label="客户移至" prop="source"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="ruleForm.source" |
|
|
|
|
|
maxlength="8" |
|
|
|
|
|
clearable |
|
|
|
|
|
></el-input> |
|
|
|
|
|
|
|
|
<el-form-item label="客户移至" prop="newSourceId"> |
|
|
|
|
|
<el-select v-model="deleteParams.newSourceId" placeholder="请选择"> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in delIdList" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item.value" |
|
|
|
|
|
> |
|
|
|
|
|
</el-option> |
|
|
|
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button @click="delVisible = false">取 消</el-button> |
|
|
|
|
|
<el-button type="primary" :loading="loadingFlag" @click="editor()" |
|
|
|
|
|
>保存</el-button |
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
@click=" |
|
|
|
|
|
delVisible = false; |
|
|
|
|
|
deleteParams.id = ''; |
|
|
|
|
|
" |
|
|
|
|
|
>取 消</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button type="primary" :loading="loadingFlag" @click="deleteItem" |
|
|
|
|
|
>删除</el-button |
|
|
> |
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
@@ -123,20 +119,7 @@ export default { |
|
|
currentPage4: 1, |
|
|
currentPage4: 1, |
|
|
value: "", |
|
|
value: "", |
|
|
input: "", |
|
|
input: "", |
|
|
tableData: [ |
|
|
|
|
|
{ |
|
|
|
|
|
id: "0", |
|
|
|
|
|
houseName: "123", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: "1", |
|
|
|
|
|
houseName: "456", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: "2", |
|
|
|
|
|
houseName: "789", |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
tableData: [], // 客户来源列表 |
|
|
multipleSelection: [], |
|
|
multipleSelection: [], |
|
|
dialogVisible: false, |
|
|
dialogVisible: false, |
|
|
loadingFlag: false, |
|
|
loadingFlag: false, |
|
@@ -145,6 +128,7 @@ export default { |
|
|
ruleForm: { |
|
|
ruleForm: { |
|
|
editFlag: "", |
|
|
editFlag: "", |
|
|
id: "", |
|
|
id: "", |
|
|
|
|
|
sourceName: "", // |
|
|
}, |
|
|
}, |
|
|
houseId: "", |
|
|
houseId: "", |
|
|
houseList: [], |
|
|
houseList: [], |
|
@@ -153,11 +137,34 @@ export default { |
|
|
words: "", |
|
|
words: "", |
|
|
total: 0, |
|
|
total: 0, |
|
|
ruleser: { |
|
|
ruleser: { |
|
|
source: [ |
|
|
|
|
|
{ required: true, message: "请填写用户来源", trigger: "blur" }, |
|
|
|
|
|
|
|
|
sourceName: [ |
|
|
|
|
|
{ required: true, message: "请填写客户来源", trigger: "blur" }, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
editFlag: false, |
|
|
editFlag: false, |
|
|
|
|
|
paramsList: { |
|
|
|
|
|
// 列表入参 |
|
|
|
|
|
id: "", |
|
|
|
|
|
sourceName: "", // 资源名称 |
|
|
|
|
|
houseId: |
|
|
|
|
|
localStorage.getItem("houseId"), // 楼盘id |
|
|
|
|
|
sort: "", // 顺序 |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
deleteParams: { |
|
|
|
|
|
// 删除入参 |
|
|
|
|
|
id: "", |
|
|
|
|
|
newSourceId: "", |
|
|
|
|
|
houseId: |
|
|
|
|
|
localStorage.getItem("houseId"), // 楼盘id |
|
|
|
|
|
}, |
|
|
|
|
|
delIdList: [], // 要转移的数据位置 |
|
|
|
|
|
|
|
|
|
|
|
editParams: { |
|
|
|
|
|
// 编辑这一项 |
|
|
|
|
|
id: "", // |
|
|
|
|
|
sourceName: "", // |
|
|
|
|
|
}, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
@@ -171,11 +178,105 @@ export default { |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
this.rowDrop(); |
|
|
this.rowDrop(); |
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
this.zkhousePage(); |
|
|
|
|
|
|
|
|
this.getList(); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
/*判断类型选择使用方法*/ |
|
|
|
|
|
addForm() { |
|
|
|
|
|
if (!this.editFlag) this.addCustomer(); |
|
|
|
|
|
else this.editCustomer(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 初始化提交变量 |
|
|
|
|
|
initRuleForm() { |
|
|
|
|
|
this.ruleForm = { |
|
|
|
|
|
editFlag: "", |
|
|
|
|
|
id: "", |
|
|
|
|
|
sourceName: "", // |
|
|
|
|
|
}; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 确认添加 |
|
|
|
|
|
addCustomer() { |
|
|
|
|
|
this.$refs.ruleForm.validate((valid) => { |
|
|
|
|
|
this.$api.api |
|
|
|
|
|
.setSourceAdd({ |
|
|
|
|
|
sourceName: this.ruleForm.sourceName, |
|
|
|
|
|
houseId: this.paramsList.houseId, |
|
|
|
|
|
}) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
console.log(res); |
|
|
|
|
|
if (res.code == 10000) { |
|
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: res.message, |
|
|
|
|
|
type: "success", |
|
|
|
|
|
}); |
|
|
|
|
|
this.initRuleForm(); |
|
|
|
|
|
this.getList(); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: res.message, |
|
|
|
|
|
type: "error", |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 编辑 |
|
|
|
|
|
editCustomer() { |
|
|
|
|
|
this.$refs.ruleForm.validate((valid) => { |
|
|
|
|
|
this.$api.api.setSourceUpdate(this.ruleForm).then((res) => { |
|
|
|
|
|
console.log(res); |
|
|
|
|
|
if (res.code == 10000) { |
|
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: res.message, |
|
|
|
|
|
type: "success", |
|
|
|
|
|
}); |
|
|
|
|
|
this.initRuleForm(); |
|
|
|
|
|
this.getList(); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: res.message, |
|
|
|
|
|
type: "error", |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 删除确认删除item |
|
|
|
|
|
deleteItem() { |
|
|
|
|
|
if (!this.deleteParams.newSourceId) { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: "请选择客户移至", |
|
|
|
|
|
type: "error", |
|
|
|
|
|
}); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
this.$api.api.setSourceDel(this.deleteParams).then((res) => { |
|
|
|
|
|
console.log(res); |
|
|
|
|
|
this.delVisible = false; |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: res.message, |
|
|
|
|
|
}); |
|
|
|
|
|
this.deleteParams.newSourceId = ""; |
|
|
|
|
|
this.getList(); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取列表 |
|
|
|
|
|
getList() { |
|
|
|
|
|
this.$api.api.getSourceList(this.paramsList).then((res) => { |
|
|
|
|
|
if (res.code == 10000) { |
|
|
|
|
|
console.log(res, "list"); |
|
|
|
|
|
this.tableData = res.data; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
//行拖拽 |
|
|
//行拖拽 |
|
|
rowDrop() { |
|
|
rowDrop() { |
|
|
const tbody = document.querySelector(".el-table__body-wrapper tbody"); |
|
|
const tbody = document.querySelector(".el-table__body-wrapper tbody"); |
|
@@ -186,6 +287,30 @@ export default { |
|
|
const currRow = _this.tableData.splice(oldIndex, 1)[0]; |
|
|
const currRow = _this.tableData.splice(oldIndex, 1)[0]; |
|
|
console.log(currRow); |
|
|
console.log(currRow); |
|
|
_this.tableData.splice(newIndex, 0, currRow); |
|
|
_this.tableData.splice(newIndex, 0, currRow); |
|
|
|
|
|
|
|
|
|
|
|
let list = _this.tableData.map((item) => { |
|
|
|
|
|
return item.id; |
|
|
|
|
|
}); |
|
|
|
|
|
_this.$api.api |
|
|
|
|
|
.setSourceupDateSort({ |
|
|
|
|
|
houseId: _this.paramsList.houseId, |
|
|
|
|
|
newSorts: list.join(","), |
|
|
|
|
|
}) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
console.log(res); |
|
|
|
|
|
if (res.code == 10000) { |
|
|
|
|
|
_this.$message({ |
|
|
|
|
|
message: res.message, |
|
|
|
|
|
type: "success", |
|
|
|
|
|
}); |
|
|
|
|
|
_this.getList(); |
|
|
|
|
|
} else { |
|
|
|
|
|
_this.$message({ |
|
|
|
|
|
message: res.message, |
|
|
|
|
|
type: "error", |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
@@ -237,13 +362,26 @@ export default { |
|
|
}, |
|
|
}, |
|
|
//删除 |
|
|
//删除 |
|
|
del(item) { |
|
|
del(item) { |
|
|
|
|
|
this.delIdList = []; |
|
|
|
|
|
this.deleteParams.id = item.id; |
|
|
|
|
|
let arr = []; |
|
|
|
|
|
this.tableData.forEach((items) => { |
|
|
|
|
|
if (items.id != item.id) { |
|
|
|
|
|
arr.push({ |
|
|
|
|
|
label: items.sourceName, |
|
|
|
|
|
value: items.id, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
console.log(arr); |
|
|
|
|
|
this.delIdList = arr; |
|
|
this.delVisible = true; |
|
|
this.delVisible = true; |
|
|
}, |
|
|
}, |
|
|
//编辑 |
|
|
//编辑 |
|
|
bianji(row) { |
|
|
bianji(row) { |
|
|
this.ruleForm.id = row.id; |
|
|
|
|
|
this.dialogVisible = true; |
|
|
this.dialogVisible = true; |
|
|
this.ruleForm.words = row.words; |
|
|
|
|
|
|
|
|
this.ruleForm.sourceName = row.sourceName; |
|
|
|
|
|
this.ruleForm.id = row.id; |
|
|
this.editFlag = true; |
|
|
this.editFlag = true; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|