epmet pc工作端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

324 lines
7.3 KiB

3 years ago
<template>
<div class="">
<div class="g-process-info">
<el-form ref="ref_form1"
:inline="false"
:rules="dataRule"
class="form">
<el-form-item label="分类"
label-width="150px"
prop="categoryList">
<el-cascader class="cell-width-2"
ref="myCascader"
3 years ago
:disabled="operationType==='2'"
3 years ago
v-model="selCategoryArray"
:key="iscascaderShow"
:options="casOptions"
:props="optionProps"
3 years ago
:show-all-levels="false"
@change="handleChangeCate"></el-cascader>
3 years ago
</el-form-item>
<el-form-item label="处理方式"
label-width="150px"
prop="operationType">
<el-radio-group v-model="operationType">
<el-radio label="0">回复</el-radio>
<el-radio label="1">立项</el-radio>
<el-radio label="2">转需求</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div v-if="operationType==='0'">
3 years ago
<process-form-replay ref="ref_process_form_replay"
:eventDetailData="eventDetailData"></process-form-replay>
3 years ago
</div>
3 years ago
<div v-if="operationType==='1'">
3 years ago
<process-form-project ref="ref_process_form_project"
:eventDetailData="eventDetailData"></process-form-project>
3 years ago
</div>
<div v-if="operationType==='2'">
<process-form-demand ref="ref_process_form_demond"
3 years ago
:eventId="eventId"
3 years ago
:demandUserId="demandUserId"
:demandUserName="demandUserName"
3 years ago
:demandUserMobile="demandUserMobile"
:eventDetailData="eventDetailData"></process-form-demand>
3 years ago
3 years ago
</div>
3 years ago
</div>
</div>
</template>
<script>
import { Loading } from "element-ui"; // 引入Loading服务
import { requestPost } from "@/js/dai/request";
import processFormReplay from "./process-form-replay";
3 years ago
import processFormProject from "./process-form-project";
import processFormDemand from "./process-form-demand";
3 years ago
let loading; // 加载动画
export default {
data () {
return {
3 years ago
3 years ago
3 years ago
casOptions: [],
iscascaderShow: 0,
selCategoryArray: [
],
3 years ago
selCateObj: {},
3 years ago
optionProps: {
3 years ago
multiple: false,
3 years ago
value: 'id',
label: 'name',
children: 'subCategory',
},
3 years ago
operationType: '0',
3 years ago
categoryList: [],
replayInfo: {},
demand: {},
project: {},
3 years ago
okflag: false,
eventDetailCopy: {}
3 years ago
};
},
components: {
3 years ago
processFormReplay,
processFormProject,
processFormDemand
3 years ago
},
computed: {
dataRule () {
return {
categoryList: [
{ required: true, message: "分类不能为空", trigger: "blur" },
],
operationType: [
{ required: true, message: "处理方式不能为空", trigger: "blur" },
],
};
},
},
3 years ago
props: {
demandUserId: {
type: String,
default: "",
},
demandUserName: {
type: String,
default: "",
},
demandUserMobile: {
type: String,
default: "",
},
3 years ago
eventId: {
type: String,
default: "",
},
3 years ago
eventDetailData: {
type: Object,
default () {
return {}
}
},
3 years ago
},
watch: {
},
3 years ago
async mounted () {
const { user } = this.$store.state
this.agencyId = user.agencyId
3 years ago
await this.getCategoryList()
if (this.eventId) {
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData));
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
}
}
}
3 years ago
3 years ago
},
3 years ago
3 years ago
methods: {
3 years ago
async getCategoryList () {
const url = "/gov/issue/issueprojectcategorydict/list"
let params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
let treeDataNew = this.filterTree(data)
3 years ago
3 years ago
//组织级联数据
++this.iscascaderShow
this.casOptions = []
3 years ago
3 years ago
this.casOptions = treeDataNew
} else {
this.$message.error(msg)
}
},
3 years ago
handleChangeCate () {
console.log(this.$refs["myCascader"].getCheckedNodes()[0].data)
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
},
3 years ago
//重构树,去除网格
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 getProcessInfo () {
3 years ago
3 years ago
this.okflag = false
3 years ago
3 years ago
if (this.selCategoryArray.length === 0) {
this.$message({
type: "error",
message: "请选择分类",
});
this.okflag = false
return false
}
3 years ago
this.categoryList = []
this.categoryList.push(this.selCategoryArray[1])
3 years ago
3 years ago
if (this.operationType === '0') {
this.$refs.ref_process_form_replay.getReplayInfo()
if (this.$refs.ref_process_form_replay.okflag) {
3 years ago
3 years ago
this.replayInfo = this.$refs.ref_process_form_replay.formData
3 years ago
this.replayInfo.categoryId = this.categoryList[0]
this.replayInfo.categoryList = this.categoryList
3 years ago
this.okflag = true
} else {
return false
}
} else if (this.operationType === '1') {
3 years ago
this.$refs.ref_process_form_project.getProjectInfo()
if (this.$refs.ref_process_form_project.okflag) {
3 years ago
3 years ago
this.project = this.$refs.ref_process_form_project.formData
3 years ago
3 years ago
this.project.categoryList = []
this.project.categoryList.push(this.selCateObj)
3 years ago
3 years ago
3 years ago
//赋值分类信息
this.okflag = true
} else {
return false
}
3 years ago
} else if (this.operationType === '2') {
3 years ago
this.$refs.ref_process_form_demond.getDemandInfo()
if (this.$refs.ref_process_form_demond.okflag) {
this.demand = this.$refs.ref_process_form_demond.formData
this.okflag = true
3 years ago
3 years ago
} else {
return false
}
3 years ago
}
},
handleCancle () {
this.resetData();
},
resetData () {
},
// 开启加载动画
startLoading () {
loading = Loading.service({
lock: true, // 是否锁定
text: "正在加载……", // 加载中需要显示的文字
background: "rgba(0,0,0,.7)", // 背景颜色
});
},
// 结束加载动画
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
};
</script>
<style
lang="scss"
src="@/assets/scss/modules/shequzhili/event-info.scss"
scoped
></style>
<style>
.el-dialog__body {
padding: 0 10px 20px !important;
}
</style>