diff --git a/src/components/CaseCommon/caseDetail.vue b/src/components/CaseCommon/caseDetail.vue index 218863f..cd7f277 100644 --- a/src/components/CaseCommon/caseDetail.vue +++ b/src/components/CaseCommon/caseDetail.vue @@ -143,10 +143,10 @@
案卷处理:
- + - - + + {{ radio.nextOperation }} @@ -169,7 +169,7 @@ - + - + - - + + @@ -298,7 +301,7 @@ - + @@ -327,31 +330,12 @@ export default { name: 'CaseDetail', components: { ArcGisMapRead }, - // props: { - // id: { - // type: String, - // default: '' - // }, - // row: { - // type: Object, - // default: null - // }, - // showProcess: { - // type: Boolean, - // default: true - // }, - // showNeedVisit: { - // type: Boolean, - // default: false - // } - // }, data() { return { id: '', showProcess: true, showNeedVisit: false, caseDetail: {}, - operationKey: '', // 案件处理按钮key fileIdVerify: [], // 核实照片id fileIdProcess: [], // 处理照片id fileIdCheck: [], // 核查照片id @@ -362,14 +346,24 @@ currState: '', // 当前案件状态 changeState: '', // 案件流转后状态 remarks: '', // 审批意见 - approvalResult: '' // 审批结果标志 + approvalResult: '', // 审批结果标志 + operationKey: '' // 案件处理按钮key,放form里以便绑定prop }, commonLanguage: '', // 常用语 commonLanguageList: [], // 常用语列表 processRadioList: [], // 案件处理单选按钮 processCompShow: '', // 案卷处理组件显示 processCompObj: {}, // 案卷处理组件相关对象 - dialogVisible: false + dialogVisible: false, + caseLevelLoading: false, + caseEorcLoading: false, + caseTypeLoading: false, + caseTypeDetailLoading: false, + caseTypeTimeLoading: false, + rules: { + operationKey: [{ required: true, message: '操作类型不能为空', trigger: ['blur', 'change'] }], + remarks: [{ required: true, message: '处置意见不能为空', trigger: ['blur', 'change'] }] + } } }, computed: { @@ -386,6 +380,9 @@ } else { return true } + }, + operationKey: function() { // 案件处理按钮key + return this.processForm.operationKey } }, watch: { @@ -453,8 +450,6 @@ // 查询流转记录接口 this.processForm.processId = this.caseDetail.processId - // const resRecord = historicalRecords(this.processForm.processId) - // this.recordList = resRecord.data historicalRecords(this.processForm.processId).then(res => { this.recordList = res.data }) @@ -465,14 +460,15 @@ }, // 每次清空案件处理相关数据 resetData() { - this.operationKey = '' + // this.operationKey = '' this.processForm = { processId: '', bizId: '', currState: '', changeState: '', remarks: '', - approvalResult: '' + approvalResult: '', + operationKey: '' } this.commonLanguage = '' this.processCompShow = '' @@ -493,30 +489,45 @@ * 选择事部件,更新大类 */ async selectEorc(value) { - const caseTypeRes = await getCaseTypeList(this.processCompObj.eorc) - this.processCompObj.caseTypeList = caseTypeRes.data + console.log('selectEorc', this.processCompObj) + if (this.processCompObj.eorc) { + this.caseTypeLoading = true + const caseTypeRes = await getCaseTypeList(this.processCompObj.eorc) + this.processCompObj.caseTypeList = caseTypeRes.data + this.caseTypeLoading = false + } else { + this.processCompObj.caseTypeList = [] + } this.processCompObj.caseType = '' }, /** * 选择大类,更新小类下拉框 */ async selectCaseType(value) { - const caseTypeDetailRes = await getCaseTypeDetailList(this.processCompObj.eorc, this.processCompObj.caseType) // 小类 - this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + console.log('selectCaseType', this.processCompObj) + if (this.processCompObj.eorc && this.processCompObj.caseType) { + this.caseTypeDetailLoading = true + const caseTypeDetailRes = await getCaseTypeDetailList(this.processCompObj.eorc, this.processCompObj.caseType) // 小类 + this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + this.caseTypeDetailLoading = false + } else { + this.processCompObj.caseTypeDetailList = [] + } this.processCompObj.caseTypeDetail = '' - // this.processCompObj.caseTypeDetail = caseTypeDetailRes.data[0].id }, /** * 选择小类,更新立案标准下拉框 */ async selectCaseTypeDetail(value) { - const caseTypeTimesRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 小类 - this.processCompObj.caseTypeTimeList = caseTypeTimesRes.data - // if (this.processCompObj.caseTypeTimeList.length > 0) { - // this.processCompObj.caseTypeTime = caseTypeTimesRes.data[0].id - // } else { - // this.processCompObj.caseTypeTime = '' - // } + console.log('selectCaseTypeDetail', this.processCompObj) + if (this.processCompObj.caseTypeDetail) { + this.caseTypeTimeLoading = true + const caseTypeTimesRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 小类 + this.processCompObj.caseTypeTimeList = caseTypeTimesRes.data + this.caseTypeTimeLoading = false + } else { + this.processCompObj.caseTypeTimeList = [] + } this.processCompObj.caseTypeTime = '' }, /** @@ -603,35 +614,49 @@ const eorcListRes = await getEorc() // 事部件 this.$set(this.processCompObj, 'eorcList', eorcListRes.data) - // if (this.caseDetail.eorc) { this.$set(this.processCompObj, 'eorc', this.caseDetail.eorc) - // } - const caseTypeRes = await getCaseTypeList(this.caseDetail.eorc) // 大类 - this.$set(this.processCompObj, 'caseTypeList', caseTypeRes.data) - if (this.caseDetail.casetypeCode) { - const defaultCaseType = _.find(this.processCompObj.caseTypeList, ['typeCode', this.caseDetail.casetypeCode]) - this.$set(this.processCompObj, 'caseType', defaultCaseType.id) - } else { - this.$set(this.processCompObj, 'caseType', '') - } - - const caseTypeDetailRes = await getCaseTypeDetailList(this.caseDetail.eorc, this.processCompObj.caseType) // 小类 - this.$set(this.processCompObj, 'caseTypeDetailList', caseTypeDetailRes.data) - if (this.caseDetail.casetypeDetailCode) { - const defaultCaseTypeDetail = _.find(this.processCompObj.caseTypeDetailList, ['typeDetailCode', this.caseDetail.casetypeDetailCode]) - this.$set(this.processCompObj, 'caseTypeDetail', defaultCaseTypeDetail.id) - } else { - this.$set(this.processCompObj, 'caseTypeDetail', '') - } - - const caseTypeTimeRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 立案标准 - this.$set(this.processCompObj, 'caseTypeTimeList', caseTypeTimeRes.data) - this.$set(this.processCompObj, 'caseTypeTime', this.caseDetail.casetypesTimeId) - + // 初始化 + this.$set(this.processCompObj, 'caseTypeList', []) + this.$set(this.processCompObj, 'caseTypeDetailList', []) + this.$set(this.processCompObj, 'caseTypeTimeList', []) + this.$set(this.processCompObj, 'caseType', '') + this.$set(this.processCompObj, 'caseTypeDetail', '') + this.$set(this.processCompObj, 'caseTypeTime', '') this.$set(this.processCompObj, 'hours', '') this.$set(this.processCompObj, 'minutes', '') - this.updateHoursAndMins() + + // 大类列表 + if (this.caseDetail.eorc) { + const caseTypeRes = await getCaseTypeList(this.caseDetail.eorc) + this.processCompObj.caseTypeList = caseTypeRes.data + } + // 大类 + if (this.caseDetail.casetypeCode) { + const defaultCaseType = _.find(this.processCompObj.caseTypeList, ['typeCode', this.caseDetail.casetypeCode]) + this.processCompObj.caseType = defaultCaseType.id + } + // 小类列表 + if (this.caseDetail.eorc && this.processCompObj.caseType) { + const caseTypeDetailRes = await getCaseTypeDetailList(this.caseDetail.eorc, this.processCompObj.caseType) + this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + } + // 小类 + if (this.caseDetail.casetypeDetailCode) { + const defaultCaseTypeDetail = _.find(this.processCompObj.caseTypeDetailList, ['typeDetailCode', this.caseDetail.casetypeDetailCode]) + this.processCompObj.caseTypeDetail = defaultCaseTypeDetail.id + } + // 立案标准列表 + if (this.processCompObj.caseTypeDetail) { + const caseTypeTimeRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) + this.processCompObj.caseTypeTimeList = caseTypeTimeRes.data + } + // 立案标准 + if (this.caseDetail.casetypesTimeId) { + this.processCompObj.caseTypeTime = this.caseDetail.casetypesTimeId + } + // this.updateHoursAndMins() + break } case 'selectFilingType': { // 选择归档类型 @@ -667,6 +692,12 @@ this.processForm.changeState = radioObj.nextState this.processForm.approvalResult = radioObj.approvalResult + // remarks不能为空 + if (!this.processForm.remarks) { + this.$message.error('处置意见不能为空') + return false + } + // 其他参数 const radioConfig = radioMap[this.operationKey] // 1. taskUserId @@ -733,7 +764,7 @@ // 4. hours,minutes if (radioConfig.showComp === 'selectCaseTime' || radioConfig.showComp === 'inputDelayTime') { if (!this.numberIsNull(this.processCompObj.hours) || !this.numberIsNull(this.processCompObj.minutes)) { - this.$message.error('请输入时间') + this.$message.error('请输入正确的时间') return false } this.processForm.hours = this.processCompObj.hours @@ -750,8 +781,8 @@ console.log(this.processForm) return true }, - numberIsNull(value) { // 判断数值是否为空 - if (value || value === 0) { + numberIsNull(value) { // 判断数值是否为空, + if (value && Number(value) >= 0) { return true } else { return false @@ -769,15 +800,19 @@ if (!isBuild) { return } - completeCaseTask(this.processForm).then(response => { - if (response.code === 200) { - this.$message.success('提交成功') - // this.$emit('submitProcess', this.caseDetail.caseid) - this.showProcess = false - this.$route.query.showProcess = false - this.initData() - } else { - this.$message.error('提交失败') + this.$refs['processForm'].validate((valid) => { + if (valid) { + completeCaseTask(this.processForm).then(response => { + if (response.code === 200) { + this.$message.success('提交成功') + // this.$emit('submitProcess', this.caseDetail.caseid) + this.showProcess = false + this.$route.query.showProcess = false + this.initData() + } else { + this.$message.error('提交失败') + } + }) } }) }).catch(() => { diff --git a/src/components/CaseCommon/caseDetail.vue b/src/components/CaseCommon/caseDetail.vue index 218863f..cd7f277 100644 --- a/src/components/CaseCommon/caseDetail.vue +++ b/src/components/CaseCommon/caseDetail.vue @@ -143,10 +143,10 @@
案卷处理:
- + - - + + {{ radio.nextOperation }} @@ -169,7 +169,7 @@ - + - + - - + + @@ -298,7 +301,7 @@ - + @@ -327,31 +330,12 @@ export default { name: 'CaseDetail', components: { ArcGisMapRead }, - // props: { - // id: { - // type: String, - // default: '' - // }, - // row: { - // type: Object, - // default: null - // }, - // showProcess: { - // type: Boolean, - // default: true - // }, - // showNeedVisit: { - // type: Boolean, - // default: false - // } - // }, data() { return { id: '', showProcess: true, showNeedVisit: false, caseDetail: {}, - operationKey: '', // 案件处理按钮key fileIdVerify: [], // 核实照片id fileIdProcess: [], // 处理照片id fileIdCheck: [], // 核查照片id @@ -362,14 +346,24 @@ currState: '', // 当前案件状态 changeState: '', // 案件流转后状态 remarks: '', // 审批意见 - approvalResult: '' // 审批结果标志 + approvalResult: '', // 审批结果标志 + operationKey: '' // 案件处理按钮key,放form里以便绑定prop }, commonLanguage: '', // 常用语 commonLanguageList: [], // 常用语列表 processRadioList: [], // 案件处理单选按钮 processCompShow: '', // 案卷处理组件显示 processCompObj: {}, // 案卷处理组件相关对象 - dialogVisible: false + dialogVisible: false, + caseLevelLoading: false, + caseEorcLoading: false, + caseTypeLoading: false, + caseTypeDetailLoading: false, + caseTypeTimeLoading: false, + rules: { + operationKey: [{ required: true, message: '操作类型不能为空', trigger: ['blur', 'change'] }], + remarks: [{ required: true, message: '处置意见不能为空', trigger: ['blur', 'change'] }] + } } }, computed: { @@ -386,6 +380,9 @@ } else { return true } + }, + operationKey: function() { // 案件处理按钮key + return this.processForm.operationKey } }, watch: { @@ -453,8 +450,6 @@ // 查询流转记录接口 this.processForm.processId = this.caseDetail.processId - // const resRecord = historicalRecords(this.processForm.processId) - // this.recordList = resRecord.data historicalRecords(this.processForm.processId).then(res => { this.recordList = res.data }) @@ -465,14 +460,15 @@ }, // 每次清空案件处理相关数据 resetData() { - this.operationKey = '' + // this.operationKey = '' this.processForm = { processId: '', bizId: '', currState: '', changeState: '', remarks: '', - approvalResult: '' + approvalResult: '', + operationKey: '' } this.commonLanguage = '' this.processCompShow = '' @@ -493,30 +489,45 @@ * 选择事部件,更新大类 */ async selectEorc(value) { - const caseTypeRes = await getCaseTypeList(this.processCompObj.eorc) - this.processCompObj.caseTypeList = caseTypeRes.data + console.log('selectEorc', this.processCompObj) + if (this.processCompObj.eorc) { + this.caseTypeLoading = true + const caseTypeRes = await getCaseTypeList(this.processCompObj.eorc) + this.processCompObj.caseTypeList = caseTypeRes.data + this.caseTypeLoading = false + } else { + this.processCompObj.caseTypeList = [] + } this.processCompObj.caseType = '' }, /** * 选择大类,更新小类下拉框 */ async selectCaseType(value) { - const caseTypeDetailRes = await getCaseTypeDetailList(this.processCompObj.eorc, this.processCompObj.caseType) // 小类 - this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + console.log('selectCaseType', this.processCompObj) + if (this.processCompObj.eorc && this.processCompObj.caseType) { + this.caseTypeDetailLoading = true + const caseTypeDetailRes = await getCaseTypeDetailList(this.processCompObj.eorc, this.processCompObj.caseType) // 小类 + this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + this.caseTypeDetailLoading = false + } else { + this.processCompObj.caseTypeDetailList = [] + } this.processCompObj.caseTypeDetail = '' - // this.processCompObj.caseTypeDetail = caseTypeDetailRes.data[0].id }, /** * 选择小类,更新立案标准下拉框 */ async selectCaseTypeDetail(value) { - const caseTypeTimesRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 小类 - this.processCompObj.caseTypeTimeList = caseTypeTimesRes.data - // if (this.processCompObj.caseTypeTimeList.length > 0) { - // this.processCompObj.caseTypeTime = caseTypeTimesRes.data[0].id - // } else { - // this.processCompObj.caseTypeTime = '' - // } + console.log('selectCaseTypeDetail', this.processCompObj) + if (this.processCompObj.caseTypeDetail) { + this.caseTypeTimeLoading = true + const caseTypeTimesRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 小类 + this.processCompObj.caseTypeTimeList = caseTypeTimesRes.data + this.caseTypeTimeLoading = false + } else { + this.processCompObj.caseTypeTimeList = [] + } this.processCompObj.caseTypeTime = '' }, /** @@ -603,35 +614,49 @@ const eorcListRes = await getEorc() // 事部件 this.$set(this.processCompObj, 'eorcList', eorcListRes.data) - // if (this.caseDetail.eorc) { this.$set(this.processCompObj, 'eorc', this.caseDetail.eorc) - // } - const caseTypeRes = await getCaseTypeList(this.caseDetail.eorc) // 大类 - this.$set(this.processCompObj, 'caseTypeList', caseTypeRes.data) - if (this.caseDetail.casetypeCode) { - const defaultCaseType = _.find(this.processCompObj.caseTypeList, ['typeCode', this.caseDetail.casetypeCode]) - this.$set(this.processCompObj, 'caseType', defaultCaseType.id) - } else { - this.$set(this.processCompObj, 'caseType', '') - } - - const caseTypeDetailRes = await getCaseTypeDetailList(this.caseDetail.eorc, this.processCompObj.caseType) // 小类 - this.$set(this.processCompObj, 'caseTypeDetailList', caseTypeDetailRes.data) - if (this.caseDetail.casetypeDetailCode) { - const defaultCaseTypeDetail = _.find(this.processCompObj.caseTypeDetailList, ['typeDetailCode', this.caseDetail.casetypeDetailCode]) - this.$set(this.processCompObj, 'caseTypeDetail', defaultCaseTypeDetail.id) - } else { - this.$set(this.processCompObj, 'caseTypeDetail', '') - } - - const caseTypeTimeRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 立案标准 - this.$set(this.processCompObj, 'caseTypeTimeList', caseTypeTimeRes.data) - this.$set(this.processCompObj, 'caseTypeTime', this.caseDetail.casetypesTimeId) - + // 初始化 + this.$set(this.processCompObj, 'caseTypeList', []) + this.$set(this.processCompObj, 'caseTypeDetailList', []) + this.$set(this.processCompObj, 'caseTypeTimeList', []) + this.$set(this.processCompObj, 'caseType', '') + this.$set(this.processCompObj, 'caseTypeDetail', '') + this.$set(this.processCompObj, 'caseTypeTime', '') this.$set(this.processCompObj, 'hours', '') this.$set(this.processCompObj, 'minutes', '') - this.updateHoursAndMins() + + // 大类列表 + if (this.caseDetail.eorc) { + const caseTypeRes = await getCaseTypeList(this.caseDetail.eorc) + this.processCompObj.caseTypeList = caseTypeRes.data + } + // 大类 + if (this.caseDetail.casetypeCode) { + const defaultCaseType = _.find(this.processCompObj.caseTypeList, ['typeCode', this.caseDetail.casetypeCode]) + this.processCompObj.caseType = defaultCaseType.id + } + // 小类列表 + if (this.caseDetail.eorc && this.processCompObj.caseType) { + const caseTypeDetailRes = await getCaseTypeDetailList(this.caseDetail.eorc, this.processCompObj.caseType) + this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + } + // 小类 + if (this.caseDetail.casetypeDetailCode) { + const defaultCaseTypeDetail = _.find(this.processCompObj.caseTypeDetailList, ['typeDetailCode', this.caseDetail.casetypeDetailCode]) + this.processCompObj.caseTypeDetail = defaultCaseTypeDetail.id + } + // 立案标准列表 + if (this.processCompObj.caseTypeDetail) { + const caseTypeTimeRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) + this.processCompObj.caseTypeTimeList = caseTypeTimeRes.data + } + // 立案标准 + if (this.caseDetail.casetypesTimeId) { + this.processCompObj.caseTypeTime = this.caseDetail.casetypesTimeId + } + // this.updateHoursAndMins() + break } case 'selectFilingType': { // 选择归档类型 @@ -667,6 +692,12 @@ this.processForm.changeState = radioObj.nextState this.processForm.approvalResult = radioObj.approvalResult + // remarks不能为空 + if (!this.processForm.remarks) { + this.$message.error('处置意见不能为空') + return false + } + // 其他参数 const radioConfig = radioMap[this.operationKey] // 1. taskUserId @@ -733,7 +764,7 @@ // 4. hours,minutes if (radioConfig.showComp === 'selectCaseTime' || radioConfig.showComp === 'inputDelayTime') { if (!this.numberIsNull(this.processCompObj.hours) || !this.numberIsNull(this.processCompObj.minutes)) { - this.$message.error('请输入时间') + this.$message.error('请输入正确的时间') return false } this.processForm.hours = this.processCompObj.hours @@ -750,8 +781,8 @@ console.log(this.processForm) return true }, - numberIsNull(value) { // 判断数值是否为空 - if (value || value === 0) { + numberIsNull(value) { // 判断数值是否为空, + if (value && Number(value) >= 0) { return true } else { return false @@ -769,15 +800,19 @@ if (!isBuild) { return } - completeCaseTask(this.processForm).then(response => { - if (response.code === 200) { - this.$message.success('提交成功') - // this.$emit('submitProcess', this.caseDetail.caseid) - this.showProcess = false - this.$route.query.showProcess = false - this.initData() - } else { - this.$message.error('提交失败') + this.$refs['processForm'].validate((valid) => { + if (valid) { + completeCaseTask(this.processForm).then(response => { + if (response.code === 200) { + this.$message.success('提交成功') + // this.$emit('submitProcess', this.caseDetail.caseid) + this.showProcess = false + this.$route.query.showProcess = false + this.initData() + } else { + this.$message.error('提交失败') + } + }) } }) }).catch(() => { diff --git a/src/components/CaseCommon/caseList.vue b/src/components/CaseCommon/caseList.vue index 79d5b7a..e55f590 100644 --- a/src/components/CaseCommon/caseList.vue +++ b/src/components/CaseCommon/caseList.vue @@ -44,8 +44,8 @@ return { offset: 1, limit: 10, - sort: '', - order: '', + sort: 'caseid', + order: 'desc', queryCondition: {} } } diff --git a/src/components/CaseCommon/caseDetail.vue b/src/components/CaseCommon/caseDetail.vue index 218863f..cd7f277 100644 --- a/src/components/CaseCommon/caseDetail.vue +++ b/src/components/CaseCommon/caseDetail.vue @@ -143,10 +143,10 @@
案卷处理:
- + - - + + {{ radio.nextOperation }} @@ -169,7 +169,7 @@ - + - + - - + + @@ -298,7 +301,7 @@ - + @@ -327,31 +330,12 @@ export default { name: 'CaseDetail', components: { ArcGisMapRead }, - // props: { - // id: { - // type: String, - // default: '' - // }, - // row: { - // type: Object, - // default: null - // }, - // showProcess: { - // type: Boolean, - // default: true - // }, - // showNeedVisit: { - // type: Boolean, - // default: false - // } - // }, data() { return { id: '', showProcess: true, showNeedVisit: false, caseDetail: {}, - operationKey: '', // 案件处理按钮key fileIdVerify: [], // 核实照片id fileIdProcess: [], // 处理照片id fileIdCheck: [], // 核查照片id @@ -362,14 +346,24 @@ currState: '', // 当前案件状态 changeState: '', // 案件流转后状态 remarks: '', // 审批意见 - approvalResult: '' // 审批结果标志 + approvalResult: '', // 审批结果标志 + operationKey: '' // 案件处理按钮key,放form里以便绑定prop }, commonLanguage: '', // 常用语 commonLanguageList: [], // 常用语列表 processRadioList: [], // 案件处理单选按钮 processCompShow: '', // 案卷处理组件显示 processCompObj: {}, // 案卷处理组件相关对象 - dialogVisible: false + dialogVisible: false, + caseLevelLoading: false, + caseEorcLoading: false, + caseTypeLoading: false, + caseTypeDetailLoading: false, + caseTypeTimeLoading: false, + rules: { + operationKey: [{ required: true, message: '操作类型不能为空', trigger: ['blur', 'change'] }], + remarks: [{ required: true, message: '处置意见不能为空', trigger: ['blur', 'change'] }] + } } }, computed: { @@ -386,6 +380,9 @@ } else { return true } + }, + operationKey: function() { // 案件处理按钮key + return this.processForm.operationKey } }, watch: { @@ -453,8 +450,6 @@ // 查询流转记录接口 this.processForm.processId = this.caseDetail.processId - // const resRecord = historicalRecords(this.processForm.processId) - // this.recordList = resRecord.data historicalRecords(this.processForm.processId).then(res => { this.recordList = res.data }) @@ -465,14 +460,15 @@ }, // 每次清空案件处理相关数据 resetData() { - this.operationKey = '' + // this.operationKey = '' this.processForm = { processId: '', bizId: '', currState: '', changeState: '', remarks: '', - approvalResult: '' + approvalResult: '', + operationKey: '' } this.commonLanguage = '' this.processCompShow = '' @@ -493,30 +489,45 @@ * 选择事部件,更新大类 */ async selectEorc(value) { - const caseTypeRes = await getCaseTypeList(this.processCompObj.eorc) - this.processCompObj.caseTypeList = caseTypeRes.data + console.log('selectEorc', this.processCompObj) + if (this.processCompObj.eorc) { + this.caseTypeLoading = true + const caseTypeRes = await getCaseTypeList(this.processCompObj.eorc) + this.processCompObj.caseTypeList = caseTypeRes.data + this.caseTypeLoading = false + } else { + this.processCompObj.caseTypeList = [] + } this.processCompObj.caseType = '' }, /** * 选择大类,更新小类下拉框 */ async selectCaseType(value) { - const caseTypeDetailRes = await getCaseTypeDetailList(this.processCompObj.eorc, this.processCompObj.caseType) // 小类 - this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + console.log('selectCaseType', this.processCompObj) + if (this.processCompObj.eorc && this.processCompObj.caseType) { + this.caseTypeDetailLoading = true + const caseTypeDetailRes = await getCaseTypeDetailList(this.processCompObj.eorc, this.processCompObj.caseType) // 小类 + this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + this.caseTypeDetailLoading = false + } else { + this.processCompObj.caseTypeDetailList = [] + } this.processCompObj.caseTypeDetail = '' - // this.processCompObj.caseTypeDetail = caseTypeDetailRes.data[0].id }, /** * 选择小类,更新立案标准下拉框 */ async selectCaseTypeDetail(value) { - const caseTypeTimesRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 小类 - this.processCompObj.caseTypeTimeList = caseTypeTimesRes.data - // if (this.processCompObj.caseTypeTimeList.length > 0) { - // this.processCompObj.caseTypeTime = caseTypeTimesRes.data[0].id - // } else { - // this.processCompObj.caseTypeTime = '' - // } + console.log('selectCaseTypeDetail', this.processCompObj) + if (this.processCompObj.caseTypeDetail) { + this.caseTypeTimeLoading = true + const caseTypeTimesRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 小类 + this.processCompObj.caseTypeTimeList = caseTypeTimesRes.data + this.caseTypeTimeLoading = false + } else { + this.processCompObj.caseTypeTimeList = [] + } this.processCompObj.caseTypeTime = '' }, /** @@ -603,35 +614,49 @@ const eorcListRes = await getEorc() // 事部件 this.$set(this.processCompObj, 'eorcList', eorcListRes.data) - // if (this.caseDetail.eorc) { this.$set(this.processCompObj, 'eorc', this.caseDetail.eorc) - // } - const caseTypeRes = await getCaseTypeList(this.caseDetail.eorc) // 大类 - this.$set(this.processCompObj, 'caseTypeList', caseTypeRes.data) - if (this.caseDetail.casetypeCode) { - const defaultCaseType = _.find(this.processCompObj.caseTypeList, ['typeCode', this.caseDetail.casetypeCode]) - this.$set(this.processCompObj, 'caseType', defaultCaseType.id) - } else { - this.$set(this.processCompObj, 'caseType', '') - } - - const caseTypeDetailRes = await getCaseTypeDetailList(this.caseDetail.eorc, this.processCompObj.caseType) // 小类 - this.$set(this.processCompObj, 'caseTypeDetailList', caseTypeDetailRes.data) - if (this.caseDetail.casetypeDetailCode) { - const defaultCaseTypeDetail = _.find(this.processCompObj.caseTypeDetailList, ['typeDetailCode', this.caseDetail.casetypeDetailCode]) - this.$set(this.processCompObj, 'caseTypeDetail', defaultCaseTypeDetail.id) - } else { - this.$set(this.processCompObj, 'caseTypeDetail', '') - } - - const caseTypeTimeRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 立案标准 - this.$set(this.processCompObj, 'caseTypeTimeList', caseTypeTimeRes.data) - this.$set(this.processCompObj, 'caseTypeTime', this.caseDetail.casetypesTimeId) - + // 初始化 + this.$set(this.processCompObj, 'caseTypeList', []) + this.$set(this.processCompObj, 'caseTypeDetailList', []) + this.$set(this.processCompObj, 'caseTypeTimeList', []) + this.$set(this.processCompObj, 'caseType', '') + this.$set(this.processCompObj, 'caseTypeDetail', '') + this.$set(this.processCompObj, 'caseTypeTime', '') this.$set(this.processCompObj, 'hours', '') this.$set(this.processCompObj, 'minutes', '') - this.updateHoursAndMins() + + // 大类列表 + if (this.caseDetail.eorc) { + const caseTypeRes = await getCaseTypeList(this.caseDetail.eorc) + this.processCompObj.caseTypeList = caseTypeRes.data + } + // 大类 + if (this.caseDetail.casetypeCode) { + const defaultCaseType = _.find(this.processCompObj.caseTypeList, ['typeCode', this.caseDetail.casetypeCode]) + this.processCompObj.caseType = defaultCaseType.id + } + // 小类列表 + if (this.caseDetail.eorc && this.processCompObj.caseType) { + const caseTypeDetailRes = await getCaseTypeDetailList(this.caseDetail.eorc, this.processCompObj.caseType) + this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + } + // 小类 + if (this.caseDetail.casetypeDetailCode) { + const defaultCaseTypeDetail = _.find(this.processCompObj.caseTypeDetailList, ['typeDetailCode', this.caseDetail.casetypeDetailCode]) + this.processCompObj.caseTypeDetail = defaultCaseTypeDetail.id + } + // 立案标准列表 + if (this.processCompObj.caseTypeDetail) { + const caseTypeTimeRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) + this.processCompObj.caseTypeTimeList = caseTypeTimeRes.data + } + // 立案标准 + if (this.caseDetail.casetypesTimeId) { + this.processCompObj.caseTypeTime = this.caseDetail.casetypesTimeId + } + // this.updateHoursAndMins() + break } case 'selectFilingType': { // 选择归档类型 @@ -667,6 +692,12 @@ this.processForm.changeState = radioObj.nextState this.processForm.approvalResult = radioObj.approvalResult + // remarks不能为空 + if (!this.processForm.remarks) { + this.$message.error('处置意见不能为空') + return false + } + // 其他参数 const radioConfig = radioMap[this.operationKey] // 1. taskUserId @@ -733,7 +764,7 @@ // 4. hours,minutes if (radioConfig.showComp === 'selectCaseTime' || radioConfig.showComp === 'inputDelayTime') { if (!this.numberIsNull(this.processCompObj.hours) || !this.numberIsNull(this.processCompObj.minutes)) { - this.$message.error('请输入时间') + this.$message.error('请输入正确的时间') return false } this.processForm.hours = this.processCompObj.hours @@ -750,8 +781,8 @@ console.log(this.processForm) return true }, - numberIsNull(value) { // 判断数值是否为空 - if (value || value === 0) { + numberIsNull(value) { // 判断数值是否为空, + if (value && Number(value) >= 0) { return true } else { return false @@ -769,15 +800,19 @@ if (!isBuild) { return } - completeCaseTask(this.processForm).then(response => { - if (response.code === 200) { - this.$message.success('提交成功') - // this.$emit('submitProcess', this.caseDetail.caseid) - this.showProcess = false - this.$route.query.showProcess = false - this.initData() - } else { - this.$message.error('提交失败') + this.$refs['processForm'].validate((valid) => { + if (valid) { + completeCaseTask(this.processForm).then(response => { + if (response.code === 200) { + this.$message.success('提交成功') + // this.$emit('submitProcess', this.caseDetail.caseid) + this.showProcess = false + this.$route.query.showProcess = false + this.initData() + } else { + this.$message.error('提交失败') + } + }) } }) }).catch(() => { diff --git a/src/components/CaseCommon/caseList.vue b/src/components/CaseCommon/caseList.vue index 79d5b7a..e55f590 100644 --- a/src/components/CaseCommon/caseList.vue +++ b/src/components/CaseCommon/caseList.vue @@ -44,8 +44,8 @@ return { offset: 1, limit: 10, - sort: '', - order: '', + sort: 'caseid', + order: 'desc', queryCondition: {} } } diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 77b5111..7907f3c 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -65,12 +65,9 @@ console.log('watch selected') this.$emit('input', val) - const obj = this.deptTreeList.find((item) => { - return item.id === val - }) const data = { id: val, - name: obj.name + name: this.findNameById(this.deptTreeList, val) } this.$emit('deptChange', data) } @@ -102,10 +99,25 @@ this.deptTreeList = list this.multiData = false } - // console.log(this.deptTreeList) + console.log(this.deptTreeList) } } }) + }, + // 根据id获取组织name + findNameById(list, id) { + for (var i = 0; i < list.length; i++) { + var item = list[i] + if (item.id === id) { + return item.name + } + if (item.children) { + var name = this.findNameById(item.children, id) + if (name) { + return name + } + } + } } } } diff --git a/src/components/CaseCommon/caseDetail.vue b/src/components/CaseCommon/caseDetail.vue index 218863f..cd7f277 100644 --- a/src/components/CaseCommon/caseDetail.vue +++ b/src/components/CaseCommon/caseDetail.vue @@ -143,10 +143,10 @@
案卷处理:
- + - - + + {{ radio.nextOperation }} @@ -169,7 +169,7 @@ - + - + - - + + @@ -298,7 +301,7 @@ - + @@ -327,31 +330,12 @@ export default { name: 'CaseDetail', components: { ArcGisMapRead }, - // props: { - // id: { - // type: String, - // default: '' - // }, - // row: { - // type: Object, - // default: null - // }, - // showProcess: { - // type: Boolean, - // default: true - // }, - // showNeedVisit: { - // type: Boolean, - // default: false - // } - // }, data() { return { id: '', showProcess: true, showNeedVisit: false, caseDetail: {}, - operationKey: '', // 案件处理按钮key fileIdVerify: [], // 核实照片id fileIdProcess: [], // 处理照片id fileIdCheck: [], // 核查照片id @@ -362,14 +346,24 @@ currState: '', // 当前案件状态 changeState: '', // 案件流转后状态 remarks: '', // 审批意见 - approvalResult: '' // 审批结果标志 + approvalResult: '', // 审批结果标志 + operationKey: '' // 案件处理按钮key,放form里以便绑定prop }, commonLanguage: '', // 常用语 commonLanguageList: [], // 常用语列表 processRadioList: [], // 案件处理单选按钮 processCompShow: '', // 案卷处理组件显示 processCompObj: {}, // 案卷处理组件相关对象 - dialogVisible: false + dialogVisible: false, + caseLevelLoading: false, + caseEorcLoading: false, + caseTypeLoading: false, + caseTypeDetailLoading: false, + caseTypeTimeLoading: false, + rules: { + operationKey: [{ required: true, message: '操作类型不能为空', trigger: ['blur', 'change'] }], + remarks: [{ required: true, message: '处置意见不能为空', trigger: ['blur', 'change'] }] + } } }, computed: { @@ -386,6 +380,9 @@ } else { return true } + }, + operationKey: function() { // 案件处理按钮key + return this.processForm.operationKey } }, watch: { @@ -453,8 +450,6 @@ // 查询流转记录接口 this.processForm.processId = this.caseDetail.processId - // const resRecord = historicalRecords(this.processForm.processId) - // this.recordList = resRecord.data historicalRecords(this.processForm.processId).then(res => { this.recordList = res.data }) @@ -465,14 +460,15 @@ }, // 每次清空案件处理相关数据 resetData() { - this.operationKey = '' + // this.operationKey = '' this.processForm = { processId: '', bizId: '', currState: '', changeState: '', remarks: '', - approvalResult: '' + approvalResult: '', + operationKey: '' } this.commonLanguage = '' this.processCompShow = '' @@ -493,30 +489,45 @@ * 选择事部件,更新大类 */ async selectEorc(value) { - const caseTypeRes = await getCaseTypeList(this.processCompObj.eorc) - this.processCompObj.caseTypeList = caseTypeRes.data + console.log('selectEorc', this.processCompObj) + if (this.processCompObj.eorc) { + this.caseTypeLoading = true + const caseTypeRes = await getCaseTypeList(this.processCompObj.eorc) + this.processCompObj.caseTypeList = caseTypeRes.data + this.caseTypeLoading = false + } else { + this.processCompObj.caseTypeList = [] + } this.processCompObj.caseType = '' }, /** * 选择大类,更新小类下拉框 */ async selectCaseType(value) { - const caseTypeDetailRes = await getCaseTypeDetailList(this.processCompObj.eorc, this.processCompObj.caseType) // 小类 - this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + console.log('selectCaseType', this.processCompObj) + if (this.processCompObj.eorc && this.processCompObj.caseType) { + this.caseTypeDetailLoading = true + const caseTypeDetailRes = await getCaseTypeDetailList(this.processCompObj.eorc, this.processCompObj.caseType) // 小类 + this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + this.caseTypeDetailLoading = false + } else { + this.processCompObj.caseTypeDetailList = [] + } this.processCompObj.caseTypeDetail = '' - // this.processCompObj.caseTypeDetail = caseTypeDetailRes.data[0].id }, /** * 选择小类,更新立案标准下拉框 */ async selectCaseTypeDetail(value) { - const caseTypeTimesRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 小类 - this.processCompObj.caseTypeTimeList = caseTypeTimesRes.data - // if (this.processCompObj.caseTypeTimeList.length > 0) { - // this.processCompObj.caseTypeTime = caseTypeTimesRes.data[0].id - // } else { - // this.processCompObj.caseTypeTime = '' - // } + console.log('selectCaseTypeDetail', this.processCompObj) + if (this.processCompObj.caseTypeDetail) { + this.caseTypeTimeLoading = true + const caseTypeTimesRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 小类 + this.processCompObj.caseTypeTimeList = caseTypeTimesRes.data + this.caseTypeTimeLoading = false + } else { + this.processCompObj.caseTypeTimeList = [] + } this.processCompObj.caseTypeTime = '' }, /** @@ -603,35 +614,49 @@ const eorcListRes = await getEorc() // 事部件 this.$set(this.processCompObj, 'eorcList', eorcListRes.data) - // if (this.caseDetail.eorc) { this.$set(this.processCompObj, 'eorc', this.caseDetail.eorc) - // } - const caseTypeRes = await getCaseTypeList(this.caseDetail.eorc) // 大类 - this.$set(this.processCompObj, 'caseTypeList', caseTypeRes.data) - if (this.caseDetail.casetypeCode) { - const defaultCaseType = _.find(this.processCompObj.caseTypeList, ['typeCode', this.caseDetail.casetypeCode]) - this.$set(this.processCompObj, 'caseType', defaultCaseType.id) - } else { - this.$set(this.processCompObj, 'caseType', '') - } - - const caseTypeDetailRes = await getCaseTypeDetailList(this.caseDetail.eorc, this.processCompObj.caseType) // 小类 - this.$set(this.processCompObj, 'caseTypeDetailList', caseTypeDetailRes.data) - if (this.caseDetail.casetypeDetailCode) { - const defaultCaseTypeDetail = _.find(this.processCompObj.caseTypeDetailList, ['typeDetailCode', this.caseDetail.casetypeDetailCode]) - this.$set(this.processCompObj, 'caseTypeDetail', defaultCaseTypeDetail.id) - } else { - this.$set(this.processCompObj, 'caseTypeDetail', '') - } - - const caseTypeTimeRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) // 立案标准 - this.$set(this.processCompObj, 'caseTypeTimeList', caseTypeTimeRes.data) - this.$set(this.processCompObj, 'caseTypeTime', this.caseDetail.casetypesTimeId) - + // 初始化 + this.$set(this.processCompObj, 'caseTypeList', []) + this.$set(this.processCompObj, 'caseTypeDetailList', []) + this.$set(this.processCompObj, 'caseTypeTimeList', []) + this.$set(this.processCompObj, 'caseType', '') + this.$set(this.processCompObj, 'caseTypeDetail', '') + this.$set(this.processCompObj, 'caseTypeTime', '') this.$set(this.processCompObj, 'hours', '') this.$set(this.processCompObj, 'minutes', '') - this.updateHoursAndMins() + + // 大类列表 + if (this.caseDetail.eorc) { + const caseTypeRes = await getCaseTypeList(this.caseDetail.eorc) + this.processCompObj.caseTypeList = caseTypeRes.data + } + // 大类 + if (this.caseDetail.casetypeCode) { + const defaultCaseType = _.find(this.processCompObj.caseTypeList, ['typeCode', this.caseDetail.casetypeCode]) + this.processCompObj.caseType = defaultCaseType.id + } + // 小类列表 + if (this.caseDetail.eorc && this.processCompObj.caseType) { + const caseTypeDetailRes = await getCaseTypeDetailList(this.caseDetail.eorc, this.processCompObj.caseType) + this.processCompObj.caseTypeDetailList = caseTypeDetailRes.data + } + // 小类 + if (this.caseDetail.casetypeDetailCode) { + const defaultCaseTypeDetail = _.find(this.processCompObj.caseTypeDetailList, ['typeDetailCode', this.caseDetail.casetypeDetailCode]) + this.processCompObj.caseTypeDetail = defaultCaseTypeDetail.id + } + // 立案标准列表 + if (this.processCompObj.caseTypeDetail) { + const caseTypeTimeRes = await getCaseTypeTimes(this.processCompObj.caseTypeDetail) + this.processCompObj.caseTypeTimeList = caseTypeTimeRes.data + } + // 立案标准 + if (this.caseDetail.casetypesTimeId) { + this.processCompObj.caseTypeTime = this.caseDetail.casetypesTimeId + } + // this.updateHoursAndMins() + break } case 'selectFilingType': { // 选择归档类型 @@ -667,6 +692,12 @@ this.processForm.changeState = radioObj.nextState this.processForm.approvalResult = radioObj.approvalResult + // remarks不能为空 + if (!this.processForm.remarks) { + this.$message.error('处置意见不能为空') + return false + } + // 其他参数 const radioConfig = radioMap[this.operationKey] // 1. taskUserId @@ -733,7 +764,7 @@ // 4. hours,minutes if (radioConfig.showComp === 'selectCaseTime' || radioConfig.showComp === 'inputDelayTime') { if (!this.numberIsNull(this.processCompObj.hours) || !this.numberIsNull(this.processCompObj.minutes)) { - this.$message.error('请输入时间') + this.$message.error('请输入正确的时间') return false } this.processForm.hours = this.processCompObj.hours @@ -750,8 +781,8 @@ console.log(this.processForm) return true }, - numberIsNull(value) { // 判断数值是否为空 - if (value || value === 0) { + numberIsNull(value) { // 判断数值是否为空, + if (value && Number(value) >= 0) { return true } else { return false @@ -769,15 +800,19 @@ if (!isBuild) { return } - completeCaseTask(this.processForm).then(response => { - if (response.code === 200) { - this.$message.success('提交成功') - // this.$emit('submitProcess', this.caseDetail.caseid) - this.showProcess = false - this.$route.query.showProcess = false - this.initData() - } else { - this.$message.error('提交失败') + this.$refs['processForm'].validate((valid) => { + if (valid) { + completeCaseTask(this.processForm).then(response => { + if (response.code === 200) { + this.$message.success('提交成功') + // this.$emit('submitProcess', this.caseDetail.caseid) + this.showProcess = false + this.$route.query.showProcess = false + this.initData() + } else { + this.$message.error('提交失败') + } + }) } }) }).catch(() => { diff --git a/src/components/CaseCommon/caseList.vue b/src/components/CaseCommon/caseList.vue index 79d5b7a..e55f590 100644 --- a/src/components/CaseCommon/caseList.vue +++ b/src/components/CaseCommon/caseList.vue @@ -44,8 +44,8 @@ return { offset: 1, limit: 10, - sort: '', - order: '', + sort: 'caseid', + order: 'desc', queryCondition: {} } } diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 77b5111..7907f3c 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -65,12 +65,9 @@ console.log('watch selected') this.$emit('input', val) - const obj = this.deptTreeList.find((item) => { - return item.id === val - }) const data = { id: val, - name: obj.name + name: this.findNameById(this.deptTreeList, val) } this.$emit('deptChange', data) } @@ -102,10 +99,25 @@ this.deptTreeList = list this.multiData = false } - // console.log(this.deptTreeList) + console.log(this.deptTreeList) } } }) + }, + // 根据id获取组织name + findNameById(list, id) { + for (var i = 0; i < list.length; i++) { + var item = list[i] + if (item.id === id) { + return item.name + } + if (item.children) { + var name = this.findNameById(item.children, id) + if (name) { + return name + } + } + } } } } diff --git a/src/views/busAdmin/caseType/detailCaseType.vue b/src/views/busAdmin/caseType/detailCaseType.vue index ac8cbb3..38a9cbd 100644 --- a/src/views/busAdmin/caseType/detailCaseType.vue +++ b/src/views/busAdmin/caseType/detailCaseType.vue @@ -17,8 +17,8 @@ - - + +