格式处理

This commit is contained in:
wanyongkang
2020-11-12 16:49:54 +08:00
parent 6037e4c457
commit 2fb518d641
2 changed files with 241 additions and 217 deletions

View File

@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
<template>
<div>
<div class="heior_box">
@@ -14,7 +15,6 @@
</div>
</div>
<el-table :data="manegeList" size="medium" :height="$getHeight(100)" row-key="Id" border>
<el-table-column prop="LoginCode" label="账号"></el-table-column>
<el-table-column prop="RealName" label="姓名"></el-table-column>
@@ -95,7 +95,7 @@ export default {
PageIndex: 1,
PageSize: 50,
TenantId: 0,
KeyWord: "",
KeyWord: '',
RoleId: 0,
CurrentRoleId: 0,
IsRoot: 0
@@ -104,17 +104,17 @@ export default {
checkEstate: false, // 当前是否查看项目
delroleData: {
// 删除角色
ID: "",
ID: '',
OwnerID: 1001,
OperaterID: 1,
ProjectCode: ""
ProjectCode: ''
},
delmanagerData: {
// 删除管理员
ID: "",
ID: '',
OwnerID: 1001,
OperaterID: 1,
ProjectCode: ""
ProjectCode: ''
},
stateData: {
// 更新关联项目
@@ -128,7 +128,7 @@ export default {
},
searchUserModel: {
PageIndex: 1,
keyWord: "",
keyWord: '',
PageSize: 500,
all: 0
},
@@ -137,36 +137,36 @@ export default {
Data: []
},
currentManager: null,
multipleSelection:null,
};
multipleSelection: null
}
},
watch: {
bindwx: function () {
if (!this.bindwx) {
clearInterval(this.timer);
clearInterval(this.timer)
}
}
},
created () {
this.$store.commit("setCurrentNav","会员管理>>管理员")
this.$store.commit('setCurrentNav', '会员管理>>管理员')
this.userdata = JSON.parse(
window.localStorage.getItem("etorcurrentuser")
).Manager;
this.getmanagerlist();
this.getUser();
window.localStorage.getItem('etorcurrentuser')
).Manager
this.getmanagerlist()
this.getUser()
},
methods: {
handleSelectionChange (val) {
this.multipleSelection = val;
this.multipleSelection = val
console.log(val)
},
setUser (manage) {
this.showUserDialog=true;
this.currentManager=manage;
this.showUserDialog = true
this.currentManager = manage
},
getUser () {
this.$api.get("baseinfo/v1/user/Search",this.searchUserModel).then(res => {
this.userRet=res;
this.$api.get('baseinfo/v1/user/Search', this.searchUserModel).then(res => {
this.userRet = res
})
},
doSetUser () {
@@ -174,182 +174,192 @@ export default {
ManagerId: this.currentManager.Id,
ManagerName: this.currentManager.RealName,
UserIds: this.multipleSelection.map(m => m.Id)
};
this.$api.post("baseinfo/v1/user/SetManager",data).then(res => {
this.getUser();
this.showUserDialog=false;
}
this.$api.post('baseinfo/v1/user/SetManager', data).then(res => {
this.getUser()
this.showUserDialog = false
})
},
geturl (data) {
var that = this;
var id = data.Id;
var uuid = that.getguid();
var that = this
var id = data.Id
var uuid = that.getguid()
var url =
this.$api.baseURL +
"Manager/ManageBindWx?data.Id=" +
'Manager/ManageBindWx?data.Id=' +
id +
"&data.uuid=" +
uuid;
this.bindwx = true;
this.makeqrcode(url);
'&data.uuid=' +
uuid
this.bindwx = true
this.makeqrcode(url)
that.timer = setInterval(function () {
that.time(uuid, that.timer);
}, 1000);
that.time(uuid, that.timer)
}, 1000)
},
// 获取uuid
getguid () {
return "xxxx-xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g, function(c) {
return 'xxxx-xxxx-4xxx-yxxx-xxxx'.replace(/[xy]/g, function (c) {
// eslint-disable-next-line one-var
var r = (Math.random() * 16) | 0,
v = c == "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
// eslint-disable-next-line eqeqeq
v = c == 'x' ? r : (r & 0x3) | 0x8
return v.toString(16)
})
},
time (data, time) {
this.$api
.getscanbindwxstate(data)
.then(res => {
console.log(res);
console.log(res)
// eslint-disable-next-line eqeqeq
if (res.Data.State == 0) {
clearInterval(time);
this.getmanagerlist(this.manageData.PageIndex);
this.bindwx = false;
clearInterval(time)
this.getmanagerlist(this.manageData.PageIndex)
this.bindwx = false
}
})
.catch(res => {
clearInterval(time);
});
clearInterval(time)
})
},
makeqrcode (url) {
document.getElementById("qrcode").innerHTML = "";
new QRCode(document.getElementById("qrcode"), {
document.getElementById('qrcode').innerHTML = ''
// eslint-disable-next-line no-new
new QRCode(document.getElementById('qrcode'), {
text: url,
width: 127,
height: 127,
colorDark: "#000000",
colorLight: "#ffffff",
colorDark: '#000000',
colorLight: '#ffffff',
// eslint-disable-next-line no-undef
correctLevel: QRCode.CorrectLevel.H
});
})
},
getmanagerlist (val) {
// 获取管理员列表
var that = this;
this.loading = true;
typeof val === "number" && (this.manageData.PageIndex = val);
var roleid = this.userdata.Roleid;
this.manageData.CurrentRoleId = roleid;
this.manageData.IsRoot = 1;
// eslint-disable-next-line no-unused-vars
var that = this
this.loading = true
typeof val === 'number' && (this.manageData.PageIndex = val)
var roleid = this.userdata.Roleid
this.manageData.CurrentRoleId = roleid
this.manageData.IsRoot = 1
this.$api
.get("manage/v1/Manager/Get", this.manageData)
.get('manage/v1/Manager/Get', this.manageData)
.then(res => {
// eslint-disable-next-line eqeqeq
if (res.Code == 10000) {
this.manegeTotal = res.TotalCount;
this.manegeList = res.Data;
console.log(this.manegeList);
this.manegeTotal = res.TotalCount
this.manegeList = res.Data
console.log(this.manegeList)
} else {
this.$message({
type: "error",
type: 'error',
message: res.Message
});
})
}
this.loading = false;
this.loading = false
})
.catch(res => {
// console.log(res);
});
})
},
putManagerdatadomain (e) {
// 更改某管理员关联项目列表
this.stateData.Projectcodes = e.SelectedCodes;
this.stateData.Projectcodes = e.SelectedCodes
// console.log(e);
this.$api
.putManagerdatadomain(this.stateData)
.then(res => {
// eslint-disable-next-line eqeqeq
if (res.Code == 10000) {
this.$message({
type: "success",
message: "修改关联项目成功!"
});
this.getmanagerlist();
type: 'success',
message: '修改关联项目成功!'
})
this.getmanagerlist()
} else {
this.$message({
type: "error",
type: 'error',
message: res.Message
});
})
}
})
.catch(res => {
// console.log(res);
});
})
},
getManagerdatadomain (id) {
// 获取管理员管理的楼宇编码
if (this.checkEstate) {
this.checkEstate = !this.checkEstate;
this.checkEstate = !this.checkEstate
}
this.$api
.getManagerdatadomain({ ID: id })
.then(res => {
// eslint-disable-next-line eqeqeq
if (res.Code == 10000) {
this.stateData.Managerid = res.Data.Managerid;
this.estateSelected.SelectedCodes = res.Data.Projectcodes;
this.checkEstate = true;
this.stateData.Managerid = res.Data.Managerid
this.estateSelected.SelectedCodes = res.Data.Projectcodes
this.checkEstate = true
} else {
this.$message({
type: "error",
type: 'error',
message: res.Message
});
})
}
})
.catch(res => {
// console.log(res);
});
})
},
delmanager () {
// 删除管理员
this.$confirm("确认删除该管理员吗?", "删除", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确认删除该管理员吗?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$api
.delmanager(this.delmanagerData)
.then(res => {
// eslint-disable-next-line eqeqeq
if (res.Code == 10000) {
this.$message({
type: "success",
message: "删除成功"
});
this.getmanagerlist(1);
type: 'success',
message: '删除成功'
})
this.getmanagerlist(1)
} else {
this.$message({
type: "error",
type: 'error',
message: res.Message
});
})
}
})
.catch(res => {
// console.log(res);
});
})
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除"
});
});
type: 'info',
message: '已取消删除'
})
})
},
routerGo (item) {
this.$router.push({
name: "addmanager",
name: 'addmanager',
query: {
ID: item.Id
}
});
})
}
}
}
};
</script>
<style lang="less" scoped>
@@ -410,4 +420,3 @@ export default {
color: #8f8f8f;
}
</style>

View File

@@ -100,11 +100,11 @@
</div>
</template>
<script>
import * as dateUtil from '@/extend/js/dateFormatUtil';
import * as dateUtil from '@/extend/js/dateFormatUtil'
export default {
name: "userIndex",
name: 'userIndex',
components: {
phoneHide: () => import("@/components/common/phonehide")
phoneHide: () => import('@/components/common/phonehide')
},
data () {
return {
@@ -114,75 +114,90 @@ export default {
dateRange2: [],
searchModel: {
PageIndex: 1,
keyWord: "",
sortLable:"",
keyWord: '',
sortLable: '',
sortOrder: 0,
profile:"",
profile: ''
},
types:[{ value: '已完成', label: '已完成'},
types: [
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '已完成', label: '已完成'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '高意向客户', label: '高意向客户'},
// eslint-disable-next-line indent
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '待跟进-消费减少', label: '待跟进-消费减少'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '待跟进-未购买', label: '待跟进-未购买'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '跟进超时-消费减少', label: '跟进超时-消费减少'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '跟进超时-未购买', label: '跟进超时-未购买'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '流失-需求减少', label: '流失-需求减少'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '流失-暂时不用', label: '流失-暂时不用'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '流失-价格问题', label: '流失-价格问题'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '流失-产品问题', label: '流失-产品问题'},
{ value: '跟进超时', label: '跟进超时'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '跟进超时', label: '跟进超时'}
]
}
},
created () {
this.$store.commit("setCurrentNav", "用户管理>>消费统计");
this.dateRange1[0]=dateUtil.getLastMonthStartDate();
this.dateRange1[1]=dateUtil.getLastMonthCurrentDate();
this.$store.commit('setCurrentNav', '用户管理>>消费统计')
this.dateRange1[0] = dateUtil.getLastMonthStartDate()
this.dateRange1[1] = dateUtil.getLastMonthCurrentDate()
this.dateRange2[0]=dateUtil.getMonthStartDate();
this.dateRange2[1]=dateUtil.getMonthCurrentDate();
this.get();
this.dateRange2[0] = dateUtil.getMonthStartDate()
this.dateRange2[1] = dateUtil.getMonthCurrentDate()
this.get()
},
methods: {
// eslint-disable-next-line standard/object-curly-even-spacing
sort ({column, prop, order }) {
console.log(column)
console.log(prop)
console.log(order)
this.searchModel.sortLable=prop;
this.searchModel.sortOrder=order=="ascending"?0:1;
this.searchModel.sortLable = prop
// eslint-disable-next-line eqeqeq
this.searchModel.sortOrder = order == 'ascending' ? 0 : 1
this.search()
},
changeProfile (row, command) {
row.UserInfo.Profile=command;
row.UserInfo.Profile = command
this.$api
.post("baseinfo/v1/user/UpdateProfile",{UserId:row.UserInfo.Id,Profile:command})
.then(res => {});
.post('baseinfo/v1/user/UpdateProfile', {UserId: row.UserInfo.Id, Profile: command})
.then(res => {})
},
search () {
this.searchModel.PageIndex = 1;
this.get();
this.searchModel.PageIndex = 1
this.get()
},
get () {
this.loading = true;
if (this.dateRange1 && this.dateRange1.length == 2) {
this.searchModel.bTime1 = this.dateRange1[0];
this.searchModel.eTime1 = this.dateRange1[1];
this.loading = true
if (this.dateRange1 && this.dateRange1.length === 2) {
this.searchModel.bTime1 = this.dateRange1[0]
this.searchModel.eTime1 = this.dateRange1[1]
}
if (this.dateRange2 && this.dateRange2.length == 2) {
this.searchModel.bTime2 = this.dateRange2[0];
this.searchModel.eTime2 = this.dateRange2[1];
if (this.dateRange2 && this.dateRange2.length === 2) {
this.searchModel.bTime2 = this.dateRange2[0]
this.searchModel.eTime2 = this.dateRange2[1]
}
this.$api
.get("course/v1/order/UserConsumeStatistics", this.searchModel)
.get('course/v1/order/UserConsumeStatistics', this.searchModel)
.then(res => {
this.retData = res;
this.loading = false;
});
this.retData = res
this.loading = false
})
},
dataExport () {
this.$api.getDownloadFile("/course/v1/order/ExportUserConsumeStatistics", this.searchModel);
this.$api.getDownloadFile('/course/v1/order/ExportUserConsumeStatistics', this.searchModel)
}
}
}
};
</script>
<style scoped>
</style>