index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. <!-- 工单列表 -->
  2. <template>
  3. <view class="my_bg">
  4. <view style="background-color: #ffffff;">
  5. <!-- 顶部tab栏 -->
  6. <view class="nav">
  7. <view @click="change_status(index)" :style="'border-color:'+item.color+';'"
  8. :class="index==status_arr_index?'bar_view_focus':'bar_view'" :key="index"
  9. v-for="(item, index) in status_arr">
  10. <image style="width: 98upx;height: 98upx;" :src="serverUrlImg+'order'+(index+1)+'.png'"></image>
  11. <view :style="'color:'+(status_arr_index==index?item.color:'#B7BECF')+';'">
  12. {{item.name}}
  13. </view>
  14. <view v-if="status_num_arr[index]!=0" class="bar_view_num">{{status_num_arr[index]}}</view>
  15. </view>
  16. </view>
  17. <!-- 小状态筛选 -->
  18. <view v-if="status_arr[status_arr_index]['children']" style="margin: 6upx;margin-top: 10upx;"
  19. class="type_child_box">
  20. <view :key="index" :class="order_status_child==index?'type_child_focus':'type_child'"
  21. @click="change_status_child(index)"
  22. v-for="(item, index) in status_arr[status_arr_index]['children']">
  23. {{item.name}}
  24. <view v-if="status_arr_index==4"
  25. :class="order_status_child==index?'type_child_focus2':'type_child2'">
  26. {{user_info[item.key]>0?('+'+user_info[item.key]):''}}
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- 主数据 -->
  32. <view class="t_show">
  33. <view class="loading_text" v-if="loading">加载中...</view>
  34. <view v-else>
  35. <view class="each_data" style="position: relative;margin-top: 20upx;margin-bottom: 25upx;" :key="index"
  36. v-for="(item, index) in data">
  37. <navigator :url="'/pages/order/detail?detailType=1&id='+item.biz_recruitid+'&orderId='+item.id"
  38. style="width: 92%;font-size: 30upx;border-bottom: 1rpx solid #cfd6e3;padding:15upx 4%;"
  39. class="nowrap">{{item.recruit_title}}</navigator>
  40. <!-- 工单显示 区域-->
  41. <view style="margin-left: 2%;margin-top: 10upx;" class="order_box">
  42. <view style="color: #FF663D;font-weight: bold;text-align: right;" v-if="status_arr_index==2">
  43. 等待商家结算</view>
  44. <view v-else style="color: #FF663D;font-weight: bold;text-align: right;">
  45. {{item.statusName||item.teamstatusName}}{{item.salary_status==1?'(部分结算)':''}}
  46. </view>
  47. <view v-if="item.tdwk_settlecatalogName" style="color: #FF663D;font-weight: bold;">
  48. 结算类别:{{item.tdwk_settlecatalogName}}</view>
  49. <view style="display: flex;">
  50. 报名类型:{{item.urgent_level==1?'今日零工':'完工即结'}}
  51. <navigator :url="'../personal/myGroupsDetail?catalog=3&id='+item.workteamid"
  52. style="margin-left: 10upx;color: #00c0c6;" v-if="item.workteam_mode!=0">查看报名人员
  53. </navigator>
  54. </view>
  55. <view>
  56. 上班日期:{{item.plan_dotime}}
  57. </view>
  58. <view>开始结束时间:
  59. <text
  60. v-if="item.btr_settle_catalog==0">{{((item.btr_begindatetime==item.btr_finishdatetime)||!item.btr_finishdatetime)?item.btr_begindatetime.slice(5):(item.btr_begindatetime.slice(5)+'~'+item.btr_finishdatetime.slice(5))}}</text>
  61. <text v-else>{{item.btr_begindatetime.slice(5)+'开始报名'}}</text>
  62. <text style="margin-left: 6upx;">{{item.btr_begin_hour+'~'+item.btr_finish_hour}}</text>
  63. </view>
  64. <view v-if="item.worked_begintime||item.worked_finishtime"
  65. style="background-color: #f9f9f9;padding: 5upx 0;">
  66. <view style="">开始工作时间:{{item.worked_begintime}}
  67. </view>
  68. <view style="">
  69. 结束工作时间:{{item.worked_finishtime}}</view>
  70. </view>
  71. <view style="color: #999999;">{{item.remark}}</view>
  72. <view class="order_btn_box" v-if="status_arr_index==0">
  73. <view>
  74. <view
  75. @click="open_modal('enrollCancel',item.workteam_mode!=0?item.workteamid: item.id,item.workteam_mode!=0?1:0)"
  76. class="cancel">取消报名</view>
  77. </view>
  78. </view>
  79. <view style="padding: 20upx 0 10upx;" v-if="status_arr_index==3">
  80. <!-- 商家对我的评价 -->
  81. <view style="width: 100%;" v-if="item.td_appraiseLevel!=-1">
  82. <view v-if="item.td_appraiseLevel">
  83. <view style="display: flex;align-items: center;height: 50upx;">
  84. <view style="margin-right: 10upx;color: #ff5500;">商家对我的评价</view>
  85. <trailerStars allowTap="0" :innerScore="item.td_appraiseLevel">
  86. </trailerStars>
  87. </view>
  88. <view style="color: #8E97AE;margin-top: 0upx;">评价内容:
  89. {{item.td_appraiseRemark}}
  90. </view>
  91. </view>
  92. <view style="color: #ff5500;" v-else>待商家评价</view>
  93. </view>
  94. <!-- 我的评价 -->
  95. <view style="width: 100%;margin-top: 20upx;" v-if="item.wk_appraiseLevel!=-1">
  96. <view v-if="item.wk_appraiseLevel">
  97. <view style="display: flex;align-items: center;height: 50upx;">
  98. <view style="margin-right: 10upx;color: #ff5500;">我的评价</view>
  99. <trailerStars allowTap="0" :innerScore="item.wk_appraiseLevel">
  100. </trailerStars>
  101. </view>
  102. <view style="color: #8E97AE;margin-top: 0upx;">评价内容:
  103. {{item.wk_appraiseRemark}}
  104. </view>
  105. </view>
  106. <view style="display: flex;" v-else>
  107. <view @click="open_modal('appraise',item.id)" class="confirm">评价该商家</view>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="order_btn_box" v-if="status_arr_index==1">
  112. <view v-if="order_status_child==0">
  113. <view @click="open_modal('startWork',item.id)" class="confirm">开始工作</view>
  114. </view>
  115. <view v-if="order_status_child==1">
  116. <view @click="open_modal('finishWork',item.id)" class="cancel">完成工作</view>
  117. </view>
  118. </view>
  119. <view class="order_btn_box" v-if="status_arr_index==2&&item.btr_settle_mode==0">
  120. <view @click="open_modal('showQRCode',item.payqr, 0, item.id)" class="confirm">显示核销二维码
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. <view class="loading_text" v-if="data.length==0&&!loading">暂无数据</view>
  127. </view>
  128. <!-- 遮罩内容 -->
  129. <uni-popup ref="popup" :mask-click="false">
  130. <view v-if="todo!='showQRCode'" style="overflow: hidden;" class="modal_box">
  131. <view v-if="status_arr_index==3" style="margin-top: 30upx;margin-left: 30upx;">
  132. <trailerStars allowTap="1" v-on:changeScore="changeScore" :innerScore="score">
  133. </trailerStars>
  134. </view>
  135. <view style="margin-top: 30upx;">
  136. <textarea v-model="reason" @input="textarea_ipt" style="text-indent: 20upx;"
  137. :placeholder="todo_remarks"></textarea>
  138. <view class="modal_btn">
  139. <view @click="close_modal()" class="modal_btn_cancel">取消</view>
  140. <view @click="process()" class="modal_btn_confirm">确认{{todo_title}}</view>
  141. </view>
  142. </view>
  143. </view>
  144. <view v-else style="overflow: hidden;text-align: center;" class="modal_box">
  145. <image style="width: 400upx;height: 400upx;margin-top: 30upx;" :src="qrcode">
  146. </image>
  147. <view style="justify-content: space-around;" class="modal_btn">
  148. <view @click="test_is_set()" class="modal_btn_cancel">关闭</view>
  149. </view>
  150. </view>
  151. </uni-popup>
  152. </view>
  153. </template>
  154. <script>
  155. import commonData from '../../commonData.js'
  156. import commonFun from '../../commonFun.js'
  157. import trailerStars from '../../components/starts/index.vue'
  158. export default {
  159. data() {
  160. return {
  161. serverUrlImg: this.serverUrl + 'show/',
  162. loading: false, //加载中...
  163. status_arr_index: 0, //数据状态列的当前索引
  164. order_status_child: 0, //招聘列表小状态index
  165. status_arr: commonData.order_status_arr_merchant, //订单类型数组
  166. data: [],
  167. workId: '',
  168. todo_title: '',
  169. todo_remarks: '',
  170. todo: '',
  171. reason: '',
  172. score: 5,
  173. qrcode: '', //核销二维码
  174. teamid: '', //组团取消的团组id
  175. picurls: '',
  176. is_group: 0,
  177. user_info: {},
  178. status_num_arr: [0, 0, 0, 0, 0],
  179. current_id: '',
  180. };
  181. },
  182. methods: {
  183. // 检测是否已结算
  184. test_is_set() {
  185. uni.showLoading({
  186. title: '加载中...',
  187. mask: true
  188. })
  189. let params = {
  190. bizCatalog: 'TodoWorkEntity',
  191. handleMode: 'fetch',
  192. workid: this.current_id,
  193. }
  194. commonFun.requestUrl('&WsAjaxBiz=Worker&WsAjaxAction=entityDataHandle', params, res => {
  195. if (res.status) {
  196. console.log('检测是否已结算', res.data)
  197. uni.hideLoading()
  198. if (res.data.Result.status == 4) {
  199. uni.showModal({
  200. title: '商家未结算',
  201. confirmText: '关闭',
  202. showCancel: false,
  203. success: () => {
  204. this.close_modal()
  205. }
  206. })
  207. } else {
  208. this.change_status(3)
  209. this.close_modal()
  210. }
  211. } else {
  212. this.close_modal()
  213. }
  214. })
  215. },
  216. // 获取个人信息
  217. get_info() {
  218. commonFun.get_user_info(res => {
  219. if (res.status) {
  220. uni.hideLoading()
  221. let user_info = res.data.Result
  222. this.user_info = user_info
  223. // 右上角红点数字
  224. this.status_num_arr = [
  225. this.user_info.ss_waitEnrollTotal,
  226. this.user_info.ss_workingTotal,
  227. this.user_info.ss_waitSettleTotal,
  228. 0,
  229. this.user_info.ss_unreadWKTotal_ALL,
  230. ]
  231. uni.setStorageSync('USER_INFO', this.user_info)
  232. console.log('工单页面获取个人信息', this.user_info)
  233. }
  234. })
  235. },
  236. // 输入操作备注
  237. textarea_ipt(e) {
  238. this.reason = e.target.value
  239. },
  240. // 打开遮罩
  241. open_modal(todo, workId, is_group = 0, current_id = '') {
  242. this.is_group = is_group
  243. this.todo = todo
  244. this.$refs.popup.open('top')
  245. if (todo == 'showQRCode') {
  246. this.qrcode = commonFun.serverUrlReq + workId
  247. this.current_id = current_id
  248. console.log('核销二维码路径', this.qrcode)
  249. } else {
  250. if (is_group == 1) {
  251. this.teamid = workId
  252. } else {
  253. this.workId = workId
  254. this.teamid = 0
  255. }
  256. this.todo_remarks = commonData.todo_title_obj[todo]['remarks'] + (commonData.todo_title_obj[todo][
  257. 'is_require'
  258. ] ?
  259. '(必填)' : '')
  260. this.todo_title = commonData.todo_title_obj[todo]['title']
  261. }
  262. },
  263. // 关闭遮罩
  264. close_modal() {
  265. this.$refs.popup.close('top')
  266. },
  267. // 处理
  268. process() {
  269. let params = {
  270. bizCatalog: 'TodoWorkEntity',
  271. handleMode: commonData.todo_title_obj[this.todo]['handleMode'],
  272. todo: commonData.todo_title_obj[this.todo]['todo'],
  273. remark: this.reason,
  274. reason: this.reason,
  275. workid: this.workId,
  276. appraiseLevel: this.score,
  277. appraiseRemark: this.reason,
  278. }
  279. if (this.is_group == 1) {
  280. params.teamid = this.teamid
  281. } else {
  282. params.workId = this.workId
  283. params.workIds = [this.workId]
  284. }
  285. if (this.status_arr_index == 3 && this.score == 0) {
  286. uni.showModal({
  287. content: '请对会员进行评分',
  288. showCancel: false
  289. })
  290. return
  291. }
  292. if (commonData.todo_title_obj[this.todo]['is_require'] && params.reason == '') {
  293. uni.showModal({
  294. content: commonData.todo_title_obj[this.todo]['title'] + '备注是必填的!',
  295. showCancel: false
  296. })
  297. return
  298. }
  299. console.log('处理请请求参数', params)
  300. uni.showLoading({
  301. title: '加载中...',
  302. mask: true
  303. })
  304. commonFun.requestUrl('&WsAjaxBiz=Worker&WsAjaxAction=entityDataHandle', params, res => {
  305. if (res.status) {
  306. uni.showModal({
  307. content: this.todo_title + '成功!',
  308. showCancel: false,
  309. success: res => {
  310. this.reason = ''
  311. this.close_modal()
  312. if (this.todo == 'startWork') {
  313. this.order_status_child = 1
  314. }
  315. if (this.todo == 'finishWork') {
  316. this.status_arr_index = 2
  317. this.order_status_child = 0
  318. }
  319. this.get_data()
  320. }
  321. })
  322. }
  323. uni.hideLoading()
  324. })
  325. },
  326. // 评价星星回调
  327. changeScore(e) {
  328. this.score = e
  329. },
  330. // 获取数据
  331. get_data() {
  332. this.get_info()
  333. this.loading = true
  334. uni.showLoading({
  335. title: '加载中...',
  336. mask: true
  337. })
  338. let children = this.status_arr[this.status_arr_index]['children']
  339. let params = {
  340. bizCatalog: 'TodoWorkEntity',
  341. handleMode: 'fetchall',
  342. pageIndex: 1,
  343. pageSize: 1000,
  344. orderby: 0,
  345. query: {
  346. recuritStatus: 3,
  347. status: children ? children[this.order_status_child]['wkstatus'] : this.status_arr[this
  348. .status_arr_index]['wkstatus'],
  349. teamrole: "", //0空-全部;1-单报项;2-所有团项;3-开团项;4-参团项;
  350. teamstatus: "", //0空-全部;1-待参团;2-已提交参团待审核;3-已审核入团;4-参团被驳回;5-参团被踢出;6-已解散;7-被动取消;
  351. recuritTitle: '', //招聘标题筛选
  352. memberName: "", //成员姓名
  353. },
  354. }
  355. console.log('我的工单列表请求参数', params)
  356. commonFun.requestUrl('&WsAjaxBiz=Worker&WsAjaxAction=fetchPageData', params, res => {
  357. if (res.status) {
  358. this.data = res.data.Result.pageData
  359. this.check_box = this.data.map(item => false)
  360. console.log('我的工单获取数据列表', this.data)
  361. }
  362. this.loading = false
  363. uni.hideLoading()
  364. uni.stopPullDownRefresh()
  365. })
  366. },
  367. // 修改大状态列
  368. change_status(index) {
  369. this.status_arr_index = index
  370. this.order_status_child = 0
  371. this.get_data()
  372. },
  373. //招聘信息阶段小状态筛选
  374. change_status_child(index) { //招聘信息阶段小状态筛选
  375. this.order_status_child = index
  376. this.get_data()
  377. },
  378. },
  379. components: {
  380. trailerStars
  381. },
  382. onLoad(e) {
  383. this.status_arr_index = Number(e.status) || 0
  384. this.get_data()
  385. },
  386. onPullDownRefresh() {
  387. this.get_data()
  388. },
  389. };
  390. </script>
  391. <style>
  392. @import url("./index.css");
  393. </style>