特易招,招聘小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

449 lines
9.1 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="企业信息"
  4. leftClick
  5. @leftClick="$utils.navigateBack"/>
  6. <view class="box">
  7. <!-- <view class="list">
  8. <view class="item"
  9. v-for="(item, index) in list"
  10. :key="index">
  11. <view class="title">
  12. {{ item.title }}
  13. </view>
  14. <view class="tagList">
  15. <view :class="{act : i == item.index}"
  16. @click="clickTag(item, i)" v-for="(t, i) in item.tag"
  17. :key="t.id">
  18. {{ t.name || t.adress }}
  19. </view>
  20. </view>
  21. </view>
  22. </view> -->
  23. <view class="form-sheet-cell">
  24. <view class="label">
  25. 企业名称
  26. </view>
  27. <!-- <input placeholder="请输入企业名称"
  28. v-model="form.companyName" /> -->
  29. <view class="">
  30. {{ form.companyName }}
  31. </view>
  32. </view>
  33. <view class="form-sheet-cell">
  34. <view class="label">
  35. 您的职位
  36. </view>
  37. <input placeholder="请输入您的职位"
  38. v-model="detail.ahthenticationCompany.career" />
  39. </view>
  40. <view class="form-sheet-cell">
  41. <view class="label">
  42. 公司电话
  43. </view>
  44. <input placeholder="请输入公司电话"
  45. v-model="form.phone" />
  46. </view>
  47. <view class="form-sheet-cell">
  48. <view class="label">
  49. 所属行业
  50. </view>
  51. <input placeholder="请输入所属行业"
  52. v-model="form.industry" />
  53. </view>
  54. <view class="form-sheet-cell">
  55. <view class="label">
  56. 融资轮数
  57. </view>
  58. <input placeholder="请输入融资轮数"
  59. v-model="form.financing" />
  60. </view>
  61. <!-- <view class="form-sheet-cell">
  62. <view class="label">
  63. 您的性别
  64. </view>
  65. <uv-radio-group v-model="form.sex">
  66. <view style="display: flex;justify-content: center;">
  67. <uv-radio
  68. :customStyle="{margin: '8px'}"
  69. v-for="(item, index) in sexList"
  70. :key="index"
  71. iconSize="30rpx"
  72. size="40rpx"
  73. labelSize="26rpx"
  74. :label="item.name"
  75. :name="item.name">
  76. </uv-radio>
  77. </view>
  78. </uv-radio-group>
  79. </view> -->
  80. <view class="form-sheet-cell">
  81. <view class="label">
  82. 企业人数
  83. </view>
  84. <uv-number-box v-model="form.number"/>
  85. </view>
  86. <view style="padding: 20rpx;">
  87. <view class="title">
  88. 上传企业logo
  89. </view>
  90. <view class="images box">
  91. <uv-upload
  92. :fileList="logoFileList"
  93. :maxCount="1"
  94. multiple
  95. width="150rpx"
  96. height="150rpx"
  97. name="logoFileList"
  98. @delete="deleteImage"
  99. @afterRead="afterRead"
  100. :previewFullImage="true"></uv-upload>
  101. </view>
  102. </view>
  103. <view style="padding: 20rpx;">
  104. <view class="title">
  105. 上传企业背景图片
  106. </view>
  107. <view class="images box">
  108. <uv-upload
  109. :fileList="imageBackgroundFileList"
  110. :maxCount="1"
  111. multiple
  112. width="150rpx"
  113. height="150rpx"
  114. name="imageBackgroundFileList"
  115. @delete="deleteImage"
  116. @afterRead="afterRead"
  117. :previewFullImage="true"></uv-upload>
  118. </view>
  119. </view>
  120. <view style="padding: 20rpx;">
  121. <view class="title">
  122. 上传企业照片
  123. </view>
  124. <view class="images box">
  125. <uv-upload
  126. :fileList="imageFileList"
  127. :maxCount="9"
  128. multiple
  129. width="150rpx"
  130. height="150rpx"
  131. name="imageFileList"
  132. @delete="deleteImage"
  133. @afterRead="afterRead"
  134. :previewFullImage="true"></uv-upload>
  135. </view>
  136. </view>
  137. <!-- <uv-textarea
  138. v-model="form.brief"
  139. count
  140. :maxlength="300"
  141. autoHeight
  142. placeholder="请输入个人介绍"></uv-textarea> -->
  143. <view class="uni-color-btn"
  144. @click="submit">
  145. 保存
  146. </view>
  147. </view>
  148. <uv-picker ref="picker"
  149. :columns="columns"
  150. @confirm="pickerConfirm"></uv-picker>
  151. </view>
  152. </template>
  153. <script>
  154. import { mapState } from 'vuex'
  155. export default {
  156. data() {
  157. return {
  158. list: [
  159. {
  160. title: '您希望从事的工种',
  161. tag: [],
  162. index: 0,
  163. type : 'typeId',
  164. },
  165. {
  166. title: '您希望从事工作的地区',
  167. tag: [],
  168. index: 0,
  169. type : 'expectAddress',
  170. },
  171. {
  172. title: '您希望从事工作的性质',
  173. tag: [],
  174. index: 0,
  175. type : 'natureId',
  176. },
  177. ],
  178. form : {
  179. companyName : '',
  180. industry : '',
  181. address: "",
  182. financing: "",
  183. image: "",
  184. legalPerson: "",
  185. license: "",
  186. logo: "",
  187. number: 1,
  188. phone: "",
  189. socialCode: "",
  190. },
  191. sexList : [
  192. {
  193. name : '男',
  194. },
  195. {
  196. name : '女',
  197. },
  198. ],
  199. picker : {
  200. qualification : [
  201. '初中',
  202. '高中',
  203. '专科',
  204. '本科',
  205. '研究生',
  206. '博士',
  207. ],
  208. },
  209. pickerKey : 'workAge',
  210. detail : {
  211. ahthenticationCompany : {
  212. career : ''
  213. },
  214. },
  215. logoFileList : [],//logo
  216. imageFileList : [],//企业图片
  217. imageBackgroundFileList : [],//背景图片
  218. }
  219. },
  220. computed : {
  221. ...mapState(['natureList', 'jobTypeList', 'addressList']),
  222. columns(){
  223. return [this.picker[this.pickerKey]]
  224. },
  225. },
  226. onLoad() {
  227. this.list[0].tag = this.jobTypeList
  228. this.list[1].tag = this.addressList
  229. this.list[2].tag = this.natureList
  230. this.getDataByUserId()
  231. },
  232. methods: {
  233. clickTag(item, index){
  234. item.index = index
  235. },
  236. openPicker(key, picker){
  237. this.pickerKey = key
  238. if(picker){
  239. picker.open()
  240. }else{
  241. this.$refs.picker.open()
  242. }
  243. },
  244. pickerConfirm(e){
  245. console.log(e);
  246. let data = e.value[0]
  247. if(data && data.id){
  248. this.form[this.pickerKey] = data.id
  249. this.form[this.pickerKey + '_dictText'] = data.name || data.adress
  250. }else{
  251. this.form[this.pickerKey] = data
  252. }
  253. },
  254. // 提交
  255. submit(){
  256. // if(this.fileList.length == 0){
  257. // return uni.showToast({
  258. // title: '请上传图片',
  259. // icon : 'none'
  260. // })
  261. // }
  262. this.form.image = this.imageFileList.map(n => n.url).join(',')
  263. this.form.logo = this.logoFileList.map(n => n.url).join()
  264. this.form.imageBackground = this.imageBackgroundFileList.map(n => n.url).join(',')
  265. if (this.$utils.verificationAll(this.form, {
  266. companyName : '请输入企业名称',
  267. industry : '请输入所属行业',
  268. // financing: "",
  269. // image: "",
  270. // legalPerson: "",
  271. // license: "",
  272. logo: "请上传企业logo",
  273. // number: "",
  274. // phone: "",
  275. // socialCode: "",
  276. })) {
  277. return
  278. }
  279. this.$api('updateCompany', this.form, res => {
  280. if(res.code == 200){
  281. uni.showToast({
  282. title: '保存成功!',
  283. icon: 'none'
  284. })
  285. setTimeout(uni.navigateBack, 1000, -1)
  286. }
  287. })
  288. this.$api('addAuthenticationCompany', {
  289. id : this.detail.ahthenticationCompany.id,
  290. career : this.detail.ahthenticationCompany.career,
  291. }, res =>{
  292. if(res.code == 200){
  293. }
  294. })
  295. },
  296. getDataByUserId(){
  297. this.$api('getDataByUserId', {
  298. userId : this.userInfo.id,
  299. }, res => {
  300. if(res.code == 200){
  301. this.detail = res.result
  302. this.form = res.result.company
  303. delete this.form.createBy
  304. delete this.form.createTime
  305. delete this.form.updateBy
  306. delete this.form.updateTime
  307. this.imageFileList = this.form.image ? this.form.image.split(',').map(url => {
  308. return {
  309. url
  310. }
  311. }) : []
  312. this.logoFileList = this.form.logo ? this.form.logo.split(',').map(url => {
  313. return {
  314. url
  315. }
  316. }) : []
  317. this.imageBackgroundFileList = this.form.imageBackground ? this.form.imageBackground.split(',').map(url => {
  318. return {
  319. url
  320. }
  321. }) : []
  322. }
  323. })
  324. },
  325. deleteImage(e){
  326. this[e.name].splice(e.index, 1)
  327. },
  328. afterRead(e){
  329. let self = this
  330. e.file.forEach(file => {
  331. self.$Oss.ossUpload(file.url).then(url => {
  332. self[e.name].push({
  333. url
  334. })
  335. })
  336. })
  337. },
  338. },
  339. }
  340. </script>
  341. <style scoped lang="scss">
  342. .page{
  343. background-color: #fff;
  344. min-height: 100vh;
  345. .box{
  346. padding: 30rpx;
  347. .list {
  348. .item {
  349. margin-top: 20rpx;
  350. .title {
  351. // font-weight: 900;
  352. font-size: 30rpx;
  353. }
  354. .tagList {
  355. display: flex;
  356. flex-wrap: wrap;
  357. padding: 10rpx 0;
  358. view {
  359. background: rgba($uni-color, 0.1);
  360. padding: 10rpx 20rpx;
  361. margin: 10rpx;
  362. border-radius: 10rpx;
  363. font-size: 26rpx;
  364. }
  365. .act {
  366. color: #fff;
  367. background: $uni-color;
  368. }
  369. }
  370. }
  371. }
  372. .form-sheet-cell{
  373. display: flex;
  374. background-color: #fff;
  375. padding: 20rpx;
  376. align-items: center;
  377. .label{
  378. width: 160rpx;
  379. // font-weight: 900;
  380. }
  381. .price{
  382. display: flex;
  383. text-align: center;
  384. input{
  385. width: 150rpx;
  386. border: 1px solid $uni-color;
  387. margin: 0 10rpx;
  388. }
  389. }
  390. input{
  391. flex: 1;
  392. background-color: rgba($uni-color, 0.1);
  393. padding: 10rpx 20rpx;
  394. border-radius: 10rpx;
  395. }
  396. .right-icon{
  397. margin-left: auto;
  398. }
  399. }
  400. /deep/ .uv-textarea{
  401. background-color: rgba($uni-color, 0.1) !important;
  402. min-height: 400rpx;
  403. }
  404. }
  405. }
  406. </style>