|
|
|
@ -5,7 +5,19 @@ |
|
|
|
:model="formData" |
|
|
|
:rules="dataRule" |
|
|
|
label-width="100px"> |
|
|
|
<el-form-item label="需求内容" |
|
|
|
<el-form-item label="事件分类" |
|
|
|
label-width="150px" |
|
|
|
prop="categoryId"> |
|
|
|
<el-cascader class="cell-width-2" |
|
|
|
ref="myCascader" |
|
|
|
v-model="selCategoryArray" |
|
|
|
:key="iscascaderShow" |
|
|
|
:options="casOptions" |
|
|
|
:props="optionProps" |
|
|
|
:show-all-levels="false" |
|
|
|
@change="handleChangeCate"></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="服务内容" |
|
|
|
label-width="150px" |
|
|
|
prop="content"> |
|
|
|
<el-input v-model="formData.content" |
|
|
|
@ -16,7 +28,7 @@ |
|
|
|
placeholder="请输入内容"></el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="需求类型" |
|
|
|
<el-form-item label="服务类型" |
|
|
|
label-width="150px" |
|
|
|
prop="categoryCode"> |
|
|
|
|
|
|
|
@ -40,7 +52,7 @@ |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="需求人" |
|
|
|
<el-form-item label="服务人" |
|
|
|
label-width="150px" |
|
|
|
prop="demandUserName"> |
|
|
|
<el-input v-model="formData.demandUserName" |
|
|
|
@ -165,19 +177,19 @@ var geocoder // 新建一个正逆地址解析类 |
|
|
|
|
|
|
|
function iniFmData () { |
|
|
|
return { |
|
|
|
operationType: '2',//处理方式[0:已回复 1:已转项目 2:已转需求] |
|
|
|
operationType: '2',//处理方式[0:已回复 1:已转项目 2:已转服务] |
|
|
|
icEventId: '',//事件Id |
|
|
|
gridId: '',// |
|
|
|
categoryCode: '',// 二级需求分类编码 |
|
|
|
parentCode: '',// 父级需求分类编码 |
|
|
|
content: '',// 需求内容1000字 |
|
|
|
categoryCode: '',// 二级服务分类编码 |
|
|
|
parentCode: '',// 父级服务分类编码 |
|
|
|
content: '',// 服务内容1000字 |
|
|
|
reportType: 'self_help',// 社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help |
|
|
|
reportUserName: '',// 上报人姓名 |
|
|
|
reportUserMobile: '',// 自身上报时存储注册居民的手机号 |
|
|
|
reportTime: '',// 上报时间 |
|
|
|
demandUserId: '',// 需求人:user.id或者ic_resi_user.id |
|
|
|
demandUserName: '',// 需求人姓名 |
|
|
|
demandUserMobile: '',//需求人联系电话 |
|
|
|
demandUserId: '',// 服务人:user.id或者ic_resi_user.id |
|
|
|
demandUserName: '',// 服务人姓名 |
|
|
|
demandUserMobile: '',//服务人联系电话 |
|
|
|
wantServiceTime: '',// 希望服务时间 |
|
|
|
serviceType: '', |
|
|
|
serverId: '', |
|
|
|
@ -185,6 +197,7 @@ function iniFmData () { |
|
|
|
serviceLocation: '',//事件地址 |
|
|
|
latitude: '',// 经度 |
|
|
|
longitude: '',//维度 |
|
|
|
categoryId: '' |
|
|
|
}; |
|
|
|
} |
|
|
|
export default { |
|
|
|
@ -213,6 +226,17 @@ export default { |
|
|
|
], |
|
|
|
serviceOptiondList: [], |
|
|
|
|
|
|
|
casOptions: [], |
|
|
|
iscascaderShow: 0, |
|
|
|
selCategoryArray: [], |
|
|
|
selCateObj: {}, |
|
|
|
optionProps: { |
|
|
|
multiple: false, |
|
|
|
value: 'id', |
|
|
|
label: 'name', |
|
|
|
children: 'subCategory', |
|
|
|
}, |
|
|
|
|
|
|
|
formData: iniFmData(), |
|
|
|
formDataTemp: { |
|
|
|
icEventId: "", |
|
|
|
@ -251,17 +275,20 @@ export default { |
|
|
|
dataRule () { |
|
|
|
|
|
|
|
return { |
|
|
|
categoryId: [ |
|
|
|
{ required: true, message: "请填写事件分类", trigger: "blur" }, |
|
|
|
], |
|
|
|
content: [ |
|
|
|
{ required: true, message: "需求内容不能为空", trigger: "blur" }, |
|
|
|
{ required: true, message: "服务内容不能为空", trigger: "blur" }, |
|
|
|
], |
|
|
|
categoryCode: [ |
|
|
|
{ required: true, message: "需求类型不能为空", trigger: "blur" }, |
|
|
|
{ required: true, message: "服务类型不能为空", trigger: "blur" }, |
|
|
|
], |
|
|
|
wantServiceTime: [ |
|
|
|
{ required: true, message: "服务时间不能为空", trigger: "blur" }, |
|
|
|
], |
|
|
|
demandUserName: [ |
|
|
|
{ required: true, message: "需求人不能为空", trigger: "blur" }, |
|
|
|
{ required: true, message: "服务人不能为空", trigger: "blur" }, |
|
|
|
], |
|
|
|
demandUserMobile: [ |
|
|
|
{ required: true, message: "联系电话不能为空", trigger: "blur" }, |
|
|
|
@ -325,6 +352,7 @@ export default { |
|
|
|
async mounted () { |
|
|
|
const { user } = this.$store.state |
|
|
|
this.agencyId = user.agencyId |
|
|
|
this.getCategoryList(); |
|
|
|
this.getDemandOptions(); |
|
|
|
// this.formData = { ...this.formDataTemp } |
|
|
|
this.initMap() |
|
|
|
@ -343,11 +371,55 @@ export default { |
|
|
|
this.formData.demandUserId = this.demandUserId |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
async getCategoryList () { |
|
|
|
const url = "/gov/issue/issueprojectcategorydict/list" |
|
|
|
|
|
|
|
let params = {} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
|
|
|
|
let treeDataNew = this.filterTree(data) |
|
|
|
|
|
|
|
//组织级联数据 |
|
|
|
++this.iscascaderShow |
|
|
|
this.casOptions = [] |
|
|
|
|
|
|
|
|
|
|
|
this.casOptions = treeDataNew |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeCate () { |
|
|
|
console.log(this.$refs["myCascader"].getCheckedNodes()[0].data) |
|
|
|
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data |
|
|
|
this.formData.categoryId = this.selCateObj.id |
|
|
|
}, |
|
|
|
|
|
|
|
//重构树,去除网格 |
|
|
|
filterTree (arr) { |
|
|
|
let childs = arr |
|
|
|
for (let i = childs.length; i--; i > 0) { |
|
|
|
if (childs[i].subCategory) { |
|
|
|
if (childs[i].subCategory.length) { |
|
|
|
this.filterTree(childs[i].subCategory) |
|
|
|
} else { |
|
|
|
delete childs[i].subCategory |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return arr |
|
|
|
}, |
|
|
|
|
|
|
|
async getDemandOptions () { |
|
|
|
const url = "/heart/icresidemanddict/demandoption" |
|
|
|
let params = {} |
|
|
|
@ -404,6 +476,7 @@ export default { |
|
|
|
this.formData.categoryCode = val[1]; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleServiceChange (type, val) { |
|
|
|
if (val === "social_org") { |
|
|
|
if (type === "add") this.getServiceuserList(val, "add_demand"); |
|
|
|
|