lingdu il y a 1 semaine
Parent
commit
49070f9fd2

+ 13 - 20
src/view/fenghui/form.vue

@@ -112,18 +112,20 @@
             </van-field>
 
             <!-- 证件类型 -->
-            <van-field input-align="right" v-model="formData.cardTypeName" clickable
+            <van-field label-align="top" v-model="formData.cardType" clickable
                 :rules="[{ required: true, trigger: 'onChange', message: lang[langType].conferenceTypeContent }]"
-                right-icon="calendar-o" readonly :placeholder="lang[langType].conferenceTypeContent"
-                @click="showCardType = true" required>
+                :placeholder="lang[langType].conferenceTypeContent" required>
                 <template #label>
                     <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].conferenceType"></span>
                 </template>
+                <template #input>
+                    <van-radio-group checked-color="#3F5AC8" style="width: 100%;" v-model="formData.cardType"
+                        direction="horizontal">
+                        <van-radio v-for="item in cardTypeList" :key="item.value" style="width: 50%;margin: 0 0 5px 0;"
+                            :name="item.value">{{ item.text }}</van-radio>
+                    </van-radio-group>
+                </template>
             </van-field>
-            <van-popup v-model:show="showCardType" destroy-on-close round position="bottom">
-                <van-picker :confirm-button-text="lang[langType].confirm" :cancel-button-text="lang[langType].cancel"
-                    :columns="cardTypeList" @cancel="showCardType = false" @confirm="onConfirm" />
-            </van-popup>
 
             <!-- 证件 -->
             <van-field input-align="right"
@@ -232,20 +234,17 @@
                     <van-checkbox-group checked-color="#3F5AC8" v-model="activitiesAttended">
                         <van-cell clickable :title="lang[langType].activity1">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active1" @click.stop
-                                    shape="square" />
+                                <van-checkbox style="margin-right: 5px;" name="active1" @click.stop shape="square" />
                             </template>
                         </van-cell>
                         <van-cell clickable :title="lang[langType].activity2">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active2" @click.stop
-                                    shape="square" />
+                                <van-checkbox style="margin-right: 5px;" name="active2" @click.stop shape="square" />
                             </template>
                         </van-cell>
                         <van-cell clickable :title="lang[langType].activity3">
                             <template #icon>
-                                <van-checkbox style="margin-right: 5px;" name="active3" @click.stop
-                                    shape="square" />
+                                <van-checkbox style="margin-right: 5px;" name="active3" @click.stop shape="square" />
                             </template>
                         </van-cell>
                     </van-checkbox-group>
@@ -341,7 +340,6 @@ const form = ref(null);
 const showBirthday = ref(false)
 const showReachTime = ref(false)
 const showLeavingTime = ref(false)
-const showCardType = ref(false)
 const showCheckOutTime = ref(false)
 const showUnitType = ref(false)
 const photo = ref([]);
@@ -379,11 +377,6 @@ const onUnitTypeConfirm = (values) => {
     formData.unitType = values.selectedOptions[0].value;
     formData.unitTypeName = values.selectedOptions[0].text;
 }
-const onConfirm = (values) => {
-    showCardType.value = false;
-    formData.cardType = values.selectedOptions[0].value;
-    formData.cardTypeName = values.selectedOptions[0].text;
-}
 
 // 上传
 const beforeDelete = (index) => {
@@ -466,7 +459,7 @@ const onSubmit = () => {
     loading = true
     const activity = {}
     activitiesAttended.value.forEach((item, index) => {
-        activity[`activity${index + 1}`] = '是' 
+        activity[`activity${index + 1}`] = '是'
     })
     saveData({
         ...activity,

+ 9 - 14
src/view/fenghui/form1.vue

@@ -103,19 +103,20 @@
             </van-field>
 
             <!-- 证件类型 -->
-            <van-field input-align="right" v-model="formData.cardTypeName" clickable
+            <van-field label-align="top" v-model="formData.cardType" clickable
                 :rules="[{ required: true, trigger: 'onChange', message: lang[langType].conferenceTypeContent }]"
-                right-icon="calendar-o" readonly :placeholder="lang[langType].conferenceTypeContent"
-                @click="showCardType = true" required>
+                :placeholder="lang[langType].conferenceTypeContent" required>
                 <template #label>
                     <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].conferenceType"></span>
                 </template>
+                <template #input>
+                    <van-radio-group checked-color="#3F5AC8" style="width: 100%;" v-model="formData.cardType"
+                        direction="horizontal">
+                        <van-radio v-for="item in cardTypeList" :key="item.value" style="width: 50%;margin: 0 0 5px 0;"
+                            :name="item.value">{{ item.text }}</van-radio>
+                    </van-radio-group>
+                </template>
             </van-field>
-            <van-popup v-model:show="showCardType" destroy-on-close round position="bottom">
-                <van-picker :confirm-button-text="lang[langType].confirm" :cancel-button-text="lang[langType].cancel"
-                    :model-value="formData.cardType" :columns="cardTypeList" @cancel="showCardType = false"
-                    @confirm="onConfirm" />
-            </van-popup>
 
             <!-- 证件 -->
             <van-field input-align="right"
@@ -324,7 +325,6 @@ const showBirthday = ref(false)
 const showReachTime = ref(false)
 const showUnitType = ref(false)
 const showLeavingTime = ref(false)
-const showCardType = ref(false)
 const showCheckOutTime = ref(false)
 const activitiesAttended = ref([])
 const form = ref(null);
@@ -360,11 +360,6 @@ const checkOutTimeConfirm = ({ selectedValues }) => {
     showCheckOutTime.value = false;
     formData.checkOutTime = createTextDate(selectedValues);
 }
-const onConfirm = (values) => {
-    showCardType.value = false;
-    formData.cardType = values.selectedOptions[0].value;
-    formData.cardTypeName = values.selectedOptions[0].text;
-}
 
 // 上传
 const beforeDelete = (index) => {

+ 9 - 20
src/view/fenghui/form1Recurrence.vue

@@ -103,18 +103,20 @@
             </van-field>
 
             <!-- 证件类型 -->
-            <van-field input-align="right" v-model="formData.cardTypeName" clickable
+            <van-field label-align="top" v-model="formData.cardType" clickable
                 :rules="[{ required: true, trigger: 'onChange', message: lang[langType].conferenceTypeContent }]"
-                right-icon="calendar-o" readonly :placeholder="lang[langType].conferenceTypeContent"
-                @click="showCardType = true" required>
+                :placeholder="lang[langType].conferenceTypeContent" required>
                 <template #label>
                     <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].conferenceType"></span>
                 </template>
+                <template #input>
+                    <van-radio-group checked-color="#3F5AC8" style="width: 100%;" v-model="formData.cardType"
+                        direction="horizontal">
+                        <van-radio v-for="item in cardTypeList" :key="item.value" style="width: 50%;margin: 0 0 5px 0;"
+                            :name="item.value">{{ item.text }}</van-radio>
+                    </van-radio-group>
+                </template>
             </van-field>
-            <van-popup v-model:show="showCardType" destroy-on-close round position="bottom">
-                <van-picker :confirm-button-text="lang[langType].confirm" :cancel-button-text="lang[langType].cancel"
-                    :columns="cardTypeList" @cancel="showCardType = false" @confirm="onConfirm" />
-            </van-popup>
 
             <!-- 证件 -->
             <van-field input-align="right"
@@ -321,7 +323,6 @@ const showBirthday = ref(false)
 const showReachTime = ref(false)
 const showUnitType = ref(false)
 const showLeavingTime = ref(false)
-const showCardType = ref(false)
 const showCheckOutTime = ref(false)
 const form = ref(null);
 const activitiesAttended = ref([])
@@ -370,13 +371,6 @@ const initFormData = () => {
                 url: subData[key],
             })
         }
-        if (key === 'cardType') {
-            try {
-                formData.cardTypeName = lang[props.langType].cardTypeList.filter(item => item.value === subData[key])[0].text;
-            } catch (err) {
-                formData.cardTypeName = '';
-            }
-        }
         if (key === 'unitType') {
             try {
                 formData.unitTypeName = lang[props.langType].foreignCountryUnitType.filter(item => item.value === subData[key])[0].text;
@@ -422,11 +416,6 @@ const checkOutTimeConfirm = ({ selectedValues }) => {
     showCheckOutTime.value = false;
     formData.checkOutTime = createTextDate(selectedValues);
 }
-const onConfirm = (values) => {
-    showCardType.value = false;
-    formData.cardType = values.selectedOptions[0].value;
-    formData.cardTypeName = values.selectedOptions[0].text;
-}
 
 // 上传
 const beforeDelete = (index) => {

+ 9 - 21
src/view/fenghui/formRecurrence.vue

@@ -112,19 +112,20 @@
             </van-field>
 
             <!-- 证件类型 -->
-            <van-field input-align="right" v-model="formData.cardTypeName" clickable
+            <van-field label-align="top" v-model="formData.cardType" clickable
                 :rules="[{ required: true, trigger: 'onChange', message: lang[langType].conferenceTypeContent }]"
-                right-icon="calendar-o" readonly :placeholder="lang[langType].conferenceTypeContent"
-                @click="showCardType = true" required>
+                :placeholder="lang[langType].conferenceTypeContent" required>
                 <template #label>
                     <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].conferenceType"></span>
                 </template>
+                <template #input>
+                    <van-radio-group checked-color="#3F5AC8" style="width: 100%;" v-model="formData.cardType"
+                        direction="horizontal">
+                        <van-radio v-for="item in cardTypeList" :key="item.value" style="width: 50%;margin: 0 0 5px 0;"
+                            :name="item.value">{{ item.text }}</van-radio>
+                    </van-radio-group>
+                </template>
             </van-field>
-            <van-popup v-model:show="showCardType" destroy-on-close round position="bottom">
-                <van-picker :confirm-button-text="lang[langType].confirm" :cancel-button-text="lang[langType].cancel"
-                    :model-value="formData.cardType" :columns="cardTypeList" @cancel="showCardType = false"
-                    @confirm="onConfirm" />
-            </van-popup>
 
             <!-- 证件 -->
             <van-field input-align="right"
@@ -338,7 +339,6 @@ const form = ref(null);
 const showBirthday = ref(false)
 const showReachTime = ref(false)
 const showLeavingTime = ref(false)
-const showCardType = ref(false)
 const showCheckOutTime = ref(false)
 const showUnitType = ref(false)
 const activitiesAttended = ref([])
@@ -393,13 +393,6 @@ const initFormData = () => {
                 url: subData[key],
             })
         }
-        if (key === 'cardType') {
-            try {
-                formData.cardTypeName = lang[props.langType].cardTypeList.filter(item => item.value === subData[key])[0].text;
-            } catch (err) {
-                formData.cardTypeName = '';
-            }
-        }
         if (key === 'unitType') {
             try {
                 formData.unitTypeName = lang[props.langType].foreignCountryUnitType.filter(item => item.value === subData[key])[0].text;
@@ -436,11 +429,6 @@ const onUnitTypeConfirm = (values) => {
     formData.unitType = values.selectedOptions[0].value;
     formData.unitTypeName = values.selectedOptions[0].text;
 }
-const onConfirm = (values) => {
-    showCardType.value = false;
-    formData.cardType = values.selectedOptions[0].value;
-    formData.cardTypeName = values.selectedOptions[0].text;
-}
 
 // 上传
 const beforeDelete = (index) => {