import { mapGetters } from "vuex";
import { Loading } from "element-ui"; // 引入Loading服务
-import { requestPost } from "@/js/dai/request";
+import { requestPost, requestGet } from "@/js/dai/request";
import rule from "./rule";
import labelForm from "../labelConfig/addForm.vue";
@@ -430,8 +439,8 @@ export default {
},
formData: {
- policyTypeLevel1Id: "", // 公共服务(政策级别)一级分类id
- policyCategoryL2:"",
+ policyCategoryL1: "", // 公共服务(政策级别)一级分类id
+ policyCategoryL2: "",
policyLevel: "", //政府级别
startDate: "", //起始时间yyyy-MM-dd
endDate: "", //截止时间yyyy-MM-dd
@@ -499,16 +508,18 @@ export default {
},
components: { rule, labelForm },
async mounted() {
- this.startLoading();
- this.getServiceTypeDictOptions();
- this.getDictOptions();
- this.loadScopeTree();
+ await this.startLoading();
+ await this.getServiceTypeDictOptions();
+ await this.getDictOptions();
+ await this.loadScopeTree();
await this.loadDemandoption();
if (this.formType === "add") {
this.$refs.ref_form.resetFields();
} else {
- this.loadFormInfo();
+ await this.loadFormInfo();
+ await this.handleChangeServiceTypeLevel1();
+ await this.handleServiceChange();
}
this.endLoading();
@@ -545,22 +556,29 @@ export default {
},
async loadFormInfo() {
- const url = "/heart/policy/detail/" + this.policyId;
+ const url = "/governance/policy/policyDetail/" + this.policyId;
let params = {};
- const { data, code, msg } = await requestPost(url, params);
+ const { data, code, msg } = await requestGet(url, params);
if (code === 0) {
this.demandIdArray = [];
- data.categoryList.forEach((element) => {
- let arr = element.codePath.split(",");
- this.demandIdArray.push(arr);
- });
+ // data.categoryList.forEach((element) => {
+ // let arr = element.codePath.split(",");
+ // this.demandIdArray.push(arr);
+ // });
// this.formData.ruleList = data.ruleList
-
+ data.policyLevel = "" + data.policyLevel;
this.formData = data;
-
+ this.newFormData = data.assignInfo;
+ if (data.assignInfo) {
+ for (let i in data.assignInfo.serviceScopeList) {
+ this.newFormData.serviceScopeList.push(
+ data.assignInfo.serviceScopeList[i].objectId
+ );
+ }
+ }
if (data.attachmentList) {
this.fileList = data.attachmentList;
}
@@ -614,13 +632,11 @@ export default {
this.$message.error(msg);
}
},
- async handleServiceChange(type, val) {
- console.log(val);
- await this.getServiceuserList(val);
+ async handleServiceChange() {
+ await this.getServiceuserList();
},
-
- async getServiceuserList(serverOrgType) {
- if (!serverOrgType) return false;
+ async getServiceuserList() {
+ if (!this.formData.assignInfo) return;
if (this.formData.commonServiceTypeId == "") {
this.$message.error("请先选择需求类别!");
return;
@@ -628,9 +644,10 @@ export default {
const url = "/actual/base/serviceitem/listServerOrg";
let params = {
serviceTypeId: this.formData.policyCategoryL2,
- serverOrgType: serverOrgType,
+ serverOrgType: this.formData.assignInfo.serverOrgType,
businessType: "common_service",
};
+ console.log(this.formData);
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
this.serviceOptiondList = data;
@@ -654,7 +671,7 @@ export default {
console.log("组织类型获取失败!");
});
},
- async getDictOptions() {
+ getDictOptions() {
// 政策级别下拉
this.$http
.post("/sys/dict/data/dictlist", {
@@ -746,8 +763,7 @@ export default {
// this.addFuwu();
// }
// });
- this.addFuwu();
-
+ this.addFuwu();
},
getLastItem(list, vals, key) {
let LIST = list || [];
@@ -766,8 +782,9 @@ export default {
}
},
async operationOption() {
- this.sarr = []
+ this.sarr = [];
// 使用递归找出符合条件的数据需要
+ if (!this.newFormData) return;
await this.getLastItem(
this.casOptions,
this.newFormData.serviceScopeList,
@@ -798,42 +815,53 @@ export default {
// 处理服务范围数据
await this.operationOption();
// this.formData.attachmentList = [...this.fileList];
- this.fileList.forEach(item=>{
- this.formData.attachmentList.push({
- name:item.attachmentName,
- type:item.attachmentType,
- url:item.attachmentUrl,
- format:item.attachmentFormat,
- duration:0,
- })
- })
+ // this.fileList.forEach(item=>{
+ // this.formData.attachmentList.push({
+ // name:item.attachmentName,
+ // type:item.attachmentType,
+ // url:item.attachmentUrl,
+ // format:item.attachmentFormat,
+ // duration:0,
+ // })
+ // })
this.formData.assignInfo = this.newFormData;
- let url = "/governance/policy/addPolicy";
+ let url = "";
if (this.formType === "add" || this.formType === "copy") {
url = "/governance/policy/addPolicy";
// this.formData.policyId = "";
} else {
- url = "/heart/policy/update";
- // this.formData.policyId = this.policyId;
+ url = "/governance/policy/updatePolicy";
+ this.formData.policyId = this.policyId;
+ }
+ //为什么不能传null还要返回null呢?
+ if (this.formType == "copy"&& this.formData.assignFlag == 0) {
+ this.formData.assignInfo = {
+ noticeApproches: [],
+ serverOrgId: "",
+ serverOrgType: "",
+ serviceScopeList: [],
+ serviceTimeEnd: "",
+ serviceTimeStart: "",
+ };
+ this.formData.attachmentList = []
}
-
// const url = 'http://yapi.elinkservice.cn/mock/245/heart/icServiceProject/service/initiate'
let params = {
...this.formData,
};
- delete params.policyTypeLevel1Id
- delete params.resiSearchTagName
+ delete params.policyCategoryL1;
+ delete params.resiSearchTagName;
console.log(params);
- const { data, code, msg } = await requestPost(url, params)
+ const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
- this.$message.success('操作成功')
- this.resetData()
- this.$emit('handleOk')
+ this.$message.success("操作成功");
+ this.resetData();
+ this.$emit("handleOk");
} else {
- this.btnDisable = false
- this.$message.error(msg)
+ this.btnDisable = false;
+ this.$message.error(msg);
}
},
@@ -984,11 +1012,11 @@ export default {
// 服务类型下拉框选中事件
handleChangeServiceTypeLevel1() {
- this.formData.policyCategoryL2 = "";
+ // this.formData.policyCategoryL2 = "";
this.$http
.get(
"/governance/commonServiceType/selectList/" +
- this.formData.policyTypeLevel1Id
+ this.formData.policyCategoryL1
)
.then(({ data: res }) => {
if (res.code !== 0) {
diff --git a/src/views/modules/communityService/policy/policyList.vue b/src/views/modules/communityService/policy/policyList.vue
index 10dc87899..01a58dec3 100644
--- a/src/views/modules/communityService/policy/policyList.vue
+++ b/src/views/modules/communityService/policy/policyList.vue
@@ -356,19 +356,19 @@ export default {
},
async handleDetail(row) {
- this.policyId = row.policyId;
+ this.policyId = row.id;
this.addDiaTitle = "政策详情";
this.formType = "detail";
this.showAdd = true;
},
async handleEdit(row) {
- this.policyId = row.policyId;
+ this.policyId = row.id;
this.addDiaTitle = "编辑政策";
this.formType = "edit";
this.showAdd = true;
},
async handleCopy(row) {
- this.policyId = row.policyId;
+ this.policyId = row.id;
this.addDiaTitle = "新增政策";
this.formType = "copy";
this.showAdd = true;
@@ -425,7 +425,7 @@ export default {
},
async handleDel(row) {
- this.policyId = row.policyId;
+ this.policyId = row.id;
this.$confirm("确认删除政策?", "提示", {
confirmButtonText: "确定",
@@ -446,7 +446,7 @@ export default {
},
async delPolicy() {
- const url = `/heart/policy/delete/${this.policyId}`;
+ const url = `/governance/policy/deletePolicy/${this.policyId}`;
const { data, code, msg } = await requestPost(url, {});
diff --git a/src/views/modules/cpts/base2/cpts/edit.vue b/src/views/modules/cpts/base2/cpts/edit.vue
index 89e574dad..ead2d1097 100644
--- a/src/views/modules/cpts/base2/cpts/edit.vue
+++ b/src/views/modules/cpts/base2/cpts/edit.vue
@@ -281,6 +281,10 @@
ref="mapSearch"
@click="handleSearchMap(item)">查询 -->
+
+ {{ fmData[item.keyName] || "--" }}
-
+
+
-
- {{ fmData[item.keyName] || "--" }}
-
+