Browse Source

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

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

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

@ -3,83 +3,115 @@
<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
@changeName="changeName" ref="ref_add"
@changeMobile="changeMobile" @changeName="changeName"
@changeUserId="changeUserId" @changeMobile="changeMobile"
@changeGridId="changeGridId"></event-add> @changeUserId="changeUserId"
@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
:demandUserId="demandUserId" ref="ref_processinfo_add"
:demandUserName="demandUserName" :demandUserId="demandUserId"
:demandUserMobile="demandUserMobile" :demandUserName="demandUserName"
:gridId="gridId"></process-form> :demandUserMobile="demandUserMobile"
:gridId="gridId"
<div class="div-btn "> ></process-form>
<el-button size="small"
@click="handleClose">关闭</el-button> <div class="div-btn">
<el-button style="margin-left:20px" <el-button size="small" @click="handleClose">关闭</el-button>
type="primary" <el-button
size="small" style="margin-left: 20px"
@click="handleComfirm">确定</el-button> type="primary"
size="small"
@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'"
<div :class="['g-total',{'g-left':projectProcess.length>0}]"> class="g-page"
>
<event-detail ref="ref_detail" <div :class="['g-total', { 'g-left': projectProcess.length > 0 }]">
:type="pageType" <event-detail
:eventId="eventId" ref="ref_detail"
:eventDetailData="eventDetailData" :type="pageType"
:source="source" :eventId="eventId"
@handleToProject="handleToProject" :eventDetailData="eventDetailData"
@handleToDemand="handleToDemand" :source="source"
@handleToIssue="handleToIssue" @handleToProject="handleToProject"
@handleClose="handleClose"></event-detail> @handleToDemand="handleToDemand"
@handleToIssue="handleToIssue"
<div v-if="!eventDetailData.operationId &&pageTypeCopy == 'dispose' " @handleClose="handleClose"
class="process-form"> ></event-detail>
<el-card :class="{'box-card':source==='visiual'}">
<div :class="['process-title',{'process-title-vis':source==='visiual'}]">处理</div> <div
<process-form ref="ref_processinfo_dispose" v-if="!eventDetailData.operationId && pageTypeCopy == 'dispose'"
:source="source" class="process-form"
:eventId="eventId" >
:eventDetailData="eventDetailData"></process-form> <el-card :class="{ 'box-card': source === 'visiual' }">
<div
<div class="div-btn "> :class="[
<el-button size="small" 'process-title',
@click="handleClose">关闭</el-button> { 'process-title-vis': source === 'visiual' },
<el-button style="margin-left:20px" ]"
type="primary" >
size="small" 处理
@click="handleComfirm">确定</el-button> </div>
<process-form
ref="ref_processinfo_dispose"
:source="source"
:eventId="eventId"
:eventDetailData="eventDetailData"
></process-form>
<div class="div-btn">
<el-button size="small" @click="handleClose">关闭</el-button>
<el-button
style="margin-left: 20px"
type="primary"
size="small"
@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"
:key="item.processId" :class="[
v-for="(item, index) in projectProcess"> index === 0 ? 'z-on' : '',
{ 'item-vis': source === 'visiual' },
]"
:key="item.processId"
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">
@ -87,7 +119,7 @@
</div> </div>
</div> </div>
<div v-if="item.type==='event'"> <div v-if="item.type === 'event'">
<div class="detail"> <div class="detail">
<div class="detail-field">回复人</div> <div class="detail-field">回复人</div>
<div class="detail-value">{{ item.departmentName }}</div> <div class="detail-value">{{ item.departmentName }}</div>
@ -98,8 +130,8 @@
</div> </div>
</div> </div>
<div v-else-if="item.type==='project'"> <div v-else-if="item.type === 'project'">
<div v-if="item.processName==='回复'"> <div v-if="item.processName === '回复'">
<div class="detail"> <div class="detail">
<div class="detail-field">回复人</div> <div class="detail-field">回复人</div>
<div class="detail-value">{{ item.departmentName }}</div> <div class="detail-value">{{ item.departmentName }}</div>
@ -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
target="_blank" :href="att.url"
:key="att.url" target="_blank"
v-for="att in item.internalFile"> :key="att.url"
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>
@ -152,8 +194,8 @@
</div> </div>
</div> </div>
<div v-else-if="item.type==='demand'"> <div v-else-if="item.type === 'demand'">
<div v-if="item.processName==='回复'"> <div v-if="item.processName === '回复'">
<div class="detail"> <div class="detail">
<div class="detail-field">回复人</div> <div class="detail-field">回复人</div>
<div class="detail-value">{{ item.departmentName }}</div> <div class="detail-value">{{ item.departmentName }}</div>
@ -163,26 +205,27 @@
<div class="detail-value">{{ item.publicReply }}</div> <div class="detail-value">{{ item.publicReply }}</div>
</div> </div>
</div> </div>
<div v-if="item.processName==='需求完成'"> <div v-if="item.processName === '需求完成'">
<div class="detail"> <div class="detail">
<div class="detail-field">服务方</div> <div class="detail-field">服务方</div>
<div class="detail-value">{{ item.serviceParty }}</div> <div class="detail-value">{{ item.serviceParty }}</div>
</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 === '转服务'">
<div class="detail"> <div class="detail">
<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>
<div v-else-if="item.type==='issue'"> <div v-else-if="item.type === 'issue'">
<div class="detail"> <div class="detail">
<div class="detail-field">回复人</div> <div class="detail-field">回复人</div>
<div class="detail-value">{{ item.departmentName }}</div> <div class="detail-value">{{ item.departmentName }}</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
:source="source" ref="eleEditForm"
:type="projectPageType" :source="source"
:projectId="eventDetailCopy.operationId" :sourceType="sourceType"
@close="handleCloseProject" :type="projectPageType"
@afterEdit="handleCloseProject" /> :projectId="eventDetailCopy.operationId"
@close="handleCloseProject"
@afterEdit="handleCloseProject"
/>
</div> </div>
<div v-if="pageTypeCopy == 'demand'"> <div v-if="pageTypeCopy == 'demand'">
<demand-info-origin ref="demandEditForm" <demand-info-origin
:source="source" ref="demandEditForm"
:demandRecId="eventDetailCopy.operationId" :source="source"
@close="handleCloseProject" /> :demandRecId="eventDetailCopy.operationId"
@close="handleCloseProject"
/>
</div> </div>
<div v-if="pageTypeCopy == 'issue'"> <div v-if="pageTypeCopy == 'issue'">
<issue-info-origin ref="eleEditForm" <issue-info-origin
:pageType="issuePageType" ref="eleEditForm"
:issueId="eventDetailCopy.operationId" :pageType="issuePageType"
:issueDetailData="issueDetailData" :issueId="eventDetailCopy.operationId"
@handleClose="handleCloseProject" :issueDetailData="issueDetailData"
@handleOk="handleCloseProject" @handleClose="handleCloseProject"
@dialogOk="handleCloseProject" /> @handleOk="handleCloseProject"
@dialogOk="handleCloseProject"
/>
</div> </div>
</div> </div>
</template> </template>
@ -239,11 +288,10 @@ import eventDetail from "./event-detail";
import processForm from "./process-form"; import processForm from "./process-form";
let loading; // 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: "",
}; };
} }
@ -282,15 +331,16 @@ 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,
@ -309,7 +359,7 @@ export default {
computed: {}, computed: {},
watch: { watch: {
eventId () { eventId() {
let data = iniData(); let data = iniData();
Object.keys(data).forEach((k) => { Object.keys(data).forEach((k) => {
this[k] = data[k]; this[k] = data[k];
@ -317,14 +367,11 @@ export default {
// this.getApiData(); // this.getApiData();
}, },
}, },
created () { created() {},
mounted() {
this.pageTypeCopy = this.pageType;
}, if (this.pageTypeCopy !== "add") {
mounted () { this.getProjectProcess();
this.pageTypeCopy = this.pageType
if (this.pageTypeCopy !== 'add') {
this.getProjectProcess()
} }
if (this.eventId) { if (this.eventId) {
@ -333,24 +380,21 @@ 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
}, },
// //
async getProjectProcess () { async getProjectProcess() {
const url = "/governance/icEvent/process"; const url = "/governance/icEvent/process";
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/icEvent/process"; // const url = "http://yapi.elinkservice.cn/mock/245/gov/project/icEvent/process";
@ -371,198 +415,196 @@ 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()
if (this.$refs.ref_processinfo_add.okflag) {
this.formData.operationType = this.$refs.ref_processinfo_add.operationType this.$refs.ref_processinfo_add.getProcessInfo();
this.eventInfoData.operationType = this.$refs.ref_processinfo_add.operationType // if (this.$refs.ref_processinfo_add.okflag) {
this.formData.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.status = this.replayInfo.status
if (this.replayInfo.categoryId) {
this.eventInfoData.categoryList = []
this.eventInfoData.categoryList.push(this.replayInfo.categoryId)
}
} else if (this.formData.operationType === '1') {
this.replayInfo = {}
this.demand = {}
this.project = this.$refs.ref_processinfo_add.project
//
this.project.gridId = this.eventInfoData.gridId
if (this.project.categoryList && this.project.categoryList.length > 0) {
this.eventInfoData.categoryList = []
this.eventInfoData.categoryList.push(this.project.categoryList[0].id)
}
console.log('projectInfo', this.project)
} else if (this.formData.operationType === '2') {
this.replayInfo = {}
this.project = {}
this.demand = this.$refs.ref_processinfo_add.demand
this.demand.gridId = this.eventInfoData.gridId
//
// this.eventInfoData.categoryList = []
// this.eventInfoData.categoryList.push(this.demand.categoryId)
console.log('demond', this.demand)
} else if (this.formData.operationType === '3') {
this.project = {}
this.demand = {}
this.replayInfo = {}
this.issueInfo = this.$refs.ref_processinfo_add.issueInfo
if (this.issueInfo.categoryList && this.issueInfo.categoryList.length > 0) {
this.eventInfoData.categoryList = []
this.eventInfoData.categoryList.push(this.issueInfo.categoryList[0].id)
}
console.log('issueInfo', this.issueInfo)
//
this.eventInfoData.content = this.replayInfo.content;
this.eventInfoData.status = this.replayInfo.status;
if (this.replayInfo.categoryId) {
this.eventInfoData.categoryList = [];
this.eventInfoData.categoryList.push(this.replayInfo.categoryId);
}
} else if (this.formData.operationType === "1") {
this.replayInfo = {};
this.demand = {};
this.project = this.$refs.ref_processinfo_add.project;
//
this.project.gridId = this.eventInfoData.gridId;
if (this.project.categoryList && this.project.categoryList.length > 0) {
this.eventInfoData.categoryList = [];
this.eventInfoData.categoryList.push(this.project.categoryList[0].id);
} }
console.log("projectInfo", this.project);
} else if (this.formData.operationType === "2") {
this.replayInfo = {};
this.project = {};
this.demand = this.$refs.ref_processinfo_add.demand;
this.demand.gridId = this.eventInfoData.gridId;
//
// this.eventInfoData.categoryList = []
// this.eventInfoData.categoryList.push(this.demand.categoryId)
console.log("demond", this.demand);
} else if (this.formData.operationType === "3") {
this.project = {};
this.demand = {};
this.replayInfo = {};
this.issueInfo = this.$refs.ref_processinfo_add.issueInfo;
if (
this.issueInfo.categoryList &&
this.issueInfo.categoryList.length > 0
) {
this.eventInfoData.categoryList = [];
this.eventInfoData.categoryList.push(
this.issueInfo.categoryList[0].id
);
}
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() {
const url = "/governance/icEvent/add"; if (
(this.formData.operationType == 3 && this.issueInfo.issueTitle) ||
const { formData } = this; (this.formData.operationType == 2 && this.demand.demandUserName) ||
const { data, code, msg } = await requestPost(url, { (this.formData.operationType == 1 && this.project.categoryList) ||
(this.formData.operationType == 0 && this.eventInfoData.content) ||
...formData, this.formData.operationType == 4
}); ) {
if (code === 0) { const url = "/governance/icEvent/add";
const { formData } = this;
this.$message.success("操作成功!"); const { data, code, msg } = await requestPost(url, {
if (this.pageTypeCopy === 'add') { ...formData,
this.eventInfo = this.$refs.ref_add.resetData() });
if (code === 0) {
this.$message.success("操作成功!");
if (this.pageTypeCopy === "add") {
this.eventInfo = this.$refs.ref_add.resetData();
}
this.$emit("handleOk");
} else {
this.$message.error(msg);
} }
this.$emit("handleOk"); }else if(this.formData.operationType == ''){
} else { this.$message.error('请选择处理方式!')
this.$message.error(msg);
} }
}, },
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.demand = {}
this.replayInfo = this.$refs.ref_processinfo_dispose.replayInfo
this.replayInfo.icEventId = this.eventId this.replayInfo.icEventId = this.eventId;
console.log('replayInfo', this.replayInfo) 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");
@ -571,32 +613,31 @@ 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') {
// this.projectPageType = 'edit' // this.projectPageType = 'edit'
// } 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";
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
@ -604,29 +645,25 @@ 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";
}, },
// //
startLoading () { startLoading() {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: "正在加载……", // text: "正在加载……", //
@ -634,7 +671,7 @@ export default {
}); });
}, },
// //
endLoading () { endLoading() {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close(); loading.close();

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

@ -1,15 +1,18 @@
<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="事件分类" >
label-width="150px" <el-form-item
:class="{'form-item':source==='visiual'}" label="事件分类"
prop="categoryList"> label-width="150px"
<div :class="{'visiual-form':source==='visiual'}"> :class="{ 'form-item': source === 'visiual' }"
prop="categoryList"
>
<div :class="{ 'visiual-form': source === 'visiual' }">
<!-- <el-cascader class="cell-width-2" <!-- <el-cascader class="cell-width-2"
ref="myCascader" ref="myCascader"
v-model="selCategoryArray" v-model="selCategoryArray"
@ -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
prop="content" label="回复内容"
label-width="150px" prop="content"
:class="{'form-item':source==='visiual'}" label-width="150px"
style="display: block"> :class="{ 'form-item': source === 'visiual' }"
<div :class="{'visiual-form':source==='visiual'}"> style="display: block"
<el-input class="cell-width-area" >
type="textarea" <div :class="{ 'visiual-form': source === 'visiual' }">
maxlength="500" <el-input
show-word-limit class="cell-width-area"
:rows="5" type="textarea"
placeholder="请输入回复内容,不超过500字" maxlength="500"
v-model="formData.content"></el-input> show-word-limit
:rows="5"
placeholder="请输入回复内容,不超过500字"
v-model="formData.content"
></el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="" <el-form-item
label-width="150px" label=""
:class="{'form-item':source==='visiual'}" label-width="150px"
style="display: block"> :class="{ 'form-item': source === 'visiual' }"
<el-checkbox :class="{'form-item':source==='visiual'}" style="display: block"
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: {
@ -115,122 +130,128 @@ 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({
lock: true, // lock: true, //
text: "正在加载……", // text: "正在加载……", //
@ -238,7 +259,7 @@ export default {
}); });
}, },
// //
endLoading () { endLoading() {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close(); loading.close();

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