index.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102
  1. <template>
  2. <view class="uni-container uni-container-bg">
  3. <!-- 搜索框 -->
  4. <!-- <uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
  5. <uni-col :span="24">
  6. <view class="u-page__tag-item">
  7. <u-search :showAction="true" placeholder="请输入" bgColor="#edf6f9" borderColor="#4cb2b6"
  8. v-model="keyword" @search="handleQuery" @custom="handleQuery(keyword)"></u-search>
  9. </view>
  10. </uni-col>
  11. </uni-row> -->
  12. <view class="top">
  13. <view>
  14. <view class="search-time">
  15. <!-- <text class="time-item">开始时间:</text> -->
  16. <uni-datetime-picker class="time-item-check" type="daterange" v-model="datetimerange" />
  17. </view>
  18. <!-- <view class="search-time">
  19. <text class="time-item">结束时间:</text>
  20. <uni-datetime-picker class="time-item-check" type="date" v-model="endSingle" />
  21. </view> -->
  22. </view>
  23. <view class="search-icon">
  24. <u-icon name="search" color="#4CB2B6" size="30" @click="handleQuery"></u-icon>
  25. </view>
  26. </view>
  27. <view style="margin-bottom: 20rpx;">
  28. <u-tabs :list="items" @click="onClickItem" activeStyle="color:#4CB2B6" inactiveStyle="color:#000"
  29. :current="current" :scrollable="true" lineWidth="60" lineColor="#4CB2B6"></u-tabs>
  30. <view style="height: 2rpx;background-color: #E5E5E5;margin-top: 10rpx;"></view>
  31. </view>
  32. <view v-if="current == 0">
  33. <view class="" v-if="tableData.length>0">
  34. <uni-card v-for="(item, index) in tableData" :key="index" class="last-margin">
  35. <view class="titles">{{item.taskName}}</view>
  36. <view style="" v-if="item.taskContent">
  37. <span class="name-align-task">任务说明:</span>
  38. <span class="uni-ellipsis-set">{{item.taskContent?item.taskContent:''}}</span>
  39. </view>
  40. <!-- <text class="conts">{{item.taskContent}}</text> -->
  41. <!-- <view class="">
  42. <rich-text :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
  43. </view> -->
  44. <view class="">
  45. <span class="name-align-task">接收时间:</span>
  46. <span>{{item.createTime}}</span>
  47. </view>
  48. <view class="an-niu">
  49. <text @click="addClickDetail(item.broadId)" class="detail">查看详情</text>
  50. <text v-if="item.isforward" class="solve forword">已转发</text>
  51. <text @click="addClickModify(item)" v-else class="solve">去完成</text>
  52. <text @click="forward(item)" class="solve">转发任务</text>
  53. </view>
  54. </uni-card>
  55. </view>
  56. <view style="text-align: center;" v-else>
  57. <view class="text-gray" style="padding-top: 20px;"> 暂无检查任务 </view>
  58. </view>
  59. <view>
  60. <image :src="Group" @click="addClick" class="tiantupian"></image>
  61. </view>
  62. </view>
  63. <view v-if="current == 1">
  64. <view class="" v-if="tableData.length>0">
  65. <uni-card v-for="(item, index) in tableData" :key="index" class="last-margin">
  66. <view class="titles">{{item.taskName}}</view>
  67. <view style="float: left;width: 130rpx;" v-if="item.taskContent">任务说明:</view>
  68. <view>
  69. <rich-text :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
  70. </view>
  71. <view class="">
  72. <text class="name-align-task">接收时间:</text>{{item.createTime}}
  73. </view>
  74. <view class="an-niu">
  75. <text @click="addClickDetail(item.broadId)" class="detail">查看详情</text>
  76. <text class="solve" style="background-color:#3491FA">待审核</text>
  77. </view>
  78. </uni-card>
  79. </view>
  80. <view style="text-align: center;" v-else>
  81. <view class="text-gray" style="padding-top: 20px;" > 暂无检查任务 </view>
  82. <!-- <view class="" style="padding-top: 40px;width: 120px;">
  83. <image :src="jiezhiTime" @click="addClick" class="caogaoxiang"></image>
  84. </view> 草稿箱-->
  85. </view>
  86. <view>
  87. <image :src="Group" @click="addClick" class="tiantupian"></image>
  88. </view>
  89. </view>
  90. <!-- 已发布 -->
  91. <view v-if="current ==2">
  92. <view class="" v-if="tableData.length!=0">
  93. <uni-card v-for="(item, index) in tableData" :key="index" class="last-margin">
  94. <view class="titles">{{item.taskName}}</view>
  95. <view class="">
  96. <view style="float: left;" class="name-align-task" >任务说明:</view>
  97. <rich-text :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
  98. </view>
  99. <!-- <view class="">
  100. 时间:{{item.createTime}}
  101. </view> -->
  102. <view><text class="name-align-task" >接收单位:</text>{{item.orgId}}</view>
  103. <view><text class="name-align-task" >接收人员:</text>{{item.receiverName}}</view>
  104. <view><text class="name-align-task" >发送者:</text>{{item.senderName}}</view>
  105. <view class="buju" style="display: flex;justify-content: space-between;align-items: center;">
  106. <view><text class="name-align-task" >发布时间:</text>{{item.createTime}}</view>
  107. <view class="an-niu">
  108. <text @click="showModal(item.id,item.broadId)" class="detail"
  109. v-if="item.taskStatus==2">审核</text>
  110. <text @click="addClickDetail(item.broadId)" class="solve"
  111. v-if="item.taskStatus==1||2">查看详情</text>
  112. </view>
  113. </view>
  114. </uni-card>
  115. </view>
  116. <view style="text-align: center;">
  117. <view class="text-gray" style="padding-top: 20px;" v-if="tableData.length==0"> 暂无检查任务 </view>
  118. </view>
  119. <view>
  120. <image :src="Group" @click="addClick" class="tiantupian"></image>
  121. </view>
  122. <u-modal title="审核是否通过" :show="showShenHe" showCancelButton closeOnClickOverlay confirmText="审核通过"
  123. cancelText="审核不通过" @confirm="confirm" :closeOnClickOverlay="true" @cancel="cancel" @close="close">
  124. </u-modal>
  125. </view>
  126. <!-- 草稿箱 -->
  127. <view v-if="current == 3">
  128. <!-- <u-list @scrolltolower="scrolltolower">
  129. <u-list-item> -->
  130. <view class="" v-if="tableData.length!=0" class="last-margin">
  131. <uni-card v-for="(item, index) in tableData" :key="index">
  132. <view class="titles">{{item.taskName}}</view>
  133. <view style="float: left;width: 130rpx;" v-if="item.taskContent">任务说明:</view>
  134. <view class="">
  135. <rich-text :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
  136. </view>
  137. <view class="">
  138. <text class="name-align-task">创建时间:</text>{{item.createTime}}
  139. </view>
  140. <view class="an-niu">
  141. <!-- 发布任务以前是查看详情 -->
  142. <text @click="showToasts(item.id)" class="detail">发布任务</text>
  143. <text @click="goAddCheck(item.id)" class="solve">修改任务</text>
  144. <text @click="deletes(item.id)" class="deletes">删除</text>
  145. </view>
  146. </uni-card>
  147. </view>
  148. <view style="text-align: center;">
  149. <view class="text-gray" style="padding-top: 20px;" v-if="tableData.length==0"> 暂无检查任务 </view>
  150. </view>
  151. <view>
  152. <image :src="Group" @click="addClick" class="tiantupian"></image>
  153. </view>
  154. <!-- </u-list-item>
  155. </u-list> -->
  156. </view>
  157. <!-- 归档 -->
  158. <view v-if="current == 4">
  159. <view class="" v-if="tableData.length!=0">
  160. <uni-card v-for="(item, index) in tableData" :key="index" class="last-margin">
  161. <view class="titles">{{item.taskName}}</view>
  162. <view style="float: left;width: 130rpx;" v-if="item.taskContent">任务说明:</view>
  163. <view class="">
  164. <rich-text :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
  165. </view>
  166. <view class="">
  167. <text class="name-align-task">完成时间:</text>{{item.createTime}}
  168. </view>
  169. <view class="an-niu">
  170. <text @click="addClickDetail(item.broadId)" class="detail">查看详情</text>
  171. </view>
  172. </uni-card>
  173. </view>
  174. <view style="text-align: center;">
  175. <view class="text-gray" style="padding-top: 20px;" v-if="tableData.length==0"> 暂无检查任务 </view>
  176. </view>
  177. <view>
  178. <image :src="Group" @click="addClick" class="tiantupian"></image>
  179. </view>
  180. </view>
  181. <!-- 多选closeable closeOnClickOverlay--点击遮罩层不可关闭检查项的弹出内容选中 ,选择单位-->
  182. <!-- 支队大队进来转发任务显示单位,不能删 -->
  183. <!-- <u-popup :show="checkboxShow2" :round="10" @close="checkboxShow2=false" style="position: relative;">
  184. <view style="width: 100%;position: absolute;left:0;bottom:30rpx;z-index: 9999;">
  185. <uni-row>
  186. <uni-col :span='12'>
  187. <u-button shape="circle" type="primary" color="#4CB2B6" text="确定" @click="checkboxConfirm2">
  188. </u-button>
  189. </uni-col>
  190. <uni-col :span='12'>
  191. <u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle"
  192. @click="checkboxCancel2">
  193. </u-button>
  194. </uni-col>
  195. </uni-row>
  196. </view>
  197. <view class="page-body" :style="'height:' + height + 'px'">
  198. <scroll-view class="nav-left" scroll-y :style="'height:' + height + 'px'" :scroll-top="scrollLeftTop"
  199. scroll-with-animation>
  200. <view class="nav-left-item" :class="index == categoryActive ? 'active' : ''"
  201. v-for="(item, index) in list2" @click="categoryClickMain(index,item)" :key="index">
  202. {{ `单位${item.id}` }}
  203. </view>
  204. </scroll-view>
  205. <scroll-view class="nav-right" scroll-y :scroll-top="scrollTop" @scroll="scroll"
  206. :style="'height:' + height + 'px'" scroll-with-animation>
  207. <view v-for="(item, index) in list2" :key="index" class="box">
  208. <view style="height: 60rpx;font-size: 32rpx;color:#000;font-weight: 600;padding: 25rpx;">
  209. {{ `单位${item.id}` }}
  210. </view>
  211. <view class="nav-right-item">
  212. <u-checkbox-group size='20' iconSize='18' placement="row" iconPlacement='right'
  213. v-model="items.checkedList2" v-for="(items, i) in item.orgDOList" :key="i"
  214. @change="checkboxChange2(items.id,$event)">
  215. <u-checkbox activeColor="green" :customStyle="{marginBottom: '5px'}"
  216. :label="items.orgName" :name="items.id">
  217. </u-checkbox>
  218. </u-checkbox-group>
  219. </view>
  220. </view>
  221. </scroll-view>
  222. </view>
  223. </u-popup> -->
  224. <!-- 单位进来转发任务显示人员 -->
  225. <u-popup :show="checkboxShow2" :round="10" @close="checkboxShow2=false" style="position: relative;"
  226. mode="center">
  227. <view style="width: 90vw;padding: 10px;">
  228. <text class="text-xl">检查人员</text>
  229. <view class="" class="person-forward">
  230. <u-checkbox-group v-model="item.checkboxValue1" v-for="(item, index) in personInfo" :key="index"
  231. placement="column" @change="checkboxChange2(item.user_id,$event)" activeColor="#4CB2B6">
  232. <u-checkbox :customStyle="{marginBottom: '8px'}" :label="item.nickname" :name="item.user_id">
  233. </u-checkbox>
  234. </u-checkbox-group>
  235. </view>
  236. <view class="flex flex-direction-row " style="margin: 30rpx 0;">
  237. <u-button shape="circle" type="primary" color="#4CB2B6" text="确定" @click="checkboxConfirm2"
  238. customStyle="margin-right:20px;padding:0 30px">
  239. </u-button>
  240. <u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle" @click="checkboxCancel2"
  241. customStyle="padding:0 30px">
  242. </u-button>
  243. </view>
  244. </view>
  245. </u-popup>
  246. <!-- 加载中 -->
  247. <isLodingModel></isLodingModel>
  248. </view>
  249. </template>
  250. <script>
  251. import {
  252. getCheckActiveList,
  253. getCheckActivePendList, // 主动检查提交历史列表
  254. draftTask, //获取草稿箱任务列表
  255. taskList, //获取除草稿箱以外的列表
  256. saveCheckRelease, //发布任务
  257. deleteTask, //删除任务
  258. addCheckActiveCompany, //获取单位
  259. checkSubmitForwardTask, //确认转发任务
  260. checkGetPerson, //单位转发任务获取人员
  261. verifytask //审核
  262. } from "@/api/check_active";
  263. import {
  264. shijianc
  265. } from '@/utils/common.js'
  266. import config from '@/config'
  267. const baseUrlImg = config.baseUrlImg
  268. // import jiezhiTime from '@/static/images/checkActive/jiezhiTime.png'; //暂时用的草稿箱图片
  269. export default {
  270. data() {
  271. return {
  272. startSingle: '',
  273. endSingle: '',
  274. datetimerange:[],
  275. checkedList2: [], //检查单位已选择列表
  276. list2: [], //选择单位项目的数据
  277. Group: `${baseUrlImg}/checkActive/Group.png`,
  278. // jiezhiTime: jiezhiTime, //暂时用的草稿箱图片
  279. current: 0,
  280. items: [{
  281. name: '待完成'
  282. }, {
  283. name: '已完成'
  284. }, {
  285. name: '已发布'
  286. }, {
  287. name: '草稿箱'
  288. }, {
  289. name: '归档'
  290. }],
  291. tableData: [],
  292. // 每页数据量
  293. pageSize: 10,
  294. // 当前页
  295. pageNo: 1,
  296. // 数据总量
  297. total: 0,
  298. taskStatus: 0, //任务状态,0代表未执行刚建好,可修改,1表示已执行不能改
  299. // tableData数据加载中
  300. loading: false,
  301. // 初始化时搜索框的值
  302. keyword: '',
  303. // 开始时间与结束时间
  304. formData: {
  305. start: '请选择开始时间',
  306. end: '请选择结束时间',
  307. },
  308. showtimeStart: false,
  309. showtimeEnd: false,
  310. showShenHe: false,
  311. checkboxShow2: false, //待完成转发弹窗
  312. taskType: '',
  313. formdata: {
  314. pageNo: 1,
  315. pageSize: 10,
  316. creator: this.$store.state.user.id,
  317. taskStatus: 0,
  318. taskType: '',
  319. taskName: ''
  320. },
  321. ids: '', //当前点击转发任务的id
  322. FormDataTask: {
  323. "broadId": 0,
  324. "deptId": [],
  325. "id": 0,
  326. "orgId": [],
  327. "sender": this.$store.state.user.id,
  328. "receiver": [],
  329. "status": 0,
  330. "taskContent": "",
  331. "taskName": "",
  332. "taskStatus": 0,
  333. "taskType": "" //任务类型 1对应主动检查
  334. },
  335. personInfo: [], //转发任务的人员信息
  336. taskShen: 0, //审核通过状态改为3,不通过1
  337. taskId: 0,
  338. broad: 0,
  339. checkboxValue1: [], // u-checkbox-group的v-model绑定的值如果设置为某个checkbox的name,就会被默认选中
  340. //侧边栏联动
  341. height: 0,
  342. categoryActive: 0,
  343. scrollTop: 0,
  344. scrollLeftTop: 0,
  345. arr: [0, 584, 1168, 1752, 2336, 2805, 3274, 3858, 4442, 4911, 5380, 5734, 6203, 6672,
  346. 7017
  347. ], //初始值,后边计算会根据手机适配覆盖
  348. leftItemHeight: 51, //49行会计算出新值进行覆盖
  349. navLeftHeight: 0, //左边scroll-view 内层nav的总高度
  350. diff: 0, //左边scroll-view 内层nav的总高度与视口之差
  351. tabBarHeight: 0 //如果此页面为Tab页面,自己改变高度值,,一般tab高度为51
  352. }
  353. },
  354. watch: {
  355. loading: {
  356. handler(newLength, oldLength) {
  357. this.$modal.isLoadingModel(this.loading)
  358. },
  359. immediate: true
  360. }
  361. },
  362. // 在 vue页面,向起始页通过事件传递数据
  363. onLoad: function(option) {
  364. uni.setNavigationBarTitle({
  365. title: option.title
  366. })
  367. if (option.type) {
  368. this.FormDataTask.taskType = option.type
  369. this.taskType = option.type
  370. }
  371. if (option.current) {
  372. this.current = option.current
  373. }
  374. },
  375. onShow() {
  376. this.checkedTotal(this.pageNo)
  377. this.tableData = []
  378. this.getData(this.formData.pageNo)
  379. this.height = uni.getSystemInfoSync().windowHeight - this.tabBarHeight //设置侧边联动的高
  380. },
  381. mixins: [uni.$u.mixin],
  382. methods: {
  383. //搜索
  384. /** 搜索按钮操作 */
  385. /** 搜索按钮操作 */
  386. handleQuery() {
  387. // const end = new Date(this.endSingle).getTime()
  388. // const start = new Date(this.startSingle).getTime()
  389. // if (!this.endSingle && !this.startSingle) {
  390. // this.pageNo = 1;
  391. // this.tableData=[]
  392. // this.getData(1);
  393. // } else if (this.endSingle && this.startSingle && start <= end) {
  394. // // } else{
  395. this.pageNo = 1;
  396. this.tableData=[]
  397. this.getData(1);
  398. // } else if (start > end) {
  399. // this.$modal.msgError('结束时间不能小于事件时间')
  400. // } else {
  401. // this.$modal.msgError('请选择事件时间和结束时间')
  402. // }
  403. },
  404. //popup检查单位确定============
  405. checkboxConfirm2() {
  406. // this.checkedList2.map(v => { //选择检查单位,不能删,支队和大队时放开
  407. // v.map(i => {
  408. // this.FormDataTask.orgId.push(i)
  409. // })
  410. // })
  411. this.FormDataTask.receiver = this.checkedList2 //选择检查人员,不能删,支队和大队时放开
  412. checkSubmitForwardTask(JSON.stringify(this.FormDataTask)).then(response => {
  413. if (response.data) {
  414. this.$modal.msg('转发成功')
  415. this.checkboxShow2 = false
  416. this.tableData = []
  417. this.getData(this.pageNo)
  418. } else {
  419. this.$modal.msgError(response.msg)
  420. }
  421. })
  422. },
  423. //popup取消
  424. checkboxCancel2() {
  425. this.checkboxShow2 = false
  426. this.checkedList2 = []
  427. },
  428. checkboxChange2(i, n) {
  429. if (i && n.length != 0) {
  430. this.checkedList2.push(i)
  431. } else if (i && n.length == 0) {
  432. this.checkedList2 = this.checkedList2.filter(item => item != i)
  433. }
  434. },
  435. checkedTotal(pageNo, value = '') {
  436. // this.loading = true
  437. this.pageNo = pageNo
  438. const form = {
  439. // pageNo: this.pageNo,
  440. // pageSize: this.pageSize,
  441. userId: this.$store.state.user.id
  442. }
  443. addCheckActiveCompany( //获取所属单位
  444. form
  445. ).then(response => {
  446. this.list2 = response.data
  447. });
  448. },
  449. //========
  450. close() {
  451. this.showShenHe = false
  452. },
  453. //发布任务弹框
  454. showToasts(val) {
  455. saveCheckRelease({
  456. id: val
  457. }).then(response => {
  458. if (response.data) {
  459. this.tableData = []
  460. this.getData(this.pageNo)
  461. setTimeout(() => {
  462. uni.showToast({
  463. title: `发布成功`
  464. })
  465. }, 500)
  466. this.current = 2
  467. this.getData(this.pageNo)
  468. }
  469. })
  470. },
  471. //转发
  472. forward(val) { //展示转发的弹出层
  473. this.ids = val.id //当前点击任务的id
  474. this.checkboxShow2 = true
  475. this.FormDataTask.broadId = val.broadId
  476. this.FormDataTask.id = this.ids
  477. this.FormDataTask.taskName = val.taskName
  478. this.FormDataTask.taskStatus = val.taskStatus
  479. this.FormDataTask.taskContent = val.taskContent
  480. this.FormDataTask.orgId.push(val.orgId)
  481. checkGetPerson({
  482. orgId: val.orgId
  483. }).then(response => {
  484. this.personInfo = response.data
  485. })
  486. },
  487. //草稿箱删除
  488. deletes(val) {
  489. deleteTask({
  490. id: val
  491. }).then(response => {
  492. if (response.code == 0) {
  493. this.tableData = []
  494. this.getData(this.pageNo)
  495. uni.showToast({
  496. title: '删除成功',
  497. icon: "none"
  498. }, 200)
  499. }
  500. })
  501. },
  502. //审核模态框
  503. showModal(taskId, broad) {
  504. this.showShenHe = true
  505. this.taskId = taskId
  506. this.broad = broad
  507. },
  508. //审核通过
  509. confirm() {
  510. this.taskShen = 3
  511. this.showShenHe = false
  512. verifytask({
  513. taskId: this.taskId,
  514. broadId: this.broad,
  515. status: this.taskShen
  516. }).then(response => {
  517. if (response.data) {
  518. this.tableData = []
  519. this.current = 4
  520. this.getData(this.pageNo)
  521. }
  522. })
  523. },
  524. //审核不通过
  525. cancel() {
  526. this.taskShen = 1
  527. this.showShenHe = false
  528. verifytask({
  529. taskId: this.taskId,
  530. broadId: this.broad,
  531. status: this.taskShen
  532. }).then(response => {
  533. if (response.data) {
  534. this.tableData = []
  535. this.getData(this.pageNo)
  536. }
  537. })
  538. },
  539. //修改任务
  540. goAddCheck(val) {
  541. uni.navigateTo({
  542. url: `/pagesA/fire/check_active/add_check/add_check?id=${val}&type=${this.taskType}`
  543. })
  544. },
  545. //去完成
  546. addClickModify(val) {
  547. uni.navigateTo({
  548. url: `/pagesA/fire/check_active/check_implement/check_implement?id=${val.id}&broadId=${val.broadId}&orgId=${val.orgId}&type=${this.taskType}`,
  549. // url:'/pagesA/fire/xiangjiceshi/xiangjiceshi',
  550. success: function(res) {
  551. res.eventChannel.emit('acceptDataFromOpenerPage', val);
  552. }
  553. })
  554. },
  555. //查看详情
  556. addClickDetail(val) {
  557. uni.navigateTo({
  558. url: `/pagesA/fire/check_active/check_list/check_list?id=${val}&current=${this.current}`,
  559. success: function(res) {
  560. res.eventChannel.emit('acceptDataFromOpenerPage', val);
  561. }
  562. })
  563. },
  564. navigateBack() {
  565. uni.navigateBack()
  566. },
  567. // tab头部点击
  568. onClickItem(e) {
  569. if (this.current !== e.index) {
  570. this.current = e.index
  571. }
  572. this.tableData = []
  573. this.pageNo = 1
  574. this.getData(this.pageNo)
  575. },
  576. // 获取数据
  577. getData(pageNo, value = '') {
  578. this.loading = true;
  579. if (this.current == 3) { //获取草稿箱内的列表
  580. this.formdata = {
  581. pageNo: 1,
  582. pageSize: 10,
  583. userId: this.$store.state.user.id,
  584. taskStatus: 0,
  585. taskType: this.taskType,
  586. taskName: this.keyword,
  587. }
  588. this.formdata.pageNo = pageNo ? pageNo : 1;
  589. this.formdata.startTime=this.datetimerange[0]?this.datetimerange[0]+' 00:00:00':'';
  590. this.formdata.endTime=this.datetimerange[1]?this.datetimerange[1]+' 23:59:59':''
  591. const json = JSON.stringify(this.formdata)
  592. draftTask(json).then(response => {
  593. // 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
  594. this.tableData = [...this.tableData, ...response.data.list]
  595. this.tableData.map(i=>{
  596. i.createTime=i.createTime?shijianc(i.createTime):''
  597. })
  598. this.total = response.data.total
  599. this.loading = false;
  600. })
  601. } else {
  602. this.loading = true;
  603. if (this.current == 0) {
  604. this.formdata = {
  605. pageNo: 1,
  606. pageSize: 10,
  607. taskStatus: 1,
  608. receiver: this.$store.state.user.id,
  609. taskType: this.taskType,
  610. taskName: this.keyword,
  611. }
  612. this.List(pageNo)
  613. } else if (this.current == 1) {
  614. this.formdata = {
  615. pageNo: 1,
  616. pageSize: 10,
  617. taskStatus: 2,
  618. receiver: this.$store.state.user.id,
  619. taskType: this.taskType,
  620. taskName: this.keyword,
  621. }
  622. this.List(pageNo)
  623. } else if (this.current == 2) {
  624. this.formdata = {
  625. pageNo: 1,
  626. pageSize: 10,
  627. taskStatus: 1,
  628. sender: this.$store.state.user.id,
  629. taskType: this.taskType,
  630. taskName: this.keyword,
  631. }
  632. this.List(pageNo)
  633. this.formdata.taskStatus = 2
  634. this.List(pageNo)
  635. } else if (this.current == 4) {
  636. this.formdata = {
  637. pageNo: 1,
  638. pageSize: 10,
  639. taskStatus: 3,
  640. taskType: this.taskType,
  641. taskName: this.keyword,
  642. }
  643. this.List(pageNo)
  644. }
  645. }
  646. // this.loading = false
  647. },
  648. List(pageNo) { //getData共用的接口
  649. this.formdata.pageNo = pageNo ? pageNo : 1;
  650. this.formdata.startTime=this.datetimerange[0]?this.datetimerange[0]+' 00:00:00':'';
  651. this.formdata.endTime=this.datetimerange[1]?this.datetimerange[1]+' 23:59:59':''
  652. const json = JSON.stringify(this.formdata)
  653. taskList(json).then(response => {
  654. this.tableData = [...this.tableData, ...response.data.list]
  655. this.tableData.map(i=>{
  656. i.createTime=i.createTime?shijianc(i.createTime):''
  657. })
  658. this.total = response.data.total
  659. this.loading = false;
  660. })
  661. },
  662. onClick(val) {
  663. uni.navigateTo({
  664. url: '/pagesA/fire/check_active/check_details/check_details?id=' + val.id,
  665. events: {
  666. // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
  667. acceptDataFromOpenedPage: function(val) {},
  668. },
  669. success: function(res) {
  670. // 通过eventChannel向被打开页面传送数据
  671. res.eventChannel.emit('acceptDataFromOpenerPage', val)
  672. }
  673. })
  674. },
  675. addClick() {
  676. uni.navigateTo({
  677. url: `/pagesA/fire/check_active/add_check/add_check?type=${this.taskType}`
  678. })
  679. },
  680. //侧边栏导航联动
  681. getHeightList() {
  682. let _this = this;
  683. let selectorQuery = uni.createSelectorQuery();
  684. selectorQuery.selectAll('.nav-left-item').boundingClientRect(function(rects) {
  685. _this.leftItemHeight = rects[0].height;
  686. _this.navLeftHeight = _this.leftItemHeight * this.list.length;
  687. _this.diff = _this.navLeftHeight - _this.height;
  688. });
  689. selectorQuery.selectAll('.box').boundingClientRect(function(rects) {
  690. let arr = [0];
  691. let top = 0;
  692. if (rects) {
  693. rects.forEach(function(rect) {
  694. top += rect.height;
  695. arr.push(top);
  696. });
  697. };
  698. _this.arr = arr;
  699. }).exec();
  700. },
  701. scroll(e) {
  702. let _this = this;
  703. if (this.timeoutId) {
  704. clearTimeout(this.timeoutId);
  705. }
  706. this.timeoutId = setTimeout(function() {
  707. //节流
  708. _this.scrollHeight = e.detail.scrollTop + 1 + _this.height / 2;
  709. //+1不要删除,解决最后一项某种情况下翻到底部,左边按钮并不会切换至最后一个
  710. //若想使切换参考线为屏幕顶部请删除 _this.height/2
  711. for (let i = 0; i < _this.arr.length; i++) {
  712. let height1 = _this.arr[i];
  713. let height2 = _this.arr[i + 1];
  714. if (!height2 || (_this.scrollHeight >= height1 && _this.scrollHeight < height2)) {
  715. _this.categoryActive = i;
  716. _this.diff > 0 && (_this.scrollLeftTop = Math.round((_this.categoryActive * _this
  717. .diff) / (this.list.length - 1)));
  718. return false;
  719. }
  720. }
  721. _this.categoryActive = 0;
  722. _this.timeoutId = undefined;
  723. }, 10);
  724. },
  725. categoryClickMain(index, item) {
  726. this.categoryActive = index;
  727. this.scrollTop == this.arr[index] ? (this.scrollTop = this.scrollTop + 1) : (this.scrollTop = this.arr[
  728. index]); //防止两次相等造成点击不触发滚动时间
  729. }
  730. // 触底的事件
  731. // scrolltolower() {
  732. // // 判断是否还有下一页数据
  733. // if (this.formdata.pageNo * this.formdata.pageSize >= this.total) return uni.showToast({
  734. // title: `数据加载完毕`
  735. // })
  736. // // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  737. // if (this.loading) return
  738. // this.formdata.pageNo += 1
  739. // this.getData(this.formdata.pageNo)
  740. // },
  741. },
  742. // 触底的事件
  743. onReachBottom() {
  744. // 判断是否还有下一页数据
  745. if (this.pageNo * this.pageSize >= this.total) return uni.showToast({
  746. title: `数据加载完毕`
  747. })
  748. // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  749. if (this.loading) return
  750. this.pageNo += 1
  751. this.getData(this.pageNo)
  752. },
  753. }
  754. </script>
  755. <style>
  756. page {
  757. background-color: #F5F7F9;
  758. }
  759. </style>
  760. <style lang="scss" scoped>
  761. body {
  762. background-color: #F5F7F9;
  763. }
  764. /deep/ .u-tabs__wrapper[data-v-0de61367],
  765. .u-tabs__wrapper.data-v-0de61367,/deep/ .u-tabs__wrapper {
  766. width: 99%;
  767. }
  768. /deep/.u-tabs__wrapper__nav__item[data-v-0de61367],
  769. /deep/.u-tabs__wrapper__nav__item.data-v-0de61367,/deep/.u-tabs__wrapper__nav__item {
  770. padding: 0 60rpx;
  771. }
  772. .addInsp {
  773. width: 40px;
  774. position: fixed;
  775. right: 4px;
  776. z-index: 99999;
  777. }
  778. ::v-deep .u-icon__icon {
  779. top: 2px !important;
  780. padding-left: 3px !important;
  781. }
  782. .an-niu {
  783. // float: right;
  784. font-size: 10px;
  785. text-align: center;
  786. display: flex;
  787. align-items: end;
  788. justify-content: flex-end;
  789. padding-bottom: 30rpx;
  790. color: #fff;
  791. margin-top: 30rpx;
  792. .detail {
  793. width: 72px;
  794. height: 60rpx;
  795. border-radius: 30px;
  796. background-color: #F7C41E;
  797. margin-right: 20rpx;
  798. text-align: center;
  799. line-height: 60rpx;
  800. }
  801. .solve {
  802. width: 62px;
  803. height: 60rpx;
  804. margin-right: 20rpx;
  805. border-radius: 30px;
  806. background-color: #4CB2B6;
  807. line-height: 60rpx;
  808. }
  809. .forword {
  810. //已转发
  811. background-color: #BBBBBB;
  812. }
  813. .deletes {
  814. width: 62px;
  815. height: 60rpx;
  816. border-radius: 60rpx;
  817. background-color: red;
  818. color: #fff;
  819. line-height: 60rpx;
  820. }
  821. }
  822. /deep/.segmented-control__item--button {
  823. background-color: rgb(76, 178, 182) !important;
  824. }
  825. /deep/.segmented-control__item--button--active {
  826. background-color: #FFFFFF !important;
  827. }
  828. /deep/.uni-card {
  829. box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
  830. border-radius: 30rpx;
  831. }
  832. .tiantupian,
  833. .caogaoxiang {
  834. width: 110rpx;
  835. height: 110rpx;
  836. position: fixed;
  837. right: 15px;
  838. bottom: 80rpx;
  839. }
  840. .caogaoxiang {
  841. bottom: 150rpx;
  842. width: 120rpx;
  843. right: 40rpx;
  844. height: 120rpx;
  845. }
  846. //列表样式
  847. .titles {
  848. font-weight: 600;
  849. margin-bottom: 10rpx;
  850. font-size: 16px;
  851. }
  852. .conts {
  853. font-size: 12px;
  854. max-width: 470rpx;
  855. display: -webkit-box;
  856. /*弹性伸缩盒子模型显示*/
  857. -webkit-box-orient: vertical;
  858. /*排列方式*/
  859. -webkit-line-clamp: 1;
  860. /*显示文本行数*/
  861. overflow: hidden;
  862. /*溢出隐藏*/
  863. color: #274647;
  864. text-overflow: ellipsis;
  865. /*不知道干嘛的*/
  866. .conts-title {
  867. margin-right: 10rpx;
  868. color: #728F90;
  869. }
  870. }
  871. //侧边联动
  872. /deep/.page-body {
  873. display: flex;
  874. background: #fff;
  875. overflow: hidden;
  876. }
  877. .nav {
  878. display: flex;
  879. width: 100%;
  880. }
  881. .nav-left {
  882. width: 25%;
  883. background: #fafafa;
  884. }
  885. .nav-left-item {
  886. height: 100upx;
  887. border-right: solid 1px #f1f1f1;
  888. border-bottom: solid 1px #f1f1f1;
  889. font-size: 30upx;
  890. display: flex;
  891. align-items: center;
  892. justify-content: center;
  893. }
  894. .nav-left-item:last-child {
  895. border-bottom: none;
  896. }
  897. .nav-right {
  898. width: 75%;
  899. }
  900. /deep/.nav-right-item {
  901. width: 100%;
  902. display: flex;
  903. flex-wrap: wrap;
  904. }
  905. /deep/.u-checkbox {
  906. width: 80% !important;
  907. margin-bottom: 30rpx !important;
  908. }
  909. /deep/ .u-checkbox-group {
  910. width: 33%;
  911. // justify-content: flex-end;
  912. }
  913. .box {
  914. display: block;
  915. overflow: hidden;
  916. border-bottom: 20upx solid #f3f3f3;
  917. /* min-height: 100vh; */
  918. /*若您的子分类过少想使得每个子分类占满屏请放开上边注视 */
  919. }
  920. .box:last-child {
  921. border: none;
  922. min-height: 100vh;
  923. }
  924. .u-checkbox-group--row.data-v-3d1b15f2 {
  925. display: flex;
  926. flex-direction: row;
  927. }
  928. .nav-right-item {
  929. margin-top: 20px;
  930. float: left;
  931. padding: 11upx;
  932. font-size: 28upx;
  933. background: #fff;
  934. /deep/.u-checkbox__icon-wrap[data-v-532d01c7],/deep/.u-checkbox__icon-wrap {
  935. //复选框的样式
  936. margin: 0 20rpx;
  937. }
  938. /deep/ uni-view[data-v-3d1b15f2] {
  939. //复选框上线的间距
  940. margin: 20rpx 0 !important;
  941. }
  942. // /deep/ .u-checkbox__icon-wrap--square{
  943. // margin: 20rpx;
  944. // }
  945. .u-checkbox-label--right[data-v-532d01c7],.u-checkbox-label--right {
  946. margin-right: 40rpx;
  947. }
  948. }
  949. .nav-right-item image {
  950. width: 150upx;
  951. height: 150upx;
  952. }
  953. .active {
  954. font-weight: 700;
  955. color: #274647;
  956. background: #fff;
  957. border-right: 0;
  958. }
  959. ::-webkit-scrollbar {
  960. /*取消小程序的默认导航条样式*/
  961. width: 0;
  962. height: 0;
  963. color: transparent;
  964. }
  965. /deep/.u-button[data-v-3bf2dba7],
  966. /deep/.u-button.data-v-3bf2dba7,/deep/.u-button {
  967. //按钮大小
  968. width: 33% !important;
  969. }
  970. //转发任务人员弹出
  971. .u-popup-slot {
  972. min-width: 300px;
  973. min-height: 400px;
  974. position: relative;
  975. .u-popup-slot-item {
  976. @include flex;
  977. justify-content: space-around;
  978. flex-direction: column;
  979. align-items: flex-start;
  980. padding: 0 40rpx;
  981. }
  982. .title {
  983. padding: 40rpx;
  984. color: #383838;
  985. font-size: 16px;
  986. font-weight: 600;
  987. }
  988. .sure-or-cancel {
  989. display: flex;
  990. position: absolute;
  991. bottom: 40px;
  992. left: 21%;
  993. }
  994. }
  995. .person-forward {
  996. padding-top: 40rpx;
  997. display: flex;
  998. flex-wrap: wrap;
  999. }
  1000. /deep/.u-checkbox__icon-wrap--square[data-v-532d01c7],
  1001. /deep/.u-checkbox__icon-wrap--square.data-v-532d01c7,/deep/.u-checkbox__icon-wrap--square {
  1002. //转发复选框的颜色
  1003. border-color: #4CB2B6 !important;
  1004. }
  1005. .top {
  1006. display: flex;
  1007. align-items: center;
  1008. width: 90%;
  1009. margin-left: 5%;
  1010. justify-content: space-between;
  1011. .search-time {
  1012. display: flex;
  1013. align-items: center;
  1014. margin-top: 40rpx;
  1015. margin-bottom: 20rpx;
  1016. .time-item {
  1017. margin-right: 20rpx;
  1018. }
  1019. }
  1020. }
  1021. </style>