laborManagement.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <template>
  2. <view>
  3. <u-navbar back-text="用工管理" back-icon-size="28" back-icon-color="#ffffff"
  4. :background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
  5. <!-- 标签 -->
  6. <view class="tabs">
  7. <u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
  8. </view>
  9. <!-- 发布中 -->
  10. <view class="my-registration" v-for="(item,i) in list[current].list" :key="i">
  11. <view class="card">
  12. <view class="positon-salary">
  13. <view class="positon">
  14. {{item.positionName}}
  15. </view>
  16. <view class="salary">
  17. {{item.salary}}元/天
  18. </view>
  19. </view>
  20. <view class="tags-date">
  21. <view class="tags">
  22. 招聘{{item.recruitingNumbers}}人
  23. </view>
  24. <view class="date">
  25. 刷新时间:{{item.updateTime?item.updateTime:item.createTime}}
  26. </view>
  27. </view>
  28. <u-line color="#E6E6E6"></u-line>
  29. <view class="buttons">
  30. <view class="btn refresh" v-show="item.status=='1'" @click="refreshBtn(item)">
  31. 刷新
  32. </view>
  33. <view class="btn amend" @click="amendBtn(item)">
  34. 修改
  35. </view>
  36. <view class="btn delete" @click="deleteBtn(item)">
  37. 删除
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <u-divider v-if="list[current].recordsTotal==list[current].list.length"
  43. :isnone="list[current].recordsTotal==0" nonetext="没有找到相关内容"
  44. border-color="#CFD2D5">已经到底了</u-divider>
  45. <!-- 底部 -->
  46. <view class="bottom">
  47. <button class="issue" @click="addInfo">发布用工需求
  48. </button>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import * as API from '@/apis/pagejs/packages.js'
  54. export default {
  55. data() {
  56. return {
  57. list: [{
  58. name: '发布中',
  59. pageIndex: 1,
  60. pageSize: 20,
  61. recordsTotal: 1,
  62. status: "1",
  63. list: []
  64. }, {
  65. name: '待审核',
  66. pageIndex: 1,
  67. pageSize: 20,
  68. recordsTotal: 1,
  69. status: "0",
  70. list: []
  71. }, {
  72. name: '未通过',
  73. pageIndex: 1,
  74. pageSize: 20,
  75. recordsTotal: 1,
  76. status: "2",
  77. list: []
  78. }],
  79. current: 0
  80. }
  81. },
  82. onReachBottom() {
  83. var obj = this.list[this.current]
  84. if (obj.list.length < obj.recordsTotal) {
  85. this.myLoadmore();
  86. }
  87. },
  88. onLoad() {
  89. this.getList();
  90. },
  91. methods: {
  92. getList() {
  93. uni.showLoading({
  94. title: "加载中",
  95. mask: true,
  96. })
  97. var list = this.list[this.current].list
  98. var obj = this.list[this.current]
  99. var listForm = {
  100. ...obj
  101. }
  102. delete listForm.list
  103. API.myEmployment(listForm).then((res) => {
  104. if (listForm.pageIndex == 1) {
  105. list = res.data.data;
  106. } else {
  107. list = [
  108. ...list,
  109. ...res.data.data
  110. ];
  111. }
  112. this.list[this.current].list = list
  113. this.list[this.current].recordsTotal = res.data.recordsTotal;
  114. uni.hideLoading();
  115. }).catch(error => {
  116. uni.showToast({icon: 'none',
  117. title: error,
  118. icon: "none"
  119. })
  120. })
  121. },
  122. myLoadmore() {
  123. this.list[this.current].pageIndex += 1;
  124. this.getList();
  125. },
  126. init() {
  127. //this.current = 0
  128. for(var i in this.list){
  129. this.list[i].pageIndex = 1
  130. this.list[i].list = []
  131. }
  132. this.getList()
  133. },
  134. amendBtn(item) {
  135. var url = "/pages/packages/mine/employmentService/laborManagement/postMessage?id=" +item.id;
  136. uni.navigateTo({
  137. url: url,
  138. events: {
  139. refreshData: () => {
  140. this.init()
  141. }
  142. }
  143. })
  144. },
  145. addInfo() {
  146. var url = "/pages/packages/mine/employmentService/laborManagement/postMessage";
  147. uni.navigateTo({
  148. url: url,
  149. events: {
  150. refreshData: () => {
  151. this.init()
  152. }
  153. }
  154. })
  155. },
  156. change(index) {
  157. this.current = index;
  158. var list = this.list[this.current].list
  159. if (list.length == 0) {
  160. this.getList();
  161. }
  162. },
  163. refreshBtn(item){
  164. API.myEmploymentRefresh({
  165. id:item.id
  166. }).then((res) => {
  167. item.updateTime=new Date().toLocaleString()
  168. uni.showToast({icon: 'none',
  169. title: "刷新成功",
  170. icon: "none"
  171. })
  172. }).catch(error => {
  173. uni.showToast({icon: 'none',
  174. title: error,
  175. icon: "none"
  176. })
  177. })
  178. },
  179. deleteBtn(item){
  180. var _this=this;
  181. uni.showModal({
  182. title: '提示',
  183. content:"确认是否删除",
  184. //content: '这是一个模态弹窗',
  185. success: function(res) {
  186. if (res.confirm) {
  187. _this.deleteBtnMethod(item)
  188. } else if (res.cancel) {
  189. console.log('用户点击取消');
  190. }
  191. }
  192. });
  193. },
  194. deleteBtnMethod(item){
  195. uni.showLoading({
  196. title: "加载中",
  197. mask: true,
  198. })
  199. API.myEmploymentDelete({
  200. id:item.id
  201. }).then((res) => {
  202. this.init()
  203. }).catch(error => {
  204. uni.showToast({icon: 'none',
  205. title: error,
  206. icon: "none"
  207. })
  208. })
  209. },
  210. }
  211. }
  212. </script>
  213. <style>
  214. page {
  215. background: #F0F0F2;
  216. padding-bottom: 150px;
  217. }
  218. </style>
  219. <style scoped lang="scss">
  220. .card {
  221. margin: 24rpx 32rpx;
  222. background-color: #fff;
  223. padding: 24rpx;
  224. border-radius: 12px;
  225. .positon-salary {
  226. display: flex;
  227. justify-content: space-between;
  228. align-items: center;
  229. .positon {
  230. color: rgba(16, 16, 16, 1);
  231. font-size: 36rpx;
  232. font-family: 'PingFangSC-medium';
  233. }
  234. .salary {
  235. color: rgba(255, 61, 0, 1);
  236. font-size: 32rpx;
  237. font-family: 'PingFangSC-medium';
  238. }
  239. }
  240. .tags-date {
  241. display: flex;
  242. justify-content: space-between;
  243. align-items: center;
  244. margin-top: 16rpx;
  245. margin-bottom: 24rpx;
  246. .tags {
  247. color: rgba(102, 102, 102, 1);
  248. }
  249. .date {
  250. color: rgba(153, 153, 153, 1);
  251. font-size: 24rpx;
  252. }
  253. }
  254. // 按钮
  255. .buttons {
  256. display: flex;
  257. justify-content: flex-end;
  258. margin-top: 24rpx;
  259. .btn {
  260. width: 120rpx;
  261. height: 56rpx;
  262. line-height: 56rpx;
  263. border-radius: 50px;
  264. background-color: rgba(255, 255, 255, 1);
  265. color: rgba(119, 119, 119, 1);
  266. text-align: center;
  267. font-family: Microsoft Yahei;
  268. border: 1px solid rgba(207, 210, 213, 1);
  269. margin-left: 24rpx;
  270. }
  271. .delete {
  272. color: rgba(238, 49, 56, 1);
  273. }
  274. }
  275. }
  276. .bottom {
  277. position: fixed;
  278. left: 0;
  279. right: 0;
  280. bottom: 0;
  281. .issue {
  282. height: 96rpx;
  283. line-height: 96rpx;
  284. border-radius: 50px;
  285. background-color: rgba(34, 149, 255, 1);
  286. color: rgba(241, 241, 241, 1);
  287. font-size: 36rpx;
  288. text-align: center;
  289. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.03);
  290. margin: 24rpx 32rpx;
  291. }
  292. }
  293. </style>