diff --git a/src/components/CaseCommon/caseDetail.vue b/src/components/CaseCommon/caseDetail.vue index f2ae4e9..dc1eb3f 100644 --- a/src/components/CaseCommon/caseDetail.vue +++ b/src/components/CaseCommon/caseDetail.vue @@ -166,91 +166,95 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + - - - - - - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + 小时 + 分钟 + + +
@@ -261,17 +265,8 @@ - - - - - - - - - - - + 小时 + 分钟 @@ -295,7 +290,7 @@ -
数据流转:
+
数据流转记录:
@@ -331,6 +326,13 @@ name: 'CaseDetail', components: { ArcGisMapRead }, data() { + var validateEmptyString = (rule, value, callback) => { + if (!value.trim()) { + callback(new Error('处置意见不能为空')) + } else { + callback() + } + } return { id: '', showProcess: true, @@ -360,9 +362,11 @@ caseTypeLoading: false, caseTypeDetailLoading: false, caseTypeTimeLoading: false, + registerLoading: false, rules: { operationKey: [{ required: true, message: '操作类型不能为空', trigger: ['blur', 'change'] }], - remarks: [{ required: true, message: '处置意见不能为空', trigger: ['blur', 'change'] }] + // remarks: [{ required: true, message: '处置意见不能为空', trigger: ['blur', 'change'] }] + remarks: [{ required: true, validator: validateEmptyString, trigger: ['blur', 'change'] }] } } }, @@ -385,6 +389,36 @@ return this.processForm.operationKey } }, + watch: { + 'processCompObj.eorc': { + handler(newValue, oldValue) { + if (oldValue) { + this.selectEorc(newValue) + } + } + }, + 'processCompObj.caseType': { + handler(newValue, oldValue) { + if (oldValue) { + this.selectCaseType(newValue) + } + } + }, + 'processCompObj.caseTypeDetail': { + handler(newValue, oldValue) { + if (oldValue) { + this.selectCaseTypeDetail(newValue) + } + } + }, + 'processCompObj.caseTypeTime': { + handler(newValue, oldValue) { + if (oldValue) { + this.updateHoursAndMins() + } + } + } + }, activated() { console.log('activated') this.id = this.$route.query.id @@ -515,7 +549,6 @@ return } const caseTypeTimeObj = _.find(this.processCompObj.caseTypeTimeList, ['id', this.processCompObj.caseTypeTime]) - // console.log(this.processCompObj.caseTypeTime, caseTypeTimeObj) const day = parseInt(caseTypeTimeObj.day) let hours = parseInt(caseTypeTimeObj.hours) const minutes = parseInt(caseTypeTimeObj.minutes) @@ -552,10 +585,13 @@ }, // 选择案卷处理操作 async selectNextOperation() { - console.log(this.operationKey, radioMap[this.operationKey]) + console.log(this.operationKey, radioMap[this.operationKey], this.processCompObj) const radioConfig = radioMap[this.operationKey] + + // 清除相关数据 + this.processCompShow = '' + this.processCompObj = {} if (!radioConfig.showComp) { - this.processCompShow = '' return } switch (radioConfig.showComp.split('_')[0]) { @@ -577,6 +613,7 @@ } case 'selectCaseTime': { // 立案:案卷等级、类别、大类、小类、立案标准、完成时限 this.processCompShow = 'selectCaseTime' + this.registerLoading = true const caseLevelRes = await getCaseLevelList() // 案卷等级 this.$set(this.processCompObj, 'caseLevelList', caseLevelRes.data) @@ -626,19 +663,7 @@ this.processCompObj.caseTypeTime = this.caseDetail.casetypesTimeId } - // 添加watch监控 - this.$watch('processCompObj.eorc', (newValue, oldValue) => { - this.selectEorc(newValue) - }) - this.$watch('processCompObj.caseType', (newValue, oldValue) => { - this.selectCaseType(newValue) - }) - this.$watch('processCompObj.caseTypeDetail', (newValue, oldValue) => { - this.selectCaseTypeDetail(newValue) - }) - this.$watch('processCompObj.caseTypeTime', (newValue, oldValue) => { - this.updateHoursAndMins(newValue) - }) + this.registerLoading = false break } case 'selectFilingType': { // 选择归档类型 @@ -662,22 +687,24 @@ // 构建提交表单 buildForm() { console.log('buildForm', this.operationKey) - // 通用参数 - // processId,remarks已有 - this.processForm.bizId = this.id - this.processForm.currState = this.caseDetail.caseState + // 通用参数,processId已有 + this.processForm.bizId = this.id // bizId + this.processForm.currState = this.caseDetail.caseState // currState if (!this.operationKey) { this.$message.error('请选择案卷处理操作类型') return false } const radioObj = _.find(this.processRadioList, ['operationKey', this.operationKey]) - this.processForm.changeState = radioObj.nextState - this.processForm.approvalResult = radioObj.approvalResult + this.processForm.changeState = radioObj.nextState // changeState + this.processForm.approvalResult = radioObj.approvalResult // approvalResult - // remarks不能为空 - if (!this.processForm.remarks) { + // remarks 不能为空 + if (!this.processForm.remarks.trim()) { this.$message.error('处置意见不能为空') return false + } else { + // 去除remarks空格 + this.processForm.remarks = this.processForm.remarks.trim() } // 其他参数 @@ -744,8 +771,12 @@ } // 4. hours,minutes if (radioConfig.showComp === 'selectCaseTime' || radioConfig.showComp === 'inputDelayTime') { - if (!this.numberIsNull(this.processCompObj.hours) || !this.numberIsNull(this.processCompObj.minutes)) { - this.$message.error('请输入正确的时间') + if (!this.checkHour(this.processCompObj.hours)) { + this.$message.error('小时数必须为大于等于0的整数') + return false + } + if (!this.checkMin(this.processCompObj.minutes)) { + this.$message.error('分钟数必须为大于等于0,小于60的整数') return false } this.processForm.hours = this.processCompObj.hours @@ -762,8 +793,15 @@ console.log(this.processForm) return true }, - numberIsNull(value) { // 判断数值是否为空, 且非负 - if (value && Number(value) >= 0) { + checkHour(hour) { + if (parseInt(hour) >= 0) { + return true + } else { + return false + } + }, + checkMin(min) { + if (parseInt(min) >= 0 && parseInt(min) < 60) { return true } else { return false