Procházet zdrojové kódy

fix(ruiying): 根据 footageReadOnly 禁用井深修改

Zimo před 15 hodinami
rodič
revize
572c192022
1 změnil soubory, kde provedl 9 přidání a 2 odebrání
  1. 9 2
      pages/ruiying/components/form.vue

+ 9 - 2
pages/ruiying/components/form.vue

@@ -52,6 +52,7 @@ const FORM_KEYS = [
   "drillingWorkingTime",
   "otherProductionTime",
   "lastCurrentDepth",
+  "footageReadOnly",
 
   "reportDetails",
   "constructionBrief",
@@ -221,6 +222,10 @@ const disabled = computed(() => (field) => {
   else return formType.value === "readonly";
 });
 
+const footageDisabled = computed(
+  () => disabled.value("edit") || form.value.footageReadOnly === true
+);
+
 const formRef = ref(null);
 
 // 辅助函数:计算总时间
@@ -357,6 +362,8 @@ const reportDetailsTimeRange = (data) => {
 };
 
 const inputCurrentDepth = useDebounceFn(function inputCurrentDepth() {
+  if (form.value.footageReadOnly === true) return;
+
   const details = form.value.reportDetails;
 
   if (Array.isArray(details) && details.length > 0) {
@@ -437,7 +444,7 @@ const inputCurrentDepth = useDebounceFn(function inputCurrentDepth() {
         <uni-easyinput
           type="number"
           v-bind="defaultProps"
-          :disabled="disabled('edit')"
+          :disabled="footageDisabled"
           v-model="form.currentDepth" />
       </uni-forms-item>
       <uni-forms-item label="当日用电量(kWh)" name="dailyPowerUsage">
@@ -602,7 +609,7 @@ const inputCurrentDepth = useDebounceFn(function inputCurrentDepth() {
           <uni-easyinput
             type="number"
             v-bind="defaultProps"
-            :disabled="disabled('edit')"
+            :disabled="footageDisabled"
             v-model.number="item.currentDepth"
             @input="(val) => inputCurrentDepth(val, index)" />
         </uni-forms-item>