Browse Source

bug#206事件管理新增表单操作bug210事件管理必填项

feature
mk 3 years ago
parent
commit
fa2e8109b5
  1. 463
      src/views/modules/shequzhili/event/cpts/event-info.vue
  2. 195
      src/views/modules/shequzhili/event/cpts/process-form-replay.vue
  3. 2
      src/views/modules/shequzhili/event/cpts/process-form.vue

463
src/views/modules/shequzhili/event/cpts/event-info.vue

@ -3,40 +3,47 @@
<div v-if="pageTypeCopy == 'add'"> <div v-if="pageTypeCopy == 'add'">
<el-card> <el-card>
<h3>新增事件</h3> <h3>新增事件</h3>
<event-add ref="ref_add" <event-add
ref="ref_add"
@changeName="changeName" @changeName="changeName"
@changeMobile="changeMobile" @changeMobile="changeMobile"
@changeUserId="changeUserId" @changeUserId="changeUserId"
@changeGridId="changeGridId"></event-add> @changeGridId="changeGridId"
></event-add>
</el-card> </el-card>
<div class="process-form"> <div class="process-form">
<el-card> <el-card>
<h3>处理</h3> <h3>处理</h3>
<process-form ref="ref_processinfo_add" <process-form
ref="ref_processinfo_add"
:demandUserId="demandUserId" :demandUserId="demandUserId"
:demandUserName="demandUserName" :demandUserName="demandUserName"
:demandUserMobile="demandUserMobile" :demandUserMobile="demandUserMobile"
:gridId="gridId"></process-form> :gridId="gridId"
></process-form>
<div class="div-btn"> <div class="div-btn">
<el-button size="small" <el-button size="small" @click="handleClose">关闭</el-button>
@click="handleClose">关闭</el-button> <el-button
<el-button style="margin-left:20px" style="margin-left: 20px"
type="primary" type="primary"
size="small" size="small"
@click="handleComfirm">确定</el-button> @click="handleComfirm"
>确定</el-button
>
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
<div v-if="pageTypeCopy == 'dispose'||pageTypeCopy == 'info'" <div
class="g-page"> v-if="pageTypeCopy == 'dispose' || pageTypeCopy == 'info'"
class="g-page"
>
<div :class="['g-total', { 'g-left': projectProcess.length > 0 }]"> <div :class="['g-total', { 'g-left': projectProcess.length > 0 }]">
<event-detail
<event-detail ref="ref_detail" ref="ref_detail"
:type="pageType" :type="pageType"
:eventId="eventId" :eventId="eventId"
:eventDetailData="eventDetailData" :eventDetailData="eventDetailData"
@ -44,42 +51,67 @@
@handleToProject="handleToProject" @handleToProject="handleToProject"
@handleToDemand="handleToDemand" @handleToDemand="handleToDemand"
@handleToIssue="handleToIssue" @handleToIssue="handleToIssue"
@handleClose="handleClose"></event-detail> @handleClose="handleClose"
></event-detail>
<div v-if="!eventDetailData.operationId &&pageTypeCopy == 'dispose' " <div
class="process-form"> v-if="!eventDetailData.operationId && pageTypeCopy == 'dispose'"
class="process-form"
>
<el-card :class="{ 'box-card': source === 'visiual' }"> <el-card :class="{ 'box-card': source === 'visiual' }">
<div :class="['process-title',{'process-title-vis':source==='visiual'}]">处理</div> <div
<process-form ref="ref_processinfo_dispose" :class="[
'process-title',
{ 'process-title-vis': source === 'visiual' },
]"
>
处理
</div>
<process-form
ref="ref_processinfo_dispose"
:source="source" :source="source"
:eventId="eventId" :eventId="eventId"
:eventDetailData="eventDetailData"></process-form> :eventDetailData="eventDetailData"
></process-form>
<div class="div-btn"> <div class="div-btn">
<el-button size="small" <el-button size="small" @click="handleClose">关闭</el-button>
@click="handleClose">关闭</el-button> <el-button
<el-button style="margin-left:20px" style="margin-left: 20px"
type="primary" type="primary"
size="small" size="small"
@click="handleComfirm">确定</el-button> @click="handleComfirm"
>确定</el-button
>
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
<div v-if="projectProcess.length>0" <div v-if="projectProcess.length > 0" class="g-right">
class="g-right"> <el-card
<el-card :class="{'box-card':source==='visiual'}" :class="{ 'box-card': source === 'visiual' }"
style="max-height: 90vh; overflow: auto"> style="max-height: 90vh; overflow: auto"
>
<div class="m-process"> <div class="m-process">
<div :class="['process-title',{'process-title-vis':source==='visiual'}]">处理进展</div> <div
:class="[
'process-title',
{ 'process-title-vis': source === 'visiual' },
]"
>
处理进展
</div>
<div class="list"> <div class="list">
<div class="item" <div
:class="[index === 0 ? 'z-on' : '',{'item-vis':source==='visiual'}]" class="item"
:class="[
index === 0 ? 'z-on' : '',
{ 'item-vis': source === 'visiual' },
]"
:key="item.processId" :key="item.processId"
v-for="(item, index) in projectProcess"> v-for="(item, index) in projectProcess"
>
<div class="item-row"> <div class="item-row">
<div class="name">{{ item.processName }}</div> <div class="name">{{ item.processName }}</div>
<div class="date"> <div class="date">
@ -122,28 +154,38 @@
<fold-text :row="3">{{ item.assistanceUnitName }}</fold-text> <fold-text :row="3">{{ item.assistanceUnitName }}</fold-text>
</div> </div>
</div> --> </div> -->
<div class="detail" <div
v-if="item.processName != '转项目' && item.publicReply"> class="detail"
v-if="item.processName != '转项目' && item.publicReply"
>
<div class="detail-field"> </div> <div class="detail-field"> </div>
<div class="detail-value"> <div class="detail-value">
<fold-text :row="3">{{ item.publicReply }}</fold-text> <fold-text :row="3">{{ item.publicReply }}</fold-text>
</div> </div>
</div> </div>
<div class="detail" <div
v-if="item.processName != '转项目' && item.internalRemark"> class="detail"
v-if="item.processName != '转项目' && item.internalRemark"
>
<div class="detail-field">内部备注</div> <div class="detail-field">内部备注</div>
<div class="detail-value"> <div class="detail-value">
<fold-text :row="3">{{ item.internalRemark }}</fold-text> <fold-text :row="3">{{
item.internalRemark
}}</fold-text>
</div> </div>
</div> </div>
<div v-if="item.internalFile&&item.internalFile.length>0" <div
class="detail"> v-if="item.internalFile && item.internalFile.length > 0"
class="detail"
>
<div class="attachement-list"> <div class="attachement-list">
<a :href="att.url" <a
:href="att.url"
target="_blank" target="_blank"
:key="att.url" :key="att.url"
v-for="att in item.internalFile"> v-for="att in item.internalFile"
>
<i class="el-icon-folder-opened"></i> <i class="el-icon-folder-opened"></i>
{{ att.name }} {{ att.name }}
</a> </a>
@ -170,7 +212,9 @@
</div> </div>
<div class="detail"> <div class="detail">
<div class="detail-field">实际服务时间</div> <div class="detail-field">实际服务时间</div>
<div class="detail-value">{{ item.actualServiceTime }}</div> <div class="detail-value">
{{ item.actualServiceTime }}
</div>
</div> </div>
</div> </div>
<div v-if="item.processName === '转服务'"> <div v-if="item.processName === '转服务'">
@ -178,7 +222,6 @@
<div class="detail-field">服务时间</div> <div class="detail-field">服务时间</div>
<div class="detail-value">{{ item.serviceTime }}</div> <div class="detail-value">{{ item.serviceTime }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -200,29 +243,35 @@
</div> </div>
<div v-if="pageTypeCopy == 'project'"> <div v-if="pageTypeCopy == 'project'">
<project-info-origin ref="eleEditForm" <project-info-origin
ref="eleEditForm"
:source="source" :source="source"
:sourceType="sourceType"
:type="projectPageType" :type="projectPageType"
:projectId="eventDetailCopy.operationId" :projectId="eventDetailCopy.operationId"
@close="handleCloseProject" @close="handleCloseProject"
@afterEdit="handleCloseProject" /> @afterEdit="handleCloseProject"
/>
</div> </div>
<div v-if="pageTypeCopy == 'demand'"> <div v-if="pageTypeCopy == 'demand'">
<demand-info-origin ref="demandEditForm" <demand-info-origin
ref="demandEditForm"
:source="source" :source="source"
:demandRecId="eventDetailCopy.operationId" :demandRecId="eventDetailCopy.operationId"
@close="handleCloseProject" /> @close="handleCloseProject"
/>
</div> </div>
<div v-if="pageTypeCopy == 'issue'"> <div v-if="pageTypeCopy == 'issue'">
<issue-info-origin ref="eleEditForm" <issue-info-origin
ref="eleEditForm"
:pageType="issuePageType" :pageType="issuePageType"
:issueId="eventDetailCopy.operationId" :issueId="eventDetailCopy.operationId"
:issueDetailData="issueDetailData" :issueDetailData="issueDetailData"
@handleClose="handleCloseProject" @handleClose="handleCloseProject"
@handleOk="handleCloseProject" @handleOk="handleCloseProject"
@dialogOk="handleCloseProject" /> @dialogOk="handleCloseProject"
/>
</div> </div>
</div> </div>
</template> </template>
@ -242,8 +291,7 @@ let loading; // 加载动画
function iniData() { function iniData() {
return { return {
formData: { formData: {
operationType: '', operationType: "",
}, },
eventInfoData: {}, eventInfoData: {},
replayInfo: {}, replayInfo: {},
@ -252,20 +300,21 @@ function iniData () {
issueInfo: {}, issueInfo: {},
// //
demandUserId: '', demandUserId: "",
demandUserName: '', demandUserName: "",
demandUserMobile: '', demandUserMobile: "",
gridId: '', gridId: "",
eventDetailCopy: {}, eventDetailCopy: {},
projectProcess: [], projectProcess: [],
projectPageType: 'info', projectPageType: "info",
pageTypeCopy: '', pageTypeCopy: "",
issuePageType: '', issuePageType: "",
issueDetailData: {}, issueDetailData: {},
sourceType: "",
}; };
} }
@ -283,14 +332,15 @@ export default {
eventDetailData: { eventDetailData: {
type: Object, type: Object,
default() { default() {
return {} return {};
} },
}, },
source: {//manage visiual source: {
//manage visiual
type: String, type: String,
default: 'manage' default: "manage",
} },
}, },
components: { components: {
@ -301,7 +351,7 @@ export default {
processForm, processForm,
projectInfoOrigin, projectInfoOrigin,
demandInfoOrigin, demandInfoOrigin,
issueInfoOrigin issueInfoOrigin,
}, },
data: iniData, data: iniData,
@ -317,14 +367,11 @@ export default {
// this.getApiData(); // this.getApiData();
}, },
}, },
created () { created() {},
},
mounted() { mounted() {
this.pageTypeCopy = this.pageType this.pageTypeCopy = this.pageType;
if (this.pageTypeCopy !== 'add') { if (this.pageTypeCopy !== "add") {
this.getProjectProcess() this.getProjectProcess();
} }
if (this.eventId) { if (this.eventId) {
@ -334,19 +381,16 @@ export default {
methods: { methods: {
changeName(val) { changeName(val) {
this.demandUserName = val this.demandUserName = val;
}, },
changeMobile(val) { changeMobile(val) {
this.demandUserMobile = val;
this.demandUserMobile = val
}, },
changeUserId(val) { changeUserId(val) {
this.demandUserId = val;
this.demandUserId = val
}, },
changeGridId(val) { changeGridId(val) {
this.gridId = val;
this.gridId = val
}, },
// //
@ -372,197 +416,195 @@ export default {
}, },
getEventInfo() { getEventInfo() {
this.$refs.ref_add.getEventInfo() this.$refs.ref_add.getEventInfo();
if (this.$refs.ref_add.okflag) { if (this.$refs.ref_add.okflag) {
this.eventInfoData = this.$refs.ref_add.formData;
this.eventInfoData = this.$refs.ref_add.formData
} else { } else {
return false return false;
} }
console.log('eventInfo', this.eventInfoData) console.log("eventInfo", this.eventInfoData);
}, },
async handleComfirm() { async handleComfirm() {
this.startLoading() this.startLoading();
if (this.pageTypeCopy === 'add') { if (this.pageTypeCopy === "add") {
await this.handelAdd() await this.handelAdd();
} }
if (this.pageTypeCopy === 'dispose') { if (this.pageTypeCopy === "dispose") {
await this.handelDispose() await this.handelDispose();
} }
this.endLoading() this.endLoading();
}, },
async handelAdd() { async handelAdd() {
this.$refs.ref_add.getEventInfo();
this.$refs.ref_add.getEventInfo()
if (this.$refs.ref_add.okflag) { if (this.$refs.ref_add.okflag) {
this.eventInfoData = this.$refs.ref_add.formData this.eventInfoData = this.$refs.ref_add.formData;
} else { } else {
return false return false;
} }
console.log('eventInfo', this.eventInfoData) console.log("eventInfo", this.eventInfoData);
this.$refs.ref_processinfo_add.getProcessInfo() this.$refs.ref_processinfo_add.getProcessInfo();
if (this.$refs.ref_processinfo_add.okflag) { // if (this.$refs.ref_processinfo_add.okflag) {
this.formData.operationType = this.$refs.ref_processinfo_add.operationType this.formData.operationType =
this.eventInfoData.operationType = this.$refs.ref_processinfo_add.operationType this.$refs.ref_processinfo_add.operationType;
this.eventInfoData.operationType =
this.$refs.ref_processinfo_add.operationType;
if (this.formData.operationType === "0") {
if (this.formData.operationType === '0') { this.project = {};
this.project = {} this.demand = {};
this.demand = {} this.replayInfo = this.$refs.ref_processinfo_add.replayInfo;
this.replayInfo = this.$refs.ref_processinfo_add.replayInfo console.log("replayInfo", this.replayInfo);
console.log('replayInfo', this.replayInfo)
// //
this.eventInfoData.content = this.replayInfo.content this.eventInfoData.content = this.replayInfo.content;
this.eventInfoData.status = this.replayInfo.status this.eventInfoData.status = this.replayInfo.status;
if (this.replayInfo.categoryId) { if (this.replayInfo.categoryId) {
this.eventInfoData.categoryList = [] this.eventInfoData.categoryList = [];
this.eventInfoData.categoryList.push(this.replayInfo.categoryId) this.eventInfoData.categoryList.push(this.replayInfo.categoryId);
} }
} else if (this.formData.operationType === "1") {
this.replayInfo = {};
} else if (this.formData.operationType === '1') { this.demand = {};
this.replayInfo = {} this.project = this.$refs.ref_processinfo_add.project;
this.demand = {}
this.project = this.$refs.ref_processinfo_add.project
// //
this.project.gridId = this.eventInfoData.gridId this.project.gridId = this.eventInfoData.gridId;
if (this.project.categoryList && this.project.categoryList.length > 0) { if (this.project.categoryList && this.project.categoryList.length > 0) {
this.eventInfoData.categoryList = [] this.eventInfoData.categoryList = [];
this.eventInfoData.categoryList.push(this.project.categoryList[0].id) this.eventInfoData.categoryList.push(this.project.categoryList[0].id);
} }
console.log('projectInfo', this.project) console.log("projectInfo", this.project);
} else if (this.formData.operationType === "2") {
} else if (this.formData.operationType === '2') { this.replayInfo = {};
this.replayInfo = {} this.project = {};
this.project = {} this.demand = this.$refs.ref_processinfo_add.demand;
this.demand = this.$refs.ref_processinfo_add.demand this.demand.gridId = this.eventInfoData.gridId;
this.demand.gridId = this.eventInfoData.gridId
// //
// this.eventInfoData.categoryList = [] // this.eventInfoData.categoryList = []
// this.eventInfoData.categoryList.push(this.demand.categoryId) // this.eventInfoData.categoryList.push(this.demand.categoryId)
console.log('demond', this.demand) console.log("demond", this.demand);
} else if (this.formData.operationType === '3') { } else if (this.formData.operationType === "3") {
this.project = {} this.project = {};
this.demand = {} this.demand = {};
this.replayInfo = {} this.replayInfo = {};
this.issueInfo = this.$refs.ref_processinfo_add.issueInfo this.issueInfo = this.$refs.ref_processinfo_add.issueInfo;
if (this.issueInfo.categoryList && this.issueInfo.categoryList.length > 0) { if (
this.eventInfoData.categoryList = [] this.issueInfo.categoryList &&
this.eventInfoData.categoryList.push(this.issueInfo.categoryList[0].id) this.issueInfo.categoryList.length > 0
) {
this.eventInfoData.categoryList = [];
this.eventInfoData.categoryList.push(
this.issueInfo.categoryList[0].id
);
} }
console.log('issueInfo', this.issueInfo) console.log("issueInfo", this.issueInfo);
} }
} // }
this.formData = { this.formData = {
...this.eventInfoData, ...this.eventInfoData,
// replayInfo: this.replayInfo, // replayInfo: this.replayInfo,
project: this.project, project: this.project,
demand: this.demand, demand: this.demand,
issueInfo: this.issueInfo issueInfo: this.issueInfo,
} };
console.log('this.formData', this.formData) console.log("this.formData", this.formData);
await this.submit() await this.submit();
}, },
async submit() { async submit() {
if (
(this.formData.operationType == 3 && this.issueInfo.issueTitle) ||
(this.formData.operationType == 2 && this.demand.demandUserName) ||
(this.formData.operationType == 1 && this.project.categoryList) ||
(this.formData.operationType == 0 && this.eventInfoData.content) ||
this.formData.operationType == 4
) {
const url = "/governance/icEvent/add"; const url = "/governance/icEvent/add";
const { formData } = this; const { formData } = this;
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
...formData, ...formData,
}); });
if (code === 0) { if (code === 0) {
this.$message.success("操作成功!"); this.$message.success("操作成功!");
if (this.pageTypeCopy === 'add') { if (this.pageTypeCopy === "add") {
this.eventInfo = this.$refs.ref_add.resetData() this.eventInfo = this.$refs.ref_add.resetData();
} }
this.$emit("handleOk"); this.$emit("handleOk");
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
}else if(this.formData.operationType == ''){
this.$message.error('请选择处理方式!')
}
}, },
async handelDispose() { async handelDispose() {
this.$refs.ref_processinfo_dispose.getProcessInfo() this.$refs.ref_processinfo_dispose.getProcessInfo();
if (this.$refs.ref_processinfo_dispose.okflag) { if (this.$refs.ref_processinfo_dispose.okflag) {
this.formData.operationType =
this.$refs.ref_processinfo_dispose.operationType;
this.formData.operationType = this.$refs.ref_processinfo_dispose.operationType if (this.formData.operationType === "0") {
this.project = {};
if (this.formData.operationType === '0') { this.demand = {};
this.replayInfo = this.$refs.ref_processinfo_dispose.replayInfo;
this.project = {} this.replayInfo.icEventId = this.eventId;
this.demand = {} console.log("replayInfo", this.replayInfo);
this.replayInfo = this.$refs.ref_processinfo_dispose.replayInfo
this.replayInfo.icEventId = this.eventId
console.log('replayInfo', this.replayInfo)
// //
let url = '/governance/icEvent/reply' let url = "/governance/icEvent/reply";
await this.submitDispose(url, this.replayInfo) await this.submitDispose(url, this.replayInfo);
} else if (this.formData.operationType === "1") {
} else if (this.formData.operationType === '1') { this.replayInfo = {};
this.replayInfo = {} this.demand = {};
this.demand = {} this.project = this.$refs.ref_processinfo_dispose.project;
this.project = this.$refs.ref_processinfo_dispose.project
// //
this.project.icEventId = this.eventId this.project.icEventId = this.eventId;
console.log('projectInfo', this.project) console.log("projectInfo", this.project);
let url = '/governance/icEvent/icEventToProject' let url = "/governance/icEvent/icEventToProject";
await this.submitDispose(url, this.project) await this.submitDispose(url, this.project);
} else if (this.formData.operationType === "2") {
} else if (this.formData.operationType === '2') { this.replayInfo = {};
this.replayInfo = {} this.project = {};
this.project = {} this.demand = this.$refs.ref_processinfo_dispose.demand;
this.demand = this.$refs.ref_processinfo_dispose.demand
// //
this.demand.icEventId = this.eventId this.demand.icEventId = this.eventId;
console.log('demond', this.demand) console.log("demond", this.demand);
let url = '/governance/icEvent/icEventToDemand' let url = "/governance/icEvent/icEventToDemand";
await this.submitDispose(url, this.demand) await this.submitDispose(url, this.demand);
} else if (this.formData.operationType === '3') { } else if (this.formData.operationType === "3") {
this.replayInfo = {} this.replayInfo = {};
this.demand = {} this.demand = {};
this.project = {} this.project = {};
this.issueInfo = this.$refs.ref_processinfo_dispose.issueInfo this.issueInfo = this.$refs.ref_processinfo_dispose.issueInfo;
// //
console.log('issueInfo', this.issueInfo) console.log("issueInfo", this.issueInfo);
let url = '/governance/icEvent/icEventToIssue' let url = "/governance/icEvent/icEventToIssue";
await this.submitDispose(url, this.issueInfo) await this.submitDispose(url, this.issueInfo);
} else { } else {
this.$message.info("请选择一种处理方式"); this.$message.info("请选择一种处理方式");
} }
} else { } else {
return false return false;
} }
}, },
async submitDispose(url, params) { async submitDispose(url, params) {
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
...params, ...params,
}); });
if (code === 0) { if (code === 0) {
this.$message.success("操作成功!"); this.$message.success("操作成功!");
this.$emit("handleOk"); this.$emit("handleOk");
@ -572,20 +614,20 @@ export default {
}, },
handleClose() { handleClose() {
if (this.pageTypeCopy === 'add') { if (this.pageTypeCopy === "add") {
this.eventInfo = this.$refs.ref_add.resetData() this.eventInfo = this.$refs.ref_add.resetData();
} }
this.$emit("handleClose"); this.$emit("handleClose");
}, },
handleToProject () { handleToProject(type) {
if (this.eventDetailCopy.status === 'processing') { if (this.eventDetailCopy.status === "processing") {
this.projectPageType = 'edit' this.projectPageType = "edit";
} else { } else {
this.projectPageType = 'info' this.projectPageType = "info";
} }
this.pageTypeCopy = 'project' this.sourceType = "event";
this.pageTypeCopy = "project";
}, },
handleToDemand() { handleToDemand() {
// if (this.eventDetailCopy.status === 'processing') { // if (this.eventDetailCopy.status === 'processing') {
@ -593,8 +635,7 @@ export default {
// } else { // } else {
// this.projectPageType = 'info' // this.projectPageType = 'info'
// } // }
this.pageTypeCopy = 'demand' this.pageTypeCopy = "demand";
}, },
async handleToIssue() { async handleToIssue() {
const url = "/governance/manage/votingissuedetail"; const url = "/governance/manage/votingissuedetail";
@ -604,25 +645,21 @@ export default {
}); });
if (code === 0) { if (code === 0) {
this.issueDetailData = { ...data }; this.issueDetailData = { ...data };
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
if (this.issueDetailData.issueStatus === 'voting') { if (this.issueDetailData.issueStatus === "voting") {
this.issuePageType = 'dispose' this.issuePageType = "dispose";
} else { } else {
this.issuePageType = 'info' this.issuePageType = "info";
} }
this.pageTypeCopy = 'issue' this.pageTypeCopy = "issue";
}, },
handleCloseProject() { handleCloseProject() {
this.getProjectProcess() this.getProjectProcess();
this.pageTypeCopy = 'info' this.pageTypeCopy = "info";
}, },
// //

195
src/views/modules/shequzhili/event/cpts/process-form-replay.vue

@ -1,14 +1,17 @@
<template> <template>
<div class="search"> <div class="search">
<el-form
<el-form ref="ref_form1" ref="ref_form1"
:inline="false" :inline="false"
:model="formData" :model="formData"
:rules="dataRule"> :rules="dataRule"
<el-form-item label="事件分类" >
<el-form-item
label="事件分类"
label-width="150px" label-width="150px"
:class="{ 'form-item': source === 'visiual' }" :class="{ 'form-item': source === 'visiual' }"
prop="categoryList"> prop="categoryList"
>
<div :class="{ 'visiual-form': source === 'visiual' }"> <div :class="{ 'visiual-form': source === 'visiual' }">
<!-- <el-cascader class="cell-width-2" <!-- <el-cascader class="cell-width-2"
ref="myCascader" ref="myCascader"
@ -18,38 +21,47 @@
:props="optionProps" :props="optionProps"
:show-all-levels="false" :show-all-levels="false"
@change="handleChangeCate"></el-cascader> --> @change="handleChangeCate"></el-cascader> -->
<my-cascader v-model="formData.categoryList" <my-cascader
v-model="formData.categoryList"
:casOptions="casOptions" :casOptions="casOptions"
:optionProps="optionProps" :optionProps="optionProps"
@handleChangeCate="handleChangeCate"></my-cascader> @handleChangeCate="handleChangeCate"
></my-cascader>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="回复内容" <el-form-item
label="回复内容"
prop="content" prop="content"
label-width="150px" label-width="150px"
:class="{ 'form-item': source === 'visiual' }" :class="{ 'form-item': source === 'visiual' }"
style="display: block"> style="display: block"
>
<div :class="{ 'visiual-form': source === 'visiual' }"> <div :class="{ 'visiual-form': source === 'visiual' }">
<el-input class="cell-width-area" <el-input
class="cell-width-area"
type="textarea" type="textarea"
maxlength="500" maxlength="500"
show-word-limit show-word-limit
:rows="5" :rows="5"
placeholder="请输入回复内容,不超过500字" placeholder="请输入回复内容,不超过500字"
v-model="formData.content"></el-input> v-model="formData.content"
></el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="" <el-form-item
label=""
label-width="150px" label-width="150px"
:class="{ 'form-item': source === 'visiual' }" :class="{ 'form-item': source === 'visiual' }"
style="display: block"> style="display: block"
<el-checkbox :class="{'form-item':source==='visiual'}" >
v-model="status">已完成</el-checkbox> <el-checkbox
:class="{ 'form-item': source === 'visiual' }"
v-model="status"
@change="handleChangeStatus"
>已完成</el-checkbox
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</template> </template>
@ -62,16 +74,15 @@ import { isCard } from "@/utils/validate";
import myCascader from "./myCascader.vue"; import myCascader from "./myCascader.vue";
let loading; // let loading; //
export default { export default {
data() { data() {
return { return {
btnDisable: false, btnDisable: false,
formData: { formData: {
operationType: '0',//[0: 1: 2:] operationType: "0", //[0: 1: 2:]
content: '', content: "",
status: '', status: "",
categoryList:[] categoryList: [],
}, },
status: false, status: false,
@ -85,28 +96,32 @@ export default {
selCateObj: {}, selCateObj: {},
optionProps: { optionProps: {
multiple: false, multiple: false,
value: 'id', value: "id",
label: 'name', label: "name",
children: 'subCategory', children: "subCategory",
}, },
dataRule:{
};
},
components: {myCascader},
computed: {
dataRule () {
return {
content: [ content: [
{ required: true, message: "回复内容不能为空", trigger: "blur" }, { required: true, message: "回复内容不能为空", trigger: "blur" },
], ],
categoryList: [ categoryList: [
{required:true,message:"事件分类不能为空",trigger:"blur"} // { required: true, message: "", trigger: "blur" },
] ],
}
}; };
}, },
components: { myCascader },
computed: {
// dataRule() {
// return {
// content: [
// { required: true, message: "", trigger: "blur" },
// ],
// categoryList: [
// { required: true, message: "", trigger: "blur" },
// ],
// };
// },
}, },
props: { props: {
eventId: { eventId: {
@ -116,119 +131,125 @@ export default {
eventDetailData: { eventDetailData: {
type: Object, type: Object,
default() { default() {
return {} return {};
} },
}, },
source: {//manage visiual source: {
//manage visiual
type: String, type: String,
default: 'manage' default: "manage",
} },
}, },
watch: {}, watch: {},
created() { created() {
console.log(this.source);
console.log(this.source)
}, },
async mounted() { async mounted() {
this.getCategoryList();
this.getCategoryList()
if (this.eventId) { if (this.eventId) {
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData));
if (this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.categoryId) { if (
this.selCategoryArray = [] this.eventDetailCopy.parentCategoryId &&
this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId) this.eventDetailCopy.categoryId
this.selCategoryArray.push(this.eventDetailCopy.categoryId) ) {
this.selCategoryArray = [];
this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId);
this.selCategoryArray.push(this.eventDetailCopy.categoryId);
this.selCateObj = { this.selCateObj = {
name: this.eventDetailCopy.categoryName, name: this.eventDetailCopy.categoryName,
id: this.eventDetailCopy.categoryId id: this.eventDetailCopy.categoryId,
} };
} }
} }
}, },
methods: { methods: {
async getCategoryList() { async getCategoryList() {
const url = "/governance/issueprojectcategorydict/list" 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) { if (code === 0) {
let treeDataNew = this.filterTree(data);
let treeDataNew = this.filterTree(data)
// //
++this.iscascaderShow ++this.iscascaderShow;
this.casOptions = [] this.casOptions = [];
this.casOptions = treeDataNew
this.casOptions = treeDataNew;
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
handleChangeCate(obj) { handleChangeCate(obj) {
// console.log(this.$refs["myCascader"].getCheckedNodes()[0].data) // console.log(this.$refs["myCascader"].getCheckedNodes()[0].data)
// this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data // this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
this.selCateObj = obj if(obj){
this.selCateObj = obj;
this.formData.categoryList = []; this.formData.categoryList = [];
let flag = JSON.stringify(obj) == '{}' let flag = JSON.stringify(obj) == "{}";
if(flag) this.formData.categoryList = [] if (flag) this.formData.categoryList = [];
else this.formData.categoryList.push(this.selCateObj); else this.formData.categoryList.push(this.selCateObj);
}else{
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
}
}, },
// //
filterTree(arr) { filterTree(arr) {
let childs = arr let childs = arr;
for (let i = childs.length; i--; i > 0) { for (let i = childs.length; i--; i > 0) {
if (childs[i].subCategory) { if (childs[i].subCategory) {
if (childs[i].subCategory.length) { if (childs[i].subCategory.length) {
this.filterTree(childs[i].subCategory) this.filterTree(childs[i].subCategory);
} else { } else {
delete childs[i].subCategory delete childs[i].subCategory;
} }
} }
} }
return arr return arr;
}, },
async getReplayInfo() { async getReplayInfo() {
this.okflag = false this.okflag = false;
this.$refs["ref_form1"].validate((valid, messageObj) => { this.$refs["ref_form1"].validate((valid, messageObj) => {
if (!valid) { if (!valid) {
app.util.validateRule(messageObj); app.util.validateRule(messageObj);
} else { } else {
if (this.status) { if (this.status) {
console.log(this.selCateObj);
if (!this.selCateObj || !this.selCateObj.id) { if (!this.selCateObj || !this.selCateObj.id) {
this.$message.info("请填写事件分类"); this.$message.error("请选择事件分类");
return false return false;
} }
this.formData.status = 'closed_case' this.formData.status = "closed_case";
} else { } else {
this.formData.status = 'processing' this.formData.status = "processing";
} }
this.formData.categoryId = this.selCateObj.id this.formData.categoryId = this.selCateObj.id;
this.formData.categoryList = [] this.formData.categoryList = [];
this.formData.categoryList.push(this.selCateObj) this.formData.categoryList.push(this.selCateObj);
this.okflag = true this.okflag = true;
} }
}); });
}, },
handleChangeStatus(val){
resetData () { console.log(val);
if(!val){
this.$set(this.dataRule,'categoryList',[])
}else{
this.$set(this.dataRule,'categoryList',[{ required: true, message: "事件分类不能为空", trigger: "blur" }])
}
console.log(this.dataRule);
}, },
resetData() {},
// //
startLoading() { startLoading() {
loading = Loading.service({ loading = Loading.service({

2
src/views/modules/shequzhili/event/cpts/process-form.vue

@ -15,7 +15,7 @@
v-model="operationType" v-model="operationType"
@change="handleChangeOperationType"> @change="handleChangeOperationType">
<el-radio v-if="!eventId" <el-radio v-if="!eventId"
label="">暂不处理</el-radio> label="4">暂不处理</el-radio>
<el-radio label="0">回复</el-radio> <el-radio label="0">回复</el-radio>
<el-radio label="1">立项</el-radio> <el-radio label="1">立项</el-radio>
<el-radio label="2">转服务</el-radio> <el-radio label="2">转服务</el-radio>

Loading…
Cancel
Save