diff --git a/src/views/main.vue b/src/views/main.vue index 9635a5d9..ab5b28bc 100644 --- a/src/views/main.vue +++ b/src/views/main.vue @@ -166,6 +166,7 @@ export default { params, (data, rspMsg) => { this.$store.state.user = { ...data } + console.log('user---hahha', this.$store.state.user) // this.$store.state.user.id = data.id // this.$store.state.user.realName = data.realName // this.$store.state.user.superAdmin = data.superAdmin diff --git a/src/views/modules/communityParty/elegant/index.vue b/src/views/modules/communityParty/elegant/index.vue new file mode 100644 index 00000000..2674b91d --- /dev/null +++ b/src/views/modules/communityParty/elegant/index.vue @@ -0,0 +1,612 @@ + + + + + + + diff --git a/src/views/modules/communityService/measure/index.vue b/src/views/modules/communityService/measure/index.vue index 19914bc8..481549fc 100644 --- a/src/views/modules/communityService/measure/index.vue +++ b/src/views/modules/communityService/measure/index.vue @@ -7,7 +7,7 @@ @@ -15,21 +15,27 @@ - + + - + - @@ -81,7 +79,7 @@ - + @@ -198,19 +196,25 @@ - + + @@ -224,28 +228,42 @@ - + value-format="yyyy-MM-dd HH:mm:ss"> + --> + - + + :value="item"> - + --> + @@ -323,6 +349,7 @@ export default { value: 'party_unit' } ], + serviceOptiondList: [], options: [ { label: '是', @@ -332,7 +359,11 @@ export default { value: 2 } ], + reportOptions: [], demandOptions: [], + demandUserList: [], + optionsG: [], + optionsEditG: [], tableHeader: [ { label: '状态', @@ -428,6 +459,8 @@ export default { } ], customerId: '', + reportTime: '', + serviceTime: '', searchForm: { gridId: '', categoryCode: '', @@ -441,6 +474,7 @@ export default { wantServiceStartTime: '', wantServiceEndTime: '' }, + selectDemandUser: '', form: { gridId: '', categoryCode: '', @@ -470,8 +504,14 @@ export default { }, async created() { this.customerId = localStorage.getItem('customerId') + this.getTableData() - this.getOptions() + this.getDemandOptions() + this.getDictOptions() + setTimeout(() => { + this.getGridList('query') + this.getGridList('addorupdate') + }, 200) this.pageLoading = true }, mounted() { @@ -497,13 +537,50 @@ export default { return _val || row[item.columnName] }, resetForm(formName) { + this.searchForm.reportStartTime = '' + this.searchForm.reportEndTime = '' + this.searchForm.wantServiceStartTime = '' + this.searchForm.wantServiceTime = '' + this.searchForm.categoryCode = '' + this.searchForm.level = '' + this.reportTime = '' + this.serviceTime = '' this.$refs[formName].resetFields() }, + handleCateCHange(val) { + console.log('val', val) + this.searchForm.categoryCode = val[1] || val[0] + this.searchForm.level = val.length + }, + handleCateSlect(val) { + this.form.parentCode = val[0] + this.form.categoryCode = val[1] + }, + handleDemandChange(val) { + console.log('val', val) + this.form.demandUserName = val.demandUserName + this.form.demandUserMobile = val.demandUserMobile + this.form.demandUserId = val.demandUserId + }, handleSearch(val) { console.log('searchhh--', val) this.currentPage = 1 + if (this.reportTime.length > 0) { + this.searchForm.reportStartTime = this.reportTime[0] + this.searchForm.reportEndTime = this.reportTime[1] + } + if (this.serviceTime.length > 0) { + this.searchForm.wantServiceStartTime = this.serviceTime[0] + this.searchForm.wantServiceTime = this.serviceTime[1] + } this.getTableData() }, + handleServiceChange(val) { + this.getServiceuserList() + }, + handleGridChange(val) { + this.getDemandUserList() + }, handleAdd(type, addType, row) { this.addLevel = type this.addType = addType @@ -511,6 +588,13 @@ export default { this.dialogVisible = true }, handlerCancle() { + this.form.categoryCode = '' + this.from.parentCode = '' + this.form.demandUserName = '' + this.form.demandUserMobile = '' + this.form.demandUserId = '' + this.selectDemandUser = '' + this.$refs.ruleForm.resetFields() this.dialogVisible = false }, async handleLook(row) { @@ -540,11 +624,10 @@ export default { }, async addLevelFirst() { const _form = { - customerId: localStorage.getItem('customerId'), - categoryName: this.form.categoryName + ...this.form } await this.$http - .post('/heart/icresidemanddict/addfirst', _form) + .post('/heart/userdemand/add', _form) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) @@ -582,14 +665,10 @@ export default { }, async editCate() { const _form = { - customerId: localStorage.getItem('customerId'), - categoryName: this.form.categoryName, - categoryId: this.form.categoryId, - level: this.form.level, - awardPoint: this.form.awardPoint + ...this.form } await this.$http - .post('/heart/icresidemanddict/update', _form) + .post('/heart/userdemand/update', _form) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) @@ -607,10 +686,8 @@ export default { this.$refs.ruleForm.validate(async (valid) => { if (valid) { this.btnLoading = true - if (this.addType == 'add') { - if (this.addLevel == '1') this.addLevelFirst() - else this.addLevelChild() - } else this.editCate() + if (this.addType == 'add') this.addLevelFirst() + else this.editCate() } else { console.log('error submit!!'); @@ -642,18 +719,130 @@ export default { return this.$message.error('网络错误') }) }, - - async getOptions() { + getTreeData(data){ + if (!Array.isArray(data)) return [] + let arr = data.map(item => { + let _item = {} + if (item.children) { + if (item.children.length === 0) _item = { ...item, children: undefined } + else _item = { ...item, children: this.getTreeData(item.children)} + } else { + _item = { ...item } + } + return _item + }) + return arr + }, + async getGridList(type) { + const { user } = await this.$store.state + console.log('user---ppp', user) + // addorupdate query + this.$http + .post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: type }) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + console.log('获取查询详情成功', res.data) + + if (type === 'query') this.optionsG = res.data + else this.optionsEditG = res.data + } + }) + .catch(() => { + return this.$message.error('网络错误') + }) + }, + async getDemandUserList() { + const { user } = await this.$store.state + console.log('user---ppp', user) const params = { - parentCategoryCode: 0 + agencyId: user.agencyId, + gridId: this.form.gridId, + name: '' } + // addorupdate + this.$http + .post('/epmetuser/icresiuser/demandusers', params) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + console.log('获取查询详情成功', res.data) + this.demandUserList = res.data + } + }) + .catch(() => { + return this.$message.error('网络错误') + }) + }, + + async getDemandOptions() { + this.$http + .post('/heart/icresidemanddict/demandoption') + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + this.demandOptions = this.getTreeData(res.data) + } + }) + .catch(() => { + return this.$message.error('网络错误') + }) + }, + getServiceuserList() { + if (!this.searchForm.serviceType) return this.$message.error('服务方不能为空') + const params = { + serviceName: '', + serviceType: this.searchForm.serviceType, + queryPurpose: '' + } + this.$http + .post('/heart/userdemand/servicelist', params) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + this.serviceOptiondList = res.data + } + }) + .catch(() => { + return this.$message.error('网络错误') + }) + }, + async getDictOptions() { + this.$http + .post('/sys/dict/data/dictlist', { dictType: 'user_demand_status' }) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + this.statusOptions = res.data + } + }) + .catch(() => { + return this.$message.error('网络错误') + }) + this.$http + .post('/sys/dict/data/dictlist', { dictType: 'user_demand_report_type' }) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + this.reportOptions = res.data + } + }) + .catch(() => { + return this.$message.error('网络错误') + }) this.$http - .post('/heart/icresidemanddict/subcodelist', params) + .post('/sys/dict/data/dictlist', { dictType: 'user_demand_service_type' }) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } else { - this.demandOptions = res.data + this.serviceOptions = res.data } }) .catch(() => {