| | |
| | | @closed="visible = false" |
| | | destroy-on-close |
| | | :close-on-click-modal="false" |
| | | width="800px" |
| | | > |
| | | <div class="detail-container" v-if="dialogReadonly"> |
| | | <el-row class="detail-row-view"> |
| | |
| | | :model="formData" |
| | | :rules="rules" |
| | | :disabled="dialogReadonly" |
| | | label-width="140px" |
| | | :label-width="pxToRem(112)" |
| | | > |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | <el-col :span="24"> |
| | | <el-form-item label="案例描述" prop="caseDesc"> |
| | | <el-input |
| | | class="gd-input" |
| | | class="gd-input-text" |
| | | v-model="formData.caseDesc" |
| | | type="textarea" |
| | | :rows="4" |
| | |
| | | </el-form> |
| | | <template #footer> |
| | | <template v-if="!dialogReadonly"> |
| | | <el-button color="#F2F3F5" @click="visible = false">取消</el-button> |
| | | <el-button color="#F2F3F5" :loading="submitting" |
| | | :disabled="submitting" @click="preservation">保存</el-button> |
| | | <el-button |
| | | class="" |
| | | color="#4C34FF" |
| | |
| | | gdApplicationInnovationDetailApi, |
| | | gdApplicationInnovationSubmitApi, |
| | | } from '@/views/orderView/orderDataManage/appInnovation/appInnovationApi' |
| | | import { pxToRem } from '@/utils/rem' |
| | | |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | |
| | | const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' }) |
| | | |
| | | const rules = { |
| | | caseName: fieldRules(true), |
| | | belongDomain: fieldRules(true), |
| | | applicationScenarioDesc: fieldRules(true), |
| | | matterName: fieldRules(true), |
| | | resourceName: fieldRules(true), |
| | | resourceCode: fieldRules(true), |
| | | caseDesc: fieldRules(true), |
| | | caseName: fieldRules(true,50), |
| | | belongDomain: fieldRules(true,50), |
| | | applicationScenarioDesc: fieldRules(true,50), |
| | | matterName: fieldRules(true,50), |
| | | resourceName: fieldRules(true,50), |
| | | resourceCode: fieldRules(true,50), |
| | | caseDesc: fieldRules(true,200), |
| | | } |
| | | |
| | | // 保存 |
| | | async function preservation(){ |
| | | const isValid = await formRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | submitting.value = true |
| | | try { |
| | | formData.value.innovationStatus = '3' |
| | | await gdApplicationInnovationSubmitApi(formData.value) |
| | | ElMessage.success('新增成功') |
| | | visible.value = false |
| | | emit('success') |
| | | } finally { |
| | | submitting.value = false |
| | | } |
| | | |
| | | } |
| | | // 提交新增/编辑 |
| | | async function handleSubmit() { |
| | | const isValid = await formRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | submitting.value = true |
| | | try { |
| | | formData.value.innovationStatus = dialogMode.value === 'add' ? '0' : formData.value.innovationStatus |
| | | formData.value.innovationStatus = '0' |
| | | await gdApplicationInnovationSubmitApi(formData.value) |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | | visible.value = false |