formRecurrence.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  1. <!-- 外国嘉宾 -->
  2. <template>
  3. <div>
  4. <van-nav-bar fixed :border="false">
  5. <template #left>
  6. <van-icon name="arrow-left" color="#3D3D3D" @click="onClickLeft" />
  7. </template>
  8. <template #title>
  9. <p class="navTitle" v-text="lang[langType].signUp"></p>
  10. </template>
  11. </van-nav-bar>
  12. <div class="form">
  13. <van-form ref="form" @submit="onSubmit" label-width="8em">
  14. <!-- 国家/地区 -->
  15. <van-field size="large" input-align="right" clickable readonly
  16. @click="countryRegionList = lang[langType].countryRegionList, showCountryRegion = true"
  17. right-icon="arrow"
  18. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].countryRegionContent }]"
  19. required v-model="formData.countryRegionName" :placeholder="lang[langType].countryRegionContent">
  20. <template #label>
  21. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].countryRegion"></span>
  22. </template>
  23. </van-field>
  24. <van-popup v-model:show="showCountryRegion" destroy-on-close round position="bottom">
  25. <van-picker :confirm-button-text="lang[langType].confirm" :columns="countryRegionList"
  26. :cancel-button-text="lang[langType].cancel" @confirm="countryRegionConfirm"
  27. :title="lang[langType].countryRegion" @cancel="showCountryRegion = false">
  28. <template #columns-top>
  29. <van-search @update:model-value="input" v-model="searchConuntry"
  30. :placeholder="lang[langType].searchText" />
  31. </template>
  32. </van-picker>
  33. </van-popup>
  34. <!-- 姓 -->
  35. <van-field size="large" input-align="right"
  36. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].lastNameContent }]" required
  37. v-model="formData.lastName" :placeholder="lang[langType].lastNameContent">
  38. <template #label>
  39. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].lastName"></span>
  40. </template>
  41. </van-field>
  42. <!-- 名 -->
  43. <van-field size="large" input-align="right"
  44. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].firstNameContent }]" required
  45. v-model="formData.firstName" :placeholder="lang[langType].firstNameContent">
  46. <template #label>
  47. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].firstName"></span>
  48. </template>
  49. </van-field>
  50. <!-- 性别 -->
  51. <van-field size="large" input-align="right"
  52. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].genderContent }]"
  53. v-model="formData.gender" required :placeholder="lang[langType].genderContent">
  54. <template #label>
  55. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].gender"></span>
  56. </template>
  57. </van-field>
  58. <!-- 生日 -->
  59. <!-- <van-field size="large" input-align="right"
  60. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].birthdayContent }]" clickable
  61. right-icon="calendar-o" readonly @click="showBirthday = true" v-model="formData.birthday" required
  62. :placeholder="lang[langType].birthdayContent">
  63. <template #label>
  64. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].birthday"></span>
  65. </template>
  66. </van-field> -->
  67. <van-popup v-model:show="showBirthday" destroy-on-close round position="bottom">
  68. <van-date-picker :confirm-button-text="lang[langType].confirm"
  69. :cancel-button-text="lang[langType].cancel" @confirm="packerConfirm"
  70. :title="lang[langType].birthday" @cancel="showBirthday = false" :min-date="new Date(1920, 0, 1)"
  71. :max-date="new Date()" />
  72. </van-popup>
  73. <!-- 照片 -->
  74. <van-field size="large" input-align="right" :placeholder="lang[langType].photoContent" required
  75. :rules="[{ required: true, trigger: 'onChange', message: lang[langType].photoContent }]"
  76. v-model="formData.photoUrl">
  77. <template #label>
  78. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].photo"></span>
  79. </template>
  80. <template #input>
  81. <van-uploader :preview-full-image="false" accept="image/*" v-model="photo"
  82. :before-delete="beforeDelete" :max-count="1" :max-size="524288000" @oversize="filesize"
  83. :after-read="beforeRead" result-type="file">
  84. </van-uploader>
  85. <p class="upFileSubtitle" v-text="lang[langType].photoSubContent"> </p>
  86. </template>
  87. </van-field>
  88. <!-- 手机号 -->
  89. <van-field size="large" input-align="right"
  90. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].contactContent }]"
  91. v-model="formData.contact" type="number" required :placeholder="lang[langType].contactContent">
  92. <template #label>
  93. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].contact"></span>
  94. </template>
  95. </van-field>
  96. <!-- 邮箱 -->
  97. <van-field size="large" input-align="right"
  98. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].emailContent }]" required
  99. v-model="formData.email" :placeholder="lang[langType].emailContent">
  100. <template #label>
  101. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].email"></span>
  102. </template>
  103. </van-field>
  104. <!-- 紧急联系人 -->
  105. <van-field size="large" input-align="right" v-model="formData.emergencyContact"
  106. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].emergencyContactContent }]"
  107. required :placeholder="lang[langType].emergencyContactContent">
  108. <template #label>
  109. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].emergencyContact"></span>
  110. </template>
  111. </van-field>
  112. <!-- 紧急联系人电话 -->
  113. <van-field size="large" input-align="right" v-model="formData.emergencyContactPhone" required
  114. type="number"
  115. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].emergencyContactPhoneContent }]"
  116. :placeholder="lang[langType].emergencyContactPhoneContent">
  117. <template #label>
  118. <span :class="langType === 'zh' ? 'label' : ''"
  119. v-html="lang[langType].emergencyContactPhone"></span>
  120. </template>
  121. </van-field>
  122. <!-- 证件类型 -->
  123. <van-field size="large" label-align="top" v-model="formData.cardType" clickable
  124. :rules="[{ required: true, trigger: 'onChange', message: lang[langType].conferenceTypeContent }]"
  125. :placeholder="lang[langType].conferenceTypeContent" required>
  126. <template #label>
  127. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].conferenceType"></span>
  128. </template>
  129. <template #input>
  130. <van-radio-group checked-color="#3F5AC8" style="width: 100%;" v-model="formData.cardType"
  131. :direction="langType == 'zh' ? 'horizontal' : 'vertical'">
  132. <template v-for="item in cardTypeList" :key="item.value">
  133. <van-radio v-if="item.value !== '身份证'"
  134. :style="langType == 'zh' ? 'width: 50%;margin: 10px 0 0 0;' : 'margin: 10px 0 0 0;'"
  135. :name="item.value">{{ item.text
  136. }}</van-radio>
  137. </template>
  138. </van-radio-group>
  139. </template>
  140. </van-field>
  141. <!-- 证件 -->
  142. <van-field size="large" input-align="right"
  143. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].passportContent }]"
  144. v-model="formData.passport" required :placeholder="lang[langType].passportContent">
  145. <template #label>
  146. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].passport"></span>
  147. </template>
  148. </van-field>
  149. <!-- 宗教 -->
  150. <!-- <van-field size="large" input-align="right"
  151. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].beliefContent }]"
  152. v-model="formData.belief" required :placeholder="lang[langType].beliefContent">
  153. <template #label>
  154. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].belief"></span>
  155. </template>
  156. </van-field> -->
  157. <!-- 饮食要求 -->
  158. <van-field size="large" input-align="right" v-model="formData.catering" rows="1" autosize
  159. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].cateringContent }]"
  160. type="textarea" required :placeholder="lang[langType].cateringContent">
  161. <template #label>
  162. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].catering"></span>
  163. </template>
  164. </van-field>
  165. <div style="background-color: #F7F7F7;height: 10px;"></div>
  166. <!-- 工作单位 -->
  167. <van-field size="large" input-align="right" v-model="formData.workUnit"
  168. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].companyContent }]" required
  169. :placeholder="lang[langType].companyContent">
  170. <template #label>
  171. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].company"></span>
  172. </template>
  173. </van-field>
  174. <!-- 单位类型 -->
  175. <van-field size="large" input-align="right" v-model="formData.unitTypeName" clickable
  176. :rules="[{ required: true, trigger: 'onChange', message: lang[langType].unitTypeContent }]"
  177. right-icon="calendar-o" readonly :placeholder="lang[langType].unitTypeContent"
  178. @click="showUnitType = true" required>
  179. <template #label>
  180. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].unitType"></span>
  181. </template>
  182. </van-field>
  183. <van-popup v-model:show="showUnitType" destroy-on-close round position="bottom">
  184. <van-picker :confirm-button-text="lang[langType].confirm"
  185. :cancel-button-text="lang[langType].cancel" :columns="unitTypeList"
  186. @cancel="showUnitType = false" @confirm="onUnitTypeConfirm" />
  187. </van-popup>
  188. <!-- 职务 -->
  189. <van-field size="large" input-align="right" v-model="formData.career"
  190. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].careerContent }]" required
  191. :placeholder="lang[langType].careerContent">
  192. <template #label>
  193. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].career"></span>
  194. </template>
  195. </van-field>
  196. <!-- 职级 -->
  197. <van-field size="large" label-align="top" input-align="right" v-model="formData.level"
  198. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].levelContent }]" required
  199. :placeholder="lang[langType].levelContent">
  200. <template #label>
  201. <span :style="langType === 'zh' ? 'text-align-last: justify;' : ''"
  202. :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].level"></span>
  203. </template>
  204. <template #input>
  205. <van-radio-group checked-color="#3F5AC8" style="width: 100%;" v-model="formData.level"
  206. :direction="langType == 'zh' ? 'horizontal' : 'vertical'">
  207. <van-radio style="flex: 1;margin-top: 10px " :name="item.value"
  208. v-for="item in lang[langType].careerList" :key="item.value">{{
  209. item.text
  210. }}</van-radio>
  211. </van-radio-group>
  212. </template>
  213. </van-field>
  214. <!-- 传真 -->
  215. <van-field size="large" input-align="right" v-model="formData.fax"
  216. :placeholder="lang[langType].faxContent">
  217. <template #label>
  218. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].fax"></span>
  219. </template>
  220. </van-field>
  221. <!-- 办公地址 -->
  222. <van-field size="large" input-align="right" v-model="formData.officeAddress" rows="1" autosize
  223. type="textarea" :placeholder="lang[langType].officeAddressContent">
  224. <template #label>
  225. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].officeAddress"></span>
  226. </template>
  227. </van-field>
  228. <div style="background-color: #F7F7F7;height: 10px;"></div>
  229. <!-- 接受采访意向 -->
  230. <van-field size="large" v-model="formData.interview" required label-align="top"
  231. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].interviewContent }]"
  232. :placeholder="lang[langType].interviewContent">
  233. <template #label>
  234. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].interview"></span>
  235. </template>
  236. <template #input>
  237. <van-radio-group checked-color="#3F5AC8" style="justify-content: flex-end;width: 100%;"
  238. v-model="formData.interview" direction="horizontal">
  239. <van-radio style="flex: 1;margin-top: 10px " name="是">{{ lang[langType].confirm
  240. }}</van-radio>
  241. <van-radio style="flex: 1;margin-top: 10px " name="否">{{ lang[langType].cancel
  242. }}</van-radio>
  243. </van-radio-group>
  244. </template>
  245. </van-field>
  246. <div style="background-color: #F7F7F7;height: 10px;"></div>
  247. <!-- 是否参加开幕式 active0 -->
  248. <van-field size="large" label-align="top" v-model="formData.active1" required
  249. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].active0Content }]"
  250. :placeholder="lang[langType].active0Content">
  251. <template #label>
  252. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].active0"></span>
  253. </template>
  254. <template #input>
  255. <van-radio-group checked-color="#3F5AC8" style="width: 100%;" v-model="formData.active1"
  256. direction="horizontal">
  257. <van-radio style="flex: 1;margin-top: 10px " name="是">{{ lang[langType].confirm
  258. }}</van-radio>
  259. <van-radio style="flex: 1;margin-top: 10px " name="否">{{ lang[langType].cancel
  260. }}</van-radio>
  261. </van-radio-group>
  262. </template>
  263. </van-field>
  264. <!-- 选择分论坛 -->
  265. <van-field size="large" label-align="top" required
  266. :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].activeContent }]"
  267. :placeholder="lang[langType].activeContent">
  268. <template #label>
  269. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].active"></span>
  270. </template>
  271. <template #input>
  272. <van-checkbox-group checked-color="#3F5AC8" style="width: 100%;padding-left: 16px;"
  273. v-model="formData.active2">
  274. <van-checkbox style="flex: 1;margin-top: 10px " name="共享数字经济发展机遇" shape="square">
  275. {{ lang[langType].active1 }}
  276. </van-checkbox>
  277. <van-checkbox style="flex: 1;margin-top: 10px " name="共筑网络安全防线" shape="square">
  278. {{ lang[langType].active2 }}
  279. </van-checkbox>
  280. <van-checkbox style="flex: 1;margin-top: 10px " name="共商人工智能发展治理" shape="square">
  281. {{ lang[langType].active3 }}
  282. </van-checkbox>
  283. </van-checkbox-group>
  284. </template>
  285. </van-field>
  286. <!-- 拟参加的活动 -->
  287. <van-field size="large" label-align="top" v-model="formData.activitiesAttended" required
  288. :placeholder="lang[langType].activitiesAttendedContent">
  289. <template #label>
  290. <span :class="langType === 'zh' ? 'label' : ''"
  291. v-html="lang[langType].activitiesAttended"></span>
  292. </template>
  293. <template #input>
  294. <div>
  295. <van-checkbox-group :border="false" ref="checkbox" checked-color="#3F5AC8"
  296. v-model="activitiesAttended" @change="isGroup">
  297. <van-cell clickable :title="lang[langType].active4" @click="checkboxRefs[0].toggle()">
  298. <template #icon>
  299. <van-checkbox :ref="el => checkboxRefs[0] = el" style="margin-right: 5px;"
  300. name="active4" @click.stop shape="square" />
  301. </template>
  302. </van-cell>
  303. <van-cell clickable :title="lang[langType].active5" @click="checkboxRefs[1].toggle()">
  304. <template #icon>
  305. <van-checkbox :ref="el => checkboxRefs[1] = el" style="margin-right: 5px;"
  306. name="active5" @click.stop shape="square" />
  307. </template>
  308. </van-cell>
  309. <van-cell clickable :title="lang[langType].active6" @click="checkboxRefs[2].toggle()">
  310. <template #icon>
  311. <van-checkbox :ref="el => checkboxRefs[2] = el" style="margin-right: 5px;"
  312. name="active6" @click.stop shape="square" />
  313. </template>
  314. </van-cell>
  315. </van-checkbox-group>
  316. <van-cell clickable :title="lang[langType].active7"
  317. @click="() => isUndefined(checkboxRefs[3])">
  318. <template #icon>
  319. <div class="noClcik">
  320. <van-checkbox checked-color="#3F5AC8" v-model="selectunde"
  321. style="margin-right: 5px;" :ref="el => checkboxRefs[3] = el" name="none"
  322. @click.stop shape="square" />
  323. </div>
  324. </template>
  325. </van-cell>
  326. </div>
  327. </template>
  328. </van-field>
  329. <div style="background-color: #F7F7F7;height: 10px;"></div>
  330. <!-- 抵达西安交通车次 -->
  331. <van-field size="large" input-align="right" v-model="formData.reachTrainNumber"
  332. :placeholder="lang[langType].reachTrainNumberContent">
  333. <template #label>
  334. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].reachTrainNumber"></span>
  335. </template>
  336. </van-field>
  337. <!-- 抵达西安时间 -->
  338. <van-field size="large" input-align="right" v-model="formData.reachTime" clickable
  339. right-icon="calendar-o" readonly @click="showReachTime = true"
  340. :placeholder="lang[langType].reachTimeContent">
  341. <template #label>
  342. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].reachTime"></span>
  343. </template>
  344. </van-field>
  345. <van-popup v-model:show="showReachTime" destroy-on-close round position="bottom">
  346. <van-picker :confirm-button-text="lang[langType].confirm"
  347. :cancel-button-text="lang[langType].cancel" :title="lang[langType].reachTime"
  348. :columns="dateTimeColumns" @confirm="reachTimeConfirm" @cancel="showReachTime = false" />
  349. </van-popup>
  350. <!-- 离开车次 -->
  351. <van-field size="large" input-align="right" v-model="formData.leavingTrainNumber"
  352. :placeholder="lang[langType].leavingTrainNumberContent">
  353. <template #label>
  354. <span :class="langType === 'zh' ? 'label' : ''"
  355. v-html="lang[langType].leavingTrainNumber"></span>
  356. </template>
  357. </van-field>
  358. <!-- 离开时间 -->
  359. <van-field size="large" input-align="right" v-model="formData.leavingTime" clickable
  360. right-icon="calendar-o" readonly @click="showLeavingTime = true"
  361. :placeholder="lang[langType].leavingTimeContent">
  362. <template #label>
  363. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].leavingTime"></span>
  364. </template>
  365. </van-field>
  366. <van-popup v-model:show="showLeavingTime" destroy-on-close round position="bottom">
  367. <van-picker :confirm-button-text="lang[langType].confirm"
  368. :cancel-button-text="lang[langType].cancel" :title="lang[langType].leavingTime"
  369. :columns="dateTimeColumns" @confirm="leavingTimeConfirm" @cancel="showLeavingTime = false" />
  370. </van-popup>
  371. <!-- 离店时间 -->
  372. <van-field size="large" input-align="right" v-model="formData.checkOutTime" clickable
  373. right-icon="calendar-o" readonly @click="showCheckOutTime = true"
  374. :placeholder="lang[langType].checkOutTimeContent">
  375. <template #label>
  376. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].checkOutTime"></span>
  377. </template>
  378. </van-field>
  379. <van-popup v-model:show="showCheckOutTime" destroy-on-close round position="bottom">
  380. <van-picker :confirm-button-text="lang[langType].confirm"
  381. :cancel-button-text="lang[langType].cancel" :title="lang[langType].checkOutTime"
  382. :columns="dateTimeColumns" @confirm="checkOutTimeConfirm" @cancel="showCheckOutTime = false" />
  383. </van-popup>
  384. <van-field size="large" input-align="right" v-model="formData.message" rows="3" autosize type="textarea"
  385. :placeholder="lang[langType].ortherNotesContent">
  386. <template #label>
  387. <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].ortherNotes"></span>
  388. </template>
  389. </van-field>
  390. <br />
  391. <van-button
  392. style="background: linear-gradient(270deg, #1D19BC 0%, #1C4CD5 100%);margin: 0 auto;width: calc(100% - 40px);"
  393. block type="primary" native-type="submit">
  394. {{ lang[langType].submit }}
  395. </van-button>
  396. </van-form>
  397. </div>
  398. </div>
  399. </template>
  400. <script setup>
  401. import { defineProps, defineEmits, defineExpose, reactive, ref, computed } from 'vue';
  402. import { showToast, showDialog } from 'vant';
  403. import { editData, uploadImage } from '@/api/2025.js';
  404. import lang from './lang.js';
  405. const props = defineProps(['langType', 'verificationCode', 'subData']);
  406. const emits = defineEmits(['closeComponent']);
  407. const formData = reactive({
  408. active2: []
  409. })
  410. const cardTypeList = computed(() => lang[props.langType].cardTypeList)
  411. const unitTypeList = computed(() => lang[props.langType].foreignCountryUnitType)
  412. const form = ref(null);
  413. const showBirthday = ref(false)
  414. const showReachTime = ref(false)
  415. const showLeavingTime = ref(false)
  416. const showCheckOutTime = ref(false)
  417. const showUnitType = ref(false)
  418. const selectunde = ref(false)
  419. const showCountryRegion = ref(false)
  420. const activitiesAttended = ref([])
  421. const photo = ref([]);
  422. const checkboxRefs = ref([]);
  423. const checkbox = ref(null);
  424. const searchConuntry = ref('')
  425. const countryRegionList = ref([]);
  426. let t
  427. const input = (val) => {
  428. if (t) clearTimeout(t);
  429. t = setTimeout(() => {
  430. countryRegionList.value = lang[props.langType].countryRegionList.filter(item => {
  431. // 判断是否包含搜索的关键字,中英西班牙
  432. if (props.langType === 'zh') return item.text.includes(val)
  433. else return item.text.toLowerCase().includes(val.toLowerCase())
  434. })
  435. clearTimeout(t);
  436. }, 200);
  437. }
  438. const onClickLeft = () => {
  439. emits('closeComponent');
  440. };
  441. const isGroup = (val) => {
  442. formData.activitiesAttended = val.join(',')
  443. if (val.length > 0) {
  444. selectunde.value = false
  445. }
  446. }
  447. const isUndefined = (ele) => {
  448. ele.toggle()
  449. formData.activitiesAttended = selectunde.value ? 'none' : '';
  450. activitiesAttended.value = []
  451. }
  452. /**
  453. * 将subData数据转换为formData
  454. */
  455. const initFormData = () => {
  456. if (!props.subData) return;
  457. const relationship = {
  458. lastName: 'lastName', // 姓
  459. firstName: 'firstName', // 名
  460. countryRegion: 'countryRegion', // 国家/地区
  461. religion: 'belief', // 宗教
  462. level: 'level', // 职级
  463. gender: 'gender', // 性别
  464. birthDate: 'birthday', // 出生日期
  465. photo: 'photoUrl', // 照片
  466. phone: 'contact', // 手机号
  467. email: 'email', // 邮箱
  468. emergencyContact: 'emergencyContact', // 紧急联系人
  469. emergencyContactPhone: 'emergencyContactPhone', // 紧急联系人电话
  470. cardType: 'cardType', // 证件类型
  471. idCard: 'passport', // 证件号
  472. dietaryRequirements: 'catering', // 饮食要求
  473. workUnit: 'workUnit', // 工作单位
  474. unitType: 'unitType', // 单位类型
  475. position: 'career', // 职务
  476. fax: 'fax', // fax
  477. interviewIntention: 'interview', // 接受采访意向
  478. officeAddress: 'officeAddress', // 办公地址
  479. arrivalNumberXian: 'reachTrainNumber', // 抵达西安交通车次
  480. arrivalTimeXian: 'reachTime', // 抵达西安时间
  481. departureNumber: 'leavingTrainNumber', // 离开车次
  482. departureTime: 'leavingTime', // 离开时间
  483. checkOutTime: 'checkOutTime', // 离店时间
  484. remarks: 'message', // 备注
  485. active1: 'active1', // 共筑网络安全防线
  486. active2: 'active2', // 共商人工智能发展治理
  487. active3: 'active3', // 共筑网络安全防线
  488. }
  489. const subData = JSON.parse(JSON.stringify(props.subData))
  490. const keys = Object.keys(subData || {});
  491. subData.active4 === '是' && activitiesAttended.value.push('active4');
  492. subData.active5 === '是' && activitiesAttended.value.push('active5');
  493. subData.active6 === '是' && activitiesAttended.value.push('active6');
  494. if (!formData.active2) {
  495. formData.active2 = []
  496. }
  497. for (let i = 0; i < keys.length; i++) {
  498. const key = keys[i];
  499. if (key === 'photo') {
  500. photo.value.push({
  501. url: subData[key],
  502. })
  503. }
  504. if (key === 'unitType') {
  505. try {
  506. formData.unitTypeName = lang[props.langType].foreignCountryUnitType.filter(item => item.value === subData[key])[0].text;
  507. } catch (err) {
  508. formData.unitTypeName = '';
  509. }
  510. }
  511. if (key === 'active7') {
  512. subData[key] === '是' && formData.active2.push('共享数字经济发展机遇')
  513. continue
  514. }
  515. if (key === 'active2') {
  516. subData[key] === '是' && formData.active2.push('共筑网络安全防线')
  517. continue
  518. }
  519. if (key === 'active3') {
  520. subData[key] === '是' && formData.active2.push('共商人工智能发展治理')
  521. continue
  522. }
  523. if (key === 'countryRegion') {
  524. try {
  525. formData.countryRegionName = lang[props.langType].countryRegionList.filter(item => item.value === subData[key])[0].text;
  526. } catch (err) {
  527. formData.countryRegionName = '';
  528. }
  529. }
  530. formData[relationship[key]] = subData[key];
  531. }
  532. }
  533. initFormData()
  534. const reset = () => {
  535. form.value.resetValidation();
  536. }
  537. const createTextDate = values => values.slice(0, 3).join('-') + ' ' + values.slice(3).join(':');
  538. const packerConfirm = (values) => {
  539. showBirthday.value = false;
  540. formData.birthday = createTextDate(values.selectedValues);
  541. }
  542. const leavingTimeConfirm = ({ selectedValues }) => {
  543. showLeavingTime.value = false;
  544. formData.leavingTime = createTextDate(selectedValues);
  545. }
  546. const reachTimeConfirm = ({ selectedValues }) => {
  547. showReachTime.value = false;
  548. formData.reachTime = createTextDate(selectedValues);
  549. }
  550. const checkOutTimeConfirm = ({ selectedValues }) => {
  551. showCheckOutTime.value = false;
  552. formData.checkOutTime = createTextDate(selectedValues);
  553. }
  554. const onUnitTypeConfirm = (values) => {
  555. showUnitType.value = false;
  556. formData.unitType = values.selectedOptions[0].value;
  557. formData.unitTypeName = values.selectedOptions[0].text;
  558. }
  559. const countryRegionConfirm = (values) => {
  560. showCountryRegion.value = false;
  561. formData.countryRegionName = values.selectedOptions[0].text;
  562. formData.countryRegion = values.selectedOptions[0].value;
  563. }
  564. // 上传
  565. const beforeDelete = (index) => {
  566. photo.value.splice(index, 1);
  567. formData.photoUrl = '';
  568. return false;
  569. }
  570. const filesize = () => showToast(lang[props.langType].fileSize);
  571. const beforeRead = (file) => {
  572. if (!file) showToast(lang[props.langType].photoContent);
  573. uploadImage(file).then(res => {
  574. showToast(lang[props.langType].upFileSusscess);
  575. formData.photoUrl = res
  576. photo.value = [
  577. {
  578. url: res,
  579. file: file.file,
  580. }
  581. ]
  582. }).catch((res) => {
  583. showToast(res.msg || lang[props.langType].upFileError);
  584. })
  585. return false;
  586. };
  587. let arrivalTime = []
  588. const dateTimeColumns = computed(() => {
  589. const dateList = lang[props.langType].dateList;
  590. const years = [{ text: dateList[0], value: '', disabled: true }, ...Array.from({ length: 10 }, (_, i) => {
  591. const t = 2020 + i + ''
  592. return {
  593. text: t,
  594. value: t
  595. }
  596. })];
  597. const months = [{ text: dateList[1], value: '', disabled: true }, ...Array.from({ length: 12 }, (_, i) => {
  598. const m = (i + 1).toString().padStart(2, '0')
  599. return {
  600. text: m,
  601. value: m
  602. }
  603. })];
  604. // 动态计算当前选中年月对应的天数
  605. const daysInMonth = new Date(
  606. parseInt(arrivalTime[0] || '0'),
  607. parseInt(arrivalTime[1] || '0'),
  608. 0
  609. ).getDate();
  610. const days = [{ text: dateList[2], value: '', disabled: true }, ...Array.from({ length: daysInMonth }, (_, i) => {
  611. const d = (i + 1).toString().padStart(2, '0')
  612. return {
  613. text: d,
  614. value: d
  615. }
  616. })];
  617. const hours = [{ text: dateList[3], value: '', disabled: true }, ...Array.from({ length: 24 }, (_, i) => {
  618. const h = i.toString().padStart(2, '0')
  619. return {
  620. text: h,
  621. value: h
  622. }
  623. })];
  624. const minutes = [{ text: dateList[4], value: '', disabled: true }, ...Array.from({ length: 60 }, (_, i) => {
  625. const m = i.toString().padStart(2, '0')
  626. return {
  627. text: m,
  628. value: m
  629. }
  630. })];
  631. return [years, months, days, hours, minutes];
  632. });
  633. let loading = false
  634. const onSubmit = () => {
  635. if (loading) return
  636. loading = true
  637. const active = {
  638. active2: '否',
  639. active3: '否',
  640. active4: '否',
  641. active5: '否',
  642. active6: '否',
  643. active7: '否'
  644. }
  645. if (!selectunde.value) {
  646. activitiesAttended.value.forEach((item) => {
  647. active[item] = '是'
  648. })
  649. }
  650. if (formData.active2.includes('共享数字经济发展机遇')) {
  651. active.active7 = '是'
  652. }
  653. if (formData.active2.includes('共筑网络安全防线')) {
  654. active.active2 = '是'
  655. }
  656. if (formData.active2.includes('共商人工智能发展治理')) {
  657. active.active3 = '是'
  658. }
  659. editData({
  660. ...active,
  661. active1: formData.active1 || '否',
  662. id: props.subData.id, // 人员id
  663. code: props.verificationCode, // 邀请码
  664. lastName: formData.lastName, // 姓
  665. firstName: formData.firstName, // 名
  666. gender: formData.gender, // 性别
  667. birthDate: formData.birthday, // 出生日期
  668. photo: formData.photoUrl, // 照片
  669. phone: formData.contact, // 手机号
  670. countryRegion: formData.countryRegion, // 国家/地区
  671. email: formData.email, // 邮箱
  672. religion: formData.belief, // 宗教
  673. emergencyContact: formData.emergencyContact, // 紧急联系人
  674. emergencyContactPhone: formData.emergencyContactPhone, // 紧急联系人电话
  675. cardType: formData.cardType, // 证件类型
  676. idCard: formData.passport, // 证件号
  677. dietaryRequirements: formData.catering, // 饮食要求
  678. workUnit: formData.workUnit, // 工作单位
  679. unitType: formData.unitType, // 单位类型
  680. position: formData.career, // 职务
  681. level: formData.level, // 职级
  682. fax: formData.fax, // fax
  683. interviewIntention: formData.interview, // 接受采访意向
  684. officeAddress: formData.officeAddress, // 办公地址
  685. arrivalNumberXian: formData.reachTrainNumber, // 抵达西安交通车次
  686. arrivalTimeXian: formData.reachTime, // 抵达西安时间
  687. departureNumber: formData.leavingTrainNumber, // 离开车次
  688. departureTime: formData.leavingTime, // 离开时间
  689. checkOutTime: formData.checkOutTime, // 离店时间
  690. remarks: formData.message, // 备注
  691. userType: '国外嘉宾'
  692. }).then((res) => {
  693. if (!isNaN(res.code) && res.code !== 0) {
  694. showToast(res.msg || lang[props.langType].networkError);
  695. return;
  696. }
  697. // 清空表单内容 from
  698. // Object.keys(from).forEach((key) => {
  699. // from[key] = '';
  700. // });
  701. loading = false
  702. showDialog({
  703. message: lang[props.langType].upRegistration,
  704. })
  705. }).catch((res) => {
  706. loading = false
  707. showToast(res.msg || lang[props.langType].networkError);
  708. });
  709. }
  710. defineExpose({ reset })
  711. </script>
  712. <style lang="scss"></style>