index.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104
  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. sender: this.$store.state.user.id,
  641. receiver: this.$store.state.user.id,
  642. taskType: this.taskType,
  643. taskName: this.keyword,
  644. }
  645. this.List(pageNo)
  646. }
  647. }
  648. // this.loading = false
  649. },
  650. List(pageNo) { //getData共用的接口
  651. this.formdata.pageNo = pageNo ? pageNo : 1;
  652. this.formdata.startTime=this.datetimerange[0]?this.datetimerange[0]+' 00:00:00':'';
  653. this.formdata.endTime=this.datetimerange[1]?this.datetimerange[1]+' 23:59:59':''
  654. const json = JSON.stringify(this.formdata)
  655. taskList(json).then(response => {
  656. this.tableData = [...this.tableData, ...response.data.list]
  657. this.tableData.map(i=>{
  658. i.createTime=i.createTime?shijianc(i.createTime):''
  659. })
  660. this.total = response.data.total
  661. this.loading = false;
  662. })
  663. },
  664. onClick(val) {
  665. uni.navigateTo({
  666. url: '/pagesA/fire/check_active/check_details/check_details?id=' + val.id,
  667. events: {
  668. // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
  669. acceptDataFromOpenedPage: function(val) {},
  670. },
  671. success: function(res) {
  672. // 通过eventChannel向被打开页面传送数据
  673. res.eventChannel.emit('acceptDataFromOpenerPage', val)
  674. }
  675. })
  676. },
  677. addClick() {
  678. uni.navigateTo({
  679. url: `/pagesA/fire/check_active/add_check/add_check?type=${this.taskType}`
  680. })
  681. },
  682. //侧边栏导航联动
  683. getHeightList() {
  684. let _this = this;
  685. let selectorQuery = uni.createSelectorQuery();
  686. selectorQuery.selectAll('.nav-left-item').boundingClientRect(function(rects) {
  687. _this.leftItemHeight = rects[0].height;
  688. _this.navLeftHeight = _this.leftItemHeight * this.list.length;
  689. _this.diff = _this.navLeftHeight - _this.height;
  690. });
  691. selectorQuery.selectAll('.box').boundingClientRect(function(rects) {
  692. let arr = [0];
  693. let top = 0;
  694. if (rects) {
  695. rects.forEach(function(rect) {
  696. top += rect.height;
  697. arr.push(top);
  698. });
  699. };
  700. _this.arr = arr;
  701. }).exec();
  702. },
  703. scroll(e) {
  704. let _this = this;
  705. if (this.timeoutId) {
  706. clearTimeout(this.timeoutId);
  707. }
  708. this.timeoutId = setTimeout(function() {
  709. //节流
  710. _this.scrollHeight = e.detail.scrollTop + 1 + _this.height / 2;
  711. //+1不要删除,解决最后一项某种情况下翻到底部,左边按钮并不会切换至最后一个
  712. //若想使切换参考线为屏幕顶部请删除 _this.height/2
  713. for (let i = 0; i < _this.arr.length; i++) {
  714. let height1 = _this.arr[i];
  715. let height2 = _this.arr[i + 1];
  716. if (!height2 || (_this.scrollHeight >= height1 && _this.scrollHeight < height2)) {
  717. _this.categoryActive = i;
  718. _this.diff > 0 && (_this.scrollLeftTop = Math.round((_this.categoryActive * _this
  719. .diff) / (this.list.length - 1)));
  720. return false;
  721. }
  722. }
  723. _this.categoryActive = 0;
  724. _this.timeoutId = undefined;
  725. }, 10);
  726. },
  727. categoryClickMain(index, item) {
  728. this.categoryActive = index;
  729. this.scrollTop == this.arr[index] ? (this.scrollTop = this.scrollTop + 1) : (this.scrollTop = this.arr[
  730. index]); //防止两次相等造成点击不触发滚动时间
  731. }
  732. // 触底的事件
  733. // scrolltolower() {
  734. // // 判断是否还有下一页数据
  735. // if (this.formdata.pageNo * this.formdata.pageSize >= this.total) return uni.showToast({
  736. // title: `数据加载完毕`
  737. // })
  738. // // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  739. // if (this.loading) return
  740. // this.formdata.pageNo += 1
  741. // this.getData(this.formdata.pageNo)
  742. // },
  743. },
  744. // 触底的事件
  745. onReachBottom() {
  746. // 判断是否还有下一页数据
  747. if (this.pageNo * this.pageSize >= this.total) return uni.showToast({
  748. title: `数据加载完毕`
  749. })
  750. // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  751. if (this.loading) return
  752. this.pageNo += 1
  753. this.getData(this.pageNo)
  754. },
  755. }
  756. </script>
  757. <style>
  758. page {
  759. background-color: #F5F7F9;
  760. }
  761. </style>
  762. <style lang="scss" scoped>
  763. body {
  764. background-color: #F5F7F9;
  765. }
  766. /deep/ .u-tabs__wrapper[data-v-0de61367],
  767. .u-tabs__wrapper.data-v-0de61367,/deep/ .u-tabs__wrapper {
  768. width: 99%;
  769. }
  770. /deep/.u-tabs__wrapper__nav__item[data-v-0de61367],
  771. /deep/.u-tabs__wrapper__nav__item.data-v-0de61367,/deep/.u-tabs__wrapper__nav__item {
  772. padding: 0 60rpx;
  773. }
  774. .addInsp {
  775. width: 40px;
  776. position: fixed;
  777. right: 4px;
  778. z-index: 99999;
  779. }
  780. ::v-deep .u-icon__icon {
  781. top: 2px !important;
  782. padding-left: 3px !important;
  783. }
  784. .an-niu {
  785. // float: right;
  786. font-size: 10px;
  787. text-align: center;
  788. display: flex;
  789. align-items: end;
  790. justify-content: flex-end;
  791. padding-bottom: 30rpx;
  792. color: #fff;
  793. margin-top: 30rpx;
  794. .detail {
  795. width: 72px;
  796. height: 60rpx;
  797. border-radius: 30px;
  798. background-color: #F7C41E;
  799. margin-right: 20rpx;
  800. text-align: center;
  801. line-height: 60rpx;
  802. }
  803. .solve {
  804. width: 62px;
  805. height: 60rpx;
  806. margin-right: 20rpx;
  807. border-radius: 30px;
  808. background-color: #4CB2B6;
  809. line-height: 60rpx;
  810. }
  811. .forword {
  812. //已转发
  813. background-color: #BBBBBB;
  814. }
  815. .deletes {
  816. width: 62px;
  817. height: 60rpx;
  818. border-radius: 60rpx;
  819. background-color: red;
  820. color: #fff;
  821. line-height: 60rpx;
  822. }
  823. }
  824. /deep/.segmented-control__item--button {
  825. background-color: rgb(76, 178, 182) !important;
  826. }
  827. /deep/.segmented-control__item--button--active {
  828. background-color: #FFFFFF !important;
  829. }
  830. /deep/.uni-card {
  831. box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
  832. border-radius: 30rpx;
  833. }
  834. .tiantupian,
  835. .caogaoxiang {
  836. width: 110rpx;
  837. height: 110rpx;
  838. position: fixed;
  839. right: 15px;
  840. bottom: 80rpx;
  841. }
  842. .caogaoxiang {
  843. bottom: 150rpx;
  844. width: 120rpx;
  845. right: 40rpx;
  846. height: 120rpx;
  847. }
  848. //列表样式
  849. .titles {
  850. font-weight: 600;
  851. margin-bottom: 10rpx;
  852. font-size: 16px;
  853. }
  854. .conts {
  855. font-size: 12px;
  856. max-width: 470rpx;
  857. display: -webkit-box;
  858. /*弹性伸缩盒子模型显示*/
  859. -webkit-box-orient: vertical;
  860. /*排列方式*/
  861. -webkit-line-clamp: 1;
  862. /*显示文本行数*/
  863. overflow: hidden;
  864. /*溢出隐藏*/
  865. color: #274647;
  866. text-overflow: ellipsis;
  867. /*不知道干嘛的*/
  868. .conts-title {
  869. margin-right: 10rpx;
  870. color: #728F90;
  871. }
  872. }
  873. //侧边联动
  874. /deep/.page-body {
  875. display: flex;
  876. background: #fff;
  877. overflow: hidden;
  878. }
  879. .nav {
  880. display: flex;
  881. width: 100%;
  882. }
  883. .nav-left {
  884. width: 25%;
  885. background: #fafafa;
  886. }
  887. .nav-left-item {
  888. height: 100upx;
  889. border-right: solid 1px #f1f1f1;
  890. border-bottom: solid 1px #f1f1f1;
  891. font-size: 30upx;
  892. display: flex;
  893. align-items: center;
  894. justify-content: center;
  895. }
  896. .nav-left-item:last-child {
  897. border-bottom: none;
  898. }
  899. .nav-right {
  900. width: 75%;
  901. }
  902. /deep/.nav-right-item {
  903. width: 100%;
  904. display: flex;
  905. flex-wrap: wrap;
  906. }
  907. /deep/.u-checkbox {
  908. width: 80% !important;
  909. margin-bottom: 30rpx !important;
  910. }
  911. /deep/ .u-checkbox-group {
  912. width: 33%;
  913. // justify-content: flex-end;
  914. }
  915. .box {
  916. display: block;
  917. overflow: hidden;
  918. border-bottom: 20upx solid #f3f3f3;
  919. /* min-height: 100vh; */
  920. /*若您的子分类过少想使得每个子分类占满屏请放开上边注视 */
  921. }
  922. .box:last-child {
  923. border: none;
  924. min-height: 100vh;
  925. }
  926. .u-checkbox-group--row.data-v-3d1b15f2 {
  927. display: flex;
  928. flex-direction: row;
  929. }
  930. .nav-right-item {
  931. margin-top: 20px;
  932. float: left;
  933. padding: 11upx;
  934. font-size: 28upx;
  935. background: #fff;
  936. /deep/.u-checkbox__icon-wrap[data-v-532d01c7],/deep/.u-checkbox__icon-wrap {
  937. //复选框的样式
  938. margin: 0 20rpx;
  939. }
  940. /deep/ uni-view[data-v-3d1b15f2] {
  941. //复选框上线的间距
  942. margin: 20rpx 0 !important;
  943. }
  944. // /deep/ .u-checkbox__icon-wrap--square{
  945. // margin: 20rpx;
  946. // }
  947. .u-checkbox-label--right[data-v-532d01c7],.u-checkbox-label--right {
  948. margin-right: 40rpx;
  949. }
  950. }
  951. .nav-right-item image {
  952. width: 150upx;
  953. height: 150upx;
  954. }
  955. .active {
  956. font-weight: 700;
  957. color: #274647;
  958. background: #fff;
  959. border-right: 0;
  960. }
  961. ::-webkit-scrollbar {
  962. /*取消小程序的默认导航条样式*/
  963. width: 0;
  964. height: 0;
  965. color: transparent;
  966. }
  967. /deep/.u-button[data-v-3bf2dba7],
  968. /deep/.u-button.data-v-3bf2dba7,/deep/.u-button {
  969. //按钮大小
  970. width: 33% !important;
  971. }
  972. //转发任务人员弹出
  973. .u-popup-slot {
  974. min-width: 300px;
  975. min-height: 400px;
  976. position: relative;
  977. .u-popup-slot-item {
  978. @include flex;
  979. justify-content: space-around;
  980. flex-direction: column;
  981. align-items: flex-start;
  982. padding: 0 40rpx;
  983. }
  984. .title {
  985. padding: 40rpx;
  986. color: #383838;
  987. font-size: 16px;
  988. font-weight: 600;
  989. }
  990. .sure-or-cancel {
  991. display: flex;
  992. position: absolute;
  993. bottom: 40px;
  994. left: 21%;
  995. }
  996. }
  997. .person-forward {
  998. padding-top: 40rpx;
  999. display: flex;
  1000. flex-wrap: wrap;
  1001. }
  1002. /deep/.u-checkbox__icon-wrap--square[data-v-532d01c7],
  1003. /deep/.u-checkbox__icon-wrap--square.data-v-532d01c7,/deep/.u-checkbox__icon-wrap--square {
  1004. //转发复选框的颜色
  1005. border-color: #4CB2B6 !important;
  1006. }
  1007. .top {
  1008. display: flex;
  1009. align-items: center;
  1010. width: 90%;
  1011. margin-left: 5%;
  1012. justify-content: space-between;
  1013. .search-time {
  1014. display: flex;
  1015. align-items: center;
  1016. margin-top: 40rpx;
  1017. margin-bottom: 20rpx;
  1018. .time-item {
  1019. margin-right: 20rpx;
  1020. }
  1021. }
  1022. }
  1023. </style>