You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1032 lines
30 KiB
1032 lines
30 KiB
<template>
|
|
<div>
|
|
<div
|
|
class="dialog-h-content scroll-h"
|
|
:class="{ 'visiual-form': source === 'visiual' }"
|
|
>
|
|
<el-form
|
|
v-if="formType === 'add' || formType === 'edit'"
|
|
ref="ref_form"
|
|
:inline="true"
|
|
:model="formData"
|
|
:rules="dataRule"
|
|
class="div_form"
|
|
>
|
|
<el-form-item label="服务类别" prop="categoryCode" label-width="150px">
|
|
<el-cascader
|
|
v-model="formData.categoryCode"
|
|
:options="demandOptions"
|
|
:props="{label: 'categoryName',value: 'categoryCode',children: 'childCateList'}"
|
|
clearable
|
|
size="small"
|
|
class="u-item-width-normal"
|
|
></el-cascader>
|
|
</el-form-item>
|
|
<el-form-item
|
|
label="服务事项"
|
|
prop="serviceName"
|
|
label-width="150px"
|
|
:class="{ 'form-item': source === 'visiual' }"
|
|
style="display: block"
|
|
>
|
|
<el-input
|
|
class="item_width_1"
|
|
placeholder="请输入服务事项"
|
|
v-model="formData.serviceName"
|
|
>
|
|
</el-input>
|
|
</el-form-item>
|
|
|
|
<el-form-item
|
|
label="服务内容"
|
|
prop="remark"
|
|
label-width="150px"
|
|
:class="{ 'form-item': source === 'visiual' }"
|
|
style="display: block"
|
|
>
|
|
<el-input
|
|
class="item_width_1"
|
|
type="textarea"
|
|
maxlength="1000"
|
|
show-word-limit
|
|
:rows="3"
|
|
placeholder="请输入备注,不超过1000字"
|
|
v-model="formData.remark"
|
|
></el-input>
|
|
</el-form-item>
|
|
<el-form-item
|
|
label="查找享受服务人员"
|
|
prop="resiSearchTagId"
|
|
:class="{ 'form-item': source === 'visiual' }"
|
|
label-width="150px"
|
|
style="display: block"
|
|
>
|
|
<input
|
|
type="text"
|
|
v-model="formData.resiSearchTagId"
|
|
v-show="false"
|
|
/>
|
|
<template
|
|
style="margin-right: 10px"
|
|
v-if="formData.resiSearchTagName"
|
|
>
|
|
<el-tag @close="handleCloseTag" closable style="margin-right: 10px">
|
|
{{ formData.resiSearchTagName }}
|
|
</el-tag>
|
|
</template>
|
|
|
|
<el-button type="primary" @click="handleClickLabel" size="mini">
|
|
<span> <i class="el-icon-plus"></i> 按标签查找 </span>
|
|
</el-button>
|
|
</el-form-item>
|
|
<el-form-item
|
|
label="服务组织"
|
|
prop="serviceOrgId"
|
|
label-width="150px"
|
|
:class="{ 'form-item': source === 'visiual' }"
|
|
style="display: block"
|
|
>
|
|
<el-select
|
|
v-model="formData.serviceOrgType"
|
|
class="input-width-small"
|
|
placeholder="请选择"
|
|
clearable
|
|
@change="handleServiceChange('add', $event)"
|
|
>
|
|
<el-option
|
|
v-for="item in serviceOptions"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
>
|
|
</el-option>
|
|
</el-select>
|
|
-
|
|
<el-select
|
|
v-model="formData.serviceOrgId"
|
|
class="input-width-middle"
|
|
filterable
|
|
placeholder="请选择"
|
|
clearable
|
|
>
|
|
<el-option
|
|
v-for="item in serviceOptiondList"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id"
|
|
>
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item
|
|
prop="noticeApproches"
|
|
label="自动通知服务组织"
|
|
label-width="150px"
|
|
style="display: block"
|
|
>
|
|
<el-checkbox-group v-model="formData.noticeApproches">
|
|
<el-checkbox label="sms" value="sms">短信通知</el-checkbox>
|
|
<el-checkbox label="wx_official_account" value="wx_official_account">微信公众号消息通知</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-form-item>
|
|
<el-form-item
|
|
label="服务范围"
|
|
prop="gridIdList"
|
|
label-width="150px"
|
|
:class="{ 'form-item': source === 'visiual' }"
|
|
style="display: block"
|
|
>
|
|
<el-cascader
|
|
class="item_width_1"
|
|
ref="myCascader"
|
|
v-model="scopeIdArray"
|
|
:key="iscascaderShow"
|
|
:options="casOptions"
|
|
:props="optionProps"
|
|
:show-all-levels="false"
|
|
collapse-tags
|
|
@change="handleChangeScope"
|
|
></el-cascader>
|
|
</el-form-item>
|
|
|
|
<el-form-item
|
|
label="服务时间"
|
|
label-width="150px"
|
|
:class="{ 'form-item': source === 'visiual' }"
|
|
prop="serviceTimeStart"
|
|
>
|
|
<el-date-picker
|
|
v-model="formData.serviceTimeStart"
|
|
:picker-options="startPickerOptions"
|
|
class="item_width_2"
|
|
style="width: 220px"
|
|
type="date"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
value="yyyy-MM-dd"
|
|
placeholder="开始时间"
|
|
>
|
|
</el-date-picker>
|
|
<span class="u-data-tag">至</span>
|
|
<el-date-picker
|
|
v-model="formData.serviceTimeEnd"
|
|
:picker-options="endPickerOptions"
|
|
class="item_width_2 u-data-tag"
|
|
style="width: 220px"
|
|
type="date"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
value="yyyy-MM-dd"
|
|
placeholder="结束时间"
|
|
>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
|
|
<el-form-item
|
|
label="经办人"
|
|
prop="principalName"
|
|
:class="{ 'form-item': source === 'visiual' }"
|
|
label-width="150px"
|
|
style="display: block"
|
|
>
|
|
<el-input
|
|
class="item_width_1"
|
|
placeholder="请输入联系人姓名"
|
|
v-model="formData.principalName"
|
|
>
|
|
</el-input>
|
|
</el-form-item>
|
|
<el-form-item
|
|
label="联系方式"
|
|
prop="principalContact"
|
|
:class="{ 'form-item': source === 'visiual' }"
|
|
label-width="150px"
|
|
style="display: block"
|
|
>
|
|
<el-input
|
|
class="item_width_1"
|
|
placeholder="请输入联系人电话"
|
|
v-model="formData.principalContact"
|
|
>
|
|
</el-input>
|
|
</el-form-item>
|
|
<el-form-item
|
|
label="直接反馈"
|
|
prop="remark"
|
|
label-width="150px"
|
|
:class="{ 'form-item': source === 'visiual' }"
|
|
style="display: block"
|
|
>
|
|
<el-checkbox
|
|
:label="'是'"
|
|
v-model="showFeedback"
|
|
@change="handleChangeFeedback"
|
|
></el-checkbox>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div v-show="formType === 'feedback' || showFeedback">
|
|
<!-- <h3 class="d-h3">反馈内容</h3> -->
|
|
|
|
<el-form
|
|
ref="ref_form_feedback"
|
|
:inline="true"
|
|
:model="feedbackFormData"
|
|
:rules="feedbackDataRule"
|
|
class="div_form"
|
|
>
|
|
<el-form-item
|
|
label="满意度"
|
|
style="display: block"
|
|
label-width="150px"
|
|
:class="{ 'form-item': source === 'visiual' }"
|
|
prop="satisfaction"
|
|
>
|
|
<el-select
|
|
class="item_width_2"
|
|
v-model="feedbackFormData.satisfaction"
|
|
placeholder="全部"
|
|
clearable
|
|
>
|
|
<el-option
|
|
v-for="item in satisfyArray"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
>
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item
|
|
label="备注"
|
|
prop="serviceGoal"
|
|
:class="{ 'form-item': source === 'visiual' }"
|
|
label-width="150px"
|
|
style="display: block"
|
|
>
|
|
<el-input
|
|
class="item_width_1"
|
|
type="textarea"
|
|
maxlength="1000"
|
|
show-word-limit
|
|
:rows="3"
|
|
v-model="feedbackFormData.serviceGoal"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="div_btn">
|
|
<el-button size="small" @click="handleCancle">取 消</el-button>
|
|
<el-button
|
|
size="small"
|
|
type="primary"
|
|
:disabled="btnDisable"
|
|
@click="handleComfirm"
|
|
>确 定</el-button
|
|
>
|
|
</div>
|
|
|
|
<el-dialog
|
|
v-if="showLabelForm"
|
|
:visible.sync="showLabelForm"
|
|
:append-to-body="true"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
:title="'标签配置'"
|
|
width="954px"
|
|
top="5vh"
|
|
class="dialog-h"
|
|
@closed="showLabelForm = false"
|
|
>
|
|
<label-form
|
|
ref="ref_label_form"
|
|
:ruleList="ruleList"
|
|
@dialogCancle="addFormCancle"
|
|
@dialogOk="addFormOk"
|
|
>
|
|
<!-- @handleOk="handleOk"
|
|
@handleClose="handleClose" -->
|
|
</label-form>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { mapGetters } from "vuex";
|
|
import { Loading } from "element-ui"; // 引入Loading服务
|
|
import { requestPost, requestGet } from "@/js/dai/request";
|
|
// import personList from "../policy/oldPersonList.vue";
|
|
import nextTick from "dai-js/tools/nextTick";
|
|
import labelForm from "../labelConfig/addForm.vue";
|
|
import daiMap from "@/utils/dai-map";
|
|
|
|
let loading; // 加载动画
|
|
let map;
|
|
|
|
export default {
|
|
props: {
|
|
defaultData: {
|
|
type: Object,
|
|
default: null,
|
|
},
|
|
serviceRecordId: {
|
|
type: String,
|
|
required: "",
|
|
},
|
|
serviceProjectName: {
|
|
//服务项目名称
|
|
type: String,
|
|
required: false,
|
|
default: "",
|
|
},
|
|
formType: {
|
|
//表单操作类型 add新增,edit编辑,detail详情,feedback反馈
|
|
type: String,
|
|
required: "",
|
|
},
|
|
categrayArray: {
|
|
type: Array,
|
|
default() {
|
|
return [];
|
|
},
|
|
},
|
|
source: {
|
|
//展示来源:manage 管理平台 visiual 可视化平台
|
|
type: String,
|
|
default: "manage",
|
|
},
|
|
},
|
|
|
|
data() {
|
|
let endDisabledDate = (time) => {
|
|
//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键
|
|
let nowData = Date.now();
|
|
if (this.formData.serviceTimeStart) {
|
|
let serviceTimeStart = new Date(this.formData.serviceTimeStart);
|
|
return (
|
|
time.getTime() < serviceTimeStart- 24 * 60 * 60 * 1000 ||
|
|
time.getTime() === serviceTimeStart- 24 * 60 * 60 * 1000
|
|
);
|
|
} else {
|
|
return (time.getTime() > nowData || time.getTime() === nowData) ;
|
|
}
|
|
};
|
|
let startDisabledDate = (time) => {
|
|
//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键
|
|
let nowData = Date.now() - 24 * 60 * 60 * 1000;
|
|
return time.getTime() < nowData;
|
|
};
|
|
return {
|
|
btnDisable: false,
|
|
casOptions: [],
|
|
scopeIdArray: [],
|
|
iscascaderShow: 0,
|
|
|
|
optionProps: {
|
|
multiple: true,
|
|
value: "objectId",
|
|
label: "objectName",
|
|
children: "children",
|
|
checkStrictly: true,
|
|
emitPath: false,
|
|
},
|
|
|
|
keyWords: "",
|
|
formData: {
|
|
categoryCode:[],
|
|
parentCategoryCode:'',
|
|
resiSearchTagId: "", //查找享受服务人员
|
|
resiSearchTagName: "", //享受服务人员名称
|
|
serviceName: "", //服务事项
|
|
noticeApproches: [], //通知服务组织
|
|
policyId: "", //政策依据
|
|
serviceOrgType: "", //服务组织类型 社区自组织:community_org, 志愿者:ic_user_volunteer, 联建单位:party_unit
|
|
serviceOrgId: "", //服务组织Id
|
|
gridIdList: [], //
|
|
principalName: "", //经办人(责任人)姓名
|
|
principalContact: "", //经办人联系方式
|
|
serviceTimeStart: "", //服务起始时间yyyy-MM-dd
|
|
serviceTimeEnd: "", //服务截止时间yyyy-MM-dd
|
|
remark: "", //
|
|
},
|
|
feedbackFormData: {
|
|
serviceGoal: "", // 服务目标
|
|
serviceEffect: "", // 服务效果
|
|
servicePeopleNumber: null, // 服务人数
|
|
serviceStatus: "completed", // 服务状态。in_service服务中;completed:已完成
|
|
satisfaction: "", //满意度。不满意:bad、基本满意:good、非常满意:perfect
|
|
longitude: "", // 经度
|
|
latitude: "", // 维度
|
|
address: "",
|
|
fileList: [], // 附件列表
|
|
},
|
|
sarr: [],
|
|
dataRule: {
|
|
categoryCode: [
|
|
{ required: true, message: "服务类别不能为空", trigger: "change" },
|
|
],
|
|
serviceName: [
|
|
{ required: true, message: "服务事项不能为空", trigger: "change" },
|
|
],
|
|
serviceOrgId: [
|
|
{ required: true, message: "服务组织不能为空", trigger: "change" },
|
|
],
|
|
|
|
serviceTimeStart: [
|
|
{ required: true, message: "服务时间不能为空", trigger: "change" },
|
|
],
|
|
gridIdList: [
|
|
{ required: true, message: "服务范围不能为空", trigger: "change" },
|
|
],
|
|
resiSearchTagId: [
|
|
{ required: true, message: "享受服务人员不能为空", trigger: "blur" },
|
|
],
|
|
},
|
|
|
|
endPickerOptions: {
|
|
disabledDate: endDisabledDate,
|
|
},
|
|
startPickerOptions: {
|
|
disabledDate: startDisabledDate,
|
|
},
|
|
|
|
serviceOptions: [],
|
|
serviceOptiondList: [],
|
|
policyList: [],
|
|
|
|
fileList: [],
|
|
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile",
|
|
|
|
showPersonList: false,
|
|
ruleList: [],
|
|
firstInitMap: true,
|
|
|
|
categrayOptions: [],
|
|
statusArray: [
|
|
{
|
|
value: "in_service",
|
|
label: "进行中",
|
|
},
|
|
{
|
|
value: "completed",
|
|
label: "已完成",
|
|
},
|
|
],
|
|
satisfyArray: [
|
|
{
|
|
value: "bad",
|
|
label: "不满意",
|
|
},
|
|
{
|
|
value: "good",
|
|
label: "基本满意",
|
|
},
|
|
{
|
|
value: "perfect",
|
|
label: "非常满意",
|
|
},
|
|
],
|
|
showLabelForm: false,
|
|
showFeedback: false,
|
|
demandOptions:[]
|
|
};
|
|
},
|
|
|
|
computed: {
|
|
feedbackDataRule() {
|
|
return {
|
|
serviceEffect: [
|
|
{ required: true, message: "服务效果不能为空", trigger: "blur" },
|
|
],
|
|
servicePeopleNumber: [
|
|
{ required: true, message: "服务人数不能为空", trigger: "blur" },
|
|
],
|
|
serviceStatus: [
|
|
{ required: true, message: "服务状态不能为空", trigger: "blur" },
|
|
],
|
|
satisfaction: [
|
|
{ required: true, message: "满意度不能为空", trigger: "blur" },
|
|
],
|
|
address: [{ required: true, message: "地址不能为空", trigger: "blur" }],
|
|
};
|
|
},
|
|
},
|
|
|
|
watch: {
|
|
"formData.serviceTimeEnd": function (val) {
|
|
if (val && val != "") {
|
|
let arrayTemp = val.split(" ");
|
|
this.formData.serviceTimeEnd = arrayTemp[0] + " 23:59:59";
|
|
}
|
|
},
|
|
},
|
|
|
|
components: { labelForm },
|
|
|
|
async mounted() {
|
|
this.startLoading();
|
|
// 都已经重置了,还放在prop里干嘛,我不理解
|
|
this.categrayOptions = this.categrayArray;
|
|
|
|
// this.getCategrayList();
|
|
this.getDictOptions();
|
|
this.getPolicyList();
|
|
await this.loadScopeTree();
|
|
if (this.formType === "add") {
|
|
this.$refs.ref_form.resetFields();
|
|
} else if (this.formType == "edit") {
|
|
this.loadInfo();
|
|
}
|
|
await this.getDemandOptions()
|
|
await this.iniDefaultData();
|
|
|
|
this.endLoading();
|
|
// 服务分类下拉(其实是获取的共性服务分类)
|
|
},
|
|
|
|
methods: {
|
|
handelDisabledRules(v) {
|
|
if (!v) {
|
|
delete this.dataRule.resiSearchTagId;
|
|
} else {
|
|
var arr = [
|
|
{
|
|
required: true,
|
|
message: "享受服务人员不能为空",
|
|
trigger: "change",
|
|
},
|
|
];
|
|
this.dataRule.resiSearchTagId = arr;
|
|
}
|
|
console.log(this.dataRule);
|
|
},
|
|
async getDemandOptions() {
|
|
this.$http
|
|
.post("/actual/base/serviceitem/listAllCategory")
|
|
.then(({ data: res }) => {
|
|
if (res.code !== 0) {
|
|
return this.$message.error(res.msg);
|
|
} else {
|
|
this.demandOptions = this.getFlagData(
|
|
this.getTreeData(res.data),
|
|
"usableFlag"
|
|
).filter((item) => item.categoryCode == '1038' ||item.categoryCode == '1039'||item.categoryCode == '1041');
|
|
}
|
|
})
|
|
.catch(() => {
|
|
return this.$message.error("网络错误");
|
|
});
|
|
},
|
|
getFlagData(data, flag) {
|
|
if (!Array.isArray(data)) return [];
|
|
let arr1 = data.filter((item) => item[flag]);
|
|
let arr2 = arr1.map((item) => {
|
|
if (item.childCateList)
|
|
return { ...item, childCateList: this.getFlagData(item.childCateList, flag) };
|
|
else return item;
|
|
});
|
|
// console.log('arrr-oppp', arr2)
|
|
return arr2;
|
|
},
|
|
getTreeData(data) {
|
|
if (!Array.isArray(data)) return [];
|
|
let arr = data.map((item) => {
|
|
let _item = {};
|
|
if (item.childCateList) {
|
|
if (item.childCateList.length === 0)
|
|
_item = { ...item, childCateList: undefined };
|
|
else _item = { ...item, childCateList: this.getTreeData(item.childCateList) };
|
|
} else {
|
|
_item = { ...item };
|
|
}
|
|
return _item;
|
|
});
|
|
return arr;
|
|
},
|
|
//获取服务详情数据
|
|
async loadInfo() {
|
|
const url = "/governance/icServiceRecordV2/detail";
|
|
let params = {
|
|
serviceRecordId: this.serviceRecordId,
|
|
};
|
|
|
|
const { data, code, msg } = await requestPost(url, params);
|
|
|
|
if (code === 0) {
|
|
this.formData = { ...data };
|
|
if (data.categoryCode) {
|
|
this.formData.categoryCode = [data.parentCategoryCode, data.categoryCode];
|
|
} else {
|
|
this.formData.categoryCode = [data.parentCategoryCode];
|
|
}
|
|
if(!data.noticeApproches){
|
|
this.formData.noticeApproches = [];
|
|
}
|
|
this.scopeIdArray = data.gridIdList.map(i => i.objectId);
|
|
this.feedbackFormData = { ...data.feedback };
|
|
await this.getServiceuserList(data.serviceOrgType);
|
|
|
|
await this.getTagName();
|
|
// this.fileList = []
|
|
// if (data.feedback && data.feedback.fileList && data.feedback.fileList.length > 0) {
|
|
// data.feedback.fileList.forEach(element => {
|
|
// let obj = {
|
|
// name: element.name,
|
|
// format: element.format,
|
|
// url: element.url,
|
|
// }
|
|
// this.fileList.push(obj)
|
|
// });
|
|
// }
|
|
} else {
|
|
this.$message.error(msg);
|
|
}
|
|
},
|
|
async getTagName() {
|
|
const url = "/governance/resiSearchTag/listResiSearchTags";
|
|
let params = {
|
|
pageSize: 99,
|
|
};
|
|
let { data, msg, code } = await requestPost(url, params);
|
|
if (code == 0) {
|
|
let showAddProduct = data.list.filter((item) => {
|
|
return [this.formData.resiSearchTagId].includes(item.tagId);
|
|
});
|
|
this.formData.resiSearchTagName = showAddProduct[0].tagName;
|
|
} else {
|
|
this.$message.error(msg);
|
|
}
|
|
},
|
|
handleClickLabel() {
|
|
this.showLabelForm = true;
|
|
this.$nextTick(() => {
|
|
this.$refs["ref_label_form"].initForm("info");
|
|
});
|
|
},
|
|
addFormOk(val) {
|
|
this.showLabelForm = false;
|
|
this.formData.resiSearchTagId = val.tagId;
|
|
this.formData.resiSearchTagName = val.tagName;
|
|
},
|
|
addFormCancle() {
|
|
this.showLabelForm = false;
|
|
},
|
|
handleCloseTag() {
|
|
this.formData.resiSearchTagId = "";
|
|
this.formData.resiSearchTagName = "";
|
|
},
|
|
getLastItem(list, vals, key) {
|
|
let LIST = list || [];
|
|
for (let item of LIST) {
|
|
for (let i of vals) {
|
|
if (item[key] === i) {
|
|
this.sarr.push(item);
|
|
} else if (item["objectType"] == "district") {
|
|
this.getLastItem(item.children, vals, key);
|
|
} else {
|
|
this.getLastItem(item.children, vals, key);
|
|
}
|
|
}
|
|
}
|
|
},
|
|
async handleTreeList() {
|
|
const map = new Map();
|
|
await this.getLastItem(this.casOptions, this.scopeIdArray, "objectId");
|
|
let temp = [];
|
|
//递归出的数据会有重复,因为一个街道下面有两个社区的话就会循环push两遍,在这里去重
|
|
temp = this.sarr.filter(
|
|
(v) => !map.has(v.objectId) && map.set(v.objectId, 1)
|
|
);
|
|
for (let i in temp) {
|
|
this.scopeIdArray.push({
|
|
objectId: temp[i].objectId,
|
|
objectType: temp[i].objectType,
|
|
objectName: temp[i].objectName,
|
|
});
|
|
}
|
|
temp = [];
|
|
// 如果是编辑的话回填的数据会有数组字符串需要将不是对象属性的过滤掉
|
|
let arr = [];
|
|
// let isOk = false;
|
|
this.scopeIdArray.forEach((item) => {
|
|
if (typeof item != "string") {
|
|
arr.push(item);
|
|
}
|
|
});
|
|
return arr;
|
|
},
|
|
handleChangeFeedback(val) {
|
|
this.showFeedback = val;
|
|
|
|
// if (this.firstInitMap) {
|
|
// this.$nextTick(() => {
|
|
// this.initMap();
|
|
// });
|
|
// }
|
|
},
|
|
async iniDefaultData() {
|
|
const { defaultData } = this;
|
|
if (defaultData) {
|
|
const { serviceOrgType, serviceOrgId, scopeIdArray } = defaultData;
|
|
if (serviceOrgType) {
|
|
this.formData.serviceOrgType = serviceOrgType;
|
|
await this.getServiceuserList(serviceOrgType, "add_demand");
|
|
}
|
|
if (serviceOrgId) {
|
|
this.formData.serviceOrgId = serviceOrgId;
|
|
}
|
|
if (scopeIdArray) {
|
|
this.scopeIdArray = scopeIdArray;
|
|
await nextTick();
|
|
this.handleChangeScope();
|
|
}
|
|
}
|
|
},
|
|
|
|
handleClose() {
|
|
this.showPersonList = false;
|
|
},
|
|
handleOk() {
|
|
this.showPersonList = false;
|
|
},
|
|
|
|
async getPolicyList() {
|
|
const url = "/governance/policy/policyList";
|
|
|
|
let params = {};
|
|
|
|
const { data, code, msg } = await requestPost(url, params);
|
|
|
|
if (code === 0) {
|
|
this.policyList = data;
|
|
} else {
|
|
this.$message.error(msg);
|
|
}
|
|
},
|
|
|
|
async getDictOptions() {
|
|
this.$http
|
|
.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.serviceOptions = res.data.filter(item=>item.value == 'party_unit'||item.value == 'community_org'||item.value == 'publicWelfare');
|
|
}
|
|
})
|
|
.catch(() => {
|
|
return this.$message.error("网络错误");
|
|
});
|
|
},
|
|
|
|
// 字典
|
|
// async getCategrayList() {
|
|
// const url = "/sys/dict/data/dictlist";
|
|
|
|
// let params = {
|
|
// dictType: "ic_service_type",
|
|
// };
|
|
|
|
// const { data, code, msg } = await requestPost(url, params);
|
|
|
|
// if (code === 0) {
|
|
// this.categrayOptions = data;
|
|
// } else {
|
|
// this.$message.error(msg);
|
|
// }
|
|
// },
|
|
async handleServiceChange(type, val) {
|
|
if (val === "social_org") {
|
|
if (type === "add") await this.getServiceuserList(val);
|
|
else this.getServiceuserList(val);
|
|
} else this.getServiceuserList(val);
|
|
},
|
|
|
|
async getServiceuserList(serverOrgType) {
|
|
if (!serverOrgType) return false;
|
|
if (this.formData.categoryCode.length === 0) {
|
|
this.$message.error("请先选择服务类别!");
|
|
return;
|
|
}
|
|
const url = "/actual/base/serviceitem/listServerOrgNewTask";
|
|
let params = {
|
|
serverOrgCategoryCode: this.formData.categoryCode[1],
|
|
serverParentOrgCategoryCode:this.formData.categoryCode[0],
|
|
serverOrgType: serverOrgType,
|
|
};
|
|
let { data, code, msg } = await requestPost(url, params);
|
|
if (code == 0) {
|
|
this.serviceOptiondList = data;
|
|
} else if (code >= 8000) {
|
|
this.$message.error(msg);
|
|
}
|
|
},
|
|
|
|
// 获取服务范围树
|
|
async loadScopeTree() {
|
|
const url = "/gov/org/icServiceProject/service/serviceScopeTree";
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/isServiceProject/service/serviceScopeTree'
|
|
let params = {};
|
|
|
|
const { data, code, msg } = await requestPost(url, params);
|
|
|
|
if (code === 0) {
|
|
++this.iscascaderShow;
|
|
this.casOptions = [];
|
|
this.scopeIdArray = [];
|
|
this.casOptions.push(data);
|
|
} else {
|
|
this.$message.error(rspMsg);
|
|
}
|
|
},
|
|
|
|
handleChangeScope(value) {
|
|
this.formData.gridIdList = [];
|
|
let selArray = this.$refs["myCascader"].getCheckedNodes();
|
|
console.log("handleChangeScope", selArray);
|
|
selArray.forEach((element) => {
|
|
let obj = {
|
|
objectType: element.data.objectType,
|
|
objectId: element.data.objectId,
|
|
objectName: element.data.objectName,
|
|
};
|
|
this.formData.gridIdList.push(obj);
|
|
});
|
|
},
|
|
|
|
async handleComfirm() {
|
|
if (this.formType === "add") {
|
|
this.handleAdd();
|
|
} else if (this.formType === "feedback") {
|
|
this.handleFeedback();
|
|
} else if (this.formType === "edit") {
|
|
this.handleAdd();
|
|
}
|
|
},
|
|
|
|
async handleAdd() {
|
|
this.btnDisable = true;
|
|
setTimeout(() => {
|
|
this.btnDisable = false;
|
|
}, 10000);
|
|
this.formData.gridIdList = await this.handleTreeList();
|
|
this.$refs["ref_form"].validate((valid, messageObj) => {
|
|
if (!valid) {
|
|
app.util.validateRule(messageObj);
|
|
this.btnDisable = false;
|
|
} else {
|
|
var oDate1 = new Date(this.formData.serviceTimeStart);
|
|
var oDate2 = new Date(this.formData.serviceTimeEnd);
|
|
if (oDate1.getTime() > oDate2.getTime()) {
|
|
this.$message.error("服务截止时间必须大于服务开始时间");
|
|
return false;
|
|
}
|
|
this.addFuwu();
|
|
}
|
|
});
|
|
},
|
|
async handleFeedback() {
|
|
this.btnDisable = true;
|
|
setTimeout(() => {
|
|
this.btnDisable = false;
|
|
}, 10000);
|
|
|
|
this.$refs["ref_form_feedback"].validate((valid, messageObj) => {
|
|
if (!valid) {
|
|
app.util.validateRule(messageObj);
|
|
this.btnDisable = false;
|
|
} else {
|
|
this.addFeecback();
|
|
}
|
|
});
|
|
},
|
|
async addFeecback() {
|
|
// this.feedbackFormData.fileList = [];
|
|
// this.feedbackFormData.fileList = [...this.fileList];
|
|
this.feedbackFormData.serviceRecordId = this.serviceRecordId;
|
|
|
|
console.log(this.feedbackFormData);
|
|
|
|
const url = "/governance/icServiceFeedbackV2/add";
|
|
let params = {
|
|
...this.feedbackFormData,
|
|
};
|
|
|
|
const { data, code, msg } = await requestPost(url, params);
|
|
|
|
if (code === 0) {
|
|
this.$message.success("反馈成功");
|
|
this.resetData();
|
|
this.$emit("handleOk");
|
|
} else {
|
|
this.$message.error(msg);
|
|
}
|
|
},
|
|
async addFuwu() {
|
|
if (this.showFeedback) {
|
|
this.formData.feedback = { ...this.feedbackFormData };
|
|
} else {
|
|
this.formData.feedback = null;
|
|
}
|
|
let url = "";
|
|
if (this.formType != "edit") {
|
|
url = "/governance/icServiceRecordV2/searchAdd";
|
|
} else {
|
|
url = "/governance/icServiceRecordV2/searchUpdate";
|
|
}
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/governance/icServiceProject/service/initiate'
|
|
let params = {
|
|
categoryCode:this.formData.categoryCode[1]?this.formData.categoryCode[1]:'',
|
|
parentCategoryCode:this.formData.categoryCode[0],
|
|
resiSearchTagId: this.formData.resiSearchTagId,
|
|
resiSearchTagName: this.formData.resiSearchTagName,
|
|
serviceName: this.formData.serviceName,
|
|
noticeApproches: this.formData.noticeApproches,
|
|
policyId: this.formData.policyId,
|
|
serviceOrgType: this.formData.serviceOrgType,
|
|
serviceOrgId: this.formData.serviceOrgId,
|
|
objList: this.formData.gridIdList,
|
|
principalName: this.formData.principalName,
|
|
principalContact: this.formData.principalContact,
|
|
serviceTimeStart: this.formData.serviceTimeStart,
|
|
serviceTimeEnd: this.formData.serviceTimeEnd,
|
|
remark: this.formData.remark,
|
|
feedback:this.formData.feedback,
|
|
serviceRecordId:this.serviceRecordId
|
|
};
|
|
const { data, code, msg } = await requestPost(url, params);
|
|
if (code === 0) {
|
|
this.$message.success("发起成功");
|
|
this.resetData();
|
|
this.$emit("handleOk");
|
|
} else {
|
|
this.$message.error(msg);
|
|
}
|
|
},
|
|
|
|
handleCancle() {
|
|
this.resetData();
|
|
this.$emit("handleClose");
|
|
},
|
|
|
|
resetData() {
|
|
this.formData = {
|
|
categoryCode:[],
|
|
parentCategoryCode:'',
|
|
gridIdList: [], //
|
|
principalName: "", //经办人(责任人)姓名
|
|
principalContact: "", //经办人联系方式
|
|
serviceTimeStart: "", //服务起始时间yyyy-MM-dd
|
|
serviceTimeEnd: "", //服务截止时间yyyy-MM-dd
|
|
remark: "", //
|
|
};
|
|
this.feedbackFormData = {
|
|
serviceGoal: "", // 服务目标
|
|
serviceEffect: "", // 服务效果
|
|
servicePeopleNumber: null, // 服务人数
|
|
serviceStatus: "completed", // 服务状态。in_service服务中;completed:已完成
|
|
satisfaction: "", //满意度。不满意:bad、基本满意:good、非常满意:perfect
|
|
longitude: "", // 经度
|
|
latitude: "", // 维度
|
|
address: "",
|
|
fileList: [], // 附件列表
|
|
};
|
|
},
|
|
// 开启加载动画
|
|
startLoading() {
|
|
loading = Loading.service({
|
|
lock: true, // 是否锁定
|
|
text: "正在加载……", // 加载中需要显示的文字
|
|
background: "rgba(0,0,0,.7)", // 背景颜色
|
|
});
|
|
},
|
|
// 结束加载动画
|
|
endLoading() {
|
|
// clearTimeout(timer);
|
|
if (loading) {
|
|
loading.close();
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
@import "@/assets/scss/modules/management/form-main.scss";
|
|
@import "@/assets/scss/modules/visual/a_customize.scss";
|
|
|
|
.form-item::v-deep .el-form-item__label {
|
|
color: #fff;
|
|
}
|
|
.form-item {
|
|
.el-radio {
|
|
color: #fff;
|
|
}
|
|
|
|
.el-checkbox {
|
|
color: #fff;
|
|
}
|
|
}
|
|
</style>
|
|
|
|
|