From eae9cd789102c4985b8890d99c8a7d4a62d1e1f8 Mon Sep 17 00:00:00 2001
From: mk <2403457699@qq.com>
Date: Fri, 14 Apr 2023 21:10:13 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=AE=A1=E7=90=86=E5=A4=84?=
=?UTF-8?q?=E7=90=86=E4=B8=AD=E4=BA=8B=E4=BB=B6=E5=88=86=E7=B1=BB=E5=8A=A0?=
=?UTF-8?q?=E9=AA=8C=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../shequzhili/event/cpts/myCascader.vue | 62 ++
.../event/cpts/process-form-issue.vue | 32 +-
.../event/cpts/process-form-project.vue | 577 +++++++++---------
.../event/cpts/process-form-replay.vue | 31 +-
4 files changed, 407 insertions(+), 295 deletions(-)
create mode 100644 src/views/modules/shequzhili/event/cpts/myCascader.vue
diff --git a/src/views/modules/shequzhili/event/cpts/myCascader.vue b/src/views/modules/shequzhili/event/cpts/myCascader.vue
new file mode 100644
index 000000000..23a084725
--- /dev/null
+++ b/src/views/modules/shequzhili/event/cpts/myCascader.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+>
\ No newline at end of file
diff --git a/src/views/modules/shequzhili/event/cpts/process-form-issue.vue b/src/views/modules/shequzhili/event/cpts/process-form-issue.vue
index 3e2d9ae72..4afb133aa 100644
--- a/src/views/modules/shequzhili/event/cpts/process-form-issue.vue
+++ b/src/views/modules/shequzhili/event/cpts/process-form-issue.vue
@@ -10,14 +10,20 @@
:class="{'form-item':source==='visiual'}"
prop="categoryList">
-
+ @change="handleChangeCate"> -->
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
- (formData.staffList = ret)"
- @close="visibleStaffPanel = false" />
+ (formData.staffList = ret)"
+ @close="visibleStaffPanel = false"
+ />
@@ -92,116 +121,134 @@
-->
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
{{ item.name }}
-
-
+
+
选择标签
-
+
-
+
-
+
- 关闭
+ 关闭
-
-
@@ -211,64 +258,64 @@ import { requestPost } from "@/js/dai/request";
import selectStaff from "@/views/components/selectStaff";
import formVltHelper from "dai-js/tools/formVltHelper";
import foldText from "@/views/components/foldText";
-
+import myCascader from "./myCascader.vue";
import { isCard } from "@/utils/validate";
let loading; // 加载动画
-function iniFmData () {
+function iniFmData() {
return {
- operationType: '1',//处理方式[0:已回复 1:已转项目 2:已转需求]
- publicReply: '',//项目方案 1000
- internalRemark: '',// 内部备注 1000
- gridId: '',//
- assistanceUnitIndex: '',
- assistanceUnitId: '',// 协办单位Id
- assistanceUnitType: '',// 协办单位类型,1社区自组织,2联建单位
- staffList: [],// 勾选人员信息
- categoryList: [],//
- tagList: [],//
-
- internalFile: [],//
- title: '',//
-
- publicFile: [],//
- locateAddress: '',//
- locateLongitude: '',//
- locateDimension: '',//
- eventId: '',//
+ operationType: "1", //处理方式[0:已回复 1:已转项目 2:已转需求]
+ publicReply: "", //项目方案 1000
+ internalRemark: "", // 内部备注 1000
+ gridId: "", //
+ assistanceUnitIndex: "",
+ assistanceUnitId: "", // 协办单位Id
+ assistanceUnitType: "", // 协办单位类型,1社区自组织,2联建单位
+ staffList: [], // 勾选人员信息
+ categoryList: [], //
+ tagList: [], //
+
+ internalFile: [], //
+ title: "", //
+
+ publicFile: [], //
+ locateAddress: "", //
+ locateLongitude: "", //
+ locateDimension: "", //
+ eventId: "", //
};
}
export default {
- data () {
+ data() {
return {
btnDisable: false,
customerId: localStorage.getItem("customerId"),
- gridList: [],//所属网格list--场所区域
- myDepartmentList: [],//部门数组
+ gridList: [], //所属网格list--场所区域
+ myDepartmentList: [], //部门数组
visibleStaffPanel: false,
- assistanceUnitList: [],//协办单位数组
- tagList: [],//标签数组
+ assistanceUnitList: [], //协办单位数组
+ tagList: [], //标签数组
tagOptions: [],
visibleTagPanel: false,
selectedTagData: [],
casOptions: [],
- iscascaderShow: 0,
+ // iscascaderShow: 0,
selCategoryArray: [],
selCateObj: {},
optionProps: {
multiple: false,
- value: 'id',
- label: 'name',
- children: 'subCategory',
+ value: "id",
+ label: "name",
+ children: "subCategory",
},
formData: iniFmData(),
formDataTemp: {
assistanceUnitIndex: 0,
- assistanceUnitId: '',// 协办单位Id
- assistanceUnitType: '',// 协办单位类型,1社区自组织,2联建单位
+ assistanceUnitId: "", // 协办单位Id
+ assistanceUnitType: "", // 协办单位类型,1社区自组织,2联建单位
eventId: "",
gridId: "63d5ff92ea981b1c58e4914ac894c610",
@@ -280,38 +327,34 @@ export default {
internalFile: [],
staffList: [],
- tagList: [{
- id: "46294b3c9f96ee4d0b00e997e06c8f97",
- isDisable: "enable",
- name: "车行道、人行道、盲道、无障碍通道、路名牌",
- },
- {
- id: "953bafc1191f784841d9b8da61ec7b9b",
- isDisable: "enable",
- name: "城市广场管理",
- }],
-
-
+ tagList: [
+ {
+ id: "46294b3c9f96ee4d0b00e997e06c8f97",
+ isDisable: "enable",
+ name: "车行道、人行道、盲道、无障碍通道、路名牌",
+ },
+ {
+ id: "953bafc1191f784841d9b8da61ec7b9b",
+ isDisable: "enable",
+ name: "城市广场管理",
+ },
+ ],
},
okflag: false,
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2",
- eventDetailCopy: {}
-
+ eventDetailCopy: {},
};
},
- components: { selectStaff, foldText },
+ components: { selectStaff, foldText, myCascader },
computed: {
- dataRule () {
-
+ dataRule() {
return {
categoryList: [
- { required: true, message: "请填写事件分类", trigger: "blur" },
- ],
- title: [
- { required: true, message: "标题不能为空", trigger: "blur" },
+ { required: true, message: "事件分类不能为空", trigger: "blur" },
],
+ title: [{ required: true, message: "标题不能为空", trigger: "blur" }],
gridId: [
{ required: true, message: "所属网格不能为空", trigger: "blur" },
],
@@ -321,14 +364,12 @@ export default {
publicReply: [
{ required: true, message: "项目方案不能为空", trigger: "blur" },
],
-
};
},
-
-
},
props: {
- gridId: {//新增是选择的网格id
+ gridId: {
+ //新增是选择的网格id
type: String,
default: "",
},
@@ -338,23 +379,21 @@ export default {
},
eventDetailData: {
type: Object,
- default () {
- return {}
- }
+ default() {
+ return {};
+ },
},
- source: {//展示来源:manage 管理平台 visiual 可视化平台
+ source: {
+ //展示来源:manage 管理平台 visiual 可视化平台
type: String,
- default: 'manage'
- }
+ default: "manage",
+ },
},
watch: {
gridId: function (val) {
-
- this.formData.gridId = val
-
+ this.formData.gridId = val;
},
"formData.assistanceUnitIndex": function (val) {
-
if (val === "" || this.assistanceUnitList.length === 0) {
this.formData.assistanceUnitId = "";
this.formData.assistanceUnitType = "";
@@ -366,7 +405,7 @@ export default {
}
},
- async selectedTagData (val) {
+ async selectedTagData(val) {
const { tagOptions } = this;
this.tagList = await Promise.all(
val.map(async (id) => {
@@ -393,115 +432,112 @@ export default {
);
this.tagList = this.tagList.filter((item) => item.id);
- console.log(this.tagList)
+ console.log(this.tagList);
},
},
- created () {
-
+ created() {},
-
- },
-
- async mounted () {
- const { user } = this.$store.state
- this.agencyId = user.agencyId
+ async mounted() {
+ const { user } = this.$store.state;
+ this.agencyId = user.agencyId;
this.getCategoryList();
this.loadGrid();
this.getMyDepartmentList();
// this.getAssistanceUnitList();
- this.getTagList()
+ this.getTagList();
// this.formData = { ...this.formDataTemp }
if (this.eventId) {
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData));
- this.formData.gridId = this.eventDetailCopy.gridId
+ this.formData.gridId = this.eventDetailCopy.gridId;
- if (this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.categoryId) {
- this.selCategoryArray = []
- this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId)
- this.selCategoryArray.push(this.eventDetailCopy.categoryId)
+ if (
+ this.eventDetailCopy.parentCategoryId &&
+ this.eventDetailCopy.categoryId
+ ) {
+ this.selCategoryArray = [];
+ this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId);
+ this.selCategoryArray.push(this.eventDetailCopy.categoryId);
this.selCateObj = {
name: this.eventDetailCopy.categoryName,
- id: this.eventDetailCopy.categoryId
- }
+ id: this.eventDetailCopy.categoryId,
+ };
- this.formData.categoryList = []
- this.formData.categoryList.push(this.selCateObj)
+ this.formData.categoryList = [];
+ this.formData.categoryList.push(this.selCateObj);
}
} else {
- this.formData.gridId = this.gridId
-
+ this.formData.gridId = this.gridId;
}
},
methods: {
- async getCategoryList () {
- const url = "/governance/issueprojectcategorydict/list"
+ async getCategoryList() {
+ const url = "/governance/issueprojectcategorydict/list";
- let params = {}
+ let params = {};
- const { data, code, msg } = await requestPost(url, params)
+ const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
- let treeDataNew = this.filterTree(data)
+ let treeDataNew = this.filterTree(data);
//组织级联数据
- ++this.iscascaderShow
- this.casOptions = []
- this.casOptions = treeDataNew
-
+ // ++this.iscascaderShow;
+ this.casOptions = [];
+ this.casOptions = treeDataNew;
} else {
- this.$message.error(msg)
+ this.$message.error(msg);
}
-
},
- handleChangeCate () {
- console.log(this.$refs["myCascader"].getCheckedNodes()[0].data)
- this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
- this.formData.categoryList = []
- this.formData.categoryList.push(this.selCateObj)
+ handleChangeCate(obj) {
+ // console.log(this.$refs["myCascader"].getCheckedNodes()[0].data);
+ // this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data;
+ this.selCateObj = obj
+ this.formData.categoryList = [];
+ let flag = JSON.stringify(obj) == '{}'
+ if(flag) this.formData.categoryList = []
+ else this.formData.categoryList.push(this.selCateObj);
},
//重构树,去除网格
- filterTree (arr) {
- let childs = arr
+ filterTree(arr) {
+ let childs = arr;
for (let i = childs.length; i--; i > 0) {
if (childs[i].subCategory) {
if (childs[i].subCategory.length) {
- this.filterTree(childs[i].subCategory)
+ this.filterTree(childs[i].subCategory);
} else {
- delete childs[i].subCategory
+ delete childs[i].subCategory;
}
}
}
- return arr
+ return arr;
},
- async loadGrid () {
- const url = "/gov/org/customergrid/gridoption"
+ async loadGrid() {
+ const url = "/gov/org/customergrid/gridoption";
let params = {
- agencyId: this.agencyId
- }
+ agencyId: this.agencyId,
+ };
- const { data, code, msg } = await requestPost(url, params)
+ const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
- this.gridList = data
-
+ this.gridList = data;
} else {
- this.$message.error(msg)
+ this.$message.error(msg);
}
-
},
//加载处理部门数据
- async getMyDepartmentList () {
+ async getMyDepartmentList() {
const url = "/governance/trace/approvalagencylist";
const { data, code, msg } = await requestPost(url, {
- issueId: '',
- projectStaffId: '',
+ issueId: "",
+ projectStaffId: "",
});
if (code === 0) {
@@ -512,7 +548,7 @@ export default {
},
//加载协同单位数据
- async getAssistanceUnitList () {
+ async getAssistanceUnitList() {
const url = "/heart/icpartyunit/assistanceUnitList";
const { data, code, msg } = await requestPost(url, {
@@ -521,17 +557,14 @@ export default {
if (code === 0) {
this.assistanceUnitList = data;
-
} else {
this.$message.error(msg);
}
},
//加载标签
- async getTagList () {
+ async getTagList() {
const url = "/governance/issueprojecttagdict/list";
- const { data, code, msg } = await requestPost(url, {
-
- });
+ const { data, code, msg } = await requestPost(url, {});
if (code === 0) {
this.tagOptions = {
@@ -543,29 +576,26 @@ export default {
}
},
- handleTagChange (val) {
+ handleTagChange(val) {
console.log(val);
},
- updateProjectTag () {
+ updateProjectTag() {
this.visibleTagPanel = false;
},
-
- async getProjectInfo () {
- this.okflag = false
+ async getProjectInfo() {
+ this.okflag = false;
this.$refs["ref_form"].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj);
-
} else {
-
- this.formData.tagList = this.tagList
- this.okflag = true
+ this.formData.tagList = this.tagList;
+ this.okflag = true;
}
});
},
- beforeImgUpload (file) {
+ beforeImgUpload(file) {
const isLt1M = file.size / 1024 / 1024 < 10;
if (!isLt1M) {
@@ -573,10 +603,8 @@ export default {
}
return isLt1M;
},
- resetData () {
-
- },
- handleImgSuccess (res, file, fileList) {
+ resetData() {},
+ handleImgSuccess(res, file, fileList) {
console.log("res.data.url", file);
if (res.code === 0 && res.msg === "success") {
console.log("res.data.url", res.data.url);
@@ -593,7 +621,7 @@ export default {
}
},
- handleImgRemove (file) {
+ handleImgRemove(file) {
let index = this.formData.internalFile.findIndex(
(item) => item.url == file.response.data.url
);
@@ -601,9 +629,8 @@ export default {
console.log(this.formData.internalFile);
},
-
// 开启加载动画
- startLoading () {
+ startLoading() {
loading = Loading.service({
lock: true, // 是否锁定
text: "正在加载……", // 加载中需要显示的文字
@@ -611,7 +638,7 @@ export default {
});
},
// 结束加载动画
- endLoading () {
+ endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
diff --git a/src/views/modules/shequzhili/event/cpts/process-form-replay.vue b/src/views/modules/shequzhili/event/cpts/process-form-replay.vue
index 925a796c2..639bfef75 100644
--- a/src/views/modules/shequzhili/event/cpts/process-form-replay.vue
+++ b/src/views/modules/shequzhili/event/cpts/process-form-replay.vue
@@ -10,14 +10,18 @@
:class="{'form-item':source==='visiual'}"
prop="categoryList">
-
+ @change="handleChangeCate"> -->
+