workhistory.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view>
  3. <view class="box" v-if="resumesClassify==1">
  4. <view class="flex align-center justify-between">
  5. <view class=" text-bold" style="width: 150rpx;">公司名称</view>
  6. <view class="flex align-center">
  7. <u-input v-model="resumesTitle" placeholder="请输入公司名称" placeholder-style="color:#999999;" />
  8. <view class="margin-left-sm">
  9. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="margin-tb" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  14. <!-- <view class="flex align-center justify-between">
  15. <view class=" text-bold" style="width: 150rpx;">项目名称</view>
  16. <view class="flex align-center">
  17. <u-input v-model="resumesProject" placeholder="请输入项目名称" placeholder-style="color:#999999;" />
  18. <view class="margin-left-sm">
  19. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="margin-tb" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view> -->
  24. <view class="flex align-center justify-between">
  25. <view class=" text-bold" style="width: 150rpx;">担任岗位</view>
  26. <view class="text-right flex align-center ">
  27. <u-input v-model="resumesPost" placeholder="请输入岗位名称" placeholder-style="color:#999999;;" />
  28. <view class="margin-left-sm">
  29. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="margin-tb" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  34. <view class="flex align-center justify-between">
  35. <view class=" text-bold" style="width: 150rpx;">在职时间</view>
  36. <view class="text-right flex align-center ">
  37. <view :style="resumesTime1?'':'color: gray;'" @click="show=true">{{resumesTime1?resumesTime1:'请选择开始时间'}}</view>
  38. <span style="padding: 0 10rpx 0 10rpx;">至</span>
  39. <view :style="resumesTime2?'':'color: gray;'" @click="show2=true">{{resumesTime2?resumesTime2:'请选择结束时间'}}</view>
  40. <view class="margin-left-sm">
  41. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="box" v-if="resumesClassify==2">
  47. <view class="flex align-center justify-between">
  48. <view class=" text-bold" style="width: 150rpx;">项目名称</view>
  49. <view class="flex align-center">
  50. <u-input v-model="resumesTitle" placeholder="请输入项目名称" placeholder-style="color:#999999;" />
  51. <view class="margin-left-sm">
  52. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="margin-tb" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  57. <view class="flex align-center justify-between">
  58. <view class=" text-bold" style="width: 150rpx;">担任岗位</view>
  59. <view class="text-right flex align-center ">
  60. <u-input v-model="resumesPost" placeholder="请输入担任岗位" placeholder-style="color:#999999;;" />
  61. <view class="margin-left-sm">
  62. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="margin-tb" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  67. <view class="flex align-center justify-between" >
  68. <view class=" text-bold" style="width: 150rpx;">项目时间</view>
  69. <view class="text-right flex align-center ">
  70. <view :style="resumesTime1?'':'color: gray;'" @click="show=true">{{resumesTime1?resumesTime1:'请选择开始时间'}}</view>
  71. <span style="padding: 0 10rpx 0 10rpx;">至</span>
  72. <view :style="resumesTime2?'':'color: gray;'" @click="show2=true">{{resumesTime2?resumesTime2:'请选择结束时间'}}</view>
  73. <view class="margin-left-sm">
  74. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="box">
  80. <view class=" text-bold">工作内容</view>
  81. <view class="padding-tb-sm">
  82. <u-input v-model="resumesContent" type="textarea" height="300" placeholder="添加工作经历,向企业全面展示你的能力"
  83. inputAlign="text-alight:left" />
  84. </view>
  85. </view>
  86. <view class="btn" @click="submit">保存</view>
  87. <u-picker v-model="show" mode="time" @confirm="Dataconfirm"></u-picker>
  88. <u-picker v-model="show2" mode="time" @confirm="Dataconfirm2"></u-picker>
  89. </view>
  90. </template>
  91. <script>
  92. export default {
  93. data() {
  94. return {
  95. show2:false,
  96. resumesTitle: '',
  97. resumesProject:'',//项目名称
  98. resumesPost: '',
  99. resumesTime: '',
  100. resumesTime1: '',
  101. resumesTime2: '',
  102. resumesContent: '',
  103. resumesCompanyList: [],
  104. resumesWorkList: [],
  105. show: false,
  106. resumesClassify: '',
  107. index:'',
  108. }
  109. },
  110. onLoad(option) {
  111. if (option.state) {
  112. this.resumesClassify = option.state
  113. if (option.state == 2) {
  114. uni.setNavigationBarTitle({
  115. title: '项目经验'
  116. });
  117. if (uni.getStorageSync("resumesWorkList")) { //项目经验
  118. this.resumesWorkList = uni.getStorageSync("resumesWorkList")
  119. if(option.index!=1){
  120. this.index = option.index
  121. let obj = JSON.parse(option.list)
  122. this.resumesTitle = obj.resumesTitle
  123. this.resumesProject = obj.resumesProject
  124. this.resumesPost = obj.resumesPost
  125. this.resumesContent = obj.resumesContent
  126. let time = obj.resumesTime.split(' - ')
  127. this.resumesTime1 = time[0]
  128. this.resumesTime2 = time[1]
  129. this.$forceUpdate()
  130. }
  131. }
  132. }else{
  133. if (uni.getStorageSync("resumesCompanyList")) { //工作经验
  134. this.resumesCompanyList = uni.getStorageSync("resumesCompanyList")
  135. if(option.index){
  136. this.index = option.index
  137. let obj = JSON.parse(option.list)
  138. this.resumesTitle = obj.resumesTitle
  139. this.resumesProject = obj.resumesProject
  140. this.resumesPost = obj.resumesPost
  141. this.resumesContent = obj.resumesContent
  142. let time = obj.resumesTime.split(' - ')
  143. this.resumesTime1 = time[0]
  144. this.resumesTime2 = time[1]
  145. this.$forceUpdate()
  146. }
  147. }
  148. }
  149. }
  150. },
  151. onShow() {
  152. },
  153. methods: {
  154. Dataconfirm2(e) {
  155. this.resumesTime2 = e.year + '-' + e.month + '-' + e.day
  156. },
  157. Dataconfirm(e) {
  158. this.resumesTime1 = e.year + '-' + e.month + '-' + e.day
  159. },
  160. submit() {
  161. this.resumesTime = this.resumesTime1 + ' - ' + this.resumesTime2
  162. if (this.resumesClassify == 1 && !this.resumesTitle) {
  163. uni.showToast({
  164. title: '请输入公司名称',
  165. icon: 'none',
  166. duration: 1000
  167. })
  168. return
  169. }
  170. // if (!this.resumesProject) {
  171. // uni.showToast({
  172. // title: '请输入项目名称',
  173. // icon: 'none',
  174. // duration: 1000
  175. // })
  176. // return
  177. // }
  178. if (!this.resumesPost) {
  179. uni.showToast({
  180. title: '请输入岗位名称 ',
  181. icon: 'none',
  182. duration: 1000
  183. })
  184. return
  185. }
  186. if (!this.resumesTime1) {
  187. uni.showToast({
  188. title: '请选择开始时间',
  189. icon: 'none',
  190. duration: 1000
  191. })
  192. return
  193. }
  194. if (!this.resumesTime2) {
  195. uni.showToast({
  196. title: '请选择结束时间',
  197. icon: 'none',
  198. duration: 1000
  199. })
  200. return
  201. }
  202. if (!this.resumesContent) {
  203. uni.showToast({
  204. title: '添加工作经历向企业全面展示你的能力',
  205. icon: 'none',
  206. duration: 1000
  207. })
  208. return
  209. }
  210. if (this.resumesClassify == '1') {
  211. let data = {
  212. resumesTitle: this.resumesTitle,
  213. resumesPost: this.resumesPost,
  214. resumesTime: this.resumesTime,
  215. resumesContent: this.resumesContent,
  216. resumesClassify: this.resumesClassify,
  217. resumesProject: this.resumesProject
  218. }
  219. if(this.index && this.index!=''){
  220. this.resumesCompanyList[this.index] = data
  221. }else{
  222. this.resumesCompanyList.push(data)
  223. }
  224. uni.setStorageSync("resumesCompanyList", this.resumesCompanyList)
  225. } else if (this.resumesClassify == '2') {
  226. let data = {
  227. resumesTitle: this.resumesTitle,
  228. resumesPost: this.resumesPost,
  229. resumesTime: this.resumesTime,
  230. resumesContent: this.resumesContent,
  231. resumesClassify: this.resumesClassify,
  232. resumesProject: this.resumesProject
  233. }
  234. if(this.index && this.index!=''){
  235. this.resumesWorkList[this.index] = data
  236. }else{
  237. this.resumesWorkList.push(data)
  238. }
  239. uni.setStorageSync("resumesWorkList", this.resumesWorkList)
  240. }
  241. this.index = ''
  242. this.resumesTitle = ''
  243. this.resumesProject = ''
  244. this.resumesPost = ''
  245. this.resumesContent = ''
  246. this.resumesTime1 = ''
  247. this.resumesTime2 = ''
  248. uni.navigateBack()
  249. }
  250. }
  251. }
  252. </script>
  253. <style lang="less">
  254. page {
  255. background: #F2F2F7;
  256. }
  257. .box {
  258. background: #FFFFFF;
  259. border-radius: 24upx;
  260. margin: 30upx;
  261. padding: 30upx;
  262. }
  263. .btn {
  264. background: #00B88F;
  265. border-radius: 10upx;
  266. text-align: center;
  267. // margin-top: 30upx;
  268. padding: 30upx 0upx;
  269. color: #FFFFFF;
  270. // font-weight: bold;
  271. // letter-spacing: 2rpx;
  272. margin: 30upx;
  273. }
  274. </style>