From b24531c485fb275905291b8f4885ba265b7eb791 Mon Sep 17 00:00:00 2001
From: douzhuo <17611323298@163.com>
Date: Wed, 9 Feb 2022 15:54:04 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/modules/api.js | 45 +++++
src/components/wechat/WxEditor.vue | 2 +-
src/views/Customer/source.vue | 256 ++++++++++++++++++++++-------
src/views/Receive/index.vue | 1 +
vue.config.js | 4 +-
5 files changed, 246 insertions(+), 62 deletions(-)
diff --git a/src/api/modules/api.js b/src/api/modules/api.js
index a3ad088..242ba9e 100644
--- a/src/api/modules/api.js
+++ b/src/api/modules/api.js
@@ -1121,3 +1121,48 @@ export function setTargetExecutionRate(data) {
data
})
}
+
+// 客户来源列表
+export function getSourceList(data) {
+ return request({
+ url: '/autoSR/customer/source/list',
+ method: 'get',
+ params: data
+ })
+}
+
+// 添加客户类型
+export function setSourceAdd(data) {
+ return request({
+ url: '/autoSR/customer/source/add',
+ method: 'get',
+ params: data
+ })
+}
+
+// 更新客户来源文字
+export function setSourceUpdate(data) {
+ return request({
+ url: '/autoSR/customer/source/update',
+ method: 'get',
+ params: data
+ })
+}
+
+// 删除客户来源
+export function setSourceDel(data) {
+ return request({
+ url: '/autoSR/customer/source/del',
+ method: 'get',
+ params: data
+ })
+}
+
+// 修改顺序
+export function setSourceupDateSort(data) {
+ return request({
+ url: '/autoSR/customer/source/updateSort',
+ method: 'get',
+ params: data
+ })
+}
\ No newline at end of file
diff --git a/src/components/wechat/WxEditor.vue b/src/components/wechat/WxEditor.vue
index 331f340..8cb9435 100644
--- a/src/components/wechat/WxEditor.vue
+++ b/src/components/wechat/WxEditor.vue
@@ -158,7 +158,7 @@
uploadError() {
// loading动画消失
this.quillUpdateImg = false;
- this.$message.error("图片插入失败");
+ this.error("图片插入失败");
}
}
}
diff --git a/src/views/Customer/source.vue b/src/views/Customer/source.vue
index 1d78a66..2d65457 100644
--- a/src/views/Customer/source.vue
+++ b/src/views/Customer/source.vue
@@ -18,39 +18,22 @@
-
+
+
+ {{ scope.$index + 1 }}
+
-
+
-
+
-
- 编辑
- 删除
+ 编辑
+ 删除
-
-
-
-
-
+
@@ -76,17 +59,20 @@
+
- 请将此来源的客户转移到以下来源
+
+ 请将此来源的客户转移到以下来源
+
-
-
+
+
+
+
+
@@ -123,20 +119,7 @@ export default {
currentPage4: 1,
value: "",
input: "",
- tableData: [
- {
- id: "0",
- houseName: "123",
- },
- {
- id: "1",
- houseName: "456",
- },
- {
- id: "2",
- houseName: "789",
- },
- ],
+ tableData: [], // 客户来源列表
multipleSelection: [],
dialogVisible: false,
loadingFlag: false,
@@ -145,6 +128,7 @@ export default {
ruleForm: {
editFlag: "",
id: "",
+ sourceName: "", //
},
houseId: "",
houseList: [],
@@ -153,11 +137,34 @@ export default {
words: "",
total: 0,
ruleser: {
- source: [
- { required: true, message: "请填写用户来源", trigger: "blur" },
+ sourceName: [
+ { required: true, message: "请填写客户来源", trigger: "blur" },
],
},
editFlag: false,
+ paramsList: {
+ // 列表入参
+ id: "",
+ sourceName: "", // 资源名称
+ houseId:
+ localStorage.getItem("houseId"), // 楼盘id
+ sort: "", // 顺序
+ },
+
+ deleteParams: {
+ // 删除入参
+ id: "",
+ newSourceId: "",
+ houseId:
+ localStorage.getItem("houseId"), // 楼盘id
+ },
+ delIdList: [], // 要转移的数据位置
+
+ editParams: {
+ // 编辑这一项
+ id: "", //
+ sourceName: "", //
+ },
};
},
computed: {
@@ -171,11 +178,105 @@ export default {
},
mounted() {
this.rowDrop();
- return;
-
- this.zkhousePage();
+ this.getList();
},
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() {
const tbody = document.querySelector(".el-table__body-wrapper tbody");
@@ -186,6 +287,30 @@ export default {
const currRow = _this.tableData.splice(oldIndex, 1)[0];
console.log(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) {
+ 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;
},
//编辑
bianji(row) {
- this.ruleForm.id = row.id;
this.dialogVisible = true;
- this.ruleForm.words = row.words;
+ this.ruleForm.sourceName = row.sourceName;
+ this.ruleForm.id = row.id;
this.editFlag = true;
},
diff --git a/src/views/Receive/index.vue b/src/views/Receive/index.vue
index 27fd8fc..3418141 100644
--- a/src/views/Receive/index.vue
+++ b/src/views/Receive/index.vue
@@ -2209,6 +2209,7 @@ export default {
this.tablist = [];
if (this.userinformationlist.yon == 0) {
this.isd = audopbj[this.AudioIdx].id;
+ console.log(audopbj[this.AudioIdx].speakerNum, 'speakerNum')
for (var i = 0; i <= audopbj[this.AudioIdx].speakerNum; i++) {
if (i == 0) {
this.tablist.push({
diff --git a/vue.config.js b/vue.config.js
index 006679b..e605ebe 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -4,10 +4,10 @@
*/
// const url = 'http://pigx-gateway'
// const url = 'http://39.97.167.65:9999' //测试
-// const url = 'http://192.168.31.169:9999' //长龙
+const url = 'http://192.168.31.167:9999' //长龙
// const url = 'http://192.168.31.134:9999' //嘉豪
// const url = 'http://192.168.31.100:9999' //王笑
-const url = 'http://62.234.122.43:9999' //正式
+// const url = 'http://62.234.122.43:9999' //正式
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = ['js', 'css']