-
+
-
-
+
+
{{ role != 2 ? row.companyName : row.houseName }}
-
+
-
+
-
+
{{ row.avgFration || 0 }}%
@@ -1354,31 +1998,61 @@
{{ role == 2 ? "顾问排名(TOP10)" : "项目排名(TOP10)" }}
-
- >
-
+ >
+
{{ role != 2 ? row.houseName : row.accountName }}
-
+
-
+
-
+
{{ row.avgFration || 0 }}%
@@ -1388,7 +2062,10 @@
-
@@ -1442,7 +2119,7 @@ export default {
computed: {
...mapGetters(["permissions"]),
info() {
- return this.$store.state.user.userInfo
+ return this.$store.state.user.userInfo;
},
RandomColor() {
return (index) => {
@@ -1507,11 +2184,13 @@ export default {
default:
return "#138BFB";
}
- }
- }
+ };
+ },
},
mounted() {
+ console.log(this.$tableOption)
+ console.log(this.$tableOption, '多久啊开始了的接口撒了就的克拉斯绝地狂龙撒')
this.role = localStorage.getItem("orgType");
if (this.role == 3) {
this.houseId = localStorage.getItem("houseId");
@@ -1537,49 +2216,49 @@ export default {
* 2、有效接待、平均执行率、平均接待时长:打开接待页面,筛选条件:日期+有效接待
* 3、顾问:打开顾问排名,筛选条件:时间;
* 4、违禁接待次数、违禁接待占比:打开接待记录,筛选条件:日期+违禁是+有效接待;
- * */
+ * */
nowSelectTime(type) {
- let str = ''
- switch(type) {
+ let str = "";
+ switch (type) {
case 1:
if (this.TimetoAhoose == 0) {
- str = `dateType,${this.TimetoAhoose}`
- } else if(this.TimetoAhoose == 1) {
- str = `dateType,${2}`
+ str = `dateType,${this.TimetoAhoose}`;
+ } else if (this.TimetoAhoose == 1) {
+ str = `dateType,${2}`;
} else {
- str = ''
+ str = "";
}
break;
case 2:
if (this.TimetoAhoose == 0) {
- str = `dateType,${this.TimetoAhoose}&validInvalid,0`
- } else if(this.TimetoAhoose == 1) {
- str = `dateType,${2}&validInvalid,0`
+ str = `dateType,${this.TimetoAhoose}&validInvalid,0`;
+ } else if (this.TimetoAhoose == 1) {
+ str = `dateType,${2}&validInvalid,0`;
} else {
- str = 'validInvalid,0'
+ str = "validInvalid,0";
}
break;
case 3:
if (this.TimetoAhoose == 0) {
- str = `dateType,0`
+ str = `dateType,0`;
} else if (this.TimetoAhoose == 1) {
- str = `dateType,4`
+ str = `dateType,4`;
} else {
- str = 'dateType,6'
+ str = "dateType,6";
}
break;
case 4:
if (this.TimetoAhoose == 0) {
- str = `dateType,${this.TimetoAhoose}&taboo,1&validInvalid,0`
- } else if(this.TimetoAhoose == 1) {
- str = `dateType,${2}&taboo,1&validInvalid,0`
+ str = `dateType,${this.TimetoAhoose}&taboo,1&validInvalid,0`;
+ } else if (this.TimetoAhoose == 1) {
+ str = `dateType,${2}&taboo,1&validInvalid,0`;
} else {
- str = 'taboo,1&validInvalid,0'
+ str = "taboo,1&validInvalid,0";
}
break;
}
- return str
+ return str;
},
// 跳转详情
@@ -1633,10 +2312,12 @@ export default {
},
// 获取时间段
getTimes() {
- let str = ''
- let time = new Date().getTime()
+ let str = "";
+ let time = new Date().getTime();
if (this.TimetoAhoose == 0) {
- str = `${new Date(time).getFullYear()}-${new Date(time).getMonth()+1}-${new Date(time).getDate()}`
+ str = `${new Date(time).getFullYear()}-${
+ new Date(time).getMonth() + 1
+ }-${new Date(time).getDate()}`;
}
if (this.TimetoAhoose == 1) {
let starTime = new Date().getTime() - 24 * 60 * 60 * 1000 * 7;
@@ -1647,9 +2328,9 @@ export default {
let endDate = `${new Date(endTime).getFullYear()}-${
new Date(endTime).getMonth() + 1
}-${new Date(endTime).getDate()}`;
- str = `${startDate},${endDate}`
+ str = `${startDate},${endDate}`;
}
- if(this.TimetoAhoose == 2) {
+ if (this.TimetoAhoose == 2) {
let starTime = new Date().getTime() - 24 * 60 * 60 * 1000 * 30;
let startDate = `${new Date(starTime).getFullYear()}-${
new Date(starTime).getMonth() + 1
@@ -1658,9 +2339,9 @@ export default {
let endDate = `${new Date(endTime).getFullYear()}-${
new Date(endTime).getMonth() + 1
}-${new Date(endTime).getDate()}`;
- str = `${startDate},${endDate}`
+ str = `${startDate},${endDate}`;
}
- return str
+ return str;
},
jumpto(ind) {
@@ -1958,7 +2639,7 @@ export default {
\ No newline at end of file
diff --git a/src/router/router.js b/src/router/router.js
index a2bb161..68f475d 100644
--- a/src/router/router.js
+++ b/src/router/router.js
@@ -17,7 +17,6 @@ export const createRouter = () => new VueRouter({
})
const Router = createRouter()
-console.log(Router,'路由');
AvueRouter.install(Router, Store)
Router.$avueRouter.formatRoutes(Store.state.user.menu, true)
// 重置路由
diff --git a/src/util/indexedDb.js b/src/util/indexedDb.js
index 94f1e92..02088a2 100644
--- a/src/util/indexedDb.js
+++ b/src/util/indexedDb.js
@@ -1,10 +1,10 @@
export default {
// indexedDB 兼容
indexedDB: window.indexedDB || window.webkitindexedDB || window.msIndexedDB || window.mozIndexedDB,
-
+
/**
* 打开数据库
- * 新对象存储空间newStore参数:newStore.name、newStore.key
+ * 新对象存储空间newStore参数:name、key
* 新增对象存储空间要更改数据库版本
* @param {数据库名称} dbname
* @param {版本} version
@@ -16,14 +16,14 @@ export default {
let db
version = version || 1;
const request = this.indexedDB.open(dbname, version);
-
+
// 打开失败回调
request.onerror = function () {
throw "IndexedDb数据库打开错误"
}
// 打开成功回调
- request.onsuccess = function(event) {
+ request.onsuccess = function (event) {
db = event.target.result;
if (callback && (typeof callback === 'function')) {
callback(db);
@@ -31,19 +31,22 @@ export default {
}
// 调用创建新的存储空间
- request.onupgradeneeded = function(event) {
+ request.onupgradeneeded = function (event) {
db = event.target.result;
if (newStore) {
if (!db.objectStoreNames.contains(newStore.name)) {
const objectStore = db.createObjectStore(newStore.name, {
keyPath: newStore.key
+ }, {
+ unique: false,
+ autoIncrement: true
})
-
- newStore.index.forEach(item => {
- objectStore.createIndex(`${item}_index`, item, {
- unique: false
- })
- })
+ // newStore.index.forEach(item => {
+ // objectStore.createIndex(`${item}`, item, {
+ // unique: false,
+ // autoIncrement: true
+ // })
+ // })
}
}
}
@@ -53,14 +56,14 @@ export default {
* 删除数据库
* @params {*} dbname
* @params {*} callback
- * */
+ * */
deleteDb(dbname, callback) {
const deleteQuest = this.indexedDB.deleteDatabase(dbname);
- deleteQuest.onerror = function() {
+ deleteQuest.onerror = function () {
throw "删除数据库出错";
}
- deleteQuest.onsuccess = function() {
+ deleteQuest.onsuccess = function () {
if (callback && (typeof callback === 'function')) {
callback();
}
@@ -85,41 +88,41 @@ export default {
deleteData(db, storename, key, callback) {
const store = db.transaction(storename, 'readwrite').objectStore(storename)
const request = store.delete(key);
- request.onsuccess = function() {
+ request.onsuccess = function () {
if (callback && (typeof callback === 'function')) {
callback(`删除${storename}成功`)
}
}
- request.onerror = function() {
+ request.onerror = function () {
if (callback && (typeof callback === 'function')) {
callback(`删除${storename}失败`)
}
}
},
-
+
/**
* 清空数据
* @params {*} db
* @params {*} storename
* @params {*} callback
* */
- clearData(db, storename, callback) {
+ clearData(db, storename, callback) {
const store = db.transaction(storename, 'readwrite').objectStore(storename);
const request = store.clear();
- request.onsuccess = function() {
+ request.onsuccess = function () {
if (callback && (typeof callback === 'function')) {
callback(`清空${storename}成功`)
}
- }
- request.onerror = function() {
+ }
+ request.onerror = function () {
if (callback && (typeof callback === 'function')) {
callback(`清空${storename}失败`)
}
}
},
-
+
/**
* 添加数据
@@ -127,17 +130,16 @@ export default {
* @params {*} storename
* @params {*} obj
* */
- addData(db, storename, list) {
+ addData(db, storename, obj) {
const store = db.transaction(storename, 'readwrite').objectStore(storename);
- list.forEach(ls => {
- const request = store.add(ls);
- request.onsuccess = function() {
- console.log(`写入${storename}数据成功`)
- }
- request.onsuccess = function() {
- console.log(`写入${storename}数据失败`)
- }
- })
+ const request = store.add(obj);
+ request.onsuccess = function () {
+ console.log(`写入${storename}数据成功`)
+ }
+ request.onerror = function (e) {
+ console.log(`写入${storename}数据失败`)
+ console.log(e)
+ }
},
/**
@@ -146,17 +148,15 @@ export default {
* @params {*} storename
* @params {*} obj
* */
- updateData(db, storename, list) {
+ updateData(db, storename, obj) {
const store = db.transaction(storename, 'readwrite').objectStore(storename);
- list.forEach(ls => {
- const request = store.put(ls);
- request.onsuccess = function() {
- console.log(`更新${storename}数据成功`)
- }
- request.onsuccess = function() {
- console.log(`更新${storename}数据失败`)
- }
- })
+ const request = store.put(obj);
+ request.onsuccess = function () {
+ console.log(`更新${storename}数据成功`)
+ }
+ request.onerror = function () {
+ console.log(`更新${storename}数据失败`)
+ }
},
/**
@@ -168,32 +168,12 @@ export default {
* */
getData(db, storename, key) {
const store = db.transaction(storename, 'readwrite').objectStore(storename);
- const request = objectStore.get(key);
- request.onerror = function() {
+ const request = store.get(key);
+ request.onerror = function () {
console.log(`获取${storename} 里主键 ${key} 的数据失败`)
}
return new Promise(resolve => {
- request.onsuccess = function(e) {
- resolve(e.target.result)
- }
- })
- },
-
-
- /**
- * 根据索引获取数据
- * @params {*} db
- * @params {*} storename
- * @params {*} field
- * @params {*} val
- * @return
- * */
- getDataByIndex(db, storename, field, val) {
- const store = db.transaction(storename, 'readwrite').objectStore(storename);
- const index = store.index(`${field}_index`);
- const request = index.get(val)
- return new Promise(resolve => {
- request.onsuccess = function(e) {
+ request.onsuccess = function (e) {
resolve(e.target.result)
}
})
@@ -205,13 +185,13 @@ export default {
* @params {*} storename
* @return
* */
- getAllData(db, storename) {
+ getAllData(db, storename) {
const store = db.transaction(storename, 'readwrite').objectStore(storename);
const request = store.openCursor();
let data = [];
return new Promise(resolve => {
- request.onsuccess = function(e) {
+ request.onsuccess = function (e) {
let cursor = e.target.result;
if (cursor) {
data.push(cursor.value);
@@ -223,21 +203,4 @@ export default {
})
},
- /**
- * 遍历全部数据,判断是否已存在数据库
- * @params {*} allDbData
- * @params {*} key
- * @return
- * */
- readAllData(allDbData, key) {
- let flagIndex
- allDbData.then((result) => {
- flagIndex = result.findIndex(val => {
- return (val.name == key)
- })
- })
- return flagIndex;
- }
-
-
}
\ No newline at end of file
diff --git a/src/util/table.js b/src/util/table.js
new file mode 100644
index 0000000..dada9e7
--- /dev/null
+++ b/src/util/table.js
@@ -0,0 +1,87 @@
+// 公共配置项,示例
+const publicOption = {
+ CustomerAgentManagement: {
+ tableIdName: 'CustomerAgentManagement',
+ border: true,
+ index: true,
+ height: 527,
+ indexLabel: "序号",
+ stripe: true,
+ menuAlign: "center",
+ menuWidth: 250,
+ menu: false,
+ align: "center",
+ refreshBtn: false,
+ showColumnBtn: false,
+ searchSize: "mini",
+ searchMenuSpan: 9,
+ delBtn: false,
+ addBtn: false,
+ editBtn: false,
+ viewBtn: true,
+ size: "small",
+ column: [
+ {
+ label: "操作人",
+ prop: "name",
+ search: true
+ },
+ {
+ label: "操作手机",
+ prop: "createBy",
+ search: true
+ },
+ {
+ label: "登录IP",
+ prop: "remoteAddr"
+ },
+ {
+ label: "操作时间",
+ prop: "createTime",
+ },
+ {
+ label: "操作类型",
+ prop: "type",
+ dicData: [{
+ label: '新增管理',
+ value: "0"
+ }, {
+ label: '编辑项目',
+ value: "1"
+ }, {
+ label: '删除项目',
+ value: "2"
+ }, {
+ label: '新增公司',
+ value: "3"
+ }, {
+ label: '编辑公司',
+ value: "4"
+ }, {
+ label: '删除公司',
+ value: "5"
+ }, {
+ label: '新增代理商',
+ value: "6"
+ }, {
+ label: '系统运营',
+ value: '7'
+ }]
+ },
+ {
+ label: '操作内容',
+ prop: 'title',
+ search: true
+ }
+ ]
+ }
+}
+
+const modulesFiles = require.context('@/views',true,/\.js$/);
+const modules = modulesFiles.keys().reduce((modules, modulePath) => {
+ const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1');
+ const value = modulesFiles(modulePath);
+ Object.assign(modules, value.default);
+ return modules;
+}, publicOption);
+export default modules;
\ No newline at end of file
diff --git a/src/views/building/index.vue b/src/views/building/index.vue
index 225aacd..1e69b30 100644
--- a/src/views/building/index.vue
+++ b/src/views/building/index.vue
@@ -246,243 +246,91 @@
-
-
-
-
-
-
- {{ row.agentName || "-" }}
-
-
-
-
-
-
-
-
- {{ scope.row.provinceName }}{{ scope.row.cityName }}
-
-
-
-
-
- {{ row.linkman + "-" + row.linkmanPhone || "-" }}
-
-
-
-
-
- {{ row.managerPhone || "-" }}
-
-
-
-
-
-
-
-
- {{
- row.houseType == 0
- ? "正式"
- : row.houseType == 1
- ? "试用"
- : row.houseType == 2
- ? "演示"
- : "测试"
- }}
-
-
-
-
-
-
-
-
-
-
-
- {{ row.createTime.substring(0, 10) }}
-
-
-
-
-
-
- 服务中({{
- scope.row.residueTime * 1 >= 0
- ? scope.row.residueTime
- : scope.row.residueTime * -1
- }})
-
-
- 过期({{
- scope.row.residueTime * 1 >= 0
- ? scope.row.residueTime
- : scope.row.residueTime * -1
- }})
-
-
-
-
-
-
- {{ row.lockFlag == 1 ? "禁用" : "启用" }}
-
-
+
+
+
+ 编辑
+ 更换账号
+
-
-
- 编辑
+ 更多
- 更换账号
-
-
-
- 更多
-
-
- 系统运营
-
-
- 售后运营
-
-
- 绑定代理商
-
-
- 删除
-
-
- {{ row.lockFlag == 0 ? "禁用" : "启用" }}
-
-
- 使用建议
-
-
-
-
-
-
-
-
-
-
+
+
+ 系统运营
+
+
+ 售后运营
+
+
+ 绑定代理商
+
+
+ 删除
+
+
+ {{ row.lockFlag == 0 ? "禁用" : "启用" }}
+
+
+ 使用建议
+
+
+
+
+
-
+
{
+ let index = this.$tableOption.buildingIndex.column.findIndex(
+ (findObj) => item == findObj.label
+ );
+ let obj = this.$tableOption.buildingIndex.column[index];
+ if (obj.label == "代理商" && this.orgType == 0) {
+ obj.hide = false;
+ obj.showColumn = true;
+ }
+ if ((obj.label == "公司" || obj.label == "项目类型") && this.orgType != 2) {
+ obj.hide = false;
+ obj.showColumn = true;
+ }
+
+ if (obj.label == "运营人员" && (this.orgType == 0 || this.orgType == 1)) {
+ obj.hide = false;
+ obj.showColumn = true;
+ }
+ });
+
+ console.log(this.$tableOption.buildingIndex);
+
+ // return this.$tableOption.buildingIndex
+ },
+
isSystoleForm() {
this.isOpen = !this.isOpen;
},
//切换项目
houseChange() {
- this.currentPage = 1;
+ this.page.currentPage = 1;
this.zkhousePage();
},
//获取项目
@@ -1318,7 +1206,7 @@ export default {
// });
},
screen() {
- this.currentPage = 1;
+ this.page.currentPage = 1;
this.zkhousePage();
},
addSurequxiao() {
@@ -1333,14 +1221,14 @@ export default {
}
this.loadingFlag = true;
if (this.ruleForm.closeTime && this.ruleForm.closeTime < 30) {
- this.$message.error('自动结束接待时长限制最小为30分钟')
+ this.$message.error("自动结束接待时长限制最小为30分钟");
this.loadingFlag = false;
- return
+ return;
}
if (this.ruleForm.closeTime && this.ruleForm.closeTime > 720) {
- this.$message.error('自动结束接待时长限制最大为720分钟')
+ this.$message.error("自动结束接待时长限制最大为720分钟");
this.loadingFlag = false;
- return
+ return;
}
// 编辑
if (this.editFlag) {
@@ -1471,7 +1359,7 @@ export default {
// console.log(this.time)
this.ruleForm = Object.assign({}, row);
this.ruleForm.area = [this.ruleForm.provinceId, this.ruleForm.cityId];
- this.ruleForm.time = row.time || '22:00'
+ this.ruleForm.time = row.time || "22:00";
this.dialogVisible = true;
// 获取地区选择数据,在这里对回显的时候进行操作,首先先获取一级省的数据
// this.getProvinceList();
@@ -1565,8 +1453,8 @@ export default {
// 获取项目列表
zkhousePage() {
let obj = {
- current: this.currentPage,
- size: this.size,
+ current: this.page.currentPage,
+ size: this.page.pageSize,
orgType: localStorage.getItem("orgType"),
agentId: localStorage.getItem("agentId"),
orgCode: localStorage.getItem("orgCode"),
@@ -1584,12 +1472,7 @@ export default {
this.$api.api.zkhousePage(obj).then((res) => {
// console.log(res)
this.tableData = res.data.records;
-
- // 表格中设置ref属性,在数据渲染之后或者updated()之后
- this.$nextTick(() => {
- this.$refs.table.doLayout();
- });
- this.total = res.data.total;
+ this.page.total = res.data.total;
});
},
async getProvinceList(parentId = 0) {
@@ -1665,7 +1548,7 @@ export default {
operationStaffId: "",
};
this.area = [];
- this.currentPage = 1;
+ this.page.currentPage = 1;
this.zkhousePage();
},
timeChange1(e) {
@@ -1682,12 +1565,12 @@ export default {
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
- this.size = val;
+ this.page.pageSize = val;
this.zkhousePage();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
- this.currentPage = val;
+ this.page.currentPage = val;
this.zkhousePage();
},
locationsChange(e) {
diff --git a/src/views/building/table.js b/src/views/building/table.js
new file mode 100644
index 0000000..5a14246
--- /dev/null
+++ b/src/views/building/table.js
@@ -0,0 +1,123 @@
+export default {
+ buildingIndex: {
+ tableIdName: "buildingIndex",
+ border: true,
+ index: false,
+ height: 500,
+ indexLabel: "序号",
+ stripe: true,
+ menuAlign: "center",
+ menuWidth: 146,
+ menu: true,
+ align: "center",
+ refreshBtn: false,
+ showColumnBtn: false,
+ searchSize: "mini",
+ searchMenuSpan: 9,
+ delBtn: false,
+ addBtn: false,
+ editBtn: false,
+ viewBtn: true,
+ size: "small",
+ column: [
+ {
+ label: "项目名称",
+ prop: "propertyName",
+ },
+ {
+ label: "代理商",
+ prop: "agentName",
+ width: "120px",
+ },
+ {
+ label: "公司",
+ prop: "corporateName",
+ width: "120px",
+ },
+ {
+ label: "项目地区",
+ prop: "provinceName",
+ width: "120px",
+ formatter: (data) => {
+ return `${data.provinceName || '-'}${data.cityName || ''}`
+ }
+ },
+ {
+ label: "联系人信息",
+ prop: "linkman",
+ width: "110px",
+ formatter: (data) => {
+ return `${data.linkman}-${data.linkmanPhone}`
+ }
+ },
+ {
+ label: "管理员账号",
+ prop: "managerPhone",
+ width: "110px",
+ },
+ {
+ label: "运营人员",
+ prop: "operationStaffName",
+ },
+ {
+ label: "项目类型",
+ prop: "houseType",
+ width: "110px",
+ dicData: [{
+ label: '正式',
+ value: 0
+ },{
+ label: '试用',
+ value: 1
+ },{
+ label: '演示',
+ value: 2
+ },{
+ label: '测试',
+ value: 3
+ }]
+ },
+ {
+ label: "合同开始日期",
+ prop: "startWorking",
+ width: "100px",
+ },
+ {
+ label: "合同结束日期",
+ prop: "endWorking",
+ width: "100px",
+ },
+ {
+ label: "添加日期",
+ prop: "createTime",
+ width: "100px",
+ formatter: (data) => {
+ return data.createTime.substring(0, 10)
+ }
+ },
+ {
+ label: "服务状态",
+ prop: "residueTime",
+ width: "100px",
+ formatter: data => {
+ let str = ''
+ if (Number(data.residueTime) >= 0) {
+ str = `服务中(${data.residueTime})`
+ } else {
+ str = `过期(${Math.abs(data.residueTime)})`
+ }
+ return str
+ }
+ },
+ {
+ label: "状态",
+ prop: "lockFlag",
+ width: "100px",
+ formatter: data => {
+ return data.lockFlag == 1 ? "禁用" : "启用"
+ }
+ },
+
+ ]
+ }
+}
\ No newline at end of file