index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <!-- @format -->
  2. <script lang="ts" setup>
  3. import type { FormInstance, FormRules } from 'element-plus'
  4. import useLoginAndDownload from '../../useLoginAndDownload'
  5. import { getDictListApi } from '~/api/model/common'
  6. const { formInfo, visible, setSubmitInfo } = useLoginAndDownload()
  7. const ruleFormRef = ref<FormInstance>()
  8. const annualPurchaseAmountList = ref()
  9. const mobileAreaCodeList = ref()
  10. const rules = ref<FormRules>({
  11. firstName: [
  12. {
  13. required: true,
  14. message: 'FirstName must be filled in',
  15. trigger: 'blur',
  16. },
  17. ],
  18. lastName: [
  19. {
  20. required: true,
  21. message: 'LastName must be filled in',
  22. trigger: 'blur',
  23. },
  24. ],
  25. mobile: [
  26. {
  27. required: true,
  28. message: 'Mobile must be filled in',
  29. trigger: 'blur',
  30. },
  31. ],
  32. type: [
  33. {
  34. required: true,
  35. message: 'Mobile must be filled in',
  36. trigger: 'blur',
  37. },
  38. ],
  39. companyName: [
  40. {
  41. required: true,
  42. message: 'CompanyName must be filled in',
  43. trigger: 'change',
  44. },
  45. ],
  46. annualPurchaseAmount: [
  47. {
  48. required: true,
  49. message: 'AnnualPurchaseAmount must be selected',
  50. trigger: 'change',
  51. },
  52. ],
  53. })
  54. async function getMobileAreaCodeList() {
  55. const list = await getDictListApi('A064')
  56. mobileAreaCodeList.value = list
  57. }
  58. async function getAnnualPurchaseAmountList() {
  59. const list = await getDictListApi('A072')
  60. annualPurchaseAmountList.value = list
  61. }
  62. getMobileAreaCodeList()
  63. getAnnualPurchaseAmountList()
  64. </script>
  65. <template>
  66. <div>
  67. <div
  68. class="custom-title-font text-24px fw-800 text-#333 mb-10px flex items-center"
  69. >
  70. Fill in Your Information
  71. </div>
  72. <div class="text-14px text-#1A1A1A lh-22px mb-20px">
  73. We need some basic information to create your account.
  74. </div>
  75. <el-form ref="ruleFormRef" :rules="rules" :model="formInfo">
  76. <div class="flex">
  77. <el-form-item
  78. class="custom-form-item custom-form-item-hidden-label mr-20px"
  79. label=""
  80. prop="firstName"
  81. >
  82. <el-input
  83. v-model="formInfo.firstName"
  84. placeholder="* First Name"
  85. class="h-50px"
  86. />
  87. </el-form-item>
  88. <el-form-item
  89. class="custom-form-item custom-form-item-hidden-label mr-12px"
  90. label=""
  91. prop="lastName"
  92. >
  93. <el-input
  94. v-model="formInfo.lastName"
  95. placeholder="* Last Name"
  96. class="h-50px"
  97. />
  98. </el-form-item>
  99. </div>
  100. <el-form-item label="" class="custom-form-item" prop="mobile">
  101. <el-input
  102. v-model="formInfo.mobile"
  103. placeholder="Phone number"
  104. class="h-50px custom-inner-input"
  105. >
  106. <template #prepend>
  107. <el-select
  108. v-model="formInfo.mobileAreaCode"
  109. class="!h-50px !lh-50px"
  110. placeholder="Select"
  111. style="width: 120px"
  112. >
  113. <el-option
  114. v-for="(item, index) in mobileAreaCodeList"
  115. :key="index"
  116. :value="item.value"
  117. :label="`${item.value} ${item.label}`"
  118. >
  119. {{ item.value }} {{ item.label }}
  120. </el-option>
  121. </el-select>
  122. </template>
  123. </el-input>
  124. </el-form-item>
  125. <el-form-item label="" class="custom-form-item" prop="type">
  126. <el-select v-model="formInfo.type" placeholder="* Needs">
  127. <el-option
  128. class="!h-50px !lh-50px"
  129. label="Just browing"
  130. value="browing"
  131. />
  132. <el-option
  133. class="!h-50px !lh-50px"
  134. label="Find suppliers"
  135. value="suppliers"
  136. />
  137. </el-select>
  138. </el-form-item>
  139. <el-form-item
  140. v-if="visible"
  141. label=""
  142. class="custom-form-item"
  143. prop="companyName"
  144. >
  145. <el-input
  146. v-model="formInfo.companyName"
  147. placeholder="Company name"
  148. class="h-50px"
  149. />
  150. </el-form-item>
  151. <el-form-item
  152. v-if="visible"
  153. label=""
  154. prop="annualPurchaseAmount"
  155. class="custom-form-item"
  156. >
  157. <el-select
  158. v-model="formInfo.annualPurchaseAmount"
  159. placeholder="* Sourcing Budget "
  160. >
  161. <el-option
  162. v-for="(item, index) in annualPurchaseAmountList"
  163. :key="index"
  164. class="!h-50px !lh-50px"
  165. :label="item.label"
  166. :value="item.value"
  167. />
  168. </el-select>
  169. </el-form-item>
  170. <el-form-item v-if="visible" label="" class="custom-form-item">
  171. <el-input
  172. v-model="formInfo.mark"
  173. type="textarea"
  174. placeholder="Describe your needs"
  175. :rows="4"
  176. />
  177. </el-form-item>
  178. <el-form-item>
  179. <el-button
  180. class="!w-full !h-50px mb-50px !text-16px !fw-500 !b-rd-10px !bg-#9B6CFF !text-#fff"
  181. @click="setSubmitInfo(ruleFormRef)"
  182. >
  183. Download Catalog
  184. </el-button>
  185. </el-form-item>
  186. </el-form>
  187. </div>
  188. </template>
  189. <style lang="less" scoped>
  190. ::v-deep(.login-input) {
  191. &.error-txt {
  192. .el-input__wrapper {
  193. border: 1px solid red !important;
  194. }
  195. }
  196. .el-input__wrapper {
  197. border-radius: 10px;
  198. }
  199. }
  200. :deep(.custom-form-item) {
  201. margin-bottom: 24px;
  202. display: block !important;
  203. .el-form-item__content {
  204. justify-content: space-between;
  205. .el-input {
  206. .el-input__wrapper {
  207. border-radius: 10px;
  208. }
  209. .el-input-group__prepend {
  210. border-top-left-radius: 10px;
  211. border-bottom-left-radius: 10px;
  212. .el-select {
  213. .el-select__wrapper {
  214. height: 50px !important;
  215. background-color: #fff !important;
  216. border-top-left-radius: 10px;
  217. border-bottom-left-radius: 10px;
  218. &:hover {
  219. border: 1px solid #9b6cff !important;
  220. }
  221. }
  222. }
  223. }
  224. &.custom-inner-input {
  225. .el-input__wrapper {
  226. border-top-left-radius: 0px;
  227. border-bottom-left-radius: 0px;
  228. }
  229. .el-select {
  230. .el-select__wrapper {
  231. height: 50px !important;
  232. background-color: #fff !important;
  233. border-top-left-radius: 10px;
  234. border-bottom-left-radius: 10px;
  235. border-top-right-radius: 0px !important;
  236. border-bottom-right-radius: 0px !important;
  237. }
  238. }
  239. }
  240. }
  241. .el-select {
  242. .el-select__wrapper {
  243. height: 50px !important;
  244. background-color: #fff !important;
  245. border-radius: 10px;
  246. &.is-focused {
  247. box-shadow: none !important;
  248. border: 1px solid #9b6cff !important;
  249. }
  250. &:hover {
  251. box-shadow: none !important;
  252. border: 1px solid #9b6cff !important;
  253. }
  254. }
  255. }
  256. .el-textarea{
  257. .el-textarea__inner{
  258. border-radius: 10px;
  259. &:focus {
  260. box-shadow: none !important;
  261. border: 1px solid #9b6cff !important;
  262. }
  263. }
  264. }
  265. }
  266. .el-form-item__label-wrap {
  267. margin-left: unset !important;
  268. .el-form-item__label {
  269. margin-bottom: 5px;
  270. font-size: 16px !important;
  271. color: #5b463e !important;
  272. }
  273. }
  274. &.custom-form-item-hidden-label {
  275. width: 100%;
  276. &:last-child {
  277. .el-form-item__label-wrap {
  278. opacity: 0;
  279. }
  280. }
  281. }
  282. }
  283. </style>