diff --git a/src/api/modules/api.js b/src/api/modules/api.js index c0083f9..39299b2 100644 --- a/src/api/modules/api.js +++ b/src/api/modules/api.js @@ -411,6 +411,15 @@ export function findKeywords(query) { }) } +// 置业顾问 +export function findUserListByHouseId(query) { + return request({ + url: 'autoSR/cushouseuserrelationmid/findUserListByHouseId', + method:'get', + params:query + }) +} + // 常错词列表 export function correctFindbypage(query) { return request({ @@ -435,3 +444,39 @@ export function correctUpdate(query) { params:query }) } + +// +// 客户管理客户裂变 +export function customerManagement(query) { + return request({ + url: '/autoSR/customer/customerManagement', + method:'get', + params:query + }) +} + +// 销售阶段列表 +export function lifeTrackDefineList(query) { + return request({ + url: '/autoSR/lifeTrackDefine/list', + method:'get', + params:query + }) +} +// 修改 +export function lifeTrackDefineUpdate(data) { + return request({ + url: '/autoSR/lifeTrackDefine/update', + method:'post', + data + }) +} +// 添加 +export function lifeTrackDefineAdd(data) { + return request({ + url: '/autoSR/lifeTrackDefine/add', + method:'post', + data + }) +} + diff --git a/src/views/Customer/SalesStage.vue b/src/views/Customer/SalesStage.vue index 0adfde6..a0f9ced 100644 --- a/src/views/Customer/SalesStage.vue +++ b/src/views/Customer/SalesStage.vue @@ -1,93 +1,83 @@ @@ -95,100 +85,143 @@ export default { data() { return { - addagentobj:{ - name:'',// 公司名称 - contactPerson:'',// 联系人 - contactNumber:'',// 联系人手机号 + houseId: "", + houseList: [], + ruleForm: { + stageName: "", // 公司名称 + sort: "", // 联系人 + remarks: "", // 联系人手机号 }, - rules:{ - name: [ - { required: true, message: '请输入阶段名称:', trigger: 'blur' }, - ], - contactPerson: [ - { required: true, message: '请输入顺序', trigger: 'blur' }, - ], + rules: { + stageName: [ + { required: true, message: "请输入阶段名称:", trigger: "blur" }, + ], + sort: [{ required: true, message: "请输入顺序", trigger: "blur" }], }, - tableData:[], - dialogVisible:false, - options:[], - value:'' - + tableData: [], + dialogVisible: false, + editFlag: false, + options: [], + value: "", }; }, mounted() { - + // 获取楼盘列表 + this.zkhousePage(); }, methods: { - + houseChange() { + this.findbypage(); + }, + clear() { + this.ruleForm = { + stageName: "", // 公司名称 + sort: "", // 联系人 + remarks: "", // 联系人手机号 + }; + }, + zkhousePage() { + this.$api.api + .findHouseByUser({ + orgType: localStorage.getItem("orgType"), + }) + .then((res) => { + // console.log(res) + this.houseList = res.data; + this.houseId = res.data[0].id; + // 获取列表 + this.findbypage(); + }); + }, + findbypage() { + let obj = { + // current: this.currentPage, + // size: this.size, + houseId: this.houseId, + }; + this.$api.api.lifeTrackDefineList(obj).then((res) => { + // console.log(res) + this.tableData = res.data; + // this.total = res.data.total; + }); + }, //删除 - toinifodelete(item){ - this.$confirm('此操作将永久删除, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - this.$api.http.delOrg({id:item.row.id}).then((res) => { - if(res.code==0){ - this.$message({ - type: 'success', - message: '删除成功!' - }); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }) - }).catch(() => { + toinifodelete(row) { + this.$confirm("此操作将永久删除, 是否继续?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + axios({ + url: `/autoSR/lifeTrackDefine/del`, + method: "post", + data: { + id: row.id, + }, + }).then((res) => { + if (res.code == 0) { + this.$message({ + type: "success", + message: "删除成功!", + }); + this.findbypage(); + } else { + this.$message.error(res.message); + } + }); + }) + .catch(() => { this.$message({ - type: 'info', - message: '已取消删除' + type: "info", + message: "已取消删除", }); }); }, - - //新增 - infoadd(){ - this.dialogVisible=true; + //新增 + infoadd() { + this.editFlag = false; + this.dialogVisible = true; }, - - //确认新增 - add(){ - this.$refs.addagentobj.validate((valid) => { - if (valid) { - this.addagentobj.pid=0; - this.$api.http.AddaddOrg(this.addagentobj).then((res) => { - if(res.code==0){ - this.dialogVisible=false; - this.$refs.addagentobj.resetFields(); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }); + edit(row) { + console.log(row); + // console.log(this.time) + this.ruleForm = Object.assign({}, row); + // 获取地区选择数据,在这里对回显的时候进行操作,首先先获取一级省的数据 + this.editFlag = true; + this.dialogVisible = true; + }, + addSure() { + // console.log(this.addressOptions) + this.$refs.ruleForm.validate((valid) => { + if (valid) { + console.log(this.ruleForm); + // 编辑 + if (this.editFlag) { + console.log("编辑"); + this.$api.api.lifeTrackDefineUpdate(this.ruleForm).then((res) => { + console.log(res); + if (res.code == 0) { + this.dialogVisible = false; + this.$message.success("编辑成功"); + this.findbypage(); + } + }); } else { - return false; + // 添加 + console.log("添加"); + this.$api.api.lifeTrackDefineAdd({houseId:this.houseId,...this.ruleForm,}).then((res) => { + console.log(res); + if (res.code == 0) { + this.dialogVisible = false; + this.$message.success("新增成功"); + this.findbypage(); + } + }); } - }); - }, - - - // 获取列表 - getcompanyList() { - this.tableData=[]; - let parmest={ - current: this.pageNum, - size: this.pageSize, - operatorName:this.operatorName, - operationStaffName:this.operationStaffName, - name:this.name, - } - this.$api.http.getcompanyList(parmest).then((res) => { - console.log(res.data); - this.tableData=res.data.records; - this.total=res.data.total - }); + } + }); }, - }, }; @@ -200,11 +233,11 @@ export default { min-width: 1200px; padding-bottom: 100px; } -.cen-tab{ +.cen-tab { width: 100%; padding: 15px; min-height: 400px; - background: #FFFFFF; + background: #ffffff; margin-top: 15px; } .tophove { diff --git a/src/views/Customer/index.vue b/src/views/Customer/index.vue index f786187..edba215 100644 --- a/src/views/Customer/index.vue +++ b/src/views/Customer/index.vue @@ -1,14 +1,41 @@ @@ -227,21 +310,12 @@ export default { data() { return { TimetoAhoose: 2, - options: [ - { - value: "1", - label: "全部", - }, - { - value: "2", - label: "服务器内", - }, - { - value: "3", - label: "已失效", - }, - ], - options2: [ + time: [], + houseList: [], + options: [], + keywordsList: [], + accountList: [], + levelList: [ { value: "1", label: "A", @@ -259,7 +333,7 @@ export default { label: "D", }, ], - options3: [ + options3: [ { value: "1", label: "0-15分钟", @@ -299,78 +373,208 @@ export default { label: "三次以上", }, ], - currentPage4:4, - value: "", - input: "", - tableData: [ + timeTypeList: [ { - date: "2016-05-03", - name: "王小虎", - address: " 1518 弄", + value: "0", + label: "添加时间", }, { - date: "2016-05-02", - name: "王小虎", - address: " 1518 弄", - }, - { - date: "2016-05-04", - name: "王小虎", - address: " 1518 弄", - }, - { - date: "2016-05-01", - name: "王小虎", - address: " 1518 弄", + value: "1", + label: "最近接待时间", }, + ], + options5: [ { - date: "2016-05-08", - name: "王小虎", - address: " 1518 弄", + value: null, + label: "全部", }, { - date: "2016-05-06", - name: "王小虎", - address: " 1518 弄", + value: "1", + label: "已标注", }, { - date: "2016-05-07", - name: "王小虎", - address: " 1518 弄", + value: "2", + label: "未标注", }, ], - multipleSelection:[] + currentPage: 1, + size: 10, + total: 10, + value: "", + input: "", + tableData: [], + tophove: "", + type: "0", + searchForm: { + name: "", + keywordsId: [], + markAdvisor: null, + level: "", + recDurationInterval: "", + visitRecord: "", + staDate: "", + endDate: "", + dateType: "0", + projectId: "", + timeType: "0", + }, }; }, - mounted() {}, + mounted() { + this.tabtimetap(0); + // 获取楼盘列表 + this.zkhousePage(); + }, methods: { - //删除 - toinifodelete(){ - this.$confirm('此操作将永久删除, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - this.$message({ - type: 'success', - message: '删除成功!' - }); - }).catch(() => { - this.$message({ - type: 'info', - message: '已取消删除' - }); + // 接待记录列表 + findbypage() { + let obj = { + current: this.currentPage, + size: this.size, + ...this.searchForm, + }; + obj.keywordIds = obj.keywordsId.join(","); + (obj.dateType = this.searchForm.staDate + ? null + : this.searchForm.dateType), + this.$api.api.customerManagement(obj).then((res) => { + // console.log(res) + this.tableData = res.data.records; + this.total = res.data.total; }); }, - handleSelectionChange(val) { - this.multipleSelection = val; - }, - handleSizeChange(val) { - console.log(`每页 ${val} 条`); - }, - handleCurrentChange(val) { - console.log(`当前页: ${val}`); + clearScreen() { + this.currentPage = 1; + this.searchForm = { + name: "", + keywordsId: [], + markAdvisor: null, + level: "", + recDurationInterval: "", + visitRecord: "", + staDate: "", + endDate: "", + dateType: "0", + projectId: "", + timeType: "0", + projectId: this.houseList[0].id, + }; + this.findbypage(); + }, + houseChange() { + this.findbypage(); + this.findKeywords(); + // 获取置业顾问列表 + this.findUserListByHouseId(); + }, + timeChange(e) { + this.searchForm.staDate = e[0]; + this.searchForm.endDate = e[1]; + this.houseChange(); + }, + screen() { + this.currentPage = 1; + console.log(this.searchForm); + this.findbypage(); + }, + findKeywords() { + this.$api.api + .findKeywords({ + dateType: this.searchForm.staDate ? null : this.searchForm.dateType, + statDateStart: this.searchForm.staDate, + statDateEnd: this.searchForm.endDate, + projectId: this.searchForm.projectId, + type: this.type, + }) + .then((res) => { + console.log(res); + this.keywordsList = res.data; + }); + }, + zkhousePage() { + this.$api.api + .findHouseByUser({ + orgType: localStorage.getItem("orgType"), + }) + .then((res) => { + // console.log(res) + this.houseList = res.data; + this.searchForm.projectId = res.data[0].id; + // 获取接待记录列表 + this.findbypage(); + // 获取客户意向 + this.findKeywords(); + // 获取置业顾问列表 + this.findUserListByHouseId(); + }); + }, + // 置业顾问列表 + async findUserListByHouseId() { + let result = await this.$api.api.findUserListByHouseId({ + orgType: localStorage.getItem("orgType"), + projectId: this.searchForm.projectId, + }); + console.log(result); + this.accountList = result.data; + }, + handleSizeChange(val) { + console.log(`每页 ${val} 条`); + this.size = val; + this.findbypage(); + }, + handleCurrentChange(val) { + console.log(`当前页: ${val}`); + this.currentPage = val; + this.findbypage(); + }, + tabtimetap(idx) { + this.searchForm.staDate = ""; + this.searchForm.endDate = ""; + // this.$set(this, "time", null); + this.searchForm.dateType = idx; + let num = 24 * 3600 * 1000; + // 获取当前时间戳转换为日期格式 + if (idx == 0) { + num = 24 * 3600 * 1000 * 0; } + if (idx == 2) { + num = 24 * 3600 * 1000 * 6; + } + if (idx == 6) { + num = 24 * 3600 * 1000 * 29; + } + this.time = [ + this.timestampToTime(new Date().getTime() - num), + this.timestampToTime(new Date().getTime()), + ]; + }, + timestampToTime(timestamp) { + var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000 + // var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000 + + var yyyy = date.getFullYear() + "-"; + + var MM = + (date.getMonth() + 1 < 10 + ? "0" + (date.getMonth() + 1) + : date.getMonth() + 1) + "-"; + + // var dd = date.getDate() + ' '; + var dd = + (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " "; + + // var HH = date.getHours() + ':'; + // var HH = (date.getHours() < 10 ? '0'+(date.getHours()) : date.getHours()) + ':'; + // + // // var mm = date.getMinutes() + ':'; + // var mm = (date.getMinutes() < 10 ? '0'+(date.getMinutes()) : date.getMinutes()) + ':'; + // + // // var ss = date.getSeconds(); + // var ss = (date.getSeconds() < 10 ? '0'+(date.getSeconds()) : date.getSeconds()); + + // return yyyy+MM+dd+HH+mm+ss; + return yyyy + MM + dd; + }, }, }; @@ -382,10 +586,10 @@ export default { min-width: 1200px; padding-bottom: 100px; } -.cen-tab{ +.cen-tab { width: 100%; padding: 15px; - background: #FFFFFF; + background: #ffffff; margin-top: 15px; } .tophove { @@ -403,12 +607,14 @@ export default { width: 100%; display: flex; align-items: center; + flex-wrap: wrap; .label { font-size: 14px; font-weight: 400; color: #32363d; - line-height: 14px; + line-height: 32px; margin-left: 15px; + min-width: 100px; } .toptimeqhuan { height: 30px; @@ -428,4 +634,11 @@ export default { } } } +.div-lab { + display: flex; + margin: 5px; +} +.div-inp { + width: 250px; +} diff --git a/src/views/Equipment/equipmentDetailList.vue b/src/views/Equipment/equipmentDetailList.vue index 1a280e2..3f0c1ef 100644 --- a/src/views/Equipment/equipmentDetailList.vue +++ b/src/views/Equipment/equipmentDetailList.vue @@ -1,5 +1,5 @@