瀏覽代碼

🦄 refactor: 瑞鹰日报

Zimo 23 小時之前
父節點
當前提交
fa384db5ac

+ 8 - 2
src/views/pms/iotrydailyreport/index.vue

@@ -472,7 +472,13 @@
       </ContentWrap>
 
       <!-- 表单弹窗:添加/修改 -->
-      <ry-form v-model:visible="visible" type="edit" ref="formRef" :load-list="getList" />
+      <ry-form
+        v-model:visible="visible"
+        type="edit"
+        ref="formRef"
+        :load-list="getList"
+        no-validate-status
+      />
     </el-col>
   </el-row>
 </template>
@@ -825,7 +831,7 @@ const nptFields = [
   'repairTime', // 设备故障
   'selfStopTime', // 设备保养
   'complexityTime', // 技术受限
-  'relocationTime', // 生产配合
+  // 'relocationTime', // 生产配合
   'rectificationTime', // 生产组织
   'waitingStopTime', // 不可抗力
   'winterBreakTime', // 待命

+ 13 - 9
src/views/pms/iotrydailyreport/ry-form.vue

@@ -8,10 +8,12 @@ interface Props {
   visible: boolean
   type?: 'edit' | 'approval' | 'readonly'
   loadList: () => void
+  noValidateStatus?: boolean
 }
 
 const props = withDefaults(defineProps<Props>(), {
-  type: 'edit'
+  type: 'edit',
+  noValidateStatus: false
 })
 
 const emits = defineEmits(['update:visible'])
@@ -169,8 +171,10 @@ async function loadDetail(id: number) {
       }
     })
 
-    if (props.type === 'edit' && res.status !== 0) formType.value = 'readonly'
-    if (props.type === 'approval' && res.auditStatus !== 10) formType.value = 'readonly'
+    if (props.type === 'edit' && !props.noValidateStatus && res.status !== 0)
+      formType.value = 'readonly'
+    if (props.type === 'approval' && !props.noValidateStatus && res.auditStatus !== 10)
+      formType.value = 'readonly'
   } finally {
     loading.value = false
   }
@@ -669,8 +673,8 @@ const orange = computed(() => {
           @click="submitForm"
           :loading="formLoading"
           :disabled="formType === 'readonly'"
-          >确 定</el-button
-        >
+          >确 定
+        </el-button>
         <el-button size="default" @click="emits('update:visible', false)">取 消</el-button>
       </div>
       <div v-if="isApproval">
@@ -680,16 +684,16 @@ const orange = computed(() => {
           @click="handleAudit(20)"
           :loading="formLoading"
           :disabled="formType === 'readonly'"
-          >审批通过</el-button
-        >
+          >审批通过
+        </el-button>
         <el-button
           size="default"
           type="danger"
           @click="handleAudit(30)"
           :loading="formLoading"
           :disabled="formType === 'readonly'"
-          >审批拒绝</el-button
-        >
+          >审批拒绝
+        </el-button>
         <el-button size="default" @click="emits('update:visible', false)">取 消</el-button>
       </div>
     </template>

+ 7 - 3
src/views/pms/iotrydailyreport/ry-xj-form.vue

@@ -8,10 +8,12 @@ interface Props {
   visible: boolean
   type?: 'edit' | 'approval' | 'readonly'
   loadList: () => void
+  noValidateStatus?: boolean
 }
 
 const props = withDefaults(defineProps<Props>(), {
-  type: 'edit'
+  type: 'edit',
+  noValidateStatus: false
 })
 
 const emits = defineEmits(['update:visible'])
@@ -165,8 +167,10 @@ async function loadDetail(id: number) {
       }
     })
 
-    if (props.type === 'edit' && res.status !== 0) formType.value = 'readonly'
-    if (props.type === 'approval' && res.auditStatus !== 10) formType.value = 'readonly'
+    if (props.type === 'edit' && !props.noValidateStatus && res.status !== 0)
+      formType.value = 'readonly'
+    if (props.type === 'approval' && !props.noValidateStatus && res.auditStatus !== 10)
+      formType.value = 'readonly'
   } finally {
     loading.value = false
   }

+ 7 - 1
src/views/pms/iotrydailyreport/xjindex.vue

@@ -482,7 +482,13 @@
       </ContentWrap>
 
       <!-- 表单弹窗:添加/修改 -->
-      <ry-xj-form v-model:visible="visible" type="edit" ref="formRef" :load-list="getList" />
+      <ry-xj-form
+        v-model:visible="visible"
+        type="edit"
+        ref="formRef"
+        :load-list="getList"
+        no-validate-status
+      />
     </el-col>
   </el-row>
 </template>