Browse Source

fix: 优化

magic v 3 years ago
parent
commit
0d8591bffd

+ 60 - 55
src/pages/FormResult/index.vue

@@ -1,61 +1,66 @@
 <template>
-<div class="bl-flex" h100 column>
-  <div class="bl-flex" bg-color-warning center padding-xs color-label>可截屏保存</div>
-  <div size-xl bold color-des padding-top-xl text-center>请出示给门诊员工</div>
-  <div margin-top-md margin-left-lg margin-right-lg>
-    <div class="bl-flex" bg-color color-f center padding-sm active
-      @click="$router.replace({ name: 'FormVolume', query: { ...$route.query, jump: 1 } })">
-      <i class="font-ileads ileads-icon-plus-bold">&nbsp;</i>
-      <span>添加被流调人</span>
-    </div>
-  </div>
-  <div margin-top-lg margin-left-lg margin-right-lg
-    v-for="(it, itIndex) in data"
-    :key="'it' + itIndex"
-    :class="it.state ? 'card-type-warning' : 'card-type-success'">
-    <div class="bl-flex" center size-lg padding-top-xl>
-      <div class="bl-flex abnormal" items-center color-success v-if="!it.state">
-        <i class="font-ileads ileads-icon-gouxuan1 icon" size-xl margin-right-sm></i>
-        <span bold>未见异常</span>
-      </div>
-      <div class="bl-flex abnormal" items-center color-error v-else>
-        <i class="font-ileads ileads-icon-guanbi1 icon" size-xl margin-right-sm></i>
-        <span bold>发现异常</span>
-      </div>
-    </div>
-    <div w100 size-sm padding-lg padding-top-xl>
-      <div class="bl-flex" between margin-top-md margin-bottom-md
-        v-for="(item, index) in it.result.slice(0, 4)"
-        :key="index">
-        <div color-des>{{ item.title }}</div>
-        <div>{{ item.val }}</div>
-      </div>
-      <div class="bl-flex" between margin-top-md margin-bottom-md
-        :color-warning="it.temperature === 37.3"
-        :color-error="it.temperature > 37.3"
-        :color-success="it.temperature < 37.3">
-        <div color-des>当日体温</div>
-        <div v-if="it.temperature">{{ it.temperature }}°C</div>
-        <div v-else color-error>温度错误</div>
-      </div>
-      <div class="bl-flex" between margin-top-md margin-bottom-md color-error
-        v-for="(item, index) in it.result.filter(item => item.type === 'radio' && item.val === '是')"
-        :key="'a' + index">
-        <div>{{ item.title }}</div>
-        <div>{{ item.val }}</div>
-      </div>
-      <div class="bl-flex" between margin-top-md margin-bottom-md>
-        <div color-des>提交时间</div>
-        <div>{{ it.created }}</div>
+<div class="bl-flex" column h100 w100>
+  <div flex1 relative>
+    <view-scroll absolute>
+      <div class="bl-flex" column padding-bottom-lg>
+        <div class="bl-flex" bg-color-warning center padding-xs color-label color-f>可截屏保存</div>
+        <div size-xl bold color-label padding-top-xl text-center>请出示给门诊员工</div>
+        <div margin-top-md margin-left-lg margin-right-lg>
+          <div class="bl-flex bg-color" color center padding-sm active round
+            @click="$router.replace({ name: 'FormVolume', query: { ...$route.query, jump: 1 } })">
+            <i class="font-ileads ileads-icon-plus-bold">&nbsp;</i>
+            <span>添加被流调人</span>
+          </div>
+        </div>
+        <div margin-top-lg margin-left-lg margin-right-lg
+          v-for="(it, itIndex) in data"
+          :key="'it' + itIndex"
+          :class="it.state ? 'card-type-warning' : 'card-type-success'">
+          <div class="bl-flex" center size-lg padding-top-xl>
+            <div class="bl-flex abnormal" items-center color-success v-if="!it.state">
+              <i class="font-ileads ileads-icon-gouxuan1 icon" size-xl margin-right-sm></i>
+              <span bold>未见异常</span>
+            </div>
+            <div class="bl-flex abnormal" items-center color-error v-else>
+              <i class="font-ileads ileads-icon-guanbi1 icon" size-xl margin-right-sm></i>
+              <span bold>发现异常</span>
+            </div>
+          </div>
+          <div w100 size-sm padding-lg padding-top-xl>
+            <div class="bl-flex" between margin-top-md margin-bottom-md
+              v-for="(item, index) in it.result.slice(0, 4)"
+              :key="index">
+              <div color-des>{{ item.title }}</div>
+              <div>{{ item.val }}</div>
+            </div>
+            <div class="bl-flex" between margin-top-md margin-bottom-md
+              :color-warning="it.temperature === 37.3"
+              :color-error="it.temperature > 37.3"
+              :color-success="it.temperature < 37.3">
+              <div color-des>当日体温</div>
+              <div v-if="it.temperature">{{ it.temperature }}°C</div>
+              <div v-else color-error>温度错误</div>
+            </div>
+            <div class="bl-flex" between margin-top-md margin-bottom-md color-error
+              v-for="(item, index) in it.result.filter(item => item.type === 'radio' && item.val === '是')"
+              :key="'a' + index">
+              <div>{{ item.title }}</div>
+              <div>{{ item.val }}</div>
+            </div>
+            <div class="bl-flex" between margin-top-md margin-bottom-md>
+              <div color-des>提交时间</div>
+              <div>{{ it.created }}</div>
+            </div>
+          </div>
+          <div class="bl-flex" padding-bottom-lg center v-if="it.orgName">
+            <div size-lg>{{ it.orgName }}</div>
+          </div>
+        </div>
       </div>
-    </div>
-    <div class="bl-flex" padding-bottom-lg center v-if="it.orgName">
-      <div size-lg>{{ it.orgName }}</div>
-    </div>
+    </view-scroll>
   </div>
-  <div w100 padding-lg>
-    <div class="btn primary" v-if="!$route.query.go" @click="btnLinkWeChat()">回到小程序首页</div>
-    <div class="btn primary" plain v-if="$route.query.go" @click="$router.go($route.query.go)" margin-top-lg>返回</div>
+  <div class="bl-flex" w100 padding-lg v-if="$route.query.go">
+    <div class="btn primary" @click="$router.go($route.query.go)">返回</div>
   </div>
 </div>
 </template>

+ 4 - 0
src/pages/FormResult/style.scss

@@ -11,3 +11,7 @@
 .card-type-success {
   background: rgba(65, 208, 55, 0.1);
 }
+.bg-color {
+  background: rgba(64, 185, 254, 0.1);
+  border: 1px solid $color;
+}

+ 4 - 4
src/pages/FormVolume/components/HistoryRecord/index.vue

@@ -4,8 +4,8 @@
     <div class="bl-flex pie-view" bg-color color-f center size-sm touch shadow
       v-if="!!data"
       @click="btnLink()">
-      <i class="font-ileads ileads-icon-plus-bold">&nbsp;</i>
-      <span>快速填写</span>
+      <i class="font-ileads ileads-icon-plus-bold" size-sm>&nbsp;</i>
+      <span size-sm>快速填写</span>
     </div>
   </ViewMove>
   <div class="bl-flex">
@@ -37,7 +37,7 @@
                 </div>
               </div>
               <div
-                v-for="(item, itemIndex) in topic.result"
+                v-for="(item, itemIndex) in topic.result.slice(0, 4)"
                 :key="'item' + itemIndex">
                 <span color-label>{{ item.title }}</span>
                 <span margin-left-lg bold>{{ item.val }}</span>
@@ -200,7 +200,7 @@ export default {
   top: 0;
 }
 .pie-view {
-  padding: $sp-sm $sp-lg;
+  padding: $sp-sm;
   border-radius: $sp-md 0 0 $sp-md;
 }
 </style>

+ 3 - 1
src/pages/FormVolume/mixins/index.js

@@ -178,7 +178,7 @@ export default {
         callback && callback()
       })
     },
-    async btnSubmit(datas) {
+    async btnSubmit(datas, callbackSuccess, callbackError) {
       let pm
       let ld = null
       let edatas = datas || [this.data]
@@ -234,6 +234,7 @@ export default {
           dt.created = date.toString('yyyy-MM-dd HH:mm:ss')
           dt.timer = date.getTime()
           lStorage.setItem('FormResultAbnormal', dt)
+          callbackSuccess && callbackSuccess(dt)
           this.$router.replace({ name: 'FormResult', query: { ...this.$route.query, result_id, jump: undefined, history: undefined } })
         } else {
           this.btnOpenSuccess(() => this.btnLinkBack())
@@ -241,6 +242,7 @@ export default {
         pm = Promise.resolve(arrRes.length > 1 ? arrRes : arrRes[0])
       } catch (error) {
         pm = Promise.reject()
+        callbackError && callbackError(error)
       }
       ld && ld.clear()
       this.loading.submit = false

+ 3 - 2
src/pages/FormVolume/mixins/layout.js

@@ -28,10 +28,11 @@ export default {
   methods: {
     async onSubmit () {
       try {
-        let res = await this.$emit('submit')
+        let data = await new Promise((resolve, reject) => {
+          this.$emit('submit', undefined, resolve, reject)
+        })
         let ref = this.$refs['HistoryRecord']
         if (this.data.topic.id === 1 && ref) {
-          let data = res.data
           let date = new Date()
           data.created = date.toString('yyyy-MM-dd HH:mm:ss')
           data.timer = date.getTime()