laborManagement.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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}}元/{{getUnit(0,item)}}
  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. onLoad() {
  83. this.getList();
  84. },
  85. methods: {
  86. getList() {
  87. uni.showLoading({
  88. title: "加载中",
  89. mask: true,
  90. })
  91. var list = this.list[this.current].list
  92. var obj = this.list[this.current]
  93. var listForm = {
  94. ...obj
  95. }
  96. delete listForm.list
  97. API.myEmployment(listForm).then((res) => {
  98. if (listForm.pageIndex == 1) {
  99. list = res.data.data;
  100. } else {
  101. list = [
  102. ...list,
  103. ...res.data.data
  104. ];
  105. }
  106. this.list[this.current].list = list
  107. this.list[this.current].recordsTotal = res.data.recordsTotal;
  108. uni.hideLoading();
  109. }).catch(error => {
  110. uni.showToast({
  111. title: error,
  112. icon: "none"
  113. })
  114. })
  115. },
  116. myLoadmore() {
  117. this.list[this.current].pageIndex += 1;
  118. this.getList();
  119. },
  120. init() {
  121. this.current = 0
  122. for(var i in this.list){
  123. this.list[i].pageIndex = 1
  124. this.list[i].list = []
  125. }
  126. this.getList()
  127. },
  128. amendBtn(item) {
  129. var url = "/pages/packages/mine/employmentService/laborManagement/postMessage?id=" +item.id;
  130. uni.navigateTo({
  131. url: url,
  132. events: {
  133. refreshData: () => {
  134. this.init()
  135. }
  136. }
  137. })
  138. },
  139. addInfo() {
  140. var url = "/pages/packages/mine/employmentService/laborManagement/postMessage";
  141. uni.navigateTo({
  142. url: url,
  143. events: {
  144. refreshData: () => {
  145. this.init()
  146. }
  147. }
  148. })
  149. },
  150. change(index) {
  151. this.current = index;
  152. var list = this.list[this.current].list
  153. if (list.length == 0) {
  154. this.getList();
  155. }
  156. },
  157. refreshBtn(item){
  158. API.myEmploymentRefresh({
  159. id:item.id
  160. }).then((res) => {
  161. item.updateTime=new Date().toLocaleString()
  162. uni.showToast({
  163. title: "刷新成功",
  164. icon: "none"
  165. })
  166. }).catch(error => {
  167. uni.showToast({
  168. title: error,
  169. icon: "none"
  170. })
  171. })
  172. },
  173. deleteBtn(item){
  174. var _this=this;
  175. uni.showModal({
  176. title: '提示',
  177. content:"确认是否删除",
  178. //content: '这是一个模态弹窗',
  179. success: function(res) {
  180. if (res.confirm) {
  181. _this.deleteBtnMethod(item)
  182. } else if (res.cancel) {
  183. console.log('用户点击取消');
  184. }
  185. }
  186. });
  187. },
  188. deleteBtnMethod(item){
  189. uni.showLoading({
  190. title: "加载中",
  191. mask: true,
  192. })
  193. API.myEmploymentDelete({
  194. id:item.id
  195. }).then((res) => {
  196. this.init()
  197. }).catch(error => {
  198. uni.showToast({
  199. title: error,
  200. icon: "none"
  201. })
  202. })
  203. },
  204. }
  205. }
  206. </script>
  207. <style>
  208. page {
  209. background: #F0F0F2;
  210. padding-bottom: 150px;
  211. }
  212. </style>
  213. <style scoped lang="scss">
  214. .card {
  215. margin: 24rpx 32rpx;
  216. background-color: #fff;
  217. padding: 24rpx;
  218. border-radius: 12px;
  219. .positon-salary {
  220. display: flex;
  221. justify-content: space-between;
  222. align-items: center;
  223. .positon {
  224. color: rgba(16, 16, 16, 1);
  225. font-size: 36rpx;
  226. font-family: 'PingFangSC-medium';
  227. }
  228. .salary {
  229. color: rgba(255, 61, 0, 1);
  230. font-size: 32rpx;
  231. font-family: 'PingFangSC-medium';
  232. }
  233. }
  234. .tags-date {
  235. display: flex;
  236. justify-content: space-between;
  237. align-items: center;
  238. margin-top: 16rpx;
  239. margin-bottom: 24rpx;
  240. .tags {
  241. color: rgba(102, 102, 102, 1);
  242. }
  243. .date {
  244. color: rgba(153, 153, 153, 1);
  245. font-size: 24rpx;
  246. }
  247. }
  248. // 按钮
  249. .buttons {
  250. display: flex;
  251. justify-content: flex-end;
  252. margin-top: 24rpx;
  253. .btn {
  254. width: 120rpx;
  255. height: 56rpx;
  256. line-height: 56rpx;
  257. border-radius: 50px;
  258. background-color: rgba(255, 255, 255, 1);
  259. color: rgba(119, 119, 119, 1);
  260. text-align: center;
  261. font-family: Microsoft Yahei;
  262. border: 1px solid rgba(207, 210, 213, 1);
  263. margin-left: 24rpx;
  264. }
  265. .delete {
  266. color: rgba(238, 49, 56, 1);
  267. }
  268. }
  269. }
  270. .bottom {
  271. position: fixed;
  272. left: 0;
  273. right: 0;
  274. bottom: 0;
  275. .issue {
  276. height: 96rpx;
  277. line-height: 96rpx;
  278. border-radius: 50px;
  279. background-color: rgba(34, 149, 255, 1);
  280. color: rgba(241, 241, 241, 1);
  281. font-size: 36rpx;
  282. text-align: center;
  283. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.03);
  284. margin: 24rpx 32rpx;
  285. }
  286. }
  287. </style>