Browse Source

修复林业产品溯源H5的“种植产地”、“生产原料列表”、“口感调研”、“关键环境指标”、“产品介绍”、“检验检疫记录”等页面多处已知BUG

张启 4 years ago
parent
commit
d1fb606561

+ 2 - 1
config/webpack.development.js

@@ -26,7 +26,8 @@ module.exports = {
 			"/mtsy": {
 				// target: 'http://172.16.90.238:21008',
 				// target: 'http://172.16.90.64:21009',
-				target: 'http://172.16.90.77:21008',
+				// target: 'http://172.16.90.77:21008',
+				target: 'http://172.16.90.64:8103',
 				pathRewrite: {
 					"^/mtsy": ""
 				},

+ 1 - 1
src/components/time-list.vue

@@ -68,7 +68,7 @@ export default {
   },
   filters: {
     time([value, index]) {
-      return ((value + "").split(" ")[0] || "").split("-")[index] || "";
+      return (undefined == value && null == value || "" == value) ? "" : (((value + "").split(" ")[0] || "").split("-")[index] || "");
     }
   },
   data() {

+ 1 - 1
src/view/comment.vue

@@ -81,7 +81,7 @@ export default {
       return this.$store.state.info;
     },
     fkGoodsBatchGuid() {
-      return this.info.goodsBatchInfoForm.fkGoodsBatchGuid;
+      return (this.info.goodsBatchInfoForm || {}).fkGoodsBatchGuid;
     },
     disSub() {
       return this.disRate && this.disTextarea;

+ 5 - 4
src/view/environment.vue

@@ -3,7 +3,8 @@
     <main-title>关键环境指标</main-title>
     <ul class="info-list animated zoomInDown" style="animation-delay:0s;">
       <li
-        v-for="(item, index) in info.goodsBatchInfoForm.interAuxList"
+        v-for="(item, index) in (info.goodsBatchInfoForm || {}).interAuxList"
+        :key="index"
       >{{ item.auxItme }}:{{ item.auxItmeNormval }}{{ item.unit }}</li>
     </ul>
     <div class="echars animated zoomIn" style="animation-delay:1s;" ref="radarEchars"></div>
@@ -145,11 +146,11 @@ export default {
   },
   created() {
     // this.echartDatas = ;
-    // let svlist = this.$store.state.info.goodsBatchInfoForm.interAuxList;
+    // let svlist = (this.$store.state.info.goodsBatchInfoForm || {}).interAuxList;
     // let indicator = [];
     // for(let i = 0;i<svlist.length;i++){
     // 	indicator.push({
-    // 		name: svlist[i].auxItme + ':' + svlist[i].auxItmeNormval + svlist[i].unit, 
+    // 		name: svlist[i].auxItme + ':' + svlist[i].auxItmeNormval + svlist[i].unit,
     // 		max: 6000
     // 	})
     // }
@@ -241,4 +242,4 @@ export default {
 				<span class="bg"></span>
 				湄潭竹香米业水稻生长环境数据
 			</li>
-		</ul> -->
+		</ul> -->

+ 8 - 8
src/view/explain.vue

@@ -20,13 +20,13 @@
       <div style="clear:both;"></div>
       <img class="b-1-areaimg" src="../assets/image/bg-prod-area-info-img.png" />
       <img class="b-1-repchainimg" src="../assets/image/bg-repchain-img.png" />
-			
+
     </div>
     <div class="b-2">
       <preview
         class="img animated bounceInLeft"
         style="animation-delay:3s;animation-duration: 1s;animation-fill-mode: both;"
-        :value="info.goodsBatchInfoForm.imagesList"
+        :value="(info.goodsBatchInfoForm || {}).imagesList"
       ></preview>
       <!-- <el-image class="img" :src="src" :preview-src-list="[src]">
 				<div slot="placeholder" class="img-loading"><i class="el-icon-loading"></i></div>
@@ -36,16 +36,16 @@
         class="b-2-info-list animated bounceInRight"
         style="animation-delay:4s;animation-duration: 1s;animation-fill-mode: both;"
       >
-        <li>【商品名称】{{info.goodsBatchInfoForm.goodsName}}</li>
-        <li>【商品规格】{{info.goodsBatchInfoForm.goodsUnit}}</li>
-        <li>【生产日期】{{info.goodsBatchInfoForm.goodsProductDate | time}}</li>
-        <li>【保质期】{{info.goodsBatchInfoForm.goodsExpired | time}}</li>
+        <li>【商品名称】{{(info.goodsBatchInfoForm || {}).goodsName}}</li>
+        <li>【商品规格】{{(info.goodsBatchInfoForm || {}).goodsUnit}}</li>
+        <li>【生产日期】{{(info.goodsBatchInfoForm || {}).goodsProductDate | time}}</li>
+        <li>【保质期】{{(info.goodsBatchInfoForm || {}).goodsExpired | time}}</li>
       </ul>
       <ul
         class="b-2-info-list2 animated bounceInRight"
         style="animation-delay:4s;animation-duration: 1s;animation-fill-mode: both;"
       >
-        <li v-for="(aux,key) in info.goodsBatchInfoForm.auxList" :key="key">{{aux.auxItmeVal}}</li>
+        <li v-for="(aux,key) in (info.goodsBatchInfoForm || {}).auxList" :key="key">{{aux.auxItmeVal}}</li>
       </ul>
     </div>
     <bottom
@@ -76,7 +76,7 @@ export default {
 	},
   filters: {
     time(value) {
-      return (value + "").split(" ")[0];
+      return (undefined == value && null == value || "" == value) ? "" : (value + "").split(" ")[0];
     }
   },
   computed: {

+ 4 - 4
src/view/origin.vue

@@ -2,15 +2,15 @@
   <div class="body-origin">
     <main-title>种植产地</main-title>
     <ul class="info-list animated fadeInUp" style="animation-delay:0s;">
-      <li>产地名称:{{info.goodsFieldForm.fieldName}}</li>
-      <li>产地地址:{{info.goodsFieldForm.fieldAddress || ''}}</li>
-      <!-- <li>产地简介:{{info.goodsFieldForm.remark || ''}}</li> -->
+      <li>产地名称:{{(info.goodsFieldForm || {}).fieldName}}</li>
+      <li>产地地址:{{(info.goodsFieldForm || {}).fieldAddress || ''}}</li>
+      <!-- <li>产地简介:{{(info.goodsFieldForm || {}).remark || ''}}</li> -->
     </ul>
     <div class="imgs animated bounceInRight" style="animation-delay:1s;">
       <el-image
         :class="i | imgClass"
         :src="v | host"
-        v-for="(v, i) in info.goodsFieldForm.imagesList"
+        v-for="(v, i) in (info.goodsFieldForm || {}).imagesList"
         :key="i"
         style="animation-delay:2s;"
         :preview-src-list="v | hostList"

+ 3 - 3
src/view/quarantine.vue

@@ -4,7 +4,7 @@
 		<div class="list-box animated fadeInUp">
 			<h4>检验信息:</h4>
 			<ul class="list">
-				<li v-for='(aux,key) in info.assayInfoForm.auxList' :key="key">
+				<li v-for='(aux,key) in (info.assayInfoForm || {}).auxList' :key="key">
 					<span>{{aux.auxItme}}:{{aux.auxItmeVal}}</span>
 				</li>
 			</ul>
@@ -17,7 +17,7 @@
 	export default{
 		data(){
 			return{
-				
+
 			}
 		},
 		computed:{
@@ -25,7 +25,7 @@
 				return this.$store.state.info;
 			},
 			imagesList(){
-				return this.info.assayInfoForm.imagesList || [];
+				return (this.info.assayInfoForm || {}).imagesList || [];
 			}
 		}
 	}