work.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <view class="personal">
  3. <view class="body-input u-flex-col u-row-center">
  4. <text class="input-title">公司名称</text>
  5. <u--input disabledColor="#fff" customStyle="padding:0 !important" type="text" placeholder="请填写您的公司名称" border
  6. placeholderClass='input-style' v-model="job_experience.company_name"></u--input>
  7. </view>
  8. <view class="body-input u-flex-col u-row-center" @click="tohangye">
  9. <text class="input-title">公司行业</text>
  10. <u--input :disabled="true" disabledColor="#fff" customStyle="padding:0 !important" type="text"
  11. placeholder="请选择您的公司行业" border placeholderClass='input-style' suffixIcon="arrow-right"
  12. suffixIconStyle="font-size: 32rpx;font-weight: 400;color: #CACACA;" v-model="industry"></u--input>
  13. </view>
  14. <view class="body-input u-flex-col u-row-center">
  15. <text class="input-title">所属部门</text>
  16. <u--input disabledColor="#fff" customStyle="padding:0 !important" type="text" placeholder="请填写您的所属部门" border
  17. placeholderClass='input-style' v-model="job_experience.department"></u--input>
  18. </view>
  19. <view class="body-input u-flex-col u-row-center">
  20. <text class="input-title">职位名称</text>
  21. <u--input disabledColor="#fff" customStyle="padding:0 !important" type="text" placeholder="请填写您的的职位名称"
  22. border placeholderClass='input-style' v-model="job_experience.job_name"></u--input>
  23. </view>
  24. <view class="body-input u-flex-col u-row-center">
  25. <text class="input-title">在职时间</text>
  26. <view class="u-flex u-row-between" style="margin-top: 20rpx;">
  27. <view class="" @click="entryShow = true">
  28. <u--input :disabled="true" disabledColor="#fff" customStyle="padding:0 !important" type="text"
  29. placeholder="入职时间" border placeholderClass='input-style'
  30. v-model="job_experience.start_time"></u--input>
  31. </view>
  32. <view class="">-</view>
  33. <view class="" @click="dimissionShow = true">
  34. <u--input :disabled="true" disabledColor="#fff" customStyle="padding:0 !important" type="text"
  35. placeholder="离职时间" inputAlign="center" border placeholderClass='input-style'
  36. v-model="job_experience.end_time"></u--input>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="body-input u-flex-col u-row-center">
  41. <text class="input-title">离职原因</text>
  42. <u--input disabledColor="#fff" customStyle="padding:0 !important" type="text" placeholder="请填写您的离职原因" border
  43. placeholderClass='input-style' v-model="job_experience.level_reason"></u--input>
  44. </view>
  45. <view class="body-input u-flex-col u-row-center" @click="toworktion(job_experience.work_content)">
  46. <text class="input-title">工作内容</text>
  47. <u--input :disabled="true" disabledColor="#fff" customStyle="padding:0 !important" type="text" placeholder="请填写您的工作内容" border
  48. placeholderClass='input-style' v-model="job_experience.work_content"></u--input>
  49. </view>
  50. <view class="body-input u-flex-col u-row-center" style="margin-top: 34rpx;">
  51. <view class="">选填内容</view>
  52. <text class="input-title">下属人数</text>
  53. <u--input disabledColor="#fff" customStyle="padding:0 !important" type="text" placeholder="请填写(选填)" border
  54. placeholderClass='input-style' v-model="job_experience.underling_count"></u--input>
  55. </view>
  56. <view class="body-input u-flex-col u-row-center">
  57. <text class="input-title">汇报对象</text>
  58. <u--input disabledColor="#fff" customStyle="padding:0 !important" type="text" placeholder="请填写(选填)" border
  59. placeholderClass='input-style' v-model="job_experience.report_to"></u--input>
  60. </view>
  61. <view class="u-flex u-row-between">
  62. <view class="button1" @click="dele" v-if="key==2">
  63. 删除
  64. </view>
  65. <view class="button" @click="next">
  66. 保存
  67. </view>
  68. </view>
  69. <u-datetime-picker title="入职时间" :minDate="minDate1" @confirm="entryConfirm" :show="entryShow" mode="year-month"
  70. @cancel='entryShow = false'></u-datetime-picker>
  71. <u-datetime-picker title="离职时间" :minDate="minDate" @confirm="dimissionConfirm" :show="dimissionShow" mode="year-month"
  72. @cancel='dimissionShow = false'></u-datetime-picker>
  73. <u-modal :showCancelButton="true" :show="delec" :title="title" :content='content' @confirm="confirm"
  74. @cancel="delec = false"></u-modal>
  75. </view>
  76. </template>
  77. <script setup>
  78. import {
  79. get_category_industry,
  80. update,
  81. resumeDetail,
  82. destroy
  83. } from "@/units/inquire.js"
  84. export default {
  85. data() {
  86. return {
  87. delec:false,
  88. title:"您确定要删除该工作经历吗?",
  89. entryShow: false,
  90. dimissionShow: false,
  91. industryShow: false,
  92. minDate: "",
  93. minDate1: "",
  94. id: "",
  95. key:1,
  96. industry: "", //公司行业名称
  97. industry_first: "",
  98. job_experience: {
  99. industry_id: "", //公司行业id
  100. company_name: "", //公司名称
  101. start_time: "", //在职时间
  102. end_time: "", //离职时间
  103. department: "", //所属部门
  104. job_name: "", //工作名称
  105. level_reason: "", //离职原因
  106. work_content: "", //工作内容
  107. underling_count: "",
  108. report_to: ""
  109. }
  110. }
  111. },
  112. onLoad(opsition) {
  113. this.id = opsition.id
  114. this.key = opsition.key
  115. if (opsition.key == 1) {
  116. uni.setNavigationBarTitle({
  117. title: "添加工作经历"
  118. })
  119. } else {
  120. this.resumeDetail()
  121. uni.setNavigationBarTitle({
  122. title: "编辑工作经历"
  123. })
  124. }
  125. this.minDate = Number(new Date('2000-01-01'));
  126. this.minDate1 = Number(new Date('1980-01-01'));
  127. },
  128. methods: {
  129. toworktion(content){
  130. uni.navigateTo({
  131. url:'/pagesA/worktion?concant='+content,
  132. events:{
  133. todcp:res=>{
  134. this.job_experience.work_content = res
  135. }
  136. }
  137. })
  138. },
  139. resumeDetail(){
  140. resumeDetail().then(res=>{
  141. console.log(res);
  142. res.data.job_experience.forEach((item)=>{
  143. if(item.id == this.id){
  144. this.job_experience.company_name = item.company_name
  145. this.job_experience.department = item.department
  146. this.job_experience.end_time = item.end_time
  147. this.job_experience.industry_id = item.industry_id
  148. this.industry = item.industry_name
  149. this.job_experience.job_name = item.job_name
  150. this.job_experience.level_reason = item.level_reason
  151. this.job_experience.report_to = item.report_to
  152. this.job_experience.start_time = item.start_time
  153. this.job_experience.underling_count = item.underling_count
  154. this.job_experience.work_content = item.work_content
  155. }
  156. })
  157. })
  158. },
  159. dele() {
  160. this.delec = true
  161. },
  162. getdata(item) {
  163. console.log(item);
  164. },
  165. tohangye() {
  166. uni.navigateTo({
  167. url: "../pagesA/change-hangye1",
  168. events: {
  169. changehangye: (res) => {
  170. this.industry_first = res[0].id
  171. this.job_experience.industry_id = res[1].id
  172. this.industry = res[1].name
  173. }
  174. }
  175. })
  176. },
  177. async entryConfirm(e) {
  178. const timeFormat = uni.$u.timeFormat;
  179. console.log(e.value);
  180. let timeValue = await timeFormat(e.value, 'yyyy-mm');
  181. this.job_experience.start_time = timeValue;
  182. this.entryShow = false
  183. },
  184. async dimissionConfirm(e) {
  185. const timeFormat = uni.$u.timeFormat;
  186. let timeValue = await timeFormat(e.value, 'yyyy-mm');
  187. this.job_experience.end_time = timeValue;
  188. this.dimissionShow = false
  189. },
  190. return1() {
  191. uni.navigateBack()
  192. },
  193. confirm() {
  194. destroy({
  195. source_type: "job_experience",
  196. source_id: this.id
  197. }).then(res => {
  198. this.$u.toast("删除成功")
  199. setTimeout(() => {
  200. uni.navigateBack()
  201. }, 800)
  202. })
  203. },
  204. next() {
  205. if (!this.job_experience.company_name) {
  206. this.$u.toast("请填写公司名称")
  207. return
  208. }
  209. if (!this.industry) {
  210. this.$u.toast("请选择您的公司行业")
  211. return
  212. }
  213. if (!this.job_experience.department) {
  214. this.$u.toast("请填写您的所属部门")
  215. return
  216. }
  217. if (!this.job_experience.job_name) {
  218. this.$u.toast("请填写您的职业名称")
  219. return
  220. }
  221. if (!this.job_experience.start_time) {
  222. this.$u.toast("请选择入职时间")
  223. return
  224. }
  225. if (!this.job_experience.end_time) {
  226. this.$u.toast("请选择离职时间")
  227. return
  228. }
  229. if (!this.job_experience.level_reason) {
  230. this.$u.toast("请填写离职原因")
  231. return
  232. }
  233. if (!this.job_experience.work_content) {
  234. this.$u.toast("请填写工作内容")
  235. return
  236. }
  237. update({
  238. ...this.job_experience,
  239. source_type: "job_experience",
  240. source_id: this.id
  241. }).then(res => {
  242. uni.navigateBack()
  243. })
  244. }
  245. }
  246. }
  247. </script>
  248. <style lang="scss">
  249. .button1 {
  250. width: 256rpx;
  251. background: #F3F3F3;
  252. border-radius: 12rpx;
  253. margin-right: 24rpx;
  254. padding: 20rpx 50rpx;
  255. font-size: 32rpx;
  256. font-family: PingFangSC-Medium, PingFang SC;
  257. font-weight: 500;
  258. color: #333333;
  259. text-align: center;
  260. height: 88rpx !important;
  261. box-sizing: border-box;
  262. }
  263. .btn {
  264. background: #0C66C2;
  265. border-radius: 16rpx;
  266. font-size: 32rpx;
  267. font-family: PingFangSC-Regular, PingFang SC;
  268. font-weight: 400;
  269. color: #FFFFFF;
  270. width: 310rpx;
  271. height: 84rpx;
  272. line-height: 84rpx;
  273. text-align: center;
  274. margin-top: 24rpx;
  275. }
  276. //个人信息
  277. .personal {
  278. width: 750rpx;
  279. background: #FFFFFF;
  280. border-radius: 28rpx 28rpx 0rpx 0rpx;
  281. margin-top: -40rpx;
  282. position: relative;
  283. z-index: 99;
  284. padding: 40rpx 32rpx 0;
  285. margin-bottom: 60rpx;
  286. box-sizing: border-box;
  287. .title {
  288. font-size: 48rpx;
  289. font-family: PingFangSC-Medium, PingFang SC;
  290. font-weight: 500;
  291. color: #222222;
  292. }
  293. .titleb {
  294. font-size: 26rpx;
  295. font-family: PingFangSC-Regular, PingFang SC;
  296. font-weight: 400;
  297. color: #777777;
  298. margin-top: 20rpx;
  299. }
  300. .body-input {
  301. height: 150rpx;
  302. border-bottom: 2rpx solid #F4F4F4;
  303. .input-title {
  304. font-size: 26rpx;
  305. font-family: PingFangSC-Regular, PingFang SC;
  306. font-weight: 400;
  307. color: #888888;
  308. margin-top: 30rpx;
  309. box-sizing: border-box;
  310. }
  311. .input-style {
  312. font-size: 32rpx;
  313. font-family: PingFangSC-Regular, PingFang SC;
  314. font-weight: 400;
  315. color: #CACACA;
  316. }
  317. }
  318. .button {
  319. width: 686rpx;
  320. height: 88rpx !important;
  321. background: #0C66C2;
  322. border-radius: 12rpx;
  323. font-size: 32rpx;
  324. font-family: PingFangSC-Medium, PingFang SC;
  325. font-weight: 500;
  326. color: #FFFFFF;
  327. line-height: 88rpx;
  328. text-align: center;
  329. }
  330. }
  331. </style>