collector.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. <template>
  2. <view class="collector">
  3. <u-navbar ref="uNavbar" :border-bottom="false" :title-width="340" :back-icon-color="setNav.backColor" :is-back="setNav.isdisPlayNavTitle"
  4. :title-size="setNav.size" :title-bold="setNav.bold" :title="setNav.navTitle" :title-color="setNav.color" :background="setNav"></u-navbar>
  5. <view class="title">
  6. 当前还 <text>{{notRead}}人</text> 未读
  7. </view>
  8. <view class="table">
  9. <view class="thead">
  10. <view class="tr">
  11. <view class="th check-th"></view>
  12. <view class="th">负责人</view>
  13. <view class="th">单位</view>
  14. <view class="th">开始时间</view>
  15. <view class="th">结束时间</view>
  16. </view>
  17. </view>
  18. <!-- <checkbox-group @change="checkboxChange"> -->
  19. <view class="tbody" v-if="data.length">
  20. <view class="tr" v-for="(item, index) in data" :key="index">
  21. <!-- <view class="">
  22. <checkbox :value="String(item.id)" :checked="item.checked" color="#fff" />
  23. </view> -->
  24. <view class="td check-td check">
  25. <image v-if="!item.checked" @click="selected(item)" class="normal" src="../../../static/img/icon_qx_normal.png"></image>
  26. <image v-else class="selected" @click="selected(item)" src="../../../static/img/icon_qx_selected.png"></image>
  27. </view>
  28. <view class="td">
  29. {{item.receive_user_name}}
  30. </view>
  31. <view class="td">
  32. {{item.receive_dept_name}}
  33. </view>
  34. <view class="td">
  35. {{item.send_message_time}}
  36. </view>
  37. <view class="td">
  38. {{item.receive_time == null ? '未结束' : item.receive_time}}
  39. </view>
  40. </view>
  41. </view>
  42. <!-- </checkbox-group> -->
  43. <view class="no-data" v-else>暂无数据</view>
  44. </view>
  45. <view class="btns" v-if="data.length">
  46. <view class="left" @click="allchange()">
  47. <view class="check">
  48. <image v-if="!checked" class="normal" src="../../../static/img/icon_qx_normal.png"></image>
  49. <image v-else class="selected" src="../../../static/img/icon_qx_selected.png"></image>
  50. </view>
  51. <view>全选</view>
  52. <!-- <checkbox-group @change=""> -->
  53. <!-- <label class="check-td">
  54. <checkbox value="all" :checked="" color="#fff" />全选
  55. </label> -->
  56. <!-- </checkbox-group> -->
  57. </view>
  58. <view class="right" @click="insertList">
  59. 催收文
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. export default {
  66. data() {
  67. return {
  68. checked: false,
  69. setNav: {
  70. backgroundColor: '#fff', //背景色
  71. color: '#333', //字体颜色
  72. bold: true,
  73. size: '36',
  74. backColor: '#333',
  75. isdisPlayNavTitle: true, //是否显示返回按钮
  76. navTitle: '选择催收文人员' //导航标题
  77. },
  78. data: [],
  79. total: 0,
  80. notRead: 0,
  81. pageNo: 1
  82. }
  83. },
  84. onReachBottom() {
  85. if (this.data.length >= this.total) {
  86. return
  87. }
  88. this.pageNo += 1
  89. this.statistic()
  90. },
  91. onLoad(options) {
  92. this.id = options.id
  93. this.statistic()
  94. this.init()
  95. },
  96. methods: {
  97. selected(item) {
  98. item.checked = !item.checked
  99. },
  100. async insertList() {
  101. let data = []
  102. this.data.forEach(item => {
  103. if (item.checked) {
  104. data.push({
  105. "message_id": item.message_id,
  106. "message_title": item.message_title,
  107. "send_user_name": item.send_user_name,
  108. "send_user_id": item.send_user_id,
  109. "message_time": item.send_message_time,
  110. "receive_user_id": item.receive_user_id,
  111. "receive_user_name": item.receive_user_name
  112. })
  113. }
  114. })
  115. if (!data.length) {
  116. return uni.showToast({
  117. title: '请勾选催收人员'
  118. })
  119. }
  120. let res = await this.$u.post('boman-web-core/p/cs/insertList', {
  121. "tableName": "urge_read_message",
  122. "dataList": data
  123. })
  124. if (res.code == 200) {
  125. uni.showToast({
  126. title: '催收成功',
  127. duration: 2500
  128. })
  129. this.pageNo = 1
  130. this.statistic()
  131. this.init()
  132. this.checked = false
  133. } else {
  134. uni.showToast({
  135. title: res.msg,
  136. icon: 'none',
  137. duration: 2000
  138. })
  139. }
  140. },
  141. async statistic() {
  142. //
  143. let res = await this.$u.post('boman-web-core/p/cs/queryList', {
  144. "table": "boman_message_receive",
  145. "pageNo": this.pageNo,
  146. "isUi": false,
  147. "pageSize": 10,
  148. "orderBy": "status desc",
  149. "fixedData": {
  150. "condition": {
  151. "visible": "Y",
  152. "message_id": this.id,
  153. "status":"N",
  154. "is_del":"N"
  155. }
  156. }
  157. })
  158. if (res.data && res.data.rows) {
  159. res.data.rows = res.data.rows.map(item => {
  160. return Object.assign({}, item, {
  161. checked: false
  162. })
  163. })
  164. if (this.pageNo == 1) {
  165. this.data = res.data.rows
  166. this.total = res.data.total
  167. } else {
  168. this.data = this.data.concat(res.data.rows)
  169. }
  170. }
  171. },
  172. async init() {
  173. //
  174. let res = await this.$u.get('boman-web-core/messageReceive/recieve/statistic/'+ this.id)
  175. if (res.code == 200) {
  176. this.notRead = res.data.notRead
  177. }
  178. },
  179. checkboxChange: function(e) {
  180. var items = this.data,
  181. values = e.detail.value;
  182. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  183. const item = items[i]
  184. if (values.includes(String(item.id))) {
  185. this.$set(item, 'checked', true)
  186. } else {
  187. this.$set(item, 'checked', false)
  188. }
  189. }
  190. },
  191. allchange(e) {
  192. var items = this.data,
  193. values = this.checked;
  194. if (!values) {
  195. this.checked = true
  196. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  197. const item = items[i]
  198. this.$set(item, 'checked', true)
  199. }
  200. } else {
  201. this.checked = false
  202. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  203. const item = items[i]
  204. this.$set(item, 'checked', false)
  205. }
  206. }
  207. }
  208. }
  209. }
  210. </script>
  211. <style lang="scss" scoped>
  212. .collector {
  213. width: 100%;
  214. height: 100%;
  215. background: #fff;
  216. /deep/ .u-navbar-inner {
  217. box-shadow: none;
  218. }
  219. .title {
  220. height: 56rpx;
  221. background: #FFFFFF;
  222. line-height: 56rpx;
  223. box-shadow: 0px 6rpx 4rpx 0px rgba(218, 218, 218, 0.35);
  224. font-size: 24rpx;
  225. color: #343434;
  226. padding-left: 32rpx;
  227. text {
  228. color: #FF3131;
  229. margin: 0 12rpx;
  230. }
  231. }
  232. .btns {
  233. position: fixed;
  234. bottom: 0;
  235. height: 84rpx;
  236. display: flex;
  237. width: 100%;
  238. border-top: 1px solid #E5E5E5;
  239. /deep/ .left {
  240. width: 190rpx;
  241. background: #FFFFFF;
  242. text-align: center;
  243. font-size: 28rpx;
  244. font-weight: 500;
  245. color: #343434;
  246. line-height: 84rpx;
  247. display: flex;
  248. align-items: center;
  249. justify-content: center;
  250. image {
  251. margin-right: 10rpx;
  252. }
  253. uni-checkbox {
  254. margin-right: 20rpx;
  255. }
  256. }
  257. .right {
  258. flex: 1;
  259. background: #009FE8;
  260. color: #fff;
  261. text-align: center;
  262. line-height: 84rpx;
  263. }
  264. }
  265. .table {
  266. .tr {
  267. display: flex;
  268. .th,
  269. .td {
  270. flex: 1;
  271. text-align: center;
  272. display: flex;
  273. justify-content: center;
  274. align-items: center;
  275. }
  276. .td {
  277. padding: 20rpx 4rpx;
  278. font-size: 20rpx;
  279. color: #333333;
  280. border-bottom: 1px solid #E5E5E5;
  281. }
  282. }
  283. .thead {
  284. padding: 33rpx 0;
  285. font-size: 24rpx;
  286. font-weight: bold;
  287. color: #333333;
  288. }
  289. }
  290. /deep/ .check-td,
  291. .check-th {
  292. max-width: 8%;
  293. .uni-checkbox-input {
  294. margin: 0 auto;
  295. width: 0rpx;
  296. height: 0rpx;
  297. padding: 12rpx;
  298. &.uni-checkbox-input-checked {
  299. background-color: #009FE8;
  300. border: 1px solid #009FE8;
  301. }
  302. &.uni-checkbox-input-checked:before {
  303. font-size: 20rpx;
  304. }
  305. }
  306. }
  307. .check {
  308. .normal,
  309. .selected {
  310. width: 30rpx;
  311. height: 30rpx;
  312. }
  313. }
  314. }
  315. </style>