@@ -20,6 +20,13 @@ import AvueFormDesign from '@sscfaith/avue-form-design' | |||
import basicContainer from './components/basic-container/main' | |||
import api from './api' | |||
import AvueUeditor from 'avue-plugin-ueditor' | |||
import indexDb from './util/indexedDb' | |||
let storeName = { name: 'tableOption', key: 'tableIdName' } // name 表名 key 主键 | |||
indexDb.openDB('hxz', 1, storeName, function(db) { | |||
Vue.prototype.$tableDb = db | |||
Vue.prototype.$indexDb = indexDb | |||
}) | |||
Vue.use(AvueUeditor); | |||
import VueQuillEditor from 'vue-quill-editor' //vue-quill-editor其它文件可在应用页面直接引入 | |||
@@ -74,6 +81,9 @@ iconfontVersion.forEach(ele => { | |||
Vue.config.productionTip = false | |||
import APlayer from '@moefe/vue-aplayer'; | |||
import tableOption from './util/table' | |||
Vue.prototype.$tableOption = tableOption | |||
Vue.use(APlayer, { | |||
productionTip: true, | |||
}); | |||
@@ -75,7 +75,6 @@ | |||
}, | |||
mounted() { | |||
this.setActive() | |||
console.log(localStorage.getItem('allClose')); | |||
if(localStorage.getItem('allClose')=='true'){ | |||
this.closeAllTags() | |||
} | |||
@@ -35,7 +35,6 @@ export default { | |||
this.getTopMenu() | |||
// 用户权限加载 | |||
this.getUserInfo() | |||
console.log('this.getUserInfo()') | |||
}, | |||
computed: { | |||
...mapGetters(['menu']) | |||
@@ -161,7 +161,7 @@ export default { | |||
} else if (res.data.length == 1) { | |||
let idx = res.data[0].orgType; | |||
localStorage.setItem("orgType", idx); | |||
console.log("登陆成功啦!!!") | |||
if (this.rememberPwd) { | |||
this.setCookie(this.loginForm.username, this.loginForm.password, 7); | |||
} else { | |||
@@ -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) | |||
// 重置路由 | |||
@@ -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; | |||
} | |||
} |
@@ -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; |
@@ -246,243 +246,91 @@ | |||
<!-- 表格 --> | |||
<div class="cen-tab"> | |||
<el-table :header-cell-style="{background:'#F5F7FA',color:'#333333'}" :data="tableData" ref="table" height="572px" stripe style="width: 100%"> | |||
<el-table-column prop="propertyName" :show-overflow-tooltip="true" width="120px" label="项目名称" align="center"> | |||
</el-table-column> | |||
<el-table-column | |||
:show-overflow-tooltip="true" | |||
width="120px" | |||
prop="agentName" | |||
label="代理商" | |||
align="center" | |||
v-if="orgType == 0" | |||
> | |||
<template slot-scope="{ row }"> | |||
{{ row.agentName || "-" }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
:show-overflow-tooltip="true" | |||
width="120px" | |||
prop="corporateName" | |||
label="公司" | |||
align="center" | |||
v-if="orgType != 2" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
:show-overflow-tooltip="true" | |||
width="120px" | |||
prop="provinceName,cityName" | |||
label="项目地区" | |||
align="center" | |||
:key="Math.random()" | |||
> | |||
<template slot-scope="scope"> | |||
{{ scope.row.provinceName }}{{ scope.row.cityName }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
width="110px" | |||
prop="linkman" | |||
label="联系人信息" | |||
align="center" | |||
:key="Math.random()" | |||
> | |||
<template slot-scope="{ row }"> | |||
{{ row.linkman + "-" + row.linkmanPhone || "-" }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
:key="Math.random()" | |||
width="110" | |||
prop="managerPhone" | |||
label="管理员账号" | |||
align="center" | |||
> | |||
<template slot-scope="{ row }"> | |||
{{ row.managerPhone || "-" }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
:show-overflow-tooltip="true" | |||
:key="Math.random()" | |||
prop="operationStaffName" | |||
width="120" | |||
v-if="orgType == 0 || orgType == 1" | |||
label="运营人员" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
:key="Math.random()" | |||
prop="houseType" | |||
label="项目类型" | |||
align="center" | |||
v-if="orgType != 2" | |||
> | |||
<template slot-scope="{ row }"> | |||
{{ | |||
row.houseType == 0 | |||
? "正式" | |||
: row.houseType == 1 | |||
? "试用" | |||
: row.houseType == 2 | |||
? "演示" | |||
: "测试" | |||
}} | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
prop="startWorking" | |||
label="合同开始日期" | |||
width="100" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="endWorking" | |||
width="100" | |||
label="合同结束日期" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column label="添加日期" width="100" align="center"> | |||
<template slot-scope="{ row }"> | |||
{{ row.createTime.substring(0, 10) }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
prop="residueTime" | |||
width="100" | |||
label="服务状态" | |||
align="center" | |||
> | |||
<template slot-scope="scope"> | |||
<div v-if="scope.row.residueTime > 0"> | |||
服务中({{ | |||
scope.row.residueTime * 1 >= 0 | |||
? scope.row.residueTime | |||
: scope.row.residueTime * -1 | |||
}}) | |||
</div> | |||
<div v-if="scope.row.residueTime <= 0"> | |||
过期({{ | |||
scope.row.residueTime * 1 >= 0 | |||
? scope.row.residueTime | |||
: scope.row.residueTime * -1 | |||
}}) | |||
</div> | |||
</template> | |||
</el-table-column> | |||
<el-table-column prop="lockFlag" label="状态" align="center"> | |||
<template slot-scope="{ row }"> | |||
{{ row.lockFlag == 1 ? "禁用" : "启用" }} | |||
</template> | |||
</el-table-column> | |||
<!-- currentPage: 1, | |||
size: 10, | |||
total: 10, --> | |||
<avue-crud | |||
ref="crud" | |||
:page.sync="page" | |||
:data="tableData" | |||
:table-loading="tableLoading" | |||
:option="$tableOption.buildingIndex" | |||
@size-change="handleSizeChange" | |||
@current-change="handleCurrentChange" | |||
> | |||
<template slot-scope="{ row }" slot="menu"> | |||
<el-button type="text" v-if="cus_build_index_edit" @click="edit(row)" | |||
>编辑</el-button | |||
> | |||
<el-button | |||
type="text" | |||
v-if="orgType != 2 && cus_build_index_change" | |||
@click="changeAccount(row)" | |||
>更换账号 | |||
</el-button> | |||
<el-table-column label="操作" align="center" fixed="right" width="146"> | |||
<template slot-scope="{ row }"> | |||
<el-button | |||
type="text" | |||
v-if="cus_build_index_edit" | |||
@click="edit(row)" | |||
>编辑</el-button | |||
<el-dropdown> | |||
<el-button type="text" size="small" style="margin-left: 10px" | |||
>更多</el-button | |||
> | |||
<el-button | |||
type="text" | |||
v-if="orgType != 2 && cus_build_index_change" | |||
@click="changeAccount(row)" | |||
>更换账号 | |||
</el-button> | |||
<el-dropdown> | |||
<el-button type="text" size="small" style="margin-left: 10px" | |||
>更多</el-button | |||
> | |||
<el-dropdown-menu slot="dropdown"> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
size="small" | |||
v-if="cus_build_index_sys" | |||
@click="editOpera(row, 0)" | |||
>系统运营</el-button | |||
> | |||
</el-dropdown-item> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
size="small" | |||
v-if="cus_build_index_agent" | |||
@click="editOpera(row, 1)" | |||
>售后运营</el-button | |||
> | |||
</el-dropdown-item> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
size="small" | |||
v-if="cus_build_index_bindAgent" | |||
@click="bindAgent(row)" | |||
>绑定代理商</el-button | |||
> | |||
</el-dropdown-item> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
v-if="cus_build_index_del" | |||
@click="del(row)" | |||
>删除</el-button | |||
> | |||
</el-dropdown-item> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
v-if="cus_build_index_open" | |||
size="small" | |||
@click="toDisable(row)" | |||
>{{ row.lockFlag == 0 ? "禁用" : "启用" }}</el-button | |||
> | |||
</el-dropdown-item> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
v-if="permissions['cus_build_index_sug']" | |||
size="small" | |||
@click="toOtherPage(row)" | |||
>使用建议</el-button | |||
> | |||
</el-dropdown-item> | |||
</el-dropdown-menu> | |||
</el-dropdown> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
<div style="display: flex; justify-content: flex-end; margin-top: 10px"> | |||
<el-pagination | |||
@size-change="handleSizeChange" | |||
@current-change="handleCurrentChange" | |||
:current-page="currentPage" | |||
:page-sizes="[10, 20, 30, 40, 50, 100]" | |||
:page-size="size" | |||
layout="total, sizes, prev, pager, next, jumper" | |||
:total="total" | |||
> | |||
</el-pagination> | |||
</div> | |||
<el-dropdown-menu slot="dropdown"> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
size="small" | |||
v-if="cus_build_index_sys" | |||
@click="editOpera(row, 0)" | |||
>系统运营</el-button | |||
> | |||
</el-dropdown-item> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
size="small" | |||
v-if="cus_build_index_agent" | |||
@click="editOpera(row, 1)" | |||
>售后运营</el-button | |||
> | |||
</el-dropdown-item> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
size="small" | |||
v-if="cus_build_index_bindAgent" | |||
@click="bindAgent(row)" | |||
>绑定代理商</el-button | |||
> | |||
</el-dropdown-item> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
v-if="cus_build_index_del" | |||
@click="del(row)" | |||
>删除</el-button | |||
> | |||
</el-dropdown-item> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
v-if="cus_build_index_open" | |||
size="small" | |||
@click="toDisable(row)" | |||
>{{ row.lockFlag == 0 ? "禁用" : "启用" }}</el-button | |||
> | |||
</el-dropdown-item> | |||
<el-dropdown-item> | |||
<el-button | |||
type="text" | |||
v-if="permissions['cus_build_index_sug']" | |||
size="small" | |||
@click="toOtherPage(row)" | |||
>使用建议</el-button | |||
> | |||
</el-dropdown-item> | |||
</el-dropdown-menu> | |||
</el-dropdown> | |||
</template> | |||
</avue-crud> | |||
</div> | |||
<el-dialog | |||
@@ -569,7 +417,12 @@ | |||
></el-input> | |||
</el-form-item> | |||
<el-form-item label="接待时长" prop="linkman"> | |||
<el-input v-model="ruleForm.closeTime" maxlength="10" placeholder="接待时长(分钟)" clearable></el-input> | |||
<el-input | |||
v-model="ruleForm.closeTime" | |||
maxlength="10" | |||
placeholder="接待时长(分钟)" | |||
clearable | |||
></el-input> | |||
</el-form-item> | |||
<el-form-item label="联系手机" prop="linkmanPhone"> | |||
<el-input | |||
@@ -956,6 +809,7 @@ export default { | |||
operationalPeople: "", | |||
operationStaffId: "", | |||
}, | |||
tableLoading: false, | |||
areaList: [], | |||
operaList: [], | |||
options1: [ | |||
@@ -996,9 +850,13 @@ export default { | |||
label: "合同结束日期", | |||
}, | |||
], | |||
currentPage: 1, | |||
size: 10, | |||
total: 10, | |||
page: { | |||
total: this.total, // 总页数 | |||
currentPage: 1, // 当前页数 | |||
pageSize: this.size, // 每页显示多少条 | |||
}, | |||
value: "", | |||
input: "", | |||
sysFlag: "0", | |||
@@ -1051,7 +909,7 @@ export default { | |||
cityId: "", //市id | |||
agentId: localStorage.getItem("agentId"), | |||
time: "22:00", // 日报推送时间 | |||
closeTime: '120', // 接待时长(自动结束) | |||
closeTime: "120", // 接待时长(自动结束) | |||
}, | |||
ruleForm1: {}, | |||
optionsagentId: [], | |||
@@ -1136,6 +994,8 @@ export default { | |||
this.searchForm.endWorking = this.starTime[1]; | |||
} | |||
this.orgType = localStorage.getItem("orgType"); | |||
// 检测某些字段是否可以展示 | |||
this.checkOption(); | |||
// 获取公司列表数据 | |||
this.getOrgList(); | |||
// 获取运营人员 | |||
@@ -1149,12 +1009,40 @@ export default { | |||
this.zkhousePages(); | |||
}, | |||
methods: { | |||
// 检测是否可以展示某些字段 | |||
checkOption() { | |||
let checkArr = ["代理商", "公司", "运营人员", "项目类型"]; | |||
checkArr.forEach((item) => { | |||
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) { | |||
@@ -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 ? "禁用" : "启用" | |||
} | |||
}, | |||
] | |||
} | |||
} |