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

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

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

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

@ -131,16 +131,25 @@
>
</div>
<el-table
ref="config_table"
ref="gxxq_table"
border
:data="tableData"
v-loading="tableLoading"
style="width: 100%"
:height="tableHeight"
@select-all="selectAll"
@selection-change="handelSelection"
>
<el-table-column
type="selection"
fixed="left"
align="center"
width="50"
/>
<el-table-column
label="需求类别"
prop="commonServiceTypeName"
:reserve-selection="true"
fixed="left"
align="center"
/>
@ -169,11 +178,7 @@
/>
<el-table-column fixed="right" label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button
style="margin-right: 10px"
@click="handleEdit(scope.row)"
size="small"
type="text"
<el-button @click="handleEdit(scope.row)" size="small" type="text"
>查看</el-button
>
<el-button
@ -198,6 +203,9 @@
</el-table>
<div class="div-flex">
<el-button @click="deleteBatch">
批量删除
</el-button>
<div class="m-page">
<el-pagination
@size-change="handleSizeChange"
@ -249,7 +257,8 @@
:commonServiceTypeName="commonServiceTypeName"
:formType="formType"
@handleClose="addFormCancle"
@handleComfirm="addFormOk" :gxxq-id="gxxqId"
@handleComfirm="addFormOk"
:gxxq-id="gxxqId"
></detail-form>
</el-dialog>
</div>
@ -266,10 +275,10 @@ export default {
//
serviceTypesLevel1: [],
serviceTypesLevel2: [],
commonServiceTypeName:'',
formType:"add",
formEditShow:false,
gxxqId:"",
commonServiceTypeName: "",
formType: "add",
formEditShow: false,
gxxqId: "",
formData: {
title: "",
serviceTypeLevel1Id: "",
@ -288,6 +297,8 @@ export default {
label: "未指派服务",
},
],
selection: [],
selAllFlag: false,
tableData: [],
pageNo: 1,
pageSize: 20,
@ -300,7 +311,7 @@ export default {
};
},
created() {},
components: { addForm,detailForm },
components: { addForm, detailForm },
methods: {
async getCommonDemandList() {
const url = "/governance/commonDemand/list";
@ -320,18 +331,29 @@ export default {
},
addFormCancle() {
this.formShow = false;
this.formEditShow = false
},
handelSelection(row){
this.selection = row
},
addFormOk() {
this.formShow = false;
this.formEditShow = false
this.getCommonDemandList();
},
selectAll(selection) {
this.selection = selection;
if (selection.length > 0) {
this.selAllFlag = true;
} else {
this.selAllFlag = false;
}
},
handleAdd(row, type) {
if (type == "add") {
this.formTitle = "添加需求";
this.formShow = true;
this.formType = 'add'
this.$nextTick(() => {
})
this.formType = "add";
} else {
this.formTitle = "修改需求";
this.formShow = true;
@ -342,10 +364,10 @@ export default {
});
}
},
handleEdit(row){
this.gxxqId = row.id
this.commonServiceTypeName = row.commonServiceTypeName
this.formEditShow = true
handleEdit(row) {
this.gxxqId = row.id;
this.commonServiceTypeName = row.commonServiceTypeName;
this.formEditShow = true;
},
handleSizeChange(val) {
console.log(`每页 ${val}`);
@ -353,12 +375,11 @@ export default {
this.getCommonDemandList();
},
async handleDel(row) {
const url = `/governance/commonDemand/delete/${row.id}`;
let { code, msg } = await requestGet(url);
const url = `/governance/commonDemand/delete/`;
let { code, msg } = await requestPost(url, [row.id]);
if (code == 0) {
this.$message.success("删除成功");
} else {
} else if (code >= 8000) {
this.$message.error(msg);
}
this.getCommonDemandList();
@ -387,6 +408,47 @@ export default {
diaClose() {
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() {
const url = "/sys/dict/data/dictlist";

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

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