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'">
<el-card>
<h3>新增事件</h3>
<event-add ref="ref_add"
@changeName="changeName"
@changeMobile="changeMobile"
@changeUserId="changeUserId"
@changeGridId="changeGridId"></event-add>
<event-add
ref="ref_add"
@changeName="changeName"
@changeMobile="changeMobile"
@changeUserId="changeUserId"
@changeGridId="changeGridId"
></event-add>
</el-card>
<div class="process-form">
<el-card>
<h3>处理</h3>
<process-form ref="ref_processinfo_add"
:demandUserId="demandUserId"
:demandUserName="demandUserName"
:demandUserMobile="demandUserMobile"
:gridId="gridId"></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>
<process-form
ref="ref_processinfo_add"
:demandUserId="demandUserId"
:demandUserName="demandUserName"
:demandUserMobile="demandUserMobile"
:gridId="gridId"
></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>
</el-card>
</div>
</div>
<div v-if="pageTypeCopy == 'dispose'||pageTypeCopy == 'info'"
class="g-page">
<div :class="['g-total',{'g-left':projectProcess.length>0}]">
<event-detail ref="ref_detail"
:type="pageType"
:eventId="eventId"
:eventDetailData="eventDetailData"
:source="source"
@handleToProject="handleToProject"
@handleToDemand="handleToDemand"
@handleToIssue="handleToIssue"
@handleClose="handleClose"></event-detail>
<div v-if="!eventDetailData.operationId &&pageTypeCopy == 'dispose' "
class="process-form">
<el-card :class="{'box-card':source==='visiual'}">
<div :class="['process-title',{'process-title-vis':source==='visiual'}]">处理</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
v-if="pageTypeCopy == 'dispose' || pageTypeCopy == 'info'"
class="g-page"
>
<div :class="['g-total', { 'g-left': projectProcess.length > 0 }]">
<event-detail
ref="ref_detail"
:type="pageType"
:eventId="eventId"
:eventDetailData="eventDetailData"
:source="source"
@handleToProject="handleToProject"
@handleToDemand="handleToDemand"
@handleToIssue="handleToIssue"
@handleClose="handleClose"
></event-detail>
<div
v-if="!eventDetailData.operationId && pageTypeCopy == 'dispose'"
class="process-form"
>
<el-card :class="{ 'box-card': source === 'visiual' }">
<div
:class="[
'process-title',
{ 'process-title-vis': source === 'visiual' },
]"
>
处理
</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>
</el-card>
</div>
</div>
<div v-if="projectProcess.length>0"
class="g-right">
<el-card :class="{'box-card':source==='visiual'}"
style="max-height: 90vh; overflow: auto">
<div v-if="projectProcess.length > 0" class="g-right">
<el-card
:class="{ 'box-card': source === 'visiual' }"
style="max-height: 90vh; overflow: auto"
>
<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="item"
:class="[index === 0 ? 'z-on' : '',{'item-vis':source==='visiual'}]"
:key="item.processId"
v-for="(item, index) in projectProcess">
<div
class="item"
:class="[
index === 0 ? 'z-on' : '',
{ 'item-vis': source === 'visiual' },
]"
:key="item.processId"
v-for="(item, index) in projectProcess"
>
<div class="item-row">
<div class="name">{{ item.processName }}</div>
<div class="date">
@ -87,7 +119,7 @@
</div>
</div>
<div v-if="item.type==='event'">
<div v-if="item.type === 'event'">
<div class="detail">
<div class="detail-field">回复人</div>
<div class="detail-value">{{ item.departmentName }}</div>
@ -98,8 +130,8 @@
</div>
</div>
<div v-else-if="item.type==='project'">
<div v-if="item.processName==='回复'">
<div v-else-if="item.type === 'project'">
<div v-if="item.processName === '回复'">
<div class="detail">
<div class="detail-field">回复人</div>
<div class="detail-value">{{ item.departmentName }}</div>
@ -122,28 +154,38 @@
<fold-text :row="3">{{ item.assistanceUnitName }}</fold-text>
</div>
</div> -->
<div class="detail"
v-if="item.processName != '转项目' && item.publicReply">
<div
class="detail"
v-if="item.processName != '转项目' && item.publicReply"
>
<div class="detail-field"> </div>
<div class="detail-value">
<fold-text :row="3">{{ item.publicReply }}</fold-text>
</div>
</div>
<div class="detail"
v-if="item.processName != '转项目' && item.internalRemark">
<div
class="detail"
v-if="item.processName != '转项目' && item.internalRemark"
>
<div class="detail-field">内部备注</div>
<div class="detail-value">
<fold-text :row="3">{{ item.internalRemark }}</fold-text>
<fold-text :row="3">{{
item.internalRemark
}}</fold-text>
</div>
</div>
<div v-if="item.internalFile&&item.internalFile.length>0"
class="detail">
<div
v-if="item.internalFile && item.internalFile.length > 0"
class="detail"
>
<div class="attachement-list">
<a :href="att.url"
target="_blank"
:key="att.url"
v-for="att in item.internalFile">
<a
:href="att.url"
target="_blank"
:key="att.url"
v-for="att in item.internalFile"
>
<i class="el-icon-folder-opened"></i>
{{ att.name }}
</a>
@ -152,8 +194,8 @@
</div>
</div>
<div v-else-if="item.type==='demand'">
<div v-if="item.processName==='回复'">
<div v-else-if="item.type === 'demand'">
<div v-if="item.processName === '回复'">
<div class="detail">
<div class="detail-field">回复人</div>
<div class="detail-value">{{ item.departmentName }}</div>
@ -163,26 +205,27 @@
<div class="detail-value">{{ item.publicReply }}</div>
</div>
</div>
<div v-if="item.processName==='需求完成'">
<div v-if="item.processName === '需求完成'">
<div class="detail">
<div class="detail-field">服务方</div>
<div class="detail-value">{{ item.serviceParty }}</div>
</div>
<div class="detail">
<div class="detail-field">实际服务时间</div>
<div class="detail-value">{{ item.actualServiceTime }}</div>
<div class="detail-value">
{{ item.actualServiceTime }}
</div>
</div>
</div>
<div v-if="item.processName==='转服务'">
<div v-if="item.processName === '转服务'">
<div class="detail">
<div class="detail-field">服务时间</div>
<div class="detail-value">{{ item.serviceTime }}</div>
</div>
</div>
</div>
<div v-else-if="item.type==='issue'">
<div v-else-if="item.type === 'issue'">
<div class="detail">
<div class="detail-field">回复人</div>
<div class="detail-value">{{ item.departmentName }}</div>
@ -200,29 +243,35 @@
</div>
<div v-if="pageTypeCopy == 'project'">
<project-info-origin ref="eleEditForm"
:source="source"
:type="projectPageType"
:projectId="eventDetailCopy.operationId"
@close="handleCloseProject"
@afterEdit="handleCloseProject" />
<project-info-origin
ref="eleEditForm"
:source="source"
:sourceType="sourceType"
:type="projectPageType"
:projectId="eventDetailCopy.operationId"
@close="handleCloseProject"
@afterEdit="handleCloseProject"
/>
</div>
<div v-if="pageTypeCopy == 'demand'">
<demand-info-origin ref="demandEditForm"
:source="source"
:demandRecId="eventDetailCopy.operationId"
@close="handleCloseProject" />
<demand-info-origin
ref="demandEditForm"
:source="source"
:demandRecId="eventDetailCopy.operationId"
@close="handleCloseProject"
/>
</div>
<div v-if="pageTypeCopy == 'issue'">
<issue-info-origin ref="eleEditForm"
:pageType="issuePageType"
:issueId="eventDetailCopy.operationId"
:issueDetailData="issueDetailData"
@handleClose="handleCloseProject"
@handleOk="handleCloseProject"
@dialogOk="handleCloseProject" />
<issue-info-origin
ref="eleEditForm"
:pageType="issuePageType"
:issueId="eventDetailCopy.operationId"
:issueDetailData="issueDetailData"
@handleClose="handleCloseProject"
@handleOk="handleCloseProject"
@dialogOk="handleCloseProject"
/>
</div>
</div>
</template>
@ -239,11 +288,10 @@ import eventDetail from "./event-detail";
import processForm from "./process-form";
let loading; //
function iniData () {
function iniData() {
return {
formData: {
operationType: '',
operationType: "",
},
eventInfoData: {},
replayInfo: {},
@ -252,20 +300,21 @@ function iniData () {
issueInfo: {},
//
demandUserId: '',
demandUserName: '',
demandUserMobile: '',
gridId: '',
demandUserId: "",
demandUserName: "",
demandUserMobile: "",
gridId: "",
eventDetailCopy: {},
projectProcess: [],
projectPageType: 'info',
pageTypeCopy: '',
projectPageType: "info",
pageTypeCopy: "",
issuePageType: '',
issuePageType: "",
issueDetailData: {},
sourceType: "",
};
}
@ -282,15 +331,16 @@ export default {
},
eventDetailData: {
type: Object,
default () {
return {}
}
default() {
return {};
},
},
source: {//manage visiual
source: {
//manage visiual
type: String,
default: 'manage'
}
default: "manage",
},
},
components: {
@ -301,7 +351,7 @@ export default {
processForm,
projectInfoOrigin,
demandInfoOrigin,
issueInfoOrigin
issueInfoOrigin,
},
data: iniData,
@ -309,7 +359,7 @@ export default {
computed: {},
watch: {
eventId () {
eventId() {
let data = iniData();
Object.keys(data).forEach((k) => {
this[k] = data[k];
@ -317,14 +367,11 @@ export default {
// this.getApiData();
},
},
created () {
},
mounted () {
this.pageTypeCopy = this.pageType
if (this.pageTypeCopy !== 'add') {
this.getProjectProcess()
created() {},
mounted() {
this.pageTypeCopy = this.pageType;
if (this.pageTypeCopy !== "add") {
this.getProjectProcess();
}
if (this.eventId) {
@ -333,24 +380,21 @@ export default {
},
methods: {
changeName (val) {
this.demandUserName = val
changeName(val) {
this.demandUserName = val;
},
changeMobile (val) {
this.demandUserMobile = val
changeMobile(val) {
this.demandUserMobile = val;
},
changeUserId (val) {
this.demandUserId = val
changeUserId(val) {
this.demandUserId = val;
},
changeGridId (val) {
this.gridId = val
changeGridId(val) {
this.gridId = val;
},
//
async getProjectProcess () {
async getProjectProcess() {
const url = "/governance/icEvent/process";
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/icEvent/process";
@ -371,198 +415,196 @@ export default {
}
},
getEventInfo () {
this.$refs.ref_add.getEventInfo()
getEventInfo() {
this.$refs.ref_add.getEventInfo();
if (this.$refs.ref_add.okflag) {
this.eventInfoData = this.$refs.ref_add.formData
this.eventInfoData = this.$refs.ref_add.formData;
} else {
return false
return false;
}
console.log('eventInfo', this.eventInfoData)
console.log("eventInfo", this.eventInfoData);
},
async handleComfirm () {
this.startLoading()
if (this.pageTypeCopy === 'add') {
await this.handelAdd()
async handleComfirm() {
this.startLoading();
if (this.pageTypeCopy === "add") {
await this.handelAdd();
}
if (this.pageTypeCopy === 'dispose') {
await this.handelDispose()
if (this.pageTypeCopy === "dispose") {
await this.handelDispose();
}
this.endLoading()
this.endLoading();
},
async handelAdd () {
this.$refs.ref_add.getEventInfo()
async handelAdd() {
this.$refs.ref_add.getEventInfo();
if (this.$refs.ref_add.okflag) {
this.eventInfoData = this.$refs.ref_add.formData
this.eventInfoData = this.$refs.ref_add.formData;
} else {
return false
return false;
}
console.log('eventInfo', this.eventInfoData)
this.$refs.ref_processinfo_add.getProcessInfo()
if (this.$refs.ref_processinfo_add.okflag) {
console.log("eventInfo", this.eventInfoData);
this.formData.operationType = this.$refs.ref_processinfo_add.operationType
this.eventInfoData.operationType = this.$refs.ref_processinfo_add.operationType
this.$refs.ref_processinfo_add.getProcessInfo();
// 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') {
this.project = {}
this.demand = {}
this.replayInfo = this.$refs.ref_processinfo_add.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)
if (this.formData.operationType === "0") {
this.project = {};
this.demand = {};
this.replayInfo = this.$refs.ref_processinfo_add.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.formData = {
...this.eventInfoData,
// replayInfo: this.replayInfo,
project: this.project,
demand: this.demand,
issueInfo: this.issueInfo
}
issueInfo: this.issueInfo,
};
console.log('this.formData', this.formData)
await this.submit()
console.log("this.formData", this.formData);
await this.submit();
},
async submit () {
const url = "/governance/icEvent/add";
const { formData } = this;
const { data, code, msg } = await requestPost(url, {
...formData,
});
if (code === 0) {
this.$message.success("操作成功!");
if (this.pageTypeCopy === 'add') {
this.eventInfo = this.$refs.ref_add.resetData()
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 { formData } = this;
const { data, code, msg } = await requestPost(url, {
...formData,
});
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 {
this.$message.error(msg);
}else if(this.formData.operationType == ''){
this.$message.error('请选择处理方式!')
}
},
async handelDispose () {
this.$refs.ref_processinfo_dispose.getProcessInfo()
async handelDispose() {
this.$refs.ref_processinfo_dispose.getProcessInfo();
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 = {}
this.demand = {}
this.replayInfo = this.$refs.ref_processinfo_dispose.replayInfo
if (this.formData.operationType === "0") {
this.project = {};
this.demand = {};
this.replayInfo = this.$refs.ref_processinfo_dispose.replayInfo;
this.replayInfo.icEventId = this.eventId
console.log('replayInfo', this.replayInfo)
this.replayInfo.icEventId = this.eventId;
console.log("replayInfo", this.replayInfo);
//
let url = '/governance/icEvent/reply'
await this.submitDispose(url, this.replayInfo)
} else if (this.formData.operationType === '1') {
this.replayInfo = {}
this.demand = {}
this.project = this.$refs.ref_processinfo_dispose.project
let url = "/governance/icEvent/reply";
await this.submitDispose(url, this.replayInfo);
} else if (this.formData.operationType === "1") {
this.replayInfo = {};
this.demand = {};
this.project = this.$refs.ref_processinfo_dispose.project;
//
this.project.icEventId = this.eventId
console.log('projectInfo', this.project)
let url = '/governance/icEvent/icEventToProject'
await this.submitDispose(url, this.project)
} else if (this.formData.operationType === '2') {
this.replayInfo = {}
this.project = {}
this.demand = this.$refs.ref_processinfo_dispose.demand
this.project.icEventId = this.eventId;
console.log("projectInfo", this.project);
let url = "/governance/icEvent/icEventToProject";
await this.submitDispose(url, this.project);
} else if (this.formData.operationType === "2") {
this.replayInfo = {};
this.project = {};
this.demand = this.$refs.ref_processinfo_dispose.demand;
//
this.demand.icEventId = this.eventId
console.log('demond', this.demand)
let url = '/governance/icEvent/icEventToDemand'
await this.submitDispose(url, this.demand)
} else if (this.formData.operationType === '3') {
this.replayInfo = {}
this.demand = {}
this.project = {}
this.issueInfo = this.$refs.ref_processinfo_dispose.issueInfo
this.demand.icEventId = this.eventId;
console.log("demond", this.demand);
let url = "/governance/icEvent/icEventToDemand";
await this.submitDispose(url, this.demand);
} else if (this.formData.operationType === "3") {
this.replayInfo = {};
this.demand = {};
this.project = {};
this.issueInfo = this.$refs.ref_processinfo_dispose.issueInfo;
//
console.log('issueInfo', this.issueInfo)
let url = '/governance/icEvent/icEventToIssue'
await this.submitDispose(url, this.issueInfo)
console.log("issueInfo", this.issueInfo);
let url = "/governance/icEvent/icEventToIssue";
await this.submitDispose(url, this.issueInfo);
} else {
this.$message.info("请选择一种处理方式");
}
} else {
return false
return false;
}
},
async submitDispose (url, params) {
async submitDispose(url, params) {
const { data, code, msg } = await requestPost(url, {
...params,
});
if (code === 0) {
this.$message.success("操作成功!");
this.$emit("handleOk");
@ -571,32 +613,31 @@ export default {
}
},
handleClose () {
if (this.pageTypeCopy === 'add') {
this.eventInfo = this.$refs.ref_add.resetData()
handleClose() {
if (this.pageTypeCopy === "add") {
this.eventInfo = this.$refs.ref_add.resetData();
}
this.$emit("handleClose");
},
handleToProject () {
if (this.eventDetailCopy.status === 'processing') {
this.projectPageType = 'edit'
handleToProject(type) {
if (this.eventDetailCopy.status === "processing") {
this.projectPageType = "edit";
} else {
this.projectPageType = 'info'
this.projectPageType = "info";
}
this.pageTypeCopy = 'project'
this.sourceType = "event";
this.pageTypeCopy = "project";
},
handleToDemand () {
handleToDemand() {
// if (this.eventDetailCopy.status === 'processing') {
// this.projectPageType = 'edit'
// } else {
// this.projectPageType = 'info'
// }
this.pageTypeCopy = 'demand'
this.pageTypeCopy = "demand";
},
async handleToIssue () {
async handleToIssue() {
const url = "/governance/manage/votingissuedetail";
const { data, code, msg } = await requestPost(url, {
@ -604,29 +645,25 @@ export default {
});
if (code === 0) {
this.issueDetailData = { ...data };
} else {
this.$message.error(msg);
}
if (this.issueDetailData.issueStatus === 'voting') {
this.issuePageType = 'dispose'
if (this.issueDetailData.issueStatus === "voting") {
this.issuePageType = "dispose";
} else {
this.issuePageType = 'info'
this.issuePageType = "info";
}
this.pageTypeCopy = 'issue'
this.pageTypeCopy = "issue";
},
handleCloseProject () {
this.getProjectProcess()
this.pageTypeCopy = 'info'
handleCloseProject() {
this.getProjectProcess();
this.pageTypeCopy = "info";
},
//
startLoading () {
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
@ -634,7 +671,7 @@ export default {
});
},
//
endLoading () {
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();

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

@ -1,15 +1,18 @@
<template>
<div class="search">
<el-form ref="ref_form1"
:inline="false"
:model="formData"
:rules="dataRule">
<el-form-item label="事件分类"
label-width="150px"
:class="{'form-item':source==='visiual'}"
prop="categoryList">
<div :class="{'visiual-form':source==='visiual'}">
<el-form
ref="ref_form1"
:inline="false"
:model="formData"
:rules="dataRule"
>
<el-form-item
label="事件分类"
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
prop="categoryList"
>
<div :class="{ 'visiual-form': source === 'visiual' }">
<!-- <el-cascader class="cell-width-2"
ref="myCascader"
v-model="selCategoryArray"
@ -18,38 +21,47 @@
:props="optionProps"
:show-all-levels="false"
@change="handleChangeCate"></el-cascader> -->
<my-cascader v-model="formData.categoryList"
<my-cascader
v-model="formData.categoryList"
:casOptions="casOptions"
:optionProps="optionProps"
@handleChangeCate="handleChangeCate"></my-cascader>
@handleChangeCate="handleChangeCate"
></my-cascader>
</div>
</el-form-item>
<el-form-item label="回复内容"
prop="content"
label-width="150px"
:class="{'form-item':source==='visiual'}"
style="display: block">
<div :class="{'visiual-form':source==='visiual'}">
<el-input class="cell-width-area"
type="textarea"
maxlength="500"
show-word-limit
:rows="5"
placeholder="请输入回复内容,不超过500字"
v-model="formData.content"></el-input>
<el-form-item
label="回复内容"
prop="content"
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
style="display: block"
>
<div :class="{ 'visiual-form': source === 'visiual' }">
<el-input
class="cell-width-area"
type="textarea"
maxlength="500"
show-word-limit
:rows="5"
placeholder="请输入回复内容,不超过500字"
v-model="formData.content"
></el-input>
</div>
</el-form-item>
<el-form-item label=""
label-width="150px"
:class="{'form-item':source==='visiual'}"
style="display: block">
<el-checkbox :class="{'form-item':source==='visiual'}"
v-model="status">已完成</el-checkbox>
<el-form-item
label=""
label-width="150px"
:class="{ 'form-item': source === 'visiual' }"
style="display: block"
>
<el-checkbox
:class="{ 'form-item': source === 'visiual' }"
v-model="status"
@change="handleChangeStatus"
>已完成</el-checkbox
>
</el-form-item>
</el-form>
</div>
</template>
@ -62,16 +74,15 @@ import { isCard } from "@/utils/validate";
import myCascader from "./myCascader.vue";
let loading; //
export default {
data () {
data() {
return {
btnDisable: false,
formData: {
operationType: '0',//[0: 1: 2:]
content: '',
status: '',
categoryList:[]
operationType: "0", //[0: 1: 2:]
content: "",
status: "",
categoryList: [],
},
status: false,
@ -85,28 +96,32 @@ export default {
selCateObj: {},
optionProps: {
multiple: false,
value: 'id',
label: 'name',
children: 'subCategory',
value: "id",
label: "name",
children: "subCategory",
},
};
},
components: {myCascader},
computed: {
dataRule () {
return {
dataRule:{
content: [
{ required: true, message: "回复内容不能为空", trigger: "blur" },
],
categoryList:[
{required:true,message:"事件分类不能为空",trigger:"blur"}
]
};
},
categoryList: [
// { required: true, message: "", trigger: "blur" },
],
}
};
},
components: { myCascader },
computed: {
// dataRule() {
// return {
// content: [
// { required: true, message: "", trigger: "blur" },
// ],
// categoryList: [
// { required: true, message: "", trigger: "blur" },
// ],
// };
// },
},
props: {
eventId: {
@ -115,122 +130,128 @@ export default {
},
eventDetailData: {
type: Object,
default () {
return {}
}
default() {
return {};
},
},
source: {//manage visiual
source: {
//manage visiual
type: String,
default: 'manage'
}
default: "manage",
},
},
watch: {},
created () {
console.log(this.source)
created() {
console.log(this.source);
},
async mounted () {
this.getCategoryList()
async mounted() {
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)
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,
};
}
}
},
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) {
handleChangeCate(obj) {
// console.log(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 = [];
let flag = JSON.stringify(obj) == '{}'
if(flag) this.formData.categoryList = []
else this.formData.categoryList.push(this.selCateObj);
let flag = JSON.stringify(obj) == "{}";
if (flag) this.formData.categoryList = [];
else this.formData.categoryList.push(this.selCateObj);
}else{
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
}
},
//
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 getReplayInfo () {
this.okflag = false
async getReplayInfo() {
this.okflag = false;
this.$refs["ref_form1"].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj);
} else {
if (this.status) {
console.log(this.selCateObj);
if (!this.selCateObj || !this.selCateObj.id) {
this.$message.info("请填写事件分类");
return false
this.$message.error("请选择事件分类");
return false;
}
this.formData.status = 'closed_case'
this.formData.status = "closed_case";
} else {
this.formData.status = 'processing'
this.formData.status = "processing";
}
this.formData.categoryId = this.selCateObj.id
this.formData.categoryList = []
this.formData.categoryList.push(this.selCateObj)
this.formData.categoryId = this.selCateObj.id;
this.formData.categoryList = [];
this.formData.categoryList.push(this.selCateObj);
this.okflag = true
this.okflag = true;
}
});
},
resetData () {
handleChangeStatus(val){
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({
lock: true, //
text: "正在加载……", //
@ -238,7 +259,7 @@ export default {
});
},
//
endLoading () {
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();

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

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

Loading…
Cancel
Save