@@ -64,8 +55,7 @@ export default {
categoryId: "",//事件分类
deptId: "", //指派部门
deptName: "",
- categoryList: [],
- files: [] //附件
+ categoryList: []
},
orgOptions: [],
orgOptionProps: {
@@ -81,14 +71,12 @@ export default {
eventDetailCopy: {},
selCategoryArray: [],
casOptions: [],
- fileList: [],
- uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile",
iscascaderShow: 0,
optionProps: {
multiple: false,
value: "id",
- label: "categoryName",
- children: "children",
+ label: "name",
+ children: "subCategory",
},
dataRule: {
content: [
@@ -104,8 +92,8 @@ export default {
{ required: true, message: "办结时限不能为空", trigger: "blur" },
]
},
- selCateObj: {
- id: ""
+ selCateObj:{
+ id:""
},
};
},
@@ -138,6 +126,7 @@ export default {
this.getCategoryList();
if (this.eventId) {
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData));
+ console.log(this.eventDetailCopy);
// 这一步接收到eventDetailCopy在这里回填
if (this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.categoryId) {
this.selCateObj.id = this.eventDetailCopy.categoryId
@@ -163,11 +152,12 @@ export default {
}
},
async getCategoryList() {
- const url = '/governance/icEvent/getCategoryTree';
+ const url = "/governance/issueprojectcategorydict/list";
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
- let treeDataNew = this.deepTree(data, "children");
+ let treeDataNew = this.filterTree(data);
+ //组织级联数据
++this.iscascaderShow;
this.casOptions = [];
this.casOptions = treeDataNew;
@@ -181,6 +171,7 @@ export default {
this.formData.orgType = obj.level === 'grid' ? 'grid' : 'agency'
this.formData.deptId = obj.agencyId
this.formData.deptName = obj.agencyName
+
} else {
this.form.orgType = ''
this.form.orgId = ''
@@ -190,25 +181,24 @@ export default {
if (this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0]) {
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
this.formData.categoryId = this.selCateObj.id
- console.log(this.formData.categoryId, 'this.formData.categoryId');
+ console.log(this.formData.categoryId,'this.formData.categoryId');
} else {
this.selCateObj = {}
}
},
//重构树,去除网格
- deepTree(arr, children) {
- if (Array.isArray(arr) && arr.length > 0) {
- return arr.map((item) => {
- return {
- ...item,
- [children]:
- (item[children] &&
- item[children].length > 0 &&
- this.deepTree(item[children], children)) ||
- null,
- };
- });
+ 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);
+ } else {
+ delete childs[i].subCategory;
+ }
+ }
}
+ return arr;
},
async getReplayInfo() {
this.okflag = false;
@@ -216,13 +206,11 @@ export default {
if (!valid) {
app.util.validateRule(messageObj);
} else {
+ console.log(this.selCateObj);
if (!this.selCateObj || !this.selCateObj.id) {
this.$message.error("请选择事件分类");
return false;
}
- if(this.fileList){
- this.formData.files = this.fileList
- }
this.formData.status = "processing";
this.formData.categoryId = this.selCateObj.id;
this.formData.categoryList = [];
@@ -234,74 +222,6 @@ export default {
resetData() {
this.agencyIdArray = []
},
- beforeUpload(file) {
- const array = file.name.split(".");
- const extension = array[array.length - 1];
- const formatarray = [
- "jpg",
- "png",
- "jpeg",
- "bmp",
- "mp4",
- "wma",
- "m4a",
- "mp3",
- "doc",
- "docx",
- "xls",
- "xlsx",
- "pdf",
- ];
- if (formatarray.indexOf(extension) === -1) {
- this.$message.error("只支持图片、word、pdf");
- return false;
- }
- },
- handleFileRemove(file) {
- if (file && file.status === "success") {
- this.fileList.splice(
- this.fileList.findIndex((item) => item.uid === file.uid),
- 1
- );
- }
- },
- handleFileSuccess(res, file) {
- if (res.code === 0 && res.msg === "success") {
- const array = file.name.split(".");
- const fileType = array[array.length - 1];
- const picArray = ["jpg", "png", "jpeg", "bmp"];
- const videoarray = ["mp4", "wma", "m4a"];
- const docArray = ["doc", "docx", "xls", "xlsx", "pdf"];
- const mp3Array = ["mp3"];
-
- if (picArray.indexOf(fileType) > -1) {
- file.attachmentFormat = "image";
- } else if (videoarray.indexOf(fileType) > -1) {
- file.attachmentFormat = "video";
- } else if (docArray.indexOf(fileType) > -1) {
- file.attachmentFormat = "doc";
- } else if (mp3Array.indexOf(fileType) > -1) {
- file.attachmentFormat = "voice";
- }
-
- file.url = res.data.url;
- file.type = fileType;
-
- file.attachmentName = file.name;
- file.attachmentType = file.type;
- file.attachmentUrl = file.url;
-
- this.fileList.push(file);
- } else this.$message.error(res.msg);
- },
- //下载
- handleFileDownload(file) {
- var a = document.createElement("a");
- var event = new MouseEvent("click");
- a.download = file.name;
- a.href = file.url;
- a.dispatchEvent(event);
- },
// 开启加载动画
startLoading() {
loading = Loading.service({
diff --git a/src/views/modules/shequzhili/eventOld/cpts/process-form-project.vue b/src/views/modules/shequzhili/eventOld/cpts/process-form-project.vue
index 7dbabcd01..925550fae 100644
--- a/src/views/modules/shequzhili/eventOld/cpts/process-form-project.vue
+++ b/src/views/modules/shequzhili/eventOld/cpts/process-form-project.vue
@@ -1,105 +1,76 @@
-
-
-
-
-
+ @change="handleChangeCate">
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
- (formData.staffList = ret)"
- @close="visibleStaffPanel = false"
- />
+ (formData.staffList = ret)"
+ @close="visibleStaffPanel = false" />
@@ -121,134 +92,116 @@
-->
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
+
{{ item.name }}
-
-
+
+
选择标签
-
+
-
+
-
+
- 关闭
+ 关闭
+
+
@@ -258,64 +211,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",
@@ -327,34 +280,38 @@ 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, myCascader },
+ components: { selectStaff, foldText },
computed: {
- dataRule() {
+ dataRule () {
+
return {
categoryList: [
- { required: true, message: "事件分类不能为空", trigger: "blur" },
+ { required: true, message: "请填写事件分类", trigger: "blur" },
+ ],
+ title: [
+ { required: true, message: "标题不能为空", trigger: "blur" },
],
- title: [{ required: true, message: "标题不能为空", trigger: "blur" }],
gridId: [
{ required: true, message: "所属网格不能为空", trigger: "blur" },
],
@@ -364,12 +321,14 @@ export default {
publicReply: [
{ required: true, message: "项目方案不能为空", trigger: "blur" },
],
+
};
},
+
+
},
props: {
- gridId: {
- //新增是选择的网格id
+ gridId: {//新增是选择的网格id
type: String,
default: "",
},
@@ -379,21 +338,23 @@ 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 = "";
@@ -405,7 +366,7 @@ export default {
}
},
- async selectedTagData(val) {
+ async selectedTagData (val) {
const { tagOptions } = this;
this.tagList = await Promise.all(
val.map(async (id) => {
@@ -432,112 +393,115 @@ 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(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);
+ 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)
},
//重构树,去除网格
- 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) {
@@ -548,7 +512,7 @@ export default {
},
//加载协同单位数据
- async getAssistanceUnitList() {
+ async getAssistanceUnitList () {
const url = "/heart/icpartyunit/assistanceUnitList";
const { data, code, msg } = await requestPost(url, {
@@ -557,14 +521,17 @@ 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 = {
@@ -576,26 +543,29 @@ 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) {
@@ -603,8 +573,10 @@ 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);
@@ -621,7 +593,7 @@ export default {
}
},
- handleImgRemove(file) {
+ handleImgRemove (file) {
let index = this.formData.internalFile.findIndex(
(item) => item.url == file.response.data.url
);
@@ -629,8 +601,9 @@ export default {
console.log(this.formData.internalFile);
},
+
// 开启加载动画
- startLoading() {
+ startLoading () {
loading = Loading.service({
lock: true, // 是否锁定
text: "正在加载……", // 加载中需要显示的文字
@@ -638,7 +611,7 @@ export default {
});
},
// 结束加载动画
- endLoading() {
+ endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close();
@@ -660,7 +633,7 @@ export default {
-
+
+
+
+
+ }
+
+
\ No newline at end of file
diff --git a/src/views/modules/shequzhili/eventOld/cpts/process-form-urban.vue b/src/views/modules/shequzhili/eventOld/cpts/process-form-urban.vue
new file mode 100644
index 000000000..1a5f5d4bc
--- /dev/null
+++ b/src/views/modules/shequzhili/eventOld/cpts/process-form-urban.vue
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/modules/shequzhili/eventOld/cpts/process-form.vue b/src/views/modules/shequzhili/eventOld/cpts/process-form.vue
index 3e977c1e5..d56fefb2f 100644
--- a/src/views/modules/shequzhili/eventOld/cpts/process-form.vue
+++ b/src/views/modules/shequzhili/eventOld/cpts/process-form.vue
@@ -1,201 +1,281 @@
-
-
-
-
-
- 暂不处理
- 回复
- 指派
- 完成并回复
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ 暂不处理
+ 回复
+ 立项
+ 转服务
+ 转议题
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/modules/shequzhili/eventOld/eventList.vue b/src/views/modules/shequzhili/eventOld/eventList.vue
index a8e2f5976..78b0659b2 100644
--- a/src/views/modules/shequzhili/eventOld/eventList.vue
+++ b/src/views/modules/shequzhili/eventOld/eventList.vue
@@ -1,225 +1,473 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 至
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 至
-
-
-
-
-
- 查询
- 重置
-
-
-
-
-
-
-
-
- 新增
- 下载模板
-
-
-
- 导出
- handleMarkDiffcult(command)">
- 标记
-
- 标记为难点痛点
- 标记为矛盾纠纷
- 标记为自身问题
-
-
- 取消标记
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ 至
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+
+ 新增
+
+ 导出
+
+ handleMarkDiffcult(command)"
+ >
+ 标记
+
+ 标记为难点堵点
+ 标记为矛盾纠纷
+ 标记为自身问题
+
+
+ 取消标记
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 处理中
- 已完成
- --
-
-
-
-
-
- 处理
- 去评价
- 查看
- 删除
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 处理中
+ 已完成
+ --
+
+
+
+
+
+
+
+ 处理
+
+ 去评价
+ 查看
+ 删除
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
-
-
-
-
- 取消
-
-
-
+
+ 取消
+
+
+
diff --git a/vue.config.js b/vue.config.js
index 1bd675a55..2f2549d8b 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,12 +1,3 @@
-/*
- * @Author: mk 2403457699@qq.com
- * @Date: 2023-09-20 13:46:51
- * @LastEditors: mk 2403457699@qq.com
- * @LastEditTime: 2023-09-22 15:16:23
- * @Description: 介绍一下改动了什么
- *
- *
- */
/**
* 配置参考: https://cli.vuejs.org/zh/config/
*/
From 851c73b0ea02ad8cf7db08fa0026acaca431ca52 Mon Sep 17 00:00:00 2001
From: mk <2403457699@qq.com>
Date: Fri, 13 Oct 2023 18:26:52 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=9D=E9=9A=9C=E6=88=BF=E8=B5=B0?=
=?UTF-8?q?=E6=99=BA=E8=83=BD=E5=AF=BC=E5=85=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../housingNature/housingNature.vue | 79 ++++++++++++-------
1 file changed, 51 insertions(+), 28 deletions(-)
diff --git a/src/views/modules/base/residentManagement/housingNature/housingNature.vue b/src/views/modules/base/residentManagement/housingNature/housingNature.vue
index e8cd2f616..865f056ff 100644
--- a/src/views/modules/base/residentManagement/housingNature/housingNature.vue
+++ b/src/views/modules/base/residentManagement/housingNature/housingNature.vue
@@ -287,36 +287,58 @@ export default {
}
return fileType && isLt1M;
},
-
+
async uploadHttpRequest(file) {
- this.$message({
- showClose: true,
- dangerouslyUseHTMLString: true,
- message:
- "导入中,请到系统管理-导入记录中查看进度",
- duration: 3000,
- });
- let than = this;
- document.getElementById("clickA").addEventListener("click", function () {
- than.$router.replace("/main/importRecord-index");
- });
- const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加
- formData.append("file", file.file); //添加文件对象
- await this.$http
- .post("/actual/base/resiHousingNature/import", formData)
- .then((res) => {
- console.log("res-up", res);
- if (res.data.code == 0 && res.data.msg == "success") {
- this.$message.success("导入成功");
- this.getTableData();
- this.$refs.upload.clearFiles();
- } else this.$message.error(res.data.msg);
- })
- .catch((err) => {
- console.log("失败", err);
- file.onError(); //上传失败的文件会从文件列表中删除
- // this.$message.error('导入失败')
+ this.$message({
+ showClose: true,
+ dangerouslyUseHTMLString: true,
+ message:
+ "导入中,请到系统管理-导入记录中查看进度",
+ duration: 3000,
+ });
+ let than = this;
+ document.getElementById("clickA").addEventListener("click", function () {
+ than.$router.replace("/main/importRecord-index");
});
+ const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加
+ formData.append("file", file.file); //添加文件对象
+ formData.append("fileMode",'ENSUREHOUSE');
+ await this.$http
+ .post("/actual/base/importExcelData/extractExcelHead", formData)
+ .then((res) => {
+ const { metaListData, fileCode, msg } = res.data.data;
+ this.dataList = {"所属网格":"所属网格","所属小区":"所属小区","所属楼栋":"所属楼栋","所属单元":"所属单元","所属房屋":"所属房屋","本地户籍":"本地户籍","居民姓名":"居民姓名","联系电话":"联系电话","国籍":"国籍","证件类型":"证件类型","证件号":"证件号","民族":"民族","备注":"备注","户籍地址":"户籍所在地","现居地址":"现居住地址","房东姓名":"房东姓名","房东身份证号":"房东身份证号","住房性质":"住房性质","领取通知书日期":"领取通知书日期","保障类型":"保障类型","发证日期":"发证日期","补贴编号":"补贴编号","补贴金额":"补贴金额"};
+ // 相等于在for循环中写filter过滤,这样写能够以 O(1) 的时间复杂度获取 itemGroupId 匹配的元素。
+ this.importCode = fileCode;
+ this.handleComfirmUpload()
+ })
+ .catch((err) => {
+ console.log("失败", err);
+ file.onError(); //上传失败的文件会从文件列表中删除
+ // this.$message.error('导入失败')
+ });//
+ },
+ async handleComfirmUpload () {
+ this.importLoading = true;
+ this.importBtnTitle = "正在上传中...";
+ const { importOption, importCode, dataList } = this;
+ const formData = new FormData();
+ formData.append("columnMateJson", JSON.stringify(dataList));
+ formData.append("fileCode", importCode);
+ await this.$http
+ .post("/actual/base/importExcelData/importResiHouseExcel", formData)
+ .then((res) => {
+ console.log("res-up", res);
+ if (res.data.code == 0 && res.data.msg == "success") {
+ this.getTableData();
+ } else this.$message.error(res.data.msg);
+ })
+ .catch((err) => {
+ console.log("失败", err);
+ file.onError(); //上传失败的文件会从文件列表中删除
+ });
+ this.importLoading = false;
+ this.importBtnTitle = "导入";
},
// 搜索事件
handleSearch(val) {
@@ -356,6 +378,7 @@ export default {
this.showAdd = false;
this.showEdit = false;
},
+
// 新增弹出框组件确定事件
handleComfirm(type) {
this.handleClose();