Browse Source

共性需求

V1.0
mk 3 years ago
parent
commit
a2810a2278
  1. 382
      src/views/modules/communityService/gxxq/addForm.vue
  2. 11
      src/views/modules/communityService/gxxq/detailForm.vue
  3. 108
      src/views/modules/communityService/gxxq/index.vue
  4. 679
      src/views/modules/communityService/policy/policyList.vue

382
src/views/modules/communityService/gxxq/addForm.vue

@ -90,10 +90,11 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="查找享受服务人员" label="查找有该需求人员"
prop="resiSearchTagId" prop="resiSearchTagId"
:class="{ 'form-item': source === 'visiual' }" :class="{ 'form-item': source === 'visiual' }"
label-width="150px" label-width="150px"
:required="true"
style="display: block" style="display: block"
> >
<template v-if="formData.resiSearchTagName"> <template v-if="formData.resiSearchTagName">
@ -107,25 +108,19 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item label="指派服务" label-width="150px"> <el-form-item label="指派服务" label-width="150px">
<el-switch <el-switch v-model="formData.assignFlag"> </el-switch>
v-model="formData.assignFlag"
@change="handelDisabledRules"
>
</el-switch>
</el-form-item> </el-form-item>
</el-form>
<el-form :model="newFormData" :rules="newDataRule" ref="ref_gxxq_form1">
<el-form-item <el-form-item
v-if="formData.assignFlag"
label="服务方" label="服务方"
label-width="150px" label-width="150px"
style="display: block" style="display: block"
v-show="formData.assignFlag" prop="serverOrgId"
> >
<!-- 表单验证是有的但是没有红色*先手写加上吧 -->
<!-- <el-form-label class="form_label_box">
<span class="verifyRed">服务方 : </span>
</el-form-label> -->
<el-select <el-select
v-model="formData.assignInfo.serverOrgType" v-model="newFormData.serverOrgType"
class="input-width-small" class="input-width-small"
placeholder="请选择" placeholder="请选择"
clearable clearable
@ -141,7 +136,7 @@
</el-select> </el-select>
- -
<el-select <el-select
v-model="formData.assignInfo.serverOrgId" v-model="newFormData.serverOrgId"
class="input-width-middle" class="input-width-middle"
filterable filterable
placeholder="请选择" placeholder="请选择"
@ -157,31 +152,29 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="formData.assignFlag"
prop="noticeApproches"
label="自动通知服务方" label="自动通知服务方"
label-width="150px" label-width="150px"
style="display: block" style="display: block"
v-show="formData.assignFlag"
> >
<el-checkbox-group v-model="formData.assignInfo.noticeApproches"> <el-checkbox-group v-model="newFormData.noticeApproches">
<el-checkbox label="1">短信通知</el-checkbox> <el-checkbox label="1" value="1">短信通知</el-checkbox>
<el-checkbox label="2">微信公众号消息通知</el-checkbox> <el-checkbox label="2" value="2">微信公众号消息通知</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="formData.assignFlag"
label="服务范围" label="服务范围"
label-width="150px" label-width="150px"
prop="serviceScopeList"
style="display: block" style="display: block"
v-show="formData.assignFlag" prop="serviceScopeList"
> >
<!-- <el-form-label class="form_label_box">
<span class="verifyRed">服务范围 :</span>
</el-form-label> -->
<el-cascader <el-cascader
class="item_width_1" class="item_width_1"
ref="myCascader" ref="myCascader"
v-model="scopeIdArray" v-model="newFormData.serviceScopeList"
:key="iscascaderShow" :key="iscascaderShow"
:options="casOptions" :options="casOptions"
:props="optionProps" :props="optionProps"
@ -191,14 +184,14 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="服务范围" v-if="formData.assignFlag"
label="服务时间"
label-width="150px" label-width="150px"
prop="serviceTimeStart" prop="serviceTimeEnd"
v-show="formData.assignFlag"
> >
<!-- :picker-options="startPickerOptions" --> <!-- :picker-options="startPickerOptions" -->
<el-date-picker <el-date-picker
v-model="formData.assignInfo.serviceTimeStart" v-model="newFormData.serviceTimeStart"
class="item_width_2" class="item_width_2"
style="width: 220px" style="width: 220px"
type="date" type="date"
@ -210,7 +203,7 @@
<!-- :picker-options="endPickerOptions" --> <!-- :picker-options="endPickerOptions" -->
<span class="u-data-tag"></span> <span class="u-data-tag"></span>
<el-date-picker <el-date-picker
v-model="formData.assignInfo.serviceTimeEnd" v-model="newFormData.serviceTimeEnd"
class="item_width_2 u-data-tag" class="item_width_2 u-data-tag"
style="width: 220px" style="width: 220px"
type="date" type="date"
@ -248,7 +241,6 @@
> >
<label-form <label-form
ref="ref_label_form" ref="ref_label_form"
:ruleList="ruleList"
@dialogCancle="addFormCancle" @dialogCancle="addFormCancle"
@dialogOk="addFormOk" @dialogOk="addFormOk"
> >
@ -286,11 +278,6 @@ export default {
required: false, required: false,
default: "", default: "",
}, },
formType: {
// addeditdetail,feedback
type: String,
required: "",
},
categrayArray: { categrayArray: {
type: Array, type: Array,
default() { default() {
@ -330,7 +317,7 @@ export default {
// //
serviceTypesLevel1: [], serviceTypesLevel1: [],
serviceTypesLevel2: [], serviceTypesLevel2: [],
formType: "",
btnDisable: false, btnDisable: false,
casOptions: [], casOptions: [],
scopeIdArray: [], scopeIdArray: [],
@ -344,8 +331,7 @@ export default {
checkStrictly: true, checkStrictly: true,
emitPath: false, emitPath: false,
}, },
newArr: [],
keyWords: "",
formData: { formData: {
serviceTypeLevel1Id: "", // id serviceTypeLevel1Id: "", // id
commonServiceTypeId: "", // id commonServiceTypeId: "", // id
@ -353,53 +339,50 @@ export default {
resiSearchTagId: "", // resiSearchTagId: "", //
resiSearchTagName: "", // resiSearchTagName: "", //
title: "", // title: "", //
assignInfo: { assignInfo: {},
noticeApproches: [],
serviceScopeList: [], //
serviceTimeStart: "", //yyyy-MM-dd
serviceTimeEnd: "", //yyyy-MM-dd
serverOrgType: "", // community_org ic_user_volunteer party_unit
serverOrgId: "", //Id
},
content: "", // content: "", //
}, },
newFormData: {
noticeApproches: [],
serviceScopeList: [], //
serviceTimeStart: "", //yyyy-MM-dd
serviceTimeEnd: "", //yyyy-MM-dd
serverOrgType: "", // community_org ic_user_volunteer party_unit
serverOrgId: "", //Id
},
dataRule: { dataRule: {
commonServiceTypeId: [ commonServiceTypeId: [
{ required: true, message: "政策类型不能为空", trigger: "change" }, { required: true, message: "需求类别不能为空", trigger: "bulr" },
], ],
title: [ title: [
{ required: true, message: "服务名称不能为空", trigger: "change" }, { required: true, message: "服务名称不能为空", trigger: "bulr" },
], ],
// serviceTimeStart: [ resiSearchTagId: [
// { required: true, message: "", trigger: "change" }, { required: true, message: "符合条件人员不能为空", trigger: "bulr" },
// ], ],
// serviceScopeList : [
// { required: true, message: "", trigger: "change" },
// ],
}, },
newDataRule: {
// endPickerOptions: { serverOrgId: [
// disabledDate: endDisabledDate, { required: true, message: "服务方不能为空", trigger: "bulr" },
// }, ],
// startPickerOptions: { serviceScopeList: [
// disabledDate: startDisabledDate, { required: true, message: "服务范围不能为空", trigger: "bulr" },
// }, ],
serviceTimeEnd: [
{ required: true, message: "服务时间不能为空", trigger: "bulr" },
],
},
sarr: [],
scopeId: "",
serviceOptions: [], serviceOptions: [],
serviceOptiondList: [], serviceOptiondList: [],
policyList: [], policyList: [],
fileList: [],
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile",
ruleList: [],
showLabelForm: false, showLabelForm: false,
}; };
}, },
computed: {},
watch: { watch: {
"formData.serviceTimeEnd": function (val) { "formData.serviceTimeEnd": function (val) {
if (val && val != "") { if (val && val != "") {
@ -410,20 +393,15 @@ export default {
}, },
components: { personList, labelForm }, components: { personList, labelForm },
created() {},
async mounted() { async mounted() {
this.startLoading(); this.startLoading();
// prop // prop
// this.getCategrayList(); // this.getCategrayList();
this.getDictOptions(); await this.getPolicyList();
this.getPolicyList(); await this.loadScopeTree();
await this.getDictOptions();
if (this.formType === "add") { await this.endLoading();
await this.loadScopeTree();
} else {
}
await this.iniDefaultData();
this.endLoading(); this.endLoading();
// //
@ -434,7 +412,6 @@ export default {
return this.$message.error(res.msg); return this.$message.error(res.msg);
} else { } else {
this.serviceTypesLevel1 = res.data; this.serviceTypesLevel1 = res.data;
console.log(res.data);
} }
}) })
.catch(() => { .catch(() => {
@ -443,47 +420,67 @@ export default {
}, },
methods: { methods: {
handelDisabledRules(v) { async initForm(type, row) {
// if (!v) { this.formType = type;
// delete this.dataRule.resiSearchTagId,this.dataRule.serviceTimeStart,this.dataRule.serviceScopeList; this.scopeId = row.id;
// } else { await this.getDetail(row.id);
// var serviceOrgId = [ },
// { required: true, message: "", trigger: "change" }, async getDetail(id) {
// ]; const url = `/governance/commonDemand/detail/${id}`;
// var serviceTimeStart = [ const { data, code, msg } = await requestGet(url);
// { required: true, message: "", trigger: "change" },
// ]; if (code === 0) {
// var serviceScopeList = [ this.formData.serviceTypeLevel1Id = data.servicePid;
// { required: true, message: "", trigger: "change" }, this.formData.commonServiceTypeId = data.commonServiceTypeId;
// ]; this.formData.title = data.title;
// this.dataRule.serviceOrgId = serviceOrgId; this.formData.content = data.content;
// this.dataRule.serviceTimeStart = serviceTimeStart; this.formData.resiSearchTagId = data.resiSearchTagId;
// this.dataRule.serviceScopeList = serviceScopeList; this.newFormData.serviceTimeStart = data.assignInfo.serviceTimeStart;
// } this.newFormData.serviceTimeEnd = data.assignInfo.serviceTimeEnd;
if (v) { this.newFormData.serverOrgType = data.assignInfo.serverOrgType;
this.addRules(); this.newFormData.serverOrgId = data.assignInfo.serverOrgId;
this.newFormData.noticeApproches = data.assignInfo.noticeApproches;
if (data.assignFlag == 1) {
this.formData.assignFlag = true;
} else {
this.formData.assignFlag = false;
}
for (let i in data.assignInfo.serviceScopeList) {
this.newFormData.serviceScopeList.push(
data.assignInfo.serviceScopeList[i].objectId
);
}
await this.handleChangeServiceTypeLevel1();
await this.getServiceuserList(data.assignInfo.serverOrgType);
await // this.formData = { ...data };
await this.getTagName();
} else { } else {
this.romoveRules(); this.$message.error(msg);
} }
console.log(this.dataRule);
}, },
addRules() { async getTagName() {
const newRules = [ const url = "/governance/resiSearchTag/listResiSearchTags";
{ required: true, trigger: "change", message: "服务组织不能为空" }, let params = {
]; pageSize: 99,
// rules };
let arr = [ let { data, msg, code } = await requestPost(url, params);
{ required: true, trigger: "change", message: "服务组织不能为空" }, if (code == 0) {
]; let showAddProduct = data.list.filter((item) => {
this.dataRule = { ...this.dataRule, serviceOrgId: newRules }; return [this.formData.resiSearchTagId].includes(item.tagId);
}, });
romoveRules() { if (this.formData.resiSearchTagId) {
this.$refs.ref_gxxq_form.clearValidate(["serviceOrgId"]); this.formData.resiSearchTagName = showAddProduct[0].tagName;
this.rules = { ...this.rules, serviceOrgId: [] }; } else {
this.formData.resiSearchTagName = "--";
}
} else {
this.$message.error(msg);
}
}, },
// //
handleChangeServiceTypeLevel1() { handleChangeServiceTypeLevel1() {
this.formData.commonServiceTypeId = ""; // this.formData.commonServiceTypeId = "";
this.$http this.$http
.get( .get(
"/governance/commonServiceType/selectList/" + "/governance/commonServiceType/selectList/" +
@ -500,10 +497,8 @@ export default {
return this.$message.error("网络错误"); return this.$message.error("网络错误");
}); });
}, },
// //
handleChangeServiceTypeLevel2() { handleChangeServiceTypeLevel2() {
console.log(this.formData.serviceTypeLevel1Id);
console.log(this.formData.commonServiceTypeId);
if (this.formData.assignInfo.serviceOrgType) { if (this.formData.assignInfo.serviceOrgType) {
this.getServiceuserList(this.formData.assignInfo.serviceOrgType); this.getServiceuserList(this.formData.assignInfo.serviceOrgType);
} else { } else {
@ -580,10 +575,7 @@ export default {
async handleServiceChange(type, val) { async handleServiceChange(type, val) {
console.log(val); console.log(val);
if (val === "social_org") { await this.getServiceuserList(val);
if (type === "add") await this.getServiceuserList(val);
else this.getServiceuserList(val);
} else this.getServiceuserList(val);
}, },
async getServiceuserList(serverOrgType) { async getServiceuserList(serverOrgType) {
@ -625,41 +617,64 @@ export default {
}, },
handleChangeScope(value) { handleChangeScope(value) {
this.formData.assignInfo.serviceScopeList = []; // this.newFormData.serviceScopeList = [];
let selArray = this.$refs["myCascader"].getCheckedNodes(); // let selArray = this.$refs["myCascader"].getCheckedNodes();
console.log("handleChangeScope", selArray); // console.log("handleChangeScope", selArray);
selArray.forEach((element) => { // selArray.forEach((element) => {
let obj = { // let obj = {
objectType: // objectType:
element.data.objectType === "grid" // element.data.objectType === "grid"
? "grid" // ? "grid"
: element.data.objectType === "neighborhood" // : element.data.objectType === "neighborhood"
? "neighborhood" // ? "neighborhood"
: "agency", // : "agency",
objectId: element.data.objectId, // objectId: element.data.objectId,
objectName: element.data.objectName, // objectName: element.data.objectName,
}; // };
this.formData.assignInfo.serviceScopeList.push(obj); // this.newFormData.serviceScopeList.push(obj);
}); // });
}, },
async handleComfirm() { async handleComfirm() {
if (this.formType === "add") { this.handleAdd();
this.handleAdd(); },
} else if (this.formType === "feedback") { //
getLastItem(list, vals, key) {
let LIST = list || [];
for (let item of LIST) {
// console.log(item[key]);
for (let i of vals) {
if (item[key] === i) {
console.log(item[key]);
this.sarr.push(item);
} else if (item["objectType"] == "district") {
this.getLastItem(item.children, vals, key);
} else {
this.getLastItem(item.children, vals, key);
}
}
} }
}, },
async handleAdd() { async handleAdd() {
this.btnDisable = true; this.btnDisable = true;
setTimeout(() => { setTimeout(() => {
this.btnDisable = false; this.btnDisable = false;
}, 10000); }, 10000);
this.$refs["ref_gxxq_form"].validate((valid, messageObj) => { nextTick(1000);
if (!valid) {
app.util.validateRule(messageObj); const form = new Promise((resolve, reject) => {
this.btnDisable = false; this.$refs["ref_gxxq_form"].validate((valid) => {
} else { if (valid) resolve();
});
});
const form1 = new Promise((resolve, reject) => {
this.$refs["ref_gxxq_form1"].validate((valid) => {
if (valid) resolve();
});
});
Promise.all([form1, form])
.then(() => {
var oDate1 = new Date(this.formData.serviceTimeStart); var oDate1 = new Date(this.formData.serviceTimeStart);
var oDate2 = new Date(this.formData.serviceTimeEnd); var oDate2 = new Date(this.formData.serviceTimeEnd);
if (oDate1.getTime() > oDate2.getTime()) { if (oDate1.getTime() > oDate2.getTime()) {
@ -667,33 +682,82 @@ export default {
return false; return false;
} }
this.addFuwu(); this.addFuwu();
} })
}); .catch(() => {
app.util.validateRule(messageObj);
this.btnDisable = false;
});
}, },
async addFuwu() { async addFuwu() {
// 01
if (this.formData.assignFlag) { if (this.formData.assignFlag) {
this.formData.assignFlag = 1; this.formData.assignFlag = 1;
} else { } else {
this.formData.assignFlag = 0; this.formData.assignFlag = 0;
} }
const url = "/governance/commonDemand/save"; // ,'0'
// const url = 'http://yapi.elinkservice.cn/mock/245/governance/icServiceProject/service/initiate' if (this.newFormData.noticeApproches.length == 0) {
let params = { this.newFormData.noticeApproches.push(0);
title: this.formData.title, }
content: this.formData.content, // 使
commonServiceTypeId: this.formData.commonServiceTypeId, const map = new Map();
resiSearchTagId: this.formData.resiSearchTagId, this.getLastItem(
assignFlag: this.formData.assignFlag, this.casOptions,
assignInfo: this.formData.assignInfo, this.newFormData.serviceScopeList,
}; "objectId"
);
//,push,
this.newArr = this.sarr.filter(
(v) => !map.has(v.objectId) && map.set(v.objectId, 1)
);
for (let i in this.newArr) {
this.newFormData.serviceScopeList.push({
objectId: this.newArr[i].objectId,
objectType: this.newArr[i].objectType,
objectName: this.newArr[i].objectName,
});
}
//
let arr = [];
this.newFormData.serviceScopeList.forEach((item) => {
if (typeof item != "string") {
arr.push(item);
}
});
this.newFormData.serviceScopeList = arr;
var url = "";
var params = {};
if (this.formType == "edit") {
url = "/governance/commonDemand/update";
params = {
title: this.formData.title,
content: this.formData.content,
commonServiceTypeId: this.formData.commonServiceTypeId,
resiSearchTagId: this.formData.resiSearchTagId,
assignFlag: this.formData.assignFlag,
assignInfo: this.newFormData,
id: this.scopeId,
};
} else {
url = "/governance/commonDemand/save";
params = {
title: this.formData.title,
content: this.formData.content,
commonServiceTypeId: this.formData.commonServiceTypeId,
resiSearchTagId: this.formData.resiSearchTagId,
assignFlag: this.formData.assignFlag,
assignInfo: this.newFormData,
};
}
// const url = 'http://yapi.elinkservice.cn/mock/245/governance/icServiceProject/service/initiate'
console.log(params); console.log(params);
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {
this.$message.success("添加成功"); this.$message.success("添加成功");
this.resetData(); this.resetData();
this.$emit("handleOk"); this.$emit("handleComfirm");
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }

11
src/views/modules/communityService/gxxq/detailForm.vue

@ -38,7 +38,7 @@
: "--" : "--"
}}</span> }}</span>
</div> </div>
<div class="info-prop"> <div class="info-prop" v-if="formData.assignFlag == 1">
<span class="info-title-2">服务方</span> <span class="info-title-2">服务方</span>
<span>{{ serverOrgType }} - {{serverOrgName}}</span> <span>{{ serverOrgType }} - {{serverOrgName}}</span>
</div> </div>
@ -54,8 +54,8 @@
<div class="info-prop"> <div class="info-prop">
<span class="info-title-2">服务时间</span> <span class="info-title-2">服务时间</span>
<span>{{ formData.assignInfo.serviceTimeStart || "--" }}</span> <span>{{ formData.assignInfo.serviceTimeStart.substr(0,10) || "--" }}</span>
<span>{{ formData.assignInfo.serviceTimeEnd || "--" }}</span> <span>{{ formData.assignInfo.serviceTimeEnd.substr(0,10) || "--" }}</span>
</div> </div>
</template> </template>
</div> </div>
@ -139,7 +139,7 @@ export default {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
// //
async loadInfo() { async loadInfo() {
const url = `/governance/commonDemand/detail/${this.gxxqId}`; const url = `/governance/commonDemand/detail/${this.gxxqId}`;
@ -194,7 +194,7 @@ export default {
}, },
handleCancle() { handleCancle() {
this.resetData(); this.resetData();
this.$emit("diaDetailClose"); this.$emit("handleClose");
}, },
handleOk() { handleOk() {
@ -207,6 +207,7 @@ export default {
const url = "/actual/base/serviceitem/listServerOrg"; const url = "/actual/base/serviceitem/listServerOrg";
console.log(this.formData.commonServiceTypeId); console.log(this.formData.commonServiceTypeId);
if(this.formData.assignFlag!=1) return
let params = { let params = {
serviceTypeId: this.formData.commonServiceTypeId, serviceTypeId: this.formData.commonServiceTypeId,
serverOrgType: this.formData['assignInfo'].serverOrgType, serverOrgType: this.formData['assignInfo'].serverOrgType,

108
src/views/modules/communityService/gxxq/index.vue

@ -131,16 +131,25 @@
> >
</div> </div>
<el-table <el-table
ref="config_table" ref="gxxq_table"
border border
:data="tableData" :data="tableData"
v-loading="tableLoading" v-loading="tableLoading"
style="width: 100%" style="width: 100%"
:height="tableHeight" :height="tableHeight"
@select-all="selectAll"
@selection-change="handelSelection"
> >
<el-table-column
type="selection"
fixed="left"
align="center"
width="50"
/>
<el-table-column <el-table-column
label="需求类别" label="需求类别"
prop="commonServiceTypeName" prop="commonServiceTypeName"
:reserve-selection="true"
fixed="left" fixed="left"
align="center" align="center"
/> />
@ -169,11 +178,7 @@
/> />
<el-table-column fixed="right" label="操作" align="center" width="200"> <el-table-column fixed="right" label="操作" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button @click="handleEdit(scope.row)" size="small" type="text"
style="margin-right: 10px"
@click="handleEdit(scope.row)"
size="small"
type="text"
>查看</el-button >查看</el-button
> >
<el-button <el-button
@ -198,6 +203,9 @@
</el-table> </el-table>
<div class="div-flex"> <div class="div-flex">
<el-button @click="deleteBatch">
批量删除
</el-button>
<div class="m-page"> <div class="m-page">
<el-pagination <el-pagination
@size-change="handleSizeChange" @size-change="handleSizeChange"
@ -249,7 +257,8 @@
:commonServiceTypeName="commonServiceTypeName" :commonServiceTypeName="commonServiceTypeName"
:formType="formType" :formType="formType"
@handleClose="addFormCancle" @handleClose="addFormCancle"
@handleComfirm="addFormOk" :gxxq-id="gxxqId" @handleComfirm="addFormOk"
:gxxq-id="gxxqId"
></detail-form> ></detail-form>
</el-dialog> </el-dialog>
</div> </div>
@ -266,10 +275,10 @@ export default {
// //
serviceTypesLevel1: [], serviceTypesLevel1: [],
serviceTypesLevel2: [], serviceTypesLevel2: [],
commonServiceTypeName:'', commonServiceTypeName: "",
formType:"add", formType: "add",
formEditShow:false, formEditShow: false,
gxxqId:"", gxxqId: "",
formData: { formData: {
title: "", title: "",
serviceTypeLevel1Id: "", serviceTypeLevel1Id: "",
@ -288,6 +297,8 @@ export default {
label: "未指派服务", label: "未指派服务",
}, },
], ],
selection: [],
selAllFlag: false,
tableData: [], tableData: [],
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
@ -300,7 +311,7 @@ export default {
}; };
}, },
created() {}, created() {},
components: { addForm,detailForm }, components: { addForm, detailForm },
methods: { methods: {
async getCommonDemandList() { async getCommonDemandList() {
const url = "/governance/commonDemand/list"; const url = "/governance/commonDemand/list";
@ -320,18 +331,29 @@ export default {
}, },
addFormCancle() { addFormCancle() {
this.formShow = false; this.formShow = false;
this.formEditShow = false
},
handelSelection(row){
this.selection = row
}, },
addFormOk() { addFormOk() {
this.formShow = false; this.formShow = false;
this.formEditShow = false
this.getCommonDemandList(); this.getCommonDemandList();
}, },
selectAll(selection) {
this.selection = selection;
if (selection.length > 0) {
this.selAllFlag = true;
} else {
this.selAllFlag = false;
}
},
handleAdd(row, type) { handleAdd(row, type) {
if (type == "add") { if (type == "add") {
this.formTitle = "添加需求"; this.formTitle = "添加需求";
this.formShow = true; this.formShow = true;
this.formType = 'add' this.formType = "add";
this.$nextTick(() => {
})
} else { } else {
this.formTitle = "修改需求"; this.formTitle = "修改需求";
this.formShow = true; this.formShow = true;
@ -342,10 +364,10 @@ export default {
}); });
} }
}, },
handleEdit(row){ handleEdit(row) {
this.gxxqId = row.id this.gxxqId = row.id;
this.commonServiceTypeName = row.commonServiceTypeName this.commonServiceTypeName = row.commonServiceTypeName;
this.formEditShow = true this.formEditShow = true;
}, },
handleSizeChange(val) { handleSizeChange(val) {
console.log(`每页 ${val}`); console.log(`每页 ${val}`);
@ -353,12 +375,11 @@ export default {
this.getCommonDemandList(); this.getCommonDemandList();
}, },
async handleDel(row) { async handleDel(row) {
const url = `/governance/commonDemand/delete/${row.id}`; const url = `/governance/commonDemand/delete/`;
let { code, msg } = await requestPost(url, [row.id]);
let { code, msg } = await requestGet(url);
if (code == 0) { if (code == 0) {
this.$message.success("删除成功"); this.$message.success("删除成功");
} else { } else if (code >= 8000) {
this.$message.error(msg); this.$message.error(msg);
} }
this.getCommonDemandList(); this.getCommonDemandList();
@ -387,6 +408,47 @@ export default {
diaClose() { diaClose() {
this.formShow = false; this.formShow = false;
}, },
// checkSelectable(row, index) {
// console.log(index);
// return row.id;
// },
async deleteresiBatch() {
if (this.selection.length === 0)
return this.$message.error("请选择之后进行操作");
let ids = this.selection.map((item) => item.id);
this.$http
.post("/governance/commonDemand/delete/", ids)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.$message.success("删除成功");
this.getCommonDemandList();
}
})
.catch((err) => {
console.log("row4", err);
return this.$message.error("网络错误");
});
},
deleteBatch() {
if (this.selection.length > 0) {
this.$confirm("删除之后无法恢复,确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteresiBatch();
})
.catch((err) => {
if (err == "cancel") {
}
});
} else {
this.$message.warning("请先选择要删除的需求");
}
},
// //
async getDictOptions() { async getDictOptions() {
const url = "/sys/dict/data/dictlist"; const url = "/sys/dict/data/dictlist";

679
src/views/modules/communityService/policy/policyList.vue

@ -1,206 +1,275 @@
<template> <template>
<div class="g-main"> <div class="g-main">
<div> <div class="m-search">
<div class="m-search"> <el-form
<el-form :inline="true" :inline="true"
:model="formData" :model="formData"
ref="ref_searchform" ref="ref_searchform"
:label-width="'80px'"> :label-width="'100px'"
<div> >
<el-form-item label="政策标题" prop="title">
<el-form-item label="政策标题" <el-input
prop="title"> v-model="formData.title"
<el-input v-model="formData.title" class="u-item-width-normal"
class="item_width_1" size="small"
size="small" clearable
clearable placeholder="请输入"
placeholder="请输入"> >
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="政策内容" <el-form-item label="政策级别" prop="policyLevel">
prop="content"> <el-select
<el-input v-model="formData.content" class="u-item-width-normal"
class="item_width_2" size="small"
size="small" v-model="formData.policyLevel"
clearable placeholder="全部"
placeholder="请输入"> clearable
</el-input> >
</el-form-item> <el-option
v-for="item in policyLevelArray"
<el-form-item label="是否过期" :key="item.value"
prop="expiredFlag"> :label="item.label"
<el-select class="item_width_2" :value="item.value"
v-model="formData.expiredFlag" >
placeholder="全部" </el-option>
size="small" </el-select>
clearable> </el-form-item>
<el-option v-for="item in statusArray" <el-form-item label="人员标签" prop="expiredFlag">
:key="item.value" <el-input
:label="item.label" placeholder="请输入"
:value="item.value"> size="small"
</el-option> class="u-item-width-normal"
</el-select> />
</el-form-item>
</el-form-item> <el-form-item label="是否过期" prop="expiredFlag">
<el-select
<el-button style="margin-left:30px" class="u-item-width-normal"
size="small" v-model="formData.expiredFlag"
class="diy-button--search" placeholder="请选择"
@click="handleSearch">查询</el-button> size="small"
<el-button style="margin-left:10px" clearable
size="small" >
class="diy-button--reset" <el-option
@click="resetSearch">重置</el-button> v-for="item in statusArray"
</div> :key="item.value"
</el-form> :label="item.label"
</div> :value="item.value"
>
<div class="m-table"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="发布日期" prop="timeStart">
<el-date-picker
v-model="formData.timeStart"
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.timeEnd"
class="u-item-width-daterange u-data-tag"
size="small"
type="date"
value-format="yyyy-MM-dd"
value="yyyy-MM-dd"
placeholder="结束时间"
>
</el-date-picker>
</el-form-item>
</el-form>
<el-row type="flex" justify="">
<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"
size="small"
class="diy-button--white"
@click="resetSearch"
>重置</el-button
></el-col
>
</el-row>
</div>
<div class="div_btn"> <div class="m-table">
<el-button class="diy-button--add" <div class="div_btn">
size="small" <el-button type="primary" size="small" @click="handleAdd"
@click="handleAdd">新增政策</el-button> >新增政策</el-button
>
<!-- <el-button @click="handleExport" <!-- <el-button @click="handleExport"
class="diy-button--reset" class="diy-button--reset"
size="small">导出</el-button> --> size="small">导出</el-button> -->
</div> </div>
<el-table :data="tableData" <el-table
border :data="tableData"
v-loading="tableLoading" border
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}" v-loading="tableLoading"
class="table" class="m-table-item"
style="width: 100%" style="width: 100%"
:height="maxTableHeight"> :height="maxTableHeight"
<el-table-column label="序号" >
fixed="left" <el-table-column
type="index" label="序号"
align="center" fixed="left"
width="50" /> type="index"
align="center"
<el-table-column prop="policyLevelName" width="50"
label="政策级别" />
width="100"
align="center" <el-table-column
:show-overflow-tooltip="true"> prop="policyLevelName"
</el-table-column> label="政策级别"
width="100"
<el-table-column prop="title" align="center"
align="center" :show-overflow-tooltip="true"
min-width="150" >
label="政策标题" </el-table-column>
:show-overflow-tooltip="true">
<el-table-column
</el-table-column> prop="title"
<el-table-column prop="content" align="center"
align="center" min-width="150"
min-width="250" label="政策标题"
label="政策内容" :show-overflow-tooltip="true"
:show-overflow-tooltip="true"> >
</el-table-column>
</el-table-column> <el-table-column
prop="content"
<el-table-column prop="serviceTimeStart" align="center"
align="center" min-width="250"
width="300" label="政策内容"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
label="政策时间"> >
<template slot-scope="scope"> </el-table-column>
<span>{{scope.row.startDate}}-{{scope.row.endDate}}</span>
</template> <el-table-column
</el-table-column> prop="serviceTimeStart"
align="center"
<el-table-column prop="expiredFlag" width="300"
align="center" :show-overflow-tooltip="true"
width="100" label="政策时间"
label="是否过期" >
:show-overflow-tooltip="true"> <template slot-scope="scope">
<template slot-scope="scope"> <span>{{ scope.row.startDate }}-{{ scope.row.endDate }}</span>
<span>{{scope.row.expiredFlag==='1'?'已过期':'未过期'}}</span> </template>
</template> </el-table-column>
</el-table-column>
<el-table-column
<el-table-column fixed="right" prop="expiredFlag"
label="操作" align="center"
align="center" width="100"
width="220"> label="是否过期"
<template slot-scope="scope"> :show-overflow-tooltip="true"
<el-button @click="handleDetail(scope.row)" >
type="text" <template slot-scope="scope">
size="small" <span>{{
class="div-table-button--detail">详情</el-button> scope.row.expiredFlag === "1" ? "已过期" : "未过期"
<el-button @click="handleEdit(scope.row)" }}</span>
type="text" </template>
size="small" </el-table-column>
class="div-table-button--edit">编辑</el-button>
<el-button @click="handleCopy(scope.row)" <el-table-column fixed="right" label="操作" align="center" width="220">
type="text" <template slot-scope="scope">
size="small" <el-button
class="div-table-button--edit">复制</el-button> @click="handleDetail(scope.row)"
<el-button @click="handlePersonList(scope.row)" type="text"
type="text" size="small"
size="small" >详情</el-button
class="div-table-button--edit">人员名单</el-button> >
<el-button @click="handleDel(scope.row)" <el-button
@click="handleEdit(scope.row)"
type="text"
size="small"
>编辑</el-button
>
<el-button
@click="handleCopy(scope.row)"
type="text"
size="small"
>复制</el-button
>
<!-- <el-button @click="handlePersonList(scope.row)"
type="text" type="text"
size="small" size="small"
class="div-table-button--delete">删除</el-button> class="div-table-button--edit">人员名单</el-button> -->
<el-button
</template> @click="handleDel(scope.row)"
</el-table-column> type="text"
</el-table> size="small"
>删除</el-button
<div> >
<el-pagination @size-change="handleSizeChange" </template>
@current-change="handleCurrentChange" </el-table-column>
:current-page.sync="pageNo" </el-table>
:page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(pageSize)" <div>
layout="sizes, prev, pager, next, total" <el-pagination
:total="total"> @size-change="handleSizeChange"
</el-pagination> @current-change="handleCurrentChange"
</div> :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> </div>
<el-dialog v-if="showAdd" <el-dialog
:visible.sync="showAdd" v-if="showAdd"
:close-on-click-modal="false" :visible.sync="showAdd"
:close-on-press-escape="false" :close-on-click-modal="false"
:title="addDiaTitle" :close-on-press-escape="false"
:modal-append-to-body="false" :title="addDiaTitle"
width="1050px" :modal-append-to-body="false"
top="5vh" width="1050px"
class="dialog-h" top="5vh"
@closed="showAdd = false"> class="dialog-h"
<add-policy ref="ref_add_form" @closed="showAdd = false"
:formType="formType" >
:policyId="policyId" <add-policy
@handleOk="handleOk" ref="ref_add_form"
@handleClose="handleClose"></add-policy> :formType="formType"
:policyId="policyId"
@handleOk="handleOk"
@handleClose="handleClose"
></add-policy>
</el-dialog> </el-dialog>
<el-dialog v-if="showPersonList" <el-dialog
:visible.sync="showPersonList" v-if="showPersonList"
:close-on-click-modal="false" :visible.sync="showPersonList"
:close-on-press-escape="false" :close-on-click-modal="false"
:title="'人员名单'" :close-on-press-escape="false"
width="1150px" :title="'人员名单'"
top="5vh" width="1150px"
class="dialog-h" top="5vh"
@closed="showPersonList = false"> class="dialog-h"
<person-list ref="ref_detail_form" @closed="showPersonList = false"
:policyId="policyId" >
:ruleList="ruleList" <person-list
@handleOk="handleOk" ref="ref_detail_form"
@handleClose="handleClose" :policyId="policyId"
:formType="formType"> :ruleList="ruleList"
@handleOk="handleOk"
@handleClose="handleClose"
:formType="formType"
>
</person-list> </person-list>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -213,18 +282,15 @@ import axios from "axios";
import addPolicy from "./addPolicy"; import addPolicy from "./addPolicy";
import personList from "./personList"; import personList from "./personList";
export default { export default {
components: { addPolicy, personList }, components: { addPolicy, personList },
data () { data() {
return { return {
tableLoading: false, tableLoading: false,
user: {}, user: {},
agencyId: '', agencyId: "",
policyLevelArray: [], //
tableData: [], tableData: [],
statusArray: [ statusArray: [
@ -238,143 +304,153 @@ export default {
}, },
], ],
formData: { formData: {
title: '',// title: "", //
content: '',// content: "", //
expiredFlag: '',//10 expiredFlag: "", //10
}, },
pageNo: 1, pageNo: 1,
pageSize: window.localStorage.getItem("pageSize") || 20, pageSize: window.localStorage.getItem("pageSize") || 20,
total: 1, total: 1,
policyId: '', policyId: "",
serviceProjectName: '', serviceProjectName: "",
showAdd: false, showAdd: false,
formType: 'add', formType: "add",
addDiaTitle: '新增政策', addDiaTitle: "新增政策",
showPersonList: false, showPersonList: false,
ruleList: [] ruleList: [],
}; };
}, },
computed: { computed: {
maxTableHeight () { maxTableHeight() {
return this.$store.state.inIframe return this.$store.state.inIframe
? this.clientHeight - 350 + this.iframeHeigh ? this.clientHeight - 350 + this.iframeHeigh
: this.clientHeight - 350; : this.clientHeight - 350;
}, },
...mapGetters(["clientHeight", "iframeHeight"]), ...mapGetters(["clientHeight", "iframeHeight"]),
}, },
watch: { watch: {},
mounted() {
}, console.log(this.$store.state);
mounted () { this.user = this.$store.state.user;
console.log(this.$store.state) this.agencyId = this.user.agencyId;
this.user = this.$store.state.user this.getDictOptions();
this.agencyId = this.user.agencyId
this.getTableData(); this.getTableData();
}, },
methods: { methods: {
handleSearch(val) {
handleSearch (val) {
console.log(this.formData); console.log(this.formData);
this.pageNo = 1; this.pageNo = 1;
this.getTableData(); this.getTableData();
}, },
async handleAdd () { async handleAdd() {
this.addDiaTitle = '新增政策' this.addDiaTitle = "新增政策";
this.formType = 'add' this.formType = "add";
this.showAdd = true; this.showAdd = true;
}, },
async handleDetail (row) { async handleDetail(row) {
this.policyId = row.policyId this.policyId = row.policyId;
this.addDiaTitle = '政策详情' this.addDiaTitle = "政策详情";
this.formType = 'detail' this.formType = "detail";
this.showAdd = true this.showAdd = true;
}, },
async handleEdit (row) { async handleEdit(row) {
this.policyId = row.policyId this.policyId = row.policyId;
this.addDiaTitle = '编辑政策' this.addDiaTitle = "编辑政策";
this.formType = 'edit' this.formType = "edit";
this.showAdd = true; this.showAdd = true;
}, },
async handleCopy (row) { async handleCopy(row) {
this.policyId = row.policyId this.policyId = row.policyId;
this.addDiaTitle = '新增政策' this.addDiaTitle = "新增政策";
this.formType = 'copy' this.formType = "copy";
this.showAdd = true; this.showAdd = true;
}, },
// //
async handlePersonList (row) { // async handlePersonList (row) {
// this.policyId = row.policyId
// await this.loadRuleList()
// this.formType = 'personList'
// this.showPersonList = true;
// },
async getDictOptions() {
//
this.$http
.post("/sys/dict/data/dictlist", {
dictType: "policy_level",
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.policyLevelArray = res.data;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
this.policyId = row.policyId //
await this.loadRuleList() this.$http
this.formType = 'personList' .get("/governance/commonServiceType/selectList/0")
this.showPersonList = true; .then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.serviceTypesLevel1 = res.data;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
}, },
async loadRuleList() {
const url = "/heart/policy/rulelist/" + this.policyId;
async loadRuleList () { let params = {};
const url = "/heart/policy/rulelist/" + this.policyId
let params = {} const { data, code, msg } = await requestPost(url, params);
const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
this.ruleList = data this.ruleList = data;
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
handleClose() {
this.policyId = "";
this.formType = "";
handleClose () { this.showAdd = false;
this.policyId = "" this.showPersonList = false;
this.formType = ''
this.showAdd = false
this.showPersonList = false
}, },
handleOk () { handleOk() {
this.handleClose() this.handleClose();
this.pageNo = 1 this.pageNo = 1;
this.getTableData() this.getTableData();
}, },
async handleDel(row) {
async handleDel (row) { this.policyId = row.policyId;
this.policyId = row.policyId
this.$confirm("确认删除政策?", "提示", { this.$confirm("确认删除政策?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(() => { .then(() => {
this.delPolicy() this.delPolicy();
}) })
.catch(err => { .catch((err) => {
if (err == "cancel") { if (err == "cancel") {
// this.$message({ // this.$message({
// type: "info", // type: "info",
@ -382,11 +458,9 @@ export default {
// }); // });
} }
}); });
}, },
async delPolicy () { async delPolicy() {
const url = `/heart/policy/delete/${this.policyId}`; const url = `/heart/policy/delete/${this.policyId}`;
const { data, code, msg } = await requestPost(url, {}); const { data, code, msg } = await requestPost(url, {});
@ -399,8 +473,8 @@ export default {
} }
}, },
async getTableData () { async getTableData() {
this.tableLoading = true this.tableLoading = true;
const url = "/governance/policy/list"; const url = "/governance/policy/list";
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icServiceProject/service/recordList"; // const url = "http://yapi.elinkservice.cn/mock/245/heart/icServiceProject/service/recordList";
const { pageSize, pageNo, formData } = this; const { pageSize, pageNo, formData } = this;
@ -410,34 +484,32 @@ export default {
...formData, ...formData,
}); });
this.tableLoading = false this.tableLoading = false;
if (code === 0) { if (code === 0) {
this.total = data.total || 0; this.total = data.total || 0;
this.tableData = data.list this.tableData = data.list
? data.list.map((item) => { ? data.list.map((item) => {
return item; return item;
}) })
: []; : [];
this.tableData.forEach(item => { this.tableData.forEach((item) => {
if (item.operationType === '2') { if (item.operationType === "2") {
item.operationTypeShow = '已转需求' item.operationTypeShow = "已转需求";
} }
if (item.operationType === '1') { if (item.operationType === "1") {
item.operationTypeShow = '已立项' item.operationTypeShow = "已立项";
} }
if (item.operationType === '0') { if (item.operationType === "0") {
item.operationTypeShow = '已回复' item.operationTypeShow = "已回复";
} }
}); });
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
async handleExport () { async handleExport() {
const url = "/governance/icEvent/export"; const url = "/governance/icEvent/export";
const { pageSize, pageNo, formData } = this; const { pageSize, pageNo, formData } = this;
axios({ axios({
@ -472,35 +544,30 @@ export default {
}); });
}, },
handleSizeChange (val) { handleSizeChange(val) {
this.pageSize = val; this.pageSize = val;
window.localStorage.setItem("pageSize", val); window.localStorage.setItem("pageSize", val);
this.getTableData(); this.getTableData();
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
this.pageNo = val; this.pageNo = val;
this.getTableData(); this.getTableData();
}, },
resetSearch () { resetSearch() {
this.formData = { this.formData = {
title: '',// title: "", //
content: '',// content: "", //
expiredFlag: '',//10 expiredFlag: "", //10
} };
this.pageNo = 1 this.pageNo = 1;
this.getTableData() this.getTableData();
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/assets/scss/buttonstyle.scss";
@import "@/assets/scss/modules/management/list-main.scss"; @import "@/assets/scss/modules/management/list-main.scss";
@import "@/assets/scss/modules/shequzhili/event-info.scss";
</style> </style>

Loading…
Cancel
Save