张延森 4 anos atrás
pai
commit
e38473bb89
1 arquivos alterados com 20 adições e 3 exclusões
  1. 20
    3
      src/view/resc/index.vue

+ 20
- 3
src/view/resc/index.vue Ver arquivo

@@ -91,7 +91,7 @@
91 91
         />
92 92
       </g-section>
93 93
 
94
-      <div style="margin-top: 2em" v-if="willSave.length">
94
+      <div style="margin-top: 2em" v-if="canSubmit">
95 95
         <van-button block type="warning" v-shiro="'room:info:addResc'" @click="handleSubmit">
96 96
           保存审核并提交
97 97
         </van-button>
@@ -101,7 +101,7 @@
101 101
 </template>
102 102
 
103 103
 <script>
104
-import { onMounted, ref } from "vue";
104
+import { computed, onMounted, ref } from "vue";
105 105
 import { useRoute, useRouter } from 'vue-router'
106 106
 import { useModel } from '@zjxpcyc/vue-tiny-store'
107 107
 //
@@ -134,6 +134,19 @@ export default {
134 134
 
135 135
     const roomId = route.query.roomId - 0
136 136
 
137
+    const canSubmit = computed(() => {
138
+      // 报单锁定
139
+      const isLocked = detail.roomInfo?.status === '7'
140
+      // 已实勘
141
+      const rescDone = detail.roomInfo?.rescStatus === '0'
142
+      // 非保护期
143
+      const notProteced = detail.roomInfo?.rescStatus === '9' && initData.value.limitFlag != 'rescLimit'
144
+      // 存在未保存的数据
145
+      const hasNoSaved = willSave.value.length > 0
146
+
147
+      return !isLocked && (rescDone || notProteced) && hasNoSaved
148
+    })
149
+
137 150
     // 设置封面
138 151
     const handleCover = resc => {
139 152
       setRescCover(resc.id).then(() => {
@@ -188,6 +201,10 @@ export default {
188 201
             [rescType]: list
189 202
           }
190 203
         }
204
+
205
+        if (willSave.value.length) {
206
+          willSave.value = willSave.value.filter(x => x.url !== resc.url && x.imgType !== rescType)
207
+        }
191 208
       }
192 209
 
193 210
       if (resc.id) {
@@ -229,7 +246,7 @@ export default {
229 246
     return {
230 247
       initData,
231 248
       detail,
232
-      willSave,
249
+      canSubmit,
233 250
       handleCover,
234 251
       handleUpload,
235 252
       handleDelete,