Prechádzať zdrojové kódy

切换服务商修改

yanym 3 týždňov pred
rodič
commit
030a0a5495
1 zmenil súbory, kde vykonal 11 pridanie a 5 odobranie
  1. 11 5
      src/views/AIDesign/design.vue

+ 11 - 5
src/views/AIDesign/design.vue

@@ -668,11 +668,17 @@ export default class extends Vue {
     }
     that.fwsList = serviceObjArray;
     that.serviceCodeArray = serviceCodeArray;
-    const serviceCodeIndex = serviceObjArray.findIndex(item => item.shop_code == checkedFwsInfo.shop_code);
-    if (checkedFwsInfo && serviceCodeIndex != -1){
-        that.fwsCode = checkedFwsInfo.shop_code;
-        that.fwsName = checkedFwsInfo.shop_name;
-        that.fwsRadioValue = checkedFwsInfo.shop_code;
+    if (checkedFwsInfo){
+        const serviceCodeIndex = serviceObjArray.findIndex(item => item.shop_code == checkedFwsInfo.shop_code);
+        if (serviceCodeIndex == -1){
+            that.fwsCode = serviceObjArray[0].shop_code;
+            that.fwsName = serviceObjArray[0].shop_name;
+            that.fwsRadioValue = serviceObjArray[0].shop_code;
+        } else {
+            that.fwsCode = checkedFwsInfo.shop_code;
+            that.fwsName = checkedFwsInfo.shop_name;
+            that.fwsRadioValue = checkedFwsInfo.shop_code;
+        }
     } else {
         that.fwsCode = serviceObjArray[0].shop_code;
         that.fwsName = serviceObjArray[0].shop_name;