Browse Source

公益岗还没有联调完,先提交改bug了

V1.0
mk 3 years ago
parent
commit
45cecafbb0
  1. 56
      src/views/components/resiForm.vue
  2. 708
      src/views/modules/shequzhili/welfare/addForm.vue
  3. 418
      src/views/modules/shequzhili/welfare/detailForm.vue
  4. 800
      src/views/modules/shequzhili/welfare/editForm.vue
  5. 708
      src/views/modules/shequzhili/welfare/welfare.vue

56
src/views/components/resiForm.vue

@ -1250,7 +1250,7 @@ export default {
created () {
this.getGridList()
this.getAllNation()
this.getAllDict()
this.setNewForm()
},
@ -1276,7 +1276,7 @@ export default {
await this.getHouseList()
await this.residentEduInfo(this.form.resiId)
},
getAllNation(){
getAllDict(){
//
this.getDictList()
//
@ -1284,21 +1284,21 @@ export default {
//
this.getEducation()
//
this.getdisabilityNation()
this.getdisabilityNationClass()
this.getillnessNation()
this.getchronicNation()
this.getHouseholdNation()
this.getMarriageNation()
this.getResideNation()
this.getSpouseNation()
this.getdisabilityDict()
this.getdisabilityDictClass()
this.getillnessDict()
this.getchronicDict()
this.getHouseholdDict()
this.getMarriageDict()
this.getResideDict()
this.getSpouseDict()
this.getBranchlist()
this.getPartyNation()
this.getResidentNation()
this.getPartyDict()
this.getResidentDict()
this.getHousing()
this.getVolunteerNation()
this.gethobbyNation()
this.getWelfareNation()
this.getVolunteerDict()
this.gethobbyDict()
this.getWelfareDict()
},
getGridList () {
const { user } = this.$store.state
@ -1329,7 +1329,7 @@ export default {
handelminzu(val){
this.newForm.nation = val
},
async getdisabilityNation(){
async getdisabilityDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'disability_category_code'})
this.footerInputList.forEach(c => {
@ -1346,7 +1346,7 @@ export default {
}
},
async getVolunteerNation(){
async getVolunteerDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'VOLUNTEER_CATEGORY'})
this.footerInputList.forEach(c => {
@ -1362,7 +1362,7 @@ export default {
}
},
async gethobbyNation(){
async gethobbyDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'SPECIAL_SKILL'})
this.footerInputList.forEach(c => {
@ -1378,7 +1378,7 @@ export default {
}
},
async getdisabilityNationClass(){
async getdisabilityDictClass(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'disability_level'})
this.footerInputList.forEach(c => {
@ -1395,7 +1395,7 @@ export default {
}
},
async getillnessNation(){
async getillnessDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'illness_code'})
this.footerInputList.forEach(c => {
@ -1410,7 +1410,7 @@ export default {
console.log(error,'获取所患大病字典');
}
},
async getchronicNation(){
async getchronicDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'chronic_disease_code'})
this.footerInputList.forEach(c => {
@ -1425,7 +1425,7 @@ export default {
console.log(error,'获取所患慢病字典');
}
},
async getWelfareNation(){
async getWelfareDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'welfare_post'})
this.footerInputList.forEach(c => {
@ -1440,7 +1440,7 @@ export default {
console.log(error,'获取公益岗位字典');
}
},
async getHouseholdNation(){
async getHouseholdDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'household_situation'})
this.footerInputList.forEach(c => {
@ -1455,7 +1455,7 @@ export default {
console.log(error,'获取人户状况字典');
}
},
async getMarriageNation(){
async getMarriageDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'marriage'})
this.footerInputList.forEach(c => {
@ -1470,7 +1470,7 @@ export default {
console.log(error,'获取婚姻状况字典');
}
},
async getResideNation(){
async getResideDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'reside_situation'})
this.footerInputList.forEach(c => {
@ -1485,7 +1485,7 @@ export default {
console.log(error,'获取居住情况字典');
}
},
async getSpouseNation(){
async getSpouseDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'spouse_situation'})
this.footerInputList.forEach(c => {
@ -1500,7 +1500,7 @@ export default {
console.log(error,'获取配偶情况字典');
}
},
async getResidentNation(){
async getResidentDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'special_resident_category'})
console.log(data.data,'see');
@ -1516,7 +1516,7 @@ export default {
console.log(error,'获取配偶情况字典');
}
},
async getPartyNation(){
async getPartyDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'party_job'})
this.footerInputList.forEach(c => {

708
src/views/modules/shequzhili/welfare/addForm.vue

@ -0,0 +1,708 @@
<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="姓名"
style="display: block"
label-width="150px"
prop="name"
>
<el-input
class="input-width-small"
placeholder="请输入姓名"
v-model="formData.name"
>
</el-input>
</el-form-item>
<el-form-item
label="性别"
prop="gender"
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
style="display: block"
>
<el-select
v-model="formData.gender"
class="input-width-small"
placeholder="请选择"
clearable
>
<el-option
v-for="item in genderArr"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="出生日期"
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
prop="birthday"
>
<el-date-picker
v-model="formData.birthday"
class="item_width_2"
style="width: 220px"
type="date"
value-format="yyyy-MM-dd"
value="yyyy-MM-dd"
placeholder="出生日期"
>
</el-date-picker>
</el-form-item>
<el-form-item
label="民族"
prop="nation"
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
style="display: block"
>
<el-select
v-model="formData.nation"
class="input-width-small"
placeholder="请选择"
clearable
>
<el-option
v-for="item in nationArr"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="证件号"
style="display: block"
label-width="150px"
prop="idCard"
>
<el-input
class="input-width-small"
placeholder="请输入证件号"
v-model="formData.idCard"
>
</el-input>
</el-form-item>
<el-form-item
label="联系电话"
style="display: block"
label-width="150px"
prop="phone"
>
<el-input
class="input-width-small"
placeholder="请输入联系电话"
v-model="formData.phone"
>
</el-input>
</el-form-item>
<el-form-item label="文化程度" prop="eduLevel">
<el-select
class="u-item-width-normal"
v-model="formData.eduLevel"
placeholder="全部"
size="small"
clearable
>
<el-option
v-for="item in eduArray"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="政策依据"
prop="policyId"
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
style="display: block"
>
<el-select
v-model="formData.policyId"
class="input-width-small"
placeholder="请选择"
clearable
>
<el-option
v-for="item in policyList"
:key="item.policyId"
:label="item.title"
:value="item.policyId"
>
</el-option>
</el-select>
<!-- <el-button
style="margin-left: 10px"
type="primary"
size="small"
@click="handlePersonList"
>预览</el-button
> -->
</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="指派服务" label-width="150px">
<el-switch
v-model="formData.assignSwitch"
@change="handelDisabledRules"
>
</el-switch>
</el-form-item>
<el-form-item
label="查找享受服务人员"
prop="resiSearchTagId"
:class="{ 'form-item': source === 'visiual' }"
label-width="150px"
style="display: block"
v-if="formData.assignSwitch"
>
<input
type="text"
v-model="formData.resiSearchTagId"
v-show="false"
/>
<template 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
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>
<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>
</div>
</template>
<script>
import { Loading } from "element-ui"; // Loading
import { requestPost, requestGet } from "@/js/dai/request";
// import personList from "../policy/personList";
import nextTick from "dai-js/tools/nextTick";
// import labelForm from "../labelConfig/addForm.vue";
import { computedCard } from '@/utils/index'
let loading; //
let map;
export default {
props: {
serviceRecordId: {
type: String,
required: "",
},
serviceCategoryKey: {
type: String,
required: "",
},
formType: {
// addeditdetail,feedback
type: String,
required: "",
},
source: {
//manage visiual
type: String,
default: "manage",
},
},
data() {
let endDisabledDate = (time) => {
//datareturn
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) => {
//datareturn
let nowData = Date.now() - 24 * 60 * 60 * 1000;
return time.getTime() < nowData;
};
return {
//
serviceTypesLevel1: [],
serviceTypesLevel2: [],
btnDisable: false,
casOptions: [],
scopeIdArray: [],
iscascaderShow: 0,
optionProps: {
multiple: true,
value: "objectId",
label: "objectName",
children: "children",
checkStrictly: true,
emitPath: false,
},
formData: {
},
genderArr:[
{label:'男',value:'1'},
{label:'女',value:'2'},
],
nationArr:[],
// endPickerOptions: {
// disabledDate: endDisabledDate,
// },
// startPickerOptions: {
// disabledDate: startDisabledDate,
// },
showFeedback: false,
serviceOptions: [],
serviceOptiondList: [],
policyList: [],
fileList: [],
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile",
policyId: "",
showPersonList: false,
ruleList: [],
firstInitMap: true,
categrayOptions: [],
showLabelForm: false,
};
},
computed: {
dataRule() {
return {
// serviceTypeLevel2Id: [
// { required: true, message: "", trigger: "change" },
// ],
// serviceName: [
// { required: true, message: "", trigger: "change" },
// ],
// serviceOrgId: [
// { required: true, message: "", trigger: "change" },
// ],
// serviceTimeStart: [
// { required: true, message: "", trigger: "change" },
// ],
// objList: [
// { required: true, message: "", trigger: "change" },
// ],
// resiSearchTagId: [
// {
// required: true,
// message: "",
// trigger: "change",
// },
// ],
};
},
},
watch: {
},
components: {},
async mounted() {
this.startLoading();
// prop
this.getDictOptions();
if (this.formType === "add") {
// await this.loadScopeTree();
} else {
}
this.endLoading();
//
},
methods: {
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 = "";
},
//
async handlePersonList() {
if (!this.formData.policyId) {
this.$message.info("请先选择政策");
return false;
}
this.policyId = this.formData.policyId;
await this.loadRuleList();
this.showPersonList = true;
},
async loadRuleList() {
const url = "/governance/policy/rulelist/" + this.policyId;
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.ruleList = data;
} else {
this.$message.error(msg);
}
},
handleClose() {
this.showPersonList = false;
},
handleOk() {
this.showPersonList = false;
},
//
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;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
//
async getServiceuserList(serverOrgType) {
const url = "/actual/base/serviceitem/listServerOrg";
let params = {
serviceTypeId: this.formData.serviceTypeLevel2Id,
serverOrgType: serverOrgType,
businessType: "common_service",
};
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
this.serviceOptiondList = data;
} else if (code >= 8000) {
this.$message.error(msg);
}
},
async handleComfirm() {
if (this.formType === "add") {
this.handleAdd();
} else if (this.formType === "feedback") {
this.handleFeedback();
}
},
async handleAdd() {
this.btnDisable = true;
setTimeout(() => {
this.btnDisable = false;
}, 10000);
this.$refs["ref_form"].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj);
this.btnDisable = false;
} else {
this.addFuwu();
}
});
},
async addFuwu() {
console.log(this.formData);
// return false
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
if (
this.formData.principalContact &&
regPhone.test(this.formData.principalContact) === false
) {
this.btnDisable = false;
this.$message({
type: "warning",
message: "请输入正确的联系电话",
});
return false;
}
const url = "/governance/icServiceRecordV2/add";
// const url = 'http://yapi.elinkservice.cn/mock/245/governance/icServiceProject/service/initiate'
let params = {
...this.formData,
};
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 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);
// return false
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);
}
},
resetData() {
this.formData = {
serviceTypeLevel1Id: "", // id
serviceTypeLevel2Id: "", // id
objList: [], //
principalName: "", //()
principalContact: "", //
serviceTimeStart: "", //yyyy-MM-dd
serviceTimeEnd: "", //yyyy-MM-dd
remark: "", //
feedback: {}, //
};
this.feedbackFormData = {
serviceGoal: "", //
serviceEffect: "", //
servicePeopleNumber: null, //
serviceStatus: "completed", // in_servicecompleted:
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>

418
src/views/modules/shequzhili/welfare/detailForm.vue

@ -0,0 +1,418 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<div v-if="initLoading" class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">服务名称</span>
<span>{{ formData.serviceName || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务组织</span>
<span>{{ serviceOrgName || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务范围</span>
<span>{{ formData.gridIdListName || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">政策依据</span>
<span>{{ formData.policyTitle || "--" }}</span>
<!-- <el-button
v-if="formData.policyId"
style="margin-left: 10px"
type="primary"
size="small"
@click="handlePersonList"
>预览</el-button
> -->
</div>
<div class="info-prop">
<span class="info-title-2">经办人</span>
<span>{{ formData.principalName || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">联系方式</span>
<span>{{ formData.principalContact || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务时间</span>
<span>{{ formData.serviceTimeStart || "--" }}</span
>
<span>{{ formData.serviceTimeEnd || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">享受服务人员: </span>
<span>{{ resiSearchTagName }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务内容</span>
<span>{{ formData.remark || "--" }}</span>
</div>
<div v-show="formData.serviceStatus === 'completed'">
<h3 class="d-h3">反馈内容</h3>
<div class="info-prop">
<span class="info-title-2">备注</span>
<span>{{ feedbackFormData.serviceGoal || "--" }}</span>
</div>
<!-- <div class="info-prop">
<span class="info-title-2">服务效果</span>
<span>{{ feedbackFormData.serviceEffect || "--" }}</span>
</div> -->
<!-- <div class="info-prop">
<span class="info-title-2">服务人数</span>
<span>{{ feedbackFormData.servicePeopleNumber || 0 }}</span>
</div> -->
<div class="info-prop">
<span class="info-title-2">服务状态</span>
<span>{{ feedbackFormData.serviceStatusShow || "--" }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">满意度</span>
<span>{{ feedbackFormData.satisfactionShow || "--" }}</span>
</div>
<!-- <div class="info-prop">
<span class="info-title-2">地理位置</span>
<span>{{ feedbackFormData.address || "--" }}</span>
</div> -->
<!-- <div class="info-prop">
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
</div>
</div> -->
<!-- <div class="info-prop">
<span class="info-title-2">附件</span>
<file-list
v-if="fileList.length > 0"
:fileList="fileList"
></file-list>
<span v-else>--</span>
</div> -->
</div>
</div>
</div>
</div>
<div class="div-btn"></div>
<el-row type="flex" justify="right">
<el-col :span="24" align="right">
<el-button size="small" @click="handleCancle" style="margin-right: 16px"
> </el-button
>
</el-col>
</el-row>
<!-- <el-dialog
v-if="showPersonList"
:visible.sync="showPersonList"
:append-to-body="true"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'政策预览'"
width="1150px"
top="5vh"
class="dialog-h"
@closed="showPersonList = false"
>
<person-list
ref="ref_detail_form"
:policyId="policyId"
:ruleList="ruleList"
@handleOk="handleOk"
@handleClose="handleClose"
>
</person-list>
</el-dialog> -->
</div>
</template>
<script>
import { Loading } from "element-ui"; // Loading
import { requestPost } from "@/js/dai/request";
// import personList from "../policy/personList";
import fileList from "@/views/components/fileList";
import daiMap from "@/utils/dai-map";
var map;
let loading; //
export default {
data() {
return {
initLoading: false,
keyWords: "",
formData: {},
resiSearchTagName: "",
feedbackFormData: {
serviceProjectId: "", // id
serviceName: "",
serviceGoal: "", //
serviceEffect: "", //
servicePeopleNumber: null, //
serviceStatus: "completed", // in_servicecompleted:
satisfaction: "", //:bad:good:perfect
longitude: "", //
latitude: "", //
address: "",
fileList: [], //
},
policyId: "",
showPersonList: false,
ruleList: [],
policyList: [],
};
},
components: { fileList },
async mounted() {
await this.getPolicyList();
// if (this.serviceRecordId) {//
await this.loadInfo();
this.initLoading = true;
if (
this.formData.serviceStatus === "completed" &&
this.feedbackFormData.latitude
) {
this.$nextTick(() => {
this.initMap();
});
}
},
methods: {
diaDestroy() {},
//
async handlePersonList() {
if (!this.formData.policyId) {
this.$message.info("请先选择政策");
return false;
}
this.policyId = this.formData.policyId;
await this.loadRuleList();
this.showPersonList = true;
},
async loadRuleList() {
const url = "/governance/policy/rulelist/" + this.policyId;
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.ruleList = data;
} else {
this.$message.error(msg);
}
},
handleClose() {
this.showPersonList = false;
},
async getPolicyList() {
const url = "/governance/policy/policyListSelect";
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.policyList = data;
} else {
this.$message.error(msg);
}
},
//
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 };
this.formData.serviceRecordId = this.serviceRecordId;
this.feedbackFormData = { ...data.feedback };
this.formData.policyName = "";
this.formData.gridIdListName = "";
this.feedbackFormData.serviceStatusShow = "";
this.feedbackFormData.satisfactionShow = "";
await this.getTagName();
let arr = [];
this.formData.gridIdList.forEach((element) => {
arr.push(element.objectName);
});
this.formData.gridIdListName = arr.join(",");
this.statusArray.forEach((element) => {
if (this.formData.serviceStatus === element.value) {
this.feedbackFormData.serviceStatusShow = element.label;
}
});
// this.satisfyArray.forEach((element) => {
// if (this.feedbackFormData.satisfaction === element.value) {
// this.feedbackFormData.satisfactionShow = element.label;
// }
// });
this.policyList.forEach((element) => {
if (this.formData.policyId === element.policyId) {
this.formData.policyName = element.title;
}
});
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,
type: element.type,
};
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);
});
if (this.formData.resiSearchTagId) {
this.resiSearchTagName = showAddProduct[0].tagName;
} else {
this.resiSearchTagName = "--";
}
} else {
this.$message.error(msg);
}
},
handleCancle() {
this.resetData();
this.$emit("diaDetailClose");
},
// init
initMap() {
let { latitude, longitude } = this.feedbackFormData;
map = new daiMap(
document.getElementById("app_detail"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
},
handleOk() {
this.showPersonList = false;
},
resetData() {
this.formData = {};
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
background: "rgba(0,0,0,.7)", //
});
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
computed: {
dataRule() {
return {
serviceTimeStart: [
{ required: true, message: "服务时间不能为空", trigger: "blur" },
],
};
},
// resiSearchTagNameText(){
// let text = ""
// if(this.resiSearchTagName){
// text = this.resiSearchTagName
// }else {
// text = '--'
// }
// return text
// },
},
props: {
serviceRecordId: {
type: String,
required: true,
},
serviceOrgName: {
type: String,
required: true,
},
// satisfyArray: {
// type: Array,
// default() {
// return [];
// },
// },
statusArray: {
type: Array,
default() {
return [];
},
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/management/detail-main.scss";
.info-prop {
margin-top: 29px;
}
.scroll-h {
padding: 0 90px !important;
}
</style>

800
src/views/modules/shequzhili/welfare/editForm.vue

@ -0,0 +1,800 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form
ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
class="div_form"
>
<el-form-item
label="服务名称"
prop="serviceName"
label-width="150px"
style="display: block"
>
<span>{{ formData.serviceName }}</span>
<!-- <el-select class="item_width_1"
v-model="formData.serviceProjectId"
placeholder="请选择"
filterable
clearable>
<el-option v-for="(item,index) in projectList"
@click.native="hancleClickProject(index)"
:key="item.serviceProjectId"
:label="item.serviceName"
:value="item.serviceProjectId">
</el-option>
</el-select> -->
</el-form-item>
<el-form-item
label="服务组织"
prop="serviceOrgId"
label-width="150px"
style="display: block"
>
<span>{{ serviceOrgName }}</span>
<!-- <el-select class="item_width_1"
v-model="formData.serviceOrgId"
placeholder="请选择"
filterable
clearable>
<el-option v-for="item in orgList"
:key="item.icServiceOrgId"
:label="item.orgName"
:value="item.icServiceOrgId">
</el-option>
</el-select> -->
</el-form-item>
<el-form-item
label="服务范围"
prop="gridIdList"
label-width="150px"
style="display: block"
>
<div v-for="item in formData.gridIdList" :key="item.objectId">
<div>{{ item.objectName }}</div>
</div>
<!-- <el-cascader class="item_width_1"
ref="myCascader"
v-model="scopeIdArray"
:key="iscascaderShow"
:options="casOptions"
:props="optionProps"
:show-all-levels="false"
@change="handleChangeScope"></el-cascader> -->
</el-form-item>
<el-form-item
label="政策依据"
prop="policyId"
label-width="150px"
style="display: block"
>
<el-select
:disabled="formType === 'detail'"
v-model="formData.policyId"
class="input-width-small"
placeholder="请选择"
clearable
>
<el-option
v-for="item in policyList"
:key="item.policyId"
:label="item.title"
:value="item.policyId"
>
</el-option>
</el-select>
<!--
<el-button style="margin-left: 10px"
type="primary"
size="small"
@click="handlePersonList">预览</el-button> -->
</el-form-item>
<el-form-item
label="经办人"
prop="principalName"
label-width="150px"
style="display: block"
>
<el-input
:disabled="formType === 'detail'"
class="item_width_1"
placeholder="请输入经办人姓名"
v-model="formData.principalName"
>
</el-input>
</el-form-item>
<el-form-item
label="联系方式"
prop="principalContact"
label-width="150px"
style="display: block"
>
<el-input
:disabled="formType === 'detail'"
class="item_width_1"
placeholder="请输入联系方式"
v-model="formData.principalContact"
>
</el-input>
</el-form-item>
<el-form-item label="指派服务" label-width="150px">
<el-switch v-model="assignSwitch"> </el-switch>
</el-form-item>
<el-form-item
label="查找享受服务人员"
prop="resiSearchTagId"
label-width="150px"
style="display: block"
v-if="this.assignSwitch"
>
<input
type="text"
v-model="formData.resiSearchTagId"
v-show="false"
/>
<template v-if="this.resiSearchTagName">
<el-tag @close="handleCloseTag" closable style="margin-right: 10px">
{{ this.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="服务时间"
label-width="150px"
prop="serviceTimeStart"
style="display: block"
>
<el-date-picker
:disabled="formType === 'detail'"
v-model="formData.serviceTimeStart"
:picker-options="startPickerOptions"
class="item_width_2"
type="date"
value-format="yyyy-MM-dd"
value="yyyy-MM-dd"
placeholder="开始时间"
>
</el-date-picker>
<span class="u-data-tag"></span>
<el-date-picker
:disabled="formType === 'detail'"
v-model="formData.serviceTimeEnd"
:picker-options="endPickerOptions"
class="item_width_2 u-data-tag"
type="date"
value-format="yyyy-MM-dd"
value="yyyy-MM-dd"
placeholder="结束时间"
>
</el-date-picker>
</el-form-item>
<el-form-item
label="服务内容"
prop="remark"
label-width="150px"
style="display: block"
>
<el-input
:disabled="formType === 'detail'"
class="item_width_1"
type="textarea"
maxlength="500"
show-word-limit
:rows="3"
placeholder="请输入服务内容,不超过500字"
v-model="formData.remark"
></el-input>
</el-form-item>
</el-form>
<div v-show="formData.serviceStatus === 'completed'">
<h3 class="d-h3">反馈内容</h3>
<el-form
ref="ref_form_feedback"
:inline="true"
:disabled="true"
:model="feedbackFormData"
class="div_form"
>
<el-form-item
label="服务目标"
prop="serviceGoal"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:rows="3"
placeholder="请输入服务目标,不超过1000字"
v-model="feedbackFormData.serviceGoal"
></el-input>
</el-form-item>
<el-form-item
label="服务效果"
prop="serviceEffect"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:rows="3"
placeholder="请输入服务效果,不超过1000字"
v-model="feedbackFormData.serviceEffect"
></el-input>
</el-form-item>
<el-form-item
label="服务人数"
style="display: block"
prop="servicePeopleNumber"
label-width="150px"
>
<el-input-number
class="item_width_2"
v-model="feedbackFormData.servicePeopleNumber"
:min="0"
:max="9999"
label="服务人数"
></el-input-number>
</el-form-item>
<el-form-item
label="服务状态"
label-width="150px"
style="display: block"
prop="serviceStatus"
>
<span>已完成</span>
<!-- <el-select class="item_width_1"
v-model="feedbackFormData.serviceStatus"
placeholder="全部"
clearable>
<el-option v-for="item in statusArray"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> -->
</el-form-item>
<el-form-item
label="地址"
prop="address"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
v-model="feedbackFormData.address"
></el-input>
</el-form-item>
<el-form-item
class="block"
label="附件"
label-width="150px"
prop="attach"
>
<div
v-if="
feedbackFormData.fileList &&
feedbackFormData.fileList.length > 0
"
class="attachement-list"
>
<a
:href="att.url"
target="_blank"
:key="att.url"
v-for="att in feedbackFormData.fileList"
>
<i class="el-icon-folder-opened"></i>
{{ att.name }}
</a>
</div>
<span v-else>无附件</span>
</el-form-item>
</el-form>
</div>
</div>
<div class="div_btn">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button
size="small"
v-if="formType != 'detail'"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"
> </el-button
>
</div>
</div>
</template>
<script>
import { Loading } from "element-ui"; // Loading
import { requestPost } from "@/js/dai/request";
// import personList from "../policy/personList";
// import labelForm from "../labelConfig/addForm.vue";
import { nextTick } from "vue";
var map;
var search;
var markers;
var infoWindowList;
var geocoder; //
let loading; //
export default {
data() {
let endDisabledDate = (time) => {
//datareturn
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) => {
//datareturn
let nowData = Date.now() - 24 * 60 * 60 * 1000;
return time.getTime() < nowData;
};
return {
btnDisable: false,
keyWords: "",
assignSwitch: false,
formData: {},
resiSearchTagName: "",
feedbackFormData: {
serviceProjectId: "", // id
serviceName: "",
serviceGoal: "", //
serviceEffect: "", //
servicePeopleNumber: null, //
serviceStatus: "completed", // in_servicecompleted:
satisfaction: "", //:bad:good:perfect
longitude: "", //
latitude: "", //
address: "",
fileList: [], //
},
serviceList: [], //list
endPickerOptions: {
disabledDate: endDisabledDate,
},
startPickerOptions: {
disabledDate: startDisabledDate,
},
policyList: [],
projectList: [],
fileList: [],
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile",
policyId: "",
showPersonList: false,
ruleList: [],
};
},
components: { },
mounted() {
this.getPolicyList();
if (this.serviceRecordId) {
//
this.loadInfo();
}
// this.initMap()
},
methods: {
//
async handlePersonList() {
if (!this.formData.policyId) {
this.$message.info("请先选择政策");
return false;
}
this.policyId = this.formData.policyId;
await this.loadRuleList();
this.showPersonList = true;
},
async loadRuleList() {
const url = "/governance/policy/rulelist/" + this.policyId;
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.ruleList = data;
} else {
this.$message.error(msg);
}
},
handleClose() {
this.showPersonList = false;
},
handleOk() {
this.showPersonList = false;
},
handleClickLabel() {
this.showLabelForm = true;
this.$nextTick(() => {
this.$refs["ref_label_form"].initForm("info");
});
},
async getPolicyList() {
const url = "/governance/policy/policyListSelect";
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.policyList = data;
} else {
this.$message.error(msg);
}
},
//
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 };
this.formData.serviceRecordId = this.serviceRecordId;
this.feedbackFormData = { ...data.feedback };
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.resiSearchTagName = showAddProduct[0].tagName;
this.assignSwitch = this.resiSearchTagName ? true : false;
} else {
this.$message.error(msg);
}
},
async handleComfirm() {
this.btnDisable = true;
setTimeout(() => {
this.btnDisable = false;
}, 10000);
this.$refs["ref_form"].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj);
this.btnDisable = false;
} else {
this.editFuwu();
}
});
},
async editFuwu() {
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
if (
this.formData.principalContact &&
regPhone.test(this.formData.principalContact) === false
) {
this.btnDisable = false;
this.$message({
type: "warning",
message: "请输入正确的联系电话",
});
return false;
}
console.log(this.formData);
this.formData.resiSearchTagId = this.assignSwitch
? this.formData.resiSearchTagId
: "";
this.formData.resiSearchTagName = this.assignSwitch
? this.formData.resiSearchTagName
: "";
let url = "/governance/icServiceRecordV2/edit";
// let url = "http://yapi.elinkservice.cn/mock/245/governance/icServiceProject/service/update"
const { data, code, msg } = await requestPost(url, this.formData);
if (code === 0) {
this.$message({
type: "success",
message: "操作成功",
});
this.resetData();
this.$emit("handleOk");
} else {
this.btnDisable = false;
this.$message.error(msg);
}
},
handleCancle() {
this.resetData();
this.$emit("handleClose");
},
addFormOk(val) {
this.showLabelForm = false;
this.formData.resiSearchTagId = val.tagId;
this.resiSearchTagName = val.tagName;
},
addFormCancle() {
this.showLabelForm = false;
},
handleCloseTag() {
this.resiSearchTagName = "";
this.formData.resiSearchTagId = "";
},
//
handleFileDownload(file) {
var a = document.createElement("a");
var event = new MouseEvent("click");
a.download = file.name;
console.log(a);
a.href = file.url;
a.dispatchEvent(event);
},
// init
initMap() {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById("app"), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45, //
});
search = new window.TMap.service.Search({ pageSize: 10 });
//
markers = new TMap.MultiMarker({
map: map,
geometries: [],
});
infoWindowList = Array(10);
geocoder = new TMap.service.Geocoder(); //
//
map.on("panend", () => {
this.handleMoveCenter();
});
this.handleMoveCenter();
this.convert();
},
setMarker(lat, lng) {
markers.setGeometries([]);
markers.add([
{
id: "4",
styleId: "marker",
position: new TMap.LatLng(lat, lng),
properties: {
title: "marker4",
},
},
]);
},
handleSearchMap() {
infoWindowList.forEach((infoWindow) => {
infoWindow.close();
});
infoWindowList.length = 0;
markers.setGeometries([]);
//
search
.searchNearby({
keyword: this.keyWords,
radius: 1000,
autoExtend: true,
center: map.getCenter(),
})
.then((result) => {
let { data } = result;
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng },
} = data[0];
map.setCenter(new TMap.LatLng(lat, lng));
this.setMarker(lat, lng);
this.formData.latitude = lat;
this.formData.longitude = lng;
this.convert();
} else {
this.$message.error("未检索到相关位置坐标");
}
});
},
handleMoveCenter() {
//
const center = map.getCenter();
const lat = center.getLat();
const lng = center.getLng();
this.formData.latitude = lat;
this.formData.longitude = lng;
this.setMarker(lat, lng);
this.convert(lat, lng);
},
convert(lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location;
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
} else {
location = new TMap.LatLng(
this.formData.latitude,
this.formData.longitude
);
}
// map.setCenter(location);
markers.updateGeometries([
{
id: "main", //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
this.formData.address = result.result.address;
//
});
},
resetData() {
this.formData = {};
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
background: "rgba(0,0,0,.7)", //
});
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
computed: {
dataRule() {
return {
resiSearchTagId: [
{
required: true,
message: "享受服务人员不能为空",
trigger: "change",
},
],
serviceTimeStart: [
{ required: true, message: "服务时间不能为空", trigger: "blur" },
],
};
},
},
props: {
serviceRecordId: {
type: String,
required: true,
},
serviceOrgName: {
type: String,
required: true,
},
formType: {
// addeditdetail,feedback
type: String,
required: true,
},
// satisfyArray: {
// type: Array,
// default() {
// return [];
// },
// },
},
};
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/form-main.scss";
.attachement-list {
// padding-left: 20px;
a {
display: block;
cursor: pointer;
// color: #4df0ff;
font-size: 14px;
i {
color: #333;
}
}
}
</style>

708
src/views/modules/shequzhili/welfare/welfare.vue

@ -0,0 +1,708 @@
<template>
<div class="g-main">
<div>
<div class="m-search">
<el-form
:inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'"
>
<el-form-item prop="name" label="姓名">
<el-input
v-model="formData.name"
class="u-item-width-normal"
size="small"
clearable
placeholder="请输入"
>
</el-input>
</el-form-item>
<el-form-item label="性别" prop="gender">
<el-select
v-model="formData.gender"
class="u-item-width-daterange"
placeholder="请选择"
size="small"
clearable
>
<el-option
v-for="item in genderList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="年龄" prop="age">
<el-input
v-model="formData.age"
class="u-item-width-normal"
size="small"
clearable
placeholder="请输入"
>
</el-input>
</el-form-item>
<el-form-item label="证件号" prop="idCard">
<el-input
v-model="formData.idCard"
class="u-item-width-normal"
size="small"
clearable
placeholder="请输入"
>
</el-input>
</el-form-item>
<el-form-item label="文化程度" prop="eduLevel">
<el-select
class="u-item-width-normal"
v-model="formData.eduLevel"
placeholder="全部"
size="small"
clearable
>
<el-option
v-for="item in eduArray"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="岗位类型" prop="jobPost">
<el-select
class="u-item-width-normal"
placeholder="全部"
v-model="formData.jobPost"
size="small"
clearable
multiple
>
<el-option
v-for="item in jobPostArray"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="入职时间" prop="hiredateEnd">
<el-date-picker v-model="formData.hiredateStr"
:picker-options="startPickerOptions"
class="u-item-width-daterange"
size="small"
type="date"
value-format="yyyy-MM-dd"
value="yyyy-MM-dd"
placeholder="开始时间">
</el-date-picker>
<span class="u-data-tag"></span>
<el-date-picker v-model="formData.hiredateEnd"
:picker-options="endPickerOptions"
class="u-item-width-daterange u-data-tag"
size="small"
type="date"
value-format="yyyy-MM-dd-ss"
value="yyyy-MM-dd-ss"
placeholder="结束时间">
</el-date-picker>
</el-form-item>
<el-row type="flex">
<el-col :span="24" align="right">
<el-button
style="margin-left: 30px"
size="small"
type="primary "
@click="handleSearch"
>查询</el-button
>
<el-button
style="margin-left: 10px"
is-plain
class="diy-button--white el-button--default"
size="small"
@click="resetSearch"
>重置</el-button
>
</el-col>
</el-row>
</el-form>
</div>
<div class="m-table">
<div class="div_btn">
<div class="div_btn_left">
<el-button
size="small"
@click="handleAdd"
type="primary"
icon="el-icon-plus"
style="margin-right: 10px"
>新增</el-button
>
</div>
<el-button
@click="handleExport"
type="primary"
size="small"
class="diy-button--white el-button--default"
>
导出</el-button
>
</div>
<el-table
:data="tableData"
border
v-loading="tableLoading"
class="m-table-item"
style="width: 100%"
:height="maxTableHeight"
>
<el-table-column
label="序号"
fixed="left"
type="index"
align="center"
width="50"
/>
<el-table-column
prop="name"
align="center"
min-width="150"
label="姓名"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
prop="gender"
label="性别"
align="center"
min-width="150"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
{{ scope.row.gender==1?'男':'女' }}
</template>
</el-table-column>
<el-table-column
prop="address"
align="center"
min-width="150"
label="现居住地"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
prop="idCard"
align="center"
min-width="150"
label="证件号"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span
>{{ scope.row.idCard.substr(0,10)+'******'+scope.row.idCard.substr(14,4) }}</span
>
</template>
</el-table-column>
<el-table-column
prop="phone"
align="center"
min-width="150"
label="联系电话"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span
>{{ scope.row.phone.substr(0,3)+'****'+scope.row.phone.substr(7,4) }}</span
>
</template>
</el-table-column>
<el-table-column
prop="jobPost"
align="center"
min-width="150"
label="岗位类型"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span
>{{jobPostStr(scope.row.jobPost) }}</span
>
</template>
</el-table-column>
<!-- 我需要从一个数组中筛选出多个符合条件的并返回它的lable -->
<el-table-column
prop="hiredate"
align="center"
width="200"
:show-overflow-tooltip="true"
label="入职时间"
>
<!-- <template slot-scope="scope">
<span
>{{ scope.row.serviceTimeStart }}{{
scope.row.serviceTimeEnd
}}</span
>
</template> -->
</el-table-column>
<el-table-column
fixed="right"
label="操作"
align="center"
width="220"
>
<template slot-scope="scope">
<el-button
@click="handleDetail(scope.row)"
type="text"
size="small"
>查看</el-button
>
<!-- v-if="scope.row.serviceStatus === 'in_service'" -->
<el-button
@click="handleEdit(scope.row)"
type="text"
size="small"
>编辑</el-button
>
<!-- v-if="scope.row.serviceStatus === 'in_service'" -->
<el-button
@click="handleDel(scope.row)"
type="text"
size="small"
>删除</el-button
>
<!-- v-if="scope.row.serviceStatus === 'in_service'" -->
<el-button
@click="handleFeedback(scope.row)"
type="text"
size="small"
>工作记录</el-button
>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(pageSize)"
layout="sizes, prev, pager, next, total"
:total="total"
>
</el-pagination>
</div>
</div>
</div>
<el-dialog
v-if="showAdd"
:visible.sync="showAdd"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="addDiaTitle"
:modal-append-to-body="false"
width="720px"
top="5vh"
class="dialog-h"
@closed="showAdd = false"
>
<add-form
ref="ref_add_form"
:formType="formType"
:eduArray="eduArray"
:serviceRecordId="serviceRecordId"
:serviceName="serviceName"
@handleOk="handleOk"
@handleClose="handleClose"
></add-form>
</el-dialog>
<el-dialog
v-if="showEdit"
:visible.sync="showEdit"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'编辑'"
:modal-append-to-body="false"
width="850px"
top="5vh"
class="dialog-h"
@closed="showEdit = false"
>
<edit-form
ref="ref_edit_form"
:serviceRecordId="serviceRecordId"
:serviceOrgName="serviceOrgName"
:statusArray="statusArray"
@handleOk="handleOk"
@handleClose="handleClose"
:formType="formType"
>
</edit-form>
</el-dialog>
<el-dialog
v-if="showDetail"
:visible.sync="showDetail"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="detailDiaTitle"
:modal-append-to-body="false"
width="850px"
top="5vh"
class="dialog-h"
@closed="diaDetailClose"
>
<detail-form
ref="ref_detail_form"
:serviceRecordId="serviceRecordId"
:serviceOrgName="serviceOrgName"
:statusArray="statusArray"
@diaDetailClose="diaDetailClose"
>
</detail-form>
</el-dialog>
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick";
import { mapGetters } from "vuex";
import axios from "axios";
import addForm from "./addForm";
import detailForm from "./detailForm";
import editForm from "./editForm";
import feedBackForm from "./addForm";
export default {
components: { addForm, detailForm, feedBackForm, editForm },
data() {
let endDisabledDate = (time) => {
//datareturn
let nowData = Date.now();
if (this.formData.hiredateStr) {
let hiredateStr = new Date(this.formData.hiredateStr);
return (
time.getTime() < hiredateStr- 24 * 60 * 60 * 1000 ||
time.getTime() === hiredateStr- 24 * 60 * 60 * 1000
);
} else {
return (time.getTime() > nowData || time.getTime() === nowData) ;
}
};
return {
//
serviceTypesLevel2: [],
tableLoading: false,
user: {},
agencyId: "",
searchH: 170,
tableData: [],
genderList:[
{label:'男',value:'1'},
{label:'女',value:'2'}
],
formData: {
name: "",
phone: "",
age: "",
idCard: "",
gender: "",
eduLevel: "",
jobPost: [],
hiredateStr: "",
hiredateEnd: ""
},
pageNo: 1,
total: 1,
pageSize: window.localStorage.getItem("pageSize") || 20,
endPickerOptions: {
disabledDate: endDisabledDate,
},
startPickerOptions: {
// disabledDate: startDisabledDate
},
serviceRecordId: "",
serviceName: "",
serviceOrgName: "",
showAdd: false,
showEdit: false,
showDetail: false,
showFeedback: false,
formType: "add",
addDiaTitle: "发起服务",
detailDiaTitle: "服务详情",
eduArray: [],
jobPostArray: [],
};
},
computed: {
maxTableHeight() {
const h = this.clientHeight - this.searchH - 275 + this.iframeHeight;
const _h = this.clientHeight - 275 - this.searchH;
return this.$store.state.inIframe ? h : _h;
},
jobPostStr(){
return function(arr) {
let str = ''
let arrs = [...this.jobPostArray]
arrs.forEach(item=>{
arr.map(items=>{
if(item.value == items){
str += item.label + ' '
}
return arr
})
})
return str
}
},
...mapGetters(["clientHeight", "iframeHeight"]),
},
watch: {
},
created(){
this.getEducDict()
this.getTableData();
},
mounted() {
console.log(this.$store.state);
this.user = this.$store.state.user;
this.agencyId = this.user.agencyId;
this.getWelfareDict()
},
methods: {
handleSearch(val) {
console.log(this.formData);
this.pageNo = 1;
this.getTableData();
},
async handleAdd() {
this.addDiaTitle = "发起服务";
this.formType = "add";
this.showAdd = true;
},
async handleDetail(row) {
this.detailDiaTitle = "服务详情";
this.serviceRecordId = row.serviceRecordId;
this.serviceOrgName = row.serviceOrgName;
// this.formType = 'detail'
this.showDetail = true;
},
diaDetailClose() {
console.log(this.$refs.ref_detail);
this.$refs.ref_detail_form.diaDestroy();
this.showDetail = false;
},
async handleEdit(row) {
// this.detailDiaTitle = ""
this.serviceRecordId = row.serviceRecordId;
this.serviceOrgName = row.serviceOrgName;
this.formType = "edit";
this.showEdit = true;
},
//
async handleFeedback(row) {
this.serviceRecordId = row.serviceRecordId;
this.serviceName = row.serviceName;
this.addDiaTitle = "服务反馈";
this.formType = "feedback";
this.showAdd = true;
},
handleClose() {
this.serviceRecordId = "";
this.formType = "";
this.showAdd = false;
this.showDetail = false;
this.showEdit = false;
},
handleOk() {
this.handleClose();
this.pageNo = 1;
this.getTableData();
},
async handleDel(row) {
this.serviceRecordId = row.serviceRecordId;
this.$confirm("确认删除公益岗人员?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.cancelFuwu();
})
.catch((err) => {
if (err == "cancel") {
// this.$message({
// type: "info",
// message: ""
// });
}
});
},
//
async cancelFuwu() {
const url = "/governance/icServiceRecordV2/cancel";
let params = {
serviceRecordId: this.serviceRecordId,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.$message.success("取消成功!");
this.getTableData();
} else {
this.$message.error("操作失败!");
}
},
//
async getTableData() {
this.tableLoading = true;
const url = "/actual/base/publicWelfarePost/list";
const { pageSize, pageNo, formData } = this;
const { data, code, msg } = await requestPost(url, {
pageSize,
pageNo,
...formData,
});
this.tableLoading = false;
if (code === 0) {
this.total = data.total || 0;
this.tableData = data.list;
} else {
this.$message.error(msg);
}
},
//
async handleExport() {
//-
// const url = "/gov/project/icEvent/export";
const { pageSize, pageNo, formData } = this;
axios({
url: window.SITE_CONFIG["apiURL"] + url,
method: "post",
data: {
pageSize,
pageNo,
...formData,
},
responseType: "blob",
})
.then((res) => {
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
})
.catch((err) => {
console.log("获取导出情失败", err);
return this.$message.error("网络错误");
});
},
//
handleSizeChange(val) {
this.pageSize = val;
window.localStorage.setItem("pageSize", val);
this.getTableData();
},
//
handleCurrentChange(val) {
this.pageNo = val;
this.getTableData();
},
//
resetSearch() {
this.formData = {
name: "",
phone: "",
age: "",
idCard: "",
gender: "",
eduLevel: "",
jobPost: [],
hiredateStr: "",
hiredateEnd: ""
};
this.pageNo = 1;
this.getTableData();
},
async getEducDict(){
try {
let { data } = await this.$http.post('sys/dict/data/education',{formCode: "resi_base_info"})
this.eduArray = data.data
} catch (error) {
console.log(error,'获取民族字典');
}
},
async getWelfareDict(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'welfare_post'})
this.jobPostArray = data.data
} catch (error) {
console.log(error,'获取公益岗位字典');
}
},
},
props: {
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/buttonstyle.scss";
@import "@/assets/scss/modules/management/list-main.scss";
@import "@/assets/scss/modules/shequzhili/event-info.scss";
</style>
Loading…
Cancel
Save