Преглед на файлове

fix: 取消之前启动物料监控的按钮
feat: 定位录入调整

Ritchie преди 1 година
родител
ревизия
2a44337610
променени са 3 файла, в които са добавени 30 реда и са изтрити 19 реда
  1. 2 2
      src/views/device/paramsSet/paramsSetInfo.vue
  2. 10 8
      src/views/fife/index.vue
  3. 18 9
      src/views/fife/modifyLoc.vue

+ 2 - 2
src/views/device/paramsSet/paramsSetInfo.vue

@@ -28,9 +28,9 @@
           </template>
         </van-field>
         <div class="flex-row" v-else>
-          <span class="txt3 o-pl-15 o-mtb-18">{{ paramName[key] }}
+          <span class="txt3 o-pl-15 o-mtb-18" v-if="item.name != 'M502'">{{ paramName[key] }}
           </span>
-          <van-switch class="o-mt-8" :model-value="checked[key]" @update:model-value="onUpdateValue(item, key)">
+          <van-switch v-if="item.name != 'M502'" class="o-mt-8" :model-value="checked[key]" @update:model-value="onUpdateValue(item, key)">
           </van-switch>
         </div>
       </div>

+ 10 - 8
src/views/fife/index.vue

@@ -19,8 +19,10 @@
                 <van-popup v-model:show="showPicker" round position="bottom">
                     <van-picker :columns="columns" @confirm="onConfirm" @cancel="showPicker = false" />
                 </van-popup>
-                <van-field v-model="location" name="地区名称" label="地区名称" placeholder="省市/地区名称" :required="isRequired"
-                    :rules="[{ required: isRequired, message: '国内必须精确到省市' }]" />
+                <van-field v-model="location" name="地区名称" label="地区名称" placeholder="省市/地区名称" />
+
+                <!-- <van-field v-model="location" name="地区名称" label="地区名称" placeholder="省市/地区名称" :required="isRequired"
+                    :rules="[{ required: isRequired, message: '国内必须精确到省市' }]" /> -->
             </van-cell-group>
             <div style="margin: 16px; display: flex; justify-content: center; align-items: center;">
                 <van-button round class="custom-button" type="primary" size="small" native-type="submit" block>
@@ -37,7 +39,7 @@ import sHeader from "@/components/SimpleHeader";
 import { inputLocInfo } from "../../service/fife/index";
 import { ref, onMounted } from "vue";
 import { showFailToast, showToast } from "vant";
-import { computed } from "vue";
+// import { computed } from "vue";
 
 export default {
     components: { sHeader },
@@ -51,7 +53,7 @@ export default {
         const clientId = ref('');
         const showPicker = ref(false);
         const columns = [
-            { text: '中国', value: '中国' },
+            // { text: '中国', value: '中国' },
             { text: '英国', value: '英国' },
             { text: '美国', value: '美国' },
             { text: '加拿大', value: '加拿大' },
@@ -139,9 +141,9 @@ export default {
                 showFailToast(data.message);
             }
         }
-        const isRequired = computed(() => {
-            return country.value === '中国';
-        });
+        // const isRequired = computed(() => {
+        //     return country.value === '中国';
+        // });
 
         return {
             onSubmit,
@@ -155,7 +157,7 @@ export default {
             location,
             username,
             phone,
-            isRequired
+            // isRequired
         };
     }
 }

+ 18 - 9
src/views/fife/modifyLoc.vue

@@ -20,8 +20,13 @@
                     <van-picker :columns="columns" @confirm="onConfirm" @cancel="showPicker = false" />
                 </van-popup>
 
-                <van-field v-model="location" name="地区名称" label="地区名称" placeholder="省市/地区名称" left-icon="location-o"
-                    :required="isRequired" :rules="[{ required: isRequired, message: '国内必须精确到省市' }]" />
+                <van-field v-model="location" name="地区名称" label="地区名称" placeholder="其他国家/地区名称" left-icon="location-o" />
+
+                <!-- <van-field v-model="location" name="地区名称" label="地区名称" placeholder="省市/地区名称" left-icon="location-o"
+                    :required="isRequired" :rules="[{ required: isRequired, message: '国内必须精确到省市' }]" /> -->
+
+                <van-field v-model="message" rows="3" autosize label="修改原因" type="textarea" placeholder="修改原因"
+                    left-icon="edit" maxlength="50" show-word-limit :rules="[{ required: true, message: '请输入修改原因' }]"/>
             </van-cell-group>
             <div style="margin: 16px; display: flex; justify-content: center; align-items: center;">
                 <van-button round class="custom-button" type="primary" size="small" native-type="submit" block>
@@ -38,7 +43,7 @@ import sHeader from "@/components/SimpleHeader";
 import { updateLocInfo } from "../../service/fife/modifyLoc";
 import { ref } from "vue";
 import { showToast, showFailToast } from "vant";
-import { computed } from "vue";
+// import { computed } from "vue";
 
 export default {
     components: { sHeader },
@@ -52,7 +57,7 @@ export default {
         const clientId = ref('');
         const showPicker = ref(false);
         const columns = [
-            { text: '中国', value: '中国' },
+            // { text: '中国', value: '中国' },
             { text: '英国', value: '英国' },
             { text: '美国', value: '美国' },
             { text: '加拿大', value: '加拿大' },
@@ -98,6 +103,8 @@ export default {
             { text: '伊朗', value: '伊朗' },
         ];
 
+        const message = ref('');
+
         const onConfirm = ({ selectedOptions }) => {
             if (selectedOptions[0] != null) {
                 showPicker.value = false;
@@ -118,7 +125,8 @@ export default {
                 modUsername: modUsername.value,
                 clientId: clientId.value,
                 country: country.value,
-                location: location.value
+                location: location.value,
+                message: message.value,
             }
             const { data } = await updateLocInfo(locationCheck);
 
@@ -131,9 +139,9 @@ export default {
             }
         }
 
-        const isRequired = computed(() => {
-            return country.value === '中国';
-        });
+        // const isRequired = computed(() => {
+        //     return country.value === '中国';
+        // });
 
         return {
             onSubmit,
@@ -147,7 +155,8 @@ export default {
             // modUsername,
             modPhone,
             location,
-            isRequired
+            // isRequired,
+            message
         };
     }
 }