wcomlog.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view>
  3. <sl-filter :ref="'slFilter'" :topFixed="false" :isTransNav="true" :navHeight="0" :color="titleColor" :themeColor="themeColor"
  4. :menuList="menuList" @result="result"></sl-filter>
  5. <view class="cu-list menu-avatar">
  6. <block v-for="(item,index) in plist" :key="index">
  7. <view class="padding-lr padding-top-sm padding-bottom-xs bg-white margin-top-sm solid-bottom">{{item.comjobs.title}}</view>
  8. <view class="cu-item " @click="goUserDetail(item.user.id)">
  9. <view class="cu-avatar radius lg" :style="'background-image:url('+item.user.avatar+');'"></view>
  10. <view class="content">
  11. <view class="text-red">
  12. <view class="text-cut">{{item.user.realname}}</view>
  13. </view>
  14. <view class="text-gray text-sm flex">
  15. <view class="text-cut">报名时间:{{item.createtime}}</view>
  16. </view>
  17. </view>
  18. <view class="action">
  19. <view class="cu-tag round bg-gray sm">{{item.status_text}}</view>
  20. </view>
  21. </view>
  22. <view class="grid solids-top text-center col-3 padding-tb-sm bg-white">
  23. <view @tap="delComlog" :data-itemlogid="item.id" :data-itemindex="index"><text class="cuIcon-delete padding-right-xs"></text> 删除 </view>
  24. <view @tap="showModal" :data-itemlogid="item.id" :data-itemindex="index" :data-itemstatus="item.status" data-target="statusModal"><text class="cuIcon-write padding-right-xs"></text> 状态 </view>
  25. <view @tap="makeTelephone" :data-telephone="item.user.mobile"><text class="cuIcon-phone padding-right-xs"></text> 电话 </view>
  26. </view>
  27. </block>
  28. </view>
  29. <uni-load-more :status="pstatus"></uni-load-more>
  30. <view class="cu-modal" :class="modalName=='statusModal'?'show':''" @tap="hideModal">
  31. <view class="cu-dialog" @tap.stop="">
  32. <view class="cu-bar bg-white justify-end">
  33. <view class="content">点击选择要更改的状态</view>
  34. <view class="action" @tap="hideModal">
  35. <text class="cuIcon-close text-red"></text>
  36. </view>
  37. </view>
  38. <view class="solids-top">
  39. <radio-group class="block" @change="statusChange">
  40. <view class="cu-list menu text-left">
  41. <view class="cu-item">
  42. <label class="flex justify-between align-center flex-sub">
  43. <view class="flex-sub">未跟进</view>
  44. <radio class="red" :checked="itemstatus==1?true:false" value="1"></radio>
  45. </label>
  46. </view>
  47. <view class="cu-item">
  48. <label class="flex justify-between align-center flex-sub">
  49. <view class="flex-sub">未面试</view>
  50. <radio class="red" :checked="itemstatus==2?true:false" value="2"></radio>
  51. </label>
  52. </view>
  53. <view class="cu-item">
  54. <label class="flex justify-between align-center flex-sub">
  55. <view class="flex-sub">面试通过</view>
  56. <radio class="red" :checked="itemstatus==3?true:false" value="3"></radio>
  57. </label>
  58. </view>
  59. <view class="cu-item">
  60. <label class="flex justify-between align-center flex-sub">
  61. <view class="flex-sub">面试未通过</view>
  62. <radio class="red" :checked="itemstatus==4?true:false" value="4"></radio>
  63. </label>
  64. </view>
  65. <view class="cu-item">
  66. <label class="flex justify-between align-center flex-sub">
  67. <view class="flex-sub">用户放弃</view>
  68. <radio class="red" :checked="itemstatus==5?true:false" value="5"></radio>
  69. </label>
  70. </view>
  71. <view class="cu-item">
  72. <label class="flex justify-between align-center flex-sub">
  73. <view class="flex-sub">已入职</view>
  74. <radio class="red" :checked="itemstatus==6?true:false" value="6"></radio>
  75. </label>
  76. </view>
  77. <view class="cu-item">
  78. <label class="flex justify-between align-center flex-sub">
  79. <view class="flex-sub">已离职</view>
  80. <radio class="red" :checked="itemstatus==7?true:false" value="7"></radio>
  81. </label>
  82. </view>
  83. </view>
  84. </radio-group>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. import slFilter from '@/components/sl-filter/sl-filter.vue';
  92. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  93. var _this;
  94. export default {
  95. components: {
  96. slFilter,
  97. uniLoadMore
  98. },
  99. data() {
  100. return {
  101. isRotate: false,
  102. userinfo: false,
  103. workerinfo: false,
  104. themeColor: '#e11c2b',
  105. titleColor: '#666666',
  106. filterResult: '',
  107. menuList: [{
  108. 'title': '岗位',
  109. 'detailTitle': '请选择招聘岗位...',
  110. 'isMutiple': false,
  111. 'key': 'comjobsid',
  112. 'detailList': []
  113. }, {
  114. 'title': '状态',
  115. 'detailTitle': '请选择记录状态...',
  116. 'isMutiple': false,
  117. 'key': 'status',
  118. 'detailList': []
  119. }],
  120. comjobsid: 0,
  121. status: 0,
  122. modalName: null,
  123. itemlogid: 0,
  124. itemindex: 0,
  125. itemstatus: 0,
  126. pstatus: 'more',
  127. ppage: 1,
  128. psize: 20,
  129. plist: []
  130. };
  131. },
  132. onLoad: function() {
  133. _this = this;
  134. _this.userinfo = _this.checkLogin("/pages/my/my");
  135. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  136. if (_this.userinfo === false || _this.workerinfo === false) {
  137. uni.reLaunch({
  138. url: "/pages/my/my"
  139. });
  140. return false;
  141. }
  142. _this.$req.ajax({
  143. path: "wcomjobs/pagecomlog",
  144. data: {
  145. userid: _this.userinfo.id,
  146. workerid: _this.workerinfo.id,
  147. }
  148. }).then((data) => {
  149. _this.menuList[0].detailList = data.comjobslist;
  150. _this.menuList[1].detailList = data.statuslist;
  151. _this.$refs.slFilter.resetMenuList(_this.menuList);
  152. _this.getMore();
  153. }).catch((err) => {
  154. console.log("err: " + JSON.stringify(err));
  155. });
  156. },
  157. onPullDownRefresh: function() {
  158. _this.pageRefresh();
  159. },
  160. onReachBottom: function() {
  161. if (_this.pstatus !== 'more') {
  162. return;
  163. }
  164. _this.getMore();
  165. },
  166. methods: {
  167. pageRefresh: function() {
  168. _this.pstatus = 'more';
  169. _this.ppage = 1;
  170. _this.plist = [];
  171. _this.getMore();
  172. },
  173. getMore: function() {
  174. _this.$req.ajax({
  175. path: "wcomjobs/listcomlog",
  176. data: {
  177. ppage: _this.ppage,
  178. psize: _this.psize,
  179. workerid: _this.workerinfo.id,
  180. comjobsid: _this.comjobsid,
  181. status: _this.status
  182. }
  183. }).then((data) => {
  184. _this.pstatus = data.pstatus;
  185. _this.plist = _this.plist.concat(data.plist);
  186. _this.ppage += 1;
  187. uni.stopPullDownRefresh();
  188. }).catch((err) => {
  189. uni.showModal({
  190. title: '信息提示',
  191. content: err,
  192. showCancel: false
  193. });
  194. });
  195. },
  196. result: function(e) {
  197. _this.comjobsid = e.comjobsid;
  198. _this.status = e.status;
  199. _this.pageRefresh();
  200. },
  201. goDetail: function(comjobsid) {
  202. uni.navigateTo({
  203. url: '/pages/comjobs/detail?comjobsid=' + comjobsid
  204. });
  205. },
  206. goUserDetail: function(userid) {
  207. uni.navigateTo({
  208. url: '/pages/worker/wcomuserdetail?userid=' + userid
  209. });
  210. },
  211. showModal: function(e) {
  212. _this.itemlogid = e.currentTarget.dataset.itemlogid;
  213. _this.itemindex = e.currentTarget.dataset.itemindex;
  214. _this.itemstatus = e.currentTarget.dataset.itemstatus;
  215. _this.modalName = e.currentTarget.dataset.target;
  216. },
  217. hideModal: function(e) {
  218. _this.modalName = null;
  219. },
  220. statusChange: function(e) {
  221. let origin_status = _this.itemstatus;
  222. _this.itemstatus = e.detail.value;
  223. if (_this.itemstatus <= origin_status) {
  224. uni.showModal({
  225. title: '信息提示',
  226. content: '状态只能往下面的选',
  227. showCancel: false
  228. });
  229. _this.itemstatus = String(origin_status);
  230. _this.modalName = null;
  231. return false;
  232. }
  233. _this.$req.ajax({
  234. path: "wcomjobs/statuslog",
  235. data: {
  236. userid: _this.userinfo.id,
  237. workerid: _this.workerinfo.id,
  238. logid: _this.itemlogid,
  239. status: _this.itemstatus
  240. }
  241. }).then((data) => {
  242. _this.modalName = null;
  243. _this.plist[_this.itemindex] = data.comjobslog;
  244. }).catch((err) => {
  245. uni.showModal({
  246. title: '信息提示',
  247. content: err,
  248. showCancel: false
  249. });
  250. });
  251. },
  252. delComlog: function(e) {
  253. var itemlogid = e.currentTarget.dataset.itemlogid;
  254. var itemindex = e.currentTarget.dataset.itemindex;
  255. uni.showModal({
  256. title: '信息提示',
  257. content: '删除后不可恢复,确定要删除吗?',
  258. success: function(res) {
  259. if (res.confirm) {
  260. _this.$req.ajax({
  261. path: "wcomjobs/dellog",
  262. data: {
  263. userid: _this.userinfo.id,
  264. workerid: _this.workerinfo.id,
  265. logid: itemlogid
  266. }
  267. }).then((data) => {
  268. _this.modalName = null;
  269. _this.plist.splice( itemindex, 1 );
  270. }).catch((err) => {
  271. uni.showModal({
  272. title: '信息提示',
  273. content: err,
  274. showCancel: false
  275. });
  276. });
  277. }
  278. }
  279. });
  280. },
  281. makeTelephone: function(e) {
  282. var telephone = e.currentTarget.dataset.telephone;
  283. uni.makePhoneCall({
  284. phoneNumber: telephone
  285. });
  286. }
  287. }
  288. }
  289. </script>
  290. <style>
  291. .cu-list.menu-avatar>.cu-item .content {
  292. width: calc(100% - 96rpx - 60rpx - 170rpx - 20rpx);
  293. }
  294. .cu-list.menu-avatar>.cu-item .action {
  295. text-align: right;
  296. width: 150rpx;
  297. }
  298. </style>