From 5bbd1d0247583528d505d577b7f527d0f0019653 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Mon, 22 Nov 2021 16:47:56 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=B1=95=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scss/modules/visual/basicInfoMain.scss | 2 +- .../visual/basicinfo/basicInfoCommunity.vue | 262 +----------------- .../visual/basicinfo/basicInfoMain.vue | 2 +- .../modules/visual/basicinfo/peopleSearch.vue | 11 +- 4 files changed, 14 insertions(+), 263 deletions(-) diff --git a/src/assets/scss/modules/visual/basicInfoMain.scss b/src/assets/scss/modules/visual/basicInfoMain.scss index 70c4e5d9..88e617d6 100644 --- a/src/assets/scss/modules/visual/basicInfoMain.scss +++ b/src/assets/scss/modules/visual/basicInfoMain.scss @@ -37,7 +37,7 @@ width: 100%; // padding: 10px 5px 13px; // margin-top: 8px; - height: calc(88vh); + height: calc(88vh - 5px); color: #fff; // background: url('../../../img/modules/visual/warning-box.png') no-repeat // center; diff --git a/src/views/modules/visual/basicinfo/basicInfoCommunity.vue b/src/views/modules/visual/basicinfo/basicInfoCommunity.vue index 50f54367..dbb0a3c4 100644 --- a/src/views/modules/visual/basicinfo/basicInfoCommunity.vue +++ b/src/views/modules/visual/basicinfo/basicInfoCommunity.vue @@ -95,264 +95,7 @@ export default { selBuildingName: '', roomLoaded: false, - roomArray: [ - { - houseId: "1", - houseName: "101室", - categoryList: [ - { - name: '党员', - iconUrl: require('../../../../assets/img/shuju/dangyuan.png'), - isSpecial: '1', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "2", - houseName: "102室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "3", - houseName: "103室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "4", - houseName: "104室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "5", - houseName: "105室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "6", - houseName: "106室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, { - houseId: "1", - houseName: "101室", - categoryList: [ - { - name: '党员', - iconUrl: require('../../../../assets/img/shuju/dangyuan.png'), - isSpecial: '1', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "2", - houseName: "102室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "3", - houseName: "103室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "4", - houseName: "104室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "5", - houseName: "105室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "6", - houseName: "106室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, { - houseId: "1", - houseName: "101室", - categoryList: [ - { - name: '党员', - iconUrl: require('../../../../assets/img/shuju/dangyuan.png'), - isSpecial: '1', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "2", - houseName: "102室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - }, - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "3", - houseName: "103室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "4", - houseName: "104室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "5", - houseName: "105室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - }, - { - houseId: "6", - houseName: "106室", - categoryList: [ - { - name: '低保', - iconUrl: require('../../../../assets/img/modules/visual/dabing.png'), - isSpecial: '0', - } - ] - } - ], + roomArray: [], selHouseId: '', selHouseName: '', selHouseIndex: 0, @@ -414,6 +157,7 @@ export default { //点击全部成员 async handleShowAllUser (selIndex) { // this.startLoading() + await this.loadUser(this.roomArray[selIndex].houseId, selIndex) this.roomArray.forEach((element, index) => { let obj = JSON.parse(JSON.stringify(element)) @@ -422,7 +166,7 @@ export default { obj.showAllUser = !obj.showAllUser this.$set(this.roomArray, selIndex, obj) - this.loadUser(element.houseId, selIndex) + } else { obj.showAllUser = false this.$set(this.roomArray, index, obj) diff --git a/src/views/modules/visual/basicinfo/basicInfoMain.vue b/src/views/modules/visual/basicinfo/basicInfoMain.vue index fffed07d..8c0f4a59 100644 --- a/src/views/modules/visual/basicinfo/basicInfoMain.vue +++ b/src/views/modules/visual/basicinfo/basicInfoMain.vue @@ -316,7 +316,7 @@ const vueGis = { name: '搜索' } this.$nextTick(() => { - this.$refs.ref_search.loadList(); + this.$refs.ref_search.reset(); }); } else { diff --git a/src/views/modules/visual/basicinfo/peopleSearch.vue b/src/views/modules/visual/basicinfo/peopleSearch.vue index e19d780f..7e44c6d3 100644 --- a/src/views/modules/visual/basicinfo/peopleSearch.vue +++ b/src/views/modules/visual/basicinfo/peopleSearch.vue @@ -97,7 +97,10 @@ export default { } }, - + reset () { + this.searchName = '' + this.tableData = [] + }, async loadList () { if (this.searchName) { const url = "/epmetuser/icresiuser/searchbyname" @@ -130,7 +133,11 @@ export default { this.pageNo = val this.loadList() }, - } + }, + destroyed () { + console.log("我已经离开了!"); + + }, }; From 8242711974598cd386e332e9cca1c9ca42cb5fd0 Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Mon, 22 Nov 2021 21:11:48 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/base/resi.vue | 2 +- .../communityService/serviceMeasure/index.vue | 770 ++++++++++++++++++ src/views/modules/workSys/demandCate.vue | 4 +- src/views/modules/workSys/resiCate.vue | 2 +- 4 files changed, 773 insertions(+), 5 deletions(-) create mode 100644 src/views/modules/communityService/serviceMeasure/index.vue diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index b19a0943..a7bf1003 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -867,7 +867,7 @@ export default { ::v-deep .el-table th { color: #fff; background-color: rgba(33, 149, 254, 1); - border-right: 1px solid rgba(33, 149, 254, 1);; + // border-right: 1px solid rgba(33, 149, 254, 1); } } .resi-table { diff --git a/src/views/modules/communityService/serviceMeasure/index.vue b/src/views/modules/communityService/serviceMeasure/index.vue new file mode 100644 index 00000000..19914bc8 --- /dev/null +++ b/src/views/modules/communityService/serviceMeasure/index.vue @@ -0,0 +1,770 @@ + + + + + + + diff --git a/src/views/modules/workSys/demandCate.vue b/src/views/modules/workSys/demandCate.vue index 7221bb21..e8b665c6 100644 --- a/src/views/modules/workSys/demandCate.vue +++ b/src/views/modules/workSys/demandCate.vue @@ -122,8 +122,6 @@ - - - - diff --git a/src/views/modules/workSys/demandCate.vue b/src/views/modules/workSys/demandCate.vue index e8b665c6..7221bb21 100644 --- a/src/views/modules/workSys/demandCate.vue +++ b/src/views/modules/workSys/demandCate.vue @@ -122,6 +122,8 @@ + + + + diff --git a/src/views/modules/workSys/demandCate.vue b/src/views/modules/workSys/demandCate.vue index 7221bb21..e8b665c6 100644 --- a/src/views/modules/workSys/demandCate.vue +++ b/src/views/modules/workSys/demandCate.vue @@ -122,8 +122,6 @@ + + + + diff --git a/src/views/modules/workSys/demandCate.vue b/src/views/modules/workSys/demandCate.vue index 7221bb21..e8b665c6 100644 --- a/src/views/modules/workSys/demandCate.vue +++ b/src/views/modules/workSys/demandCate.vue @@ -122,8 +122,6 @@ + + + + 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(() => { From c3a6309968a639f2e68b59a97ccb423fda4c99f1 Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Wed, 24 Nov 2021 15:59:34 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8E=AA=E6=96=BD?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/base/resi.vue | 8 +- .../modules/communityParty/elegant/index.vue | 10 +- .../communityService/measure/index.vue | 419 +++++++++++++----- 3 files changed, 315 insertions(+), 122 deletions(-) diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index a7bf1003..e60f23c0 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -372,10 +372,10 @@ export default { this.$message.error('上传文件只能是xls/xlsx格式!') } - if (!isLt1M) { - this.$message.error('上传图片大小不能超过 10MB!') - } - return fileType && isLt1M + // if (!isLt1M) { + // this.$message.error('上传图片大小不能超过 10MB!') + // } + return fileType }, uploadHttpRequest(file) { this.importLoading = true diff --git a/src/views/modules/communityParty/elegant/index.vue b/src/views/modules/communityParty/elegant/index.vue index 2674b91d..07c0cf23 100644 --- a/src/views/modules/communityParty/elegant/index.vue +++ b/src/views/modules/communityParty/elegant/index.vue @@ -92,7 +92,7 @@ >编辑
- 新增需求 + 新增需求
@@ -184,21 +196,29 @@ :close-on-click-modal="false" :before-close="handlerCancle" > - + - + + + - + + @@ -212,7 +232,9 @@ --> - + + - + - + - + @@ -263,27 +282,94 @@ - - + + + + + + +
取消 @@ -368,7 +454,7 @@ export default { { label: '状态', align: 'center', - columnName: 'status', + columnName: 'statusName', width: '120', options: [ { @@ -408,7 +494,7 @@ export default { options: [] }, { label: '上报类型', - columnName: 'reportType', + columnName: 'reportTypeName', align: 'center', width: '120', options: [ @@ -436,7 +522,7 @@ export default { label: '上报时间', columnName: 'reportTime', align: 'center', - width: '120', + width: '180', options: [] }, { label: '需求人', @@ -446,7 +532,7 @@ export default { options: [] }, { label: '服务方', - columnName: 'serviceName', + columnName: 'serviceShowName', align: 'center', width: '120', options: [] @@ -454,13 +540,14 @@ export default { label: '服务时间', columnName: 'wantServiceTime', align: 'center', - width: '120', + width: '180', options: [] } ], customerId: '', reportTime: '', serviceTime: '', + finishServiceTime: '', searchForm: { gridId: '', categoryCode: '', @@ -491,14 +578,19 @@ export default { }, rules: { gridId: [{ required: true, message: '所属网格不能为空', trigger: 'blur' }], - parentCode: [{ required: true, message: '需求分类不能为空', trigger: 'blur' }], + categoryCode: [{ required: true, message: '需求分类不能为空', trigger: 'blur' }], content: [{ required: true, message: '需求内容不能为空', trigger: 'blur' }], reportType: [{ required: true, message: '上报类型不能为空', trigger: 'blur' }], reportUserName: [{ required: true, message: '上报人不能为空', trigger: 'blur' }], reportUserMobile: [{ required: true, message: '上报人手机号不能为空', trigger: 'blur' }], reportTime: [{ required: true, message: '上报时间不能为空', trigger: 'blur' }], demandUserId: [{ required: true, message: '需求人不能为空', trigger: 'blur' }], - wantServiceTime: [{ required: true, message: '服务时间不能为空', trigger: 'blur' }] + wantServiceTime: [{ required: true, message: '服务时间不能为空', trigger: 'blur' }], + serviceType: [{ required: true, message: '服务方不能为空', trigger: 'blur' }], + serviceStartTime: [{ required: true, message: '实际服务时间不能为空', trigger: 'blur' }], + score: [{ required: true, message: '评分不能为空', trigger: 'blur' }], + finishDesc: [{ required: true, message: '备注不能为空', trigger: 'blur' }], + finishResult: [{ required: true, message: '完成情况不能为空', trigger: 'blur' }], } } }, @@ -536,6 +628,10 @@ export default { } return _val || row[item.columnName] }, + filterEdit(id) { + const { user } = this.$store.state + return id === user.agencyId + }, resetForm(formName) { this.searchForm.reportStartTime = '' this.searchForm.reportEndTime = '' @@ -553,8 +649,17 @@ export default { this.searchForm.level = val.length }, handleCateSlect(val) { - this.form.parentCode = val[0] - this.form.categoryCode = val[1] + console.log('val', val) + if (val.length === 1) { + this.demandOptions.forEach(item => { + if (item.value == val[0]) this.form.parentCode = item.pvalue + }) + this.form.categoryCode = val[0] + } else { + this.form.parentCode = val[0] + this.form.categoryCode = val[1] + } + }, handleDemandChange(val) { console.log('val', val) @@ -575,64 +680,120 @@ export default { } this.getTableData() }, + handelBlurServiceTime(val) { + console.log('val', val) + if (val.value.length > 0) { + this.form.serviceStartTime = val.value[0] + this.form.serviceEndTime = val.value[1] + } + + }, handleServiceChange(val) { - this.getServiceuserList() + this.getServiceuserList(val) }, handleGridChange(val) { this.getDemandUserList() }, - handleAdd(type, addType, row) { - this.addLevel = type + handleAdd(addType) { this.addType = addType - if (type == '2') this.form = { ...row, categoryName: '' } this.dialogVisible = true }, handlerCancle() { - this.form.categoryCode = '' - this.from.parentCode = '' - this.form.demandUserName = '' - this.form.demandUserMobile = '' - this.form.demandUserId = '' + // this.form.categoryCode = '' + // this.form.parentCode = '' + // this.form.demandUserName = '' + // this.form.demandUserMobile = '' + // this.form.demandUserId = '' + this.$delete(this.form, 'demandRecId') this.selectDemandUser = '' - this.$refs.ruleForm.resetFields() + for(const n in this.form) { + this.form[n] = '' + } + this.disabled = false + // this.$refs.ruleForm.resetFields() this.dialogVisible = false }, - async handleLook(row) { - const params = { - categoryId: row.categoryId, - usableFlag: !row.usableFlag + async formatRowForm(row, addType, disabled) { + this.form = { ...row, categoryCode: [row.parentCode, row.categoryCode] } + this.addType = addType + + if (disabled) { + // await this.getGridList('query', row.agencyId) + this.disabled = disabled } - this.$http - .post('/heart/icresidemanddict/updatestatus', params) + if (addType == 'look') { + this.finishServiceTime = [row.serviceStartTime, row.serviceEndTime] + } + if (addType == 'appoint' && row.serviceType) { + await this.getServiceuserList(row.serviceType) + } + if (addType == 'edit') { + await this.getDemandUserList() + this.demandOptions.forEach(item => { + if (item.value === row.categoryCode) this.form.categoryCode = [row.categoryCode] + }) + this.demandUserList.forEach(item => { + if (item.demandUserId == row.demandUserId) this.selectDemandUser = item + }) + } + + this.dialogVisible = true + }, + async handleLook(row, type) { + await this.formatRowForm(row, type, true) + }, + async handleAppoint(row, type) { + await this.formatRowForm(row, type, true) + }, + async handleFinish(row, type) { + await this.formatRowForm(row, type, true) + }, + async handleEdit(row, type) { + await this.formatRowForm(row, type, false) + // this.form = { ...row, categoryCode: [row.parentCode, row.categoryCode] } + // this.addType = addType + // this.demandOptions.forEach(item => { + // if (item.value === row.categoryCode) this.form.categoryCode = [row.categoryCode] + // }) + // await this.getDemandUserList() + // this.demandUserList.forEach(item => { + // if (item.demandUserId == row.demandUserId) this.selectDemandUser = item + // }) + // console.log('selectDemandUser', this.selectDemandUser) + // this.dialogVisible = true + }, + async addNew() { + const _form = { + ...this.form + } + await this.$http + .post('/heart/userdemand/add', _form) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } else { + this.handlerCancle() this.getTableData() - } + } }) .catch(() => { return this.$message.error('网络错误') }) + this.btnLoading = false }, - async handleEdit(row, addType) { - - this.form = { ...row } - this.addLevel = row.level - this.addType = addType - this.dialogVisible = true - }, - async addLevelFirst() { + async appointAjax() { const _form = { - ...this.form + demandRecId: this.form.demandRecId, + serviceType: this.form.serviceType, + serverId: this.form.serverId } await this.$http - .post('/heart/userdemand/add', _form) + .post('/heart/userdemand/assign', _form) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } else { - this.dialogVisible = false + this.handlerCancle() this.getTableData() } }) @@ -641,20 +802,23 @@ export default { }) this.btnLoading = false }, - async addLevelChild () { + async finishAjax() { const _form = { - customerId: localStorage.getItem('customerId'), - categoryName: this.form.categoryName, - parentCategoryCode: this.form.categoryCode, - awardPoint: this.form.awardPoint + demandRecId: this.form.demandRecId, + serviceStartTime: this.form.serviceStartTime, + serviceEndTime: this.form.serviceEndTime, + finishResult: this.form.finishResult, + finishDesc: this.form.finishDesc, + serviceId: this.form.serviceId, + score: this.form.score } await this.$http - .post('/heart/icresidemanddict/addchild', _form) + .post('/heart/userdemand/finish', _form) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } else { - this.dialogVisible = false + this.handlerCancle() this.getTableData() } }) @@ -664,6 +828,19 @@ export default { this.btnLoading = false }, async editCate() { + const categoryCode = this.form.categoryCode + if (Array.isArray(categoryCode)) { + if (categoryCode.length === 1) { + this.demandOptions.forEach(item => { + if (item.value == categoryCode[0]) this.form.parentCode = item.pvalue + }) + this.form.categoryCode = categoryCode[0] + } else { + this.form.parentCode = categoryCode[0] + this.form.categoryCode = categoryCode[1] + } + } + const _form = { ...this.form } @@ -673,7 +850,7 @@ export default { if (res.code !== 0) { return this.$message.error(res.msg) } else { - this.dialogVisible = false + this.handlerCancle() this.getTableData() } }) @@ -686,8 +863,10 @@ export default { this.$refs.ruleForm.validate(async (valid) => { if (valid) { this.btnLoading = true - if (this.addType == 'add') this.addLevelFirst() - else this.editCate() + if (this.addType == 'add') this.addNew() + else if (this.addType == 'edit') this.editCate() + else if (this.addType == 'appoint') this.appointAjax() + else if (this.addType == 'finish') this.finishAjax() } else { console.log('error submit!!'); @@ -698,19 +877,18 @@ export default { }, handleDel(row) { let params = { - formCode: 'resi_base_info', - icResiUserId: row.icResiUserId + demandRecId: row.demandRecId } console.log('row1', row) this.$http - .post('/epmetuser/icresiuser/delete', params) + .post('/heart/userdemand/cancel', params) .then(({ data: res }) => { console.log('row2', row) if (res.code !== 0) { return this.$message.error(res.msg) } else { console.log('row3', row) - this.$message.success('删除成功') + this.$message.success('取消成功') this.getTableData() } }) @@ -733,12 +911,12 @@ export default { }) return arr }, - async getGridList(type) { + async getGridList(type, agencyId) { 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 }) + await this.$http + .post('/gov/org/customergrid/gridoption', { agencyId: agencyId || user.agencyId, purpose: type }) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) @@ -762,7 +940,7 @@ export default { name: '' } // addorupdate - this.$http + await this.$http .post('/epmetuser/icresiuser/demandusers', params) .then(({ data: res }) => { if (res.code !== 0) { @@ -791,14 +969,14 @@ export default { return this.$message.error('网络错误') }) }, - getServiceuserList() { - if (!this.searchForm.serviceType) return this.$message.error('服务方不能为空') + async getServiceuserList(serviceType) { + if (!serviceType) return this.$message.error('服务方不能为空') const params = { serviceName: '', - serviceType: this.searchForm.serviceType, + serviceType: serviceType, queryPurpose: '' } - this.$http + await this.$http .post('/heart/userdemand/servicelist', params) .then(({ data: res }) => { if (res.code !== 0) { @@ -889,7 +1067,7 @@ export default { text-decoration: underline; } ::v-deep .btn-color-del { - margin-left: 10px; + margin: 0 10px; color: rgba(213, 16, 16, 1); } ::v-deep .btn-color-edit { @@ -899,11 +1077,26 @@ export default { .form-wr { .input-width { width: 260px; + &-small { + width: 160px; + } + &-middle { + width: 200px; + } + &-min { + min-width: 260px; + } } .input-width-textarea { width: 400px; } + .form-score { + ::v-deep .el-rate { + margin-top: 8px; + } + + } }