|
|
|
@ -16,6 +16,7 @@ |
|
|
|
<el-select v-model="formData.gridId" |
|
|
|
filterable |
|
|
|
placeholder="请选择" |
|
|
|
@change="handleGridChange" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in optionsG" |
|
|
|
:key="item.value" |
|
|
|
@ -34,23 +35,27 @@ |
|
|
|
placeholder="请选择" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in serviceTypeList" |
|
|
|
:key="item.id" |
|
|
|
:key="item.serviceType" |
|
|
|
:label="item.serviceTypeName" |
|
|
|
:value="item.id"> |
|
|
|
:value="item.serviceType"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="申请人" |
|
|
|
prop="applicantName" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入申请人" |
|
|
|
v-model="formData.applicantName"> |
|
|
|
</el-input> |
|
|
|
style="display: block" |
|
|
|
prop="applicantId"> |
|
|
|
<el-select v-model="formData.applicantId" |
|
|
|
filterable |
|
|
|
placeholder="请选择" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in demandUserList" |
|
|
|
:key="item.demandUserId" |
|
|
|
:label="item.label" |
|
|
|
:value="item.demandUserId"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="住址" |
|
|
|
@ -147,10 +152,13 @@ export default { |
|
|
|
applicantId: '', |
|
|
|
keyWords: '', |
|
|
|
formData: { |
|
|
|
serviceType: '', |
|
|
|
serviceType: 0, |
|
|
|
serviceTypeName: '', |
|
|
|
gridId: '', |
|
|
|
gridName: '', |
|
|
|
applicantAddress: '', |
|
|
|
applicantName: '', |
|
|
|
applicantId: '', |
|
|
|
serviceContent: '', |
|
|
|
applicantMobile: '', |
|
|
|
principalName: '', |
|
|
|
@ -160,6 +168,7 @@ export default { |
|
|
|
optionsG: [], |
|
|
|
serviceTypeList: [], |
|
|
|
publicServiceData: {}, |
|
|
|
demandUserList: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
@ -172,28 +181,25 @@ export default { |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
async initForm (type, applicantId) { |
|
|
|
async initForm (type, row) { |
|
|
|
this.startLoading() |
|
|
|
this.$refs.ref_form.resetFields(); |
|
|
|
|
|
|
|
//获取服务事项 |
|
|
|
await this.getServiceTypeList() |
|
|
|
this.getGridList(type) |
|
|
|
|
|
|
|
this.formType = type |
|
|
|
if (applicantId) { |
|
|
|
this.applicantId = applicantId |
|
|
|
this.formData.applicantId = applicantId |
|
|
|
// await this.loadFormData() |
|
|
|
} else { |
|
|
|
|
|
|
|
if (type === 'edit'){ |
|
|
|
this.formData = row |
|
|
|
} |
|
|
|
this.endLoading() |
|
|
|
}, |
|
|
|
|
|
|
|
//获取服务事项下拉框 |
|
|
|
async getServiceTypeList () { |
|
|
|
// const url = "/heart/workdiaryService/serviceType/page" |
|
|
|
let url = 'http://yapi.elinkservice.cn/mock/245/heart/workdiaryService/serviceType/page' |
|
|
|
const url = "/heart/workdiaryService/serviceType/page" |
|
|
|
// let url = 'http://yapi.elinkservice.cn/mock/245/heart/workdiaryService/serviceType/page' |
|
|
|
let params = { |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 10000 |
|
|
|
@ -205,7 +211,27 @@ export default { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async getDemandUserList () { |
|
|
|
const { user } = await this.$store.state; |
|
|
|
const params = { |
|
|
|
agencyId: user.agencyId, |
|
|
|
gridId: this.formData.gridId, |
|
|
|
name: "", |
|
|
|
}; |
|
|
|
// addorupdate |
|
|
|
await this.$http |
|
|
|
.post("/epmetuser/icresiuser/demandusers", params) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} else { |
|
|
|
this.demandUserList = res.data; |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
//加载组织 |
|
|
|
async getGridList (type) { |
|
|
|
const { user } = await this.$store.state; |
|
|
|
@ -222,7 +248,9 @@ export default { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleGridChange (val) { |
|
|
|
this.getDemandUserList(); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async handleComfirm () { |
|
|
|
@ -242,10 +270,11 @@ export default { |
|
|
|
async addUnit () { |
|
|
|
let url = '' |
|
|
|
if (this.formType === 'add') { |
|
|
|
// url = '/heart/workdiaryService/record/save' |
|
|
|
url = 'http://yapi.elinkservice.cn/mock/245/heart/workdiaryService/record/save' |
|
|
|
url = '/heart/workdiaryService/record/save' |
|
|
|
// url = 'http://yapi.elinkservice.cn/mock/245/heart/workdiaryService/record/save' |
|
|
|
} else { |
|
|
|
url = '/gov/org/icPublicService/edit' |
|
|
|
url = '/heart/workdiaryService/record/update' |
|
|
|
// url = 'http://yapi.elinkservice.cn/mock/245/heart/workdiaryService/record/update' |
|
|
|
} |
|
|
|
const { data, code, msg, internalMsg } = await requestPost(url, this.formData) |
|
|
|
if (code === 0) { |
|
|
|
@ -270,7 +299,7 @@ export default { |
|
|
|
}, |
|
|
|
resetData () { |
|
|
|
this.formData = { |
|
|
|
serviceType: '', |
|
|
|
serviceType: 0, |
|
|
|
gridId: '', |
|
|
|
applicantAddress: '', |
|
|
|
applicantName: '', |
|
|
|
@ -309,7 +338,7 @@ export default { |
|
|
|
applicantAddress: [ |
|
|
|
{ required: true, message: '住址不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
applicantName: [ |
|
|
|
applicantId: [ |
|
|
|
{ required: true, message: '申请人不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
serviceContent: [ |
|
|
|
|