index.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107
  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>{{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. console.log(option, 'optionoptionoption');
  365. uni.setNavigationBarTitle({
  366. title: option.title
  367. })
  368. if (option.type) {
  369. this.FormDataTask.taskType = option.type
  370. this.taskType = option.type
  371. }
  372. if (option.current) {
  373. this.current = option.current
  374. }
  375. },
  376. onShow() {
  377. this.checkedTotal(this.pageNo)
  378. this.tableData = []
  379. this.getData(this.formData.pageNo)
  380. this.height = uni.getSystemInfoSync().windowHeight - this.tabBarHeight //设置侧边联动的高
  381. },
  382. mixins: [uni.$u.mixin],
  383. methods: {
  384. //搜索
  385. /** 搜索按钮操作 */
  386. /** 搜索按钮操作 */
  387. handleQuery() {
  388. // const end = new Date(this.endSingle).getTime()
  389. // const start = new Date(this.startSingle).getTime()
  390. // if (!this.endSingle && !this.startSingle) {
  391. // this.pageNo = 1;
  392. // this.tableData=[]
  393. // this.getData(1);
  394. // } else if (this.endSingle && this.startSingle && start <= end) {
  395. // // } else{
  396. this.pageNo = 1;
  397. this.tableData=[]
  398. this.getData(1);
  399. // } else if (start > end) {
  400. // this.$modal.msgError('结束时间不能小于事件时间')
  401. // } else {
  402. // this.$modal.msgError('请选择事件时间和结束时间')
  403. // }
  404. },
  405. //popup检查单位确定============
  406. checkboxConfirm2() {
  407. // this.checkedList2.map(v => { //选择检查单位,不能删,支队和大队时放开
  408. // v.map(i => {
  409. // this.FormDataTask.orgId.push(i)
  410. // })
  411. // })
  412. this.FormDataTask.receiver = this.checkedList2 //选择检查人员,不能删,支队和大队时放开
  413. checkSubmitForwardTask(JSON.stringify(this.FormDataTask)).then(response => {
  414. if (response.data) {
  415. this.$modal.msg('转发成功')
  416. this.checkboxShow2 = false
  417. this.tableData = []
  418. this.getData(this.pageNo)
  419. } else {
  420. this.$modal.msgError(response.msg)
  421. }
  422. })
  423. },
  424. //popup取消
  425. checkboxCancel2() {
  426. this.checkboxShow2 = false
  427. this.checkedList2 = []
  428. },
  429. checkboxChange2(i, n) {
  430. if (i && n.length != 0) {
  431. this.checkedList2.push(i)
  432. } else if (i && n.length == 0) {
  433. this.checkedList2 = this.checkedList2.filter(item => item != i)
  434. }
  435. },
  436. checkedTotal(pageNo, value = '') {
  437. // this.loading = true
  438. this.pageNo = pageNo
  439. const form = {
  440. // pageNo: this.pageNo,
  441. // pageSize: this.pageSize,
  442. userId: this.$store.state.user.id
  443. }
  444. addCheckActiveCompany( //获取所属单位
  445. form
  446. ).then(response => {
  447. this.list2 = response.data
  448. });
  449. },
  450. //========
  451. close() {
  452. this.showShenHe = false
  453. },
  454. //发布任务弹框
  455. showToasts(val) {
  456. saveCheckRelease({
  457. id: val
  458. }).then(response => {
  459. if (response.data) {
  460. this.tableData = []
  461. this.getData(this.pageNo)
  462. setTimeout(() => {
  463. uni.showToast({
  464. title: `发布成功`
  465. })
  466. }, 500)
  467. this.current = 2
  468. this.getData(this.pageNo)
  469. }
  470. })
  471. },
  472. //转发
  473. forward(val) { //展示转发的弹出层
  474. this.ids = val.id //当前点击任务的id
  475. this.checkboxShow2 = true
  476. this.FormDataTask.broadId = val.broadId
  477. this.FormDataTask.id = this.ids
  478. this.FormDataTask.taskName = val.taskName
  479. this.FormDataTask.taskStatus = val.taskStatus
  480. this.FormDataTask.taskContent = val.taskContent
  481. this.FormDataTask.orgId.push(val.orgId)
  482. checkGetPerson({
  483. orgId: val.orgId
  484. }).then(response => {
  485. this.personInfo = response.data
  486. })
  487. },
  488. //草稿箱删除
  489. deletes(val) {
  490. deleteTask({
  491. id: val
  492. }).then(response => {
  493. if (response.code == 0) {
  494. this.tableData = []
  495. this.getData(this.pageNo)
  496. uni.showToast({
  497. title: '删除成功',
  498. icon: "none"
  499. }, 200)
  500. }
  501. })
  502. },
  503. //审核模态框
  504. showModal(taskId, broad) {
  505. this.showShenHe = true
  506. this.taskId = taskId
  507. this.broad = broad
  508. },
  509. //审核通过
  510. confirm() {
  511. this.taskShen = 3
  512. this.showShenHe = false
  513. verifytask({
  514. taskId: this.taskId,
  515. broadId: this.broad,
  516. status: this.taskShen
  517. }).then(response => {
  518. if (response.data) {
  519. this.tableData = []
  520. this.current = 4
  521. this.getData(this.pageNo)
  522. }
  523. })
  524. },
  525. //审核不通过
  526. cancel() {
  527. this.taskShen = 1
  528. this.showShenHe = false
  529. verifytask({
  530. taskId: this.taskId,
  531. broadId: this.broad,
  532. status: this.taskShen
  533. }).then(response => {
  534. if (response.data) {
  535. this.tableData = []
  536. this.getData(this.pageNo)
  537. }
  538. })
  539. },
  540. //修改任务
  541. goAddCheck(val) {
  542. console.log(this.taskType, 'this.taskType修改');
  543. uni.navigateTo({
  544. url: `/pagesA/fire/check_active/add_check/add_check?id=${val}&type=${this.taskType}`
  545. })
  546. },
  547. //去完成
  548. addClickModify(val) {
  549. uni.navigateTo({
  550. url: `/pagesA/fire/check_active/check_implement/check_implement?id=${val.id}&broadId=${val.broadId}&orgId=${val.orgId}&type=${this.taskType}`,
  551. // url:'/pagesA/fire/xiangjiceshi/xiangjiceshi',
  552. success: function(res) {
  553. res.eventChannel.emit('acceptDataFromOpenerPage', val);
  554. }
  555. })
  556. },
  557. //查看详情
  558. addClickDetail(val) {
  559. uni.navigateTo({
  560. url: `/pagesA/fire/check_active/check_list/check_list?id=${val}&current=${this.current}`,
  561. success: function(res) {
  562. res.eventChannel.emit('acceptDataFromOpenerPage', val);
  563. }
  564. })
  565. },
  566. navigateBack() {
  567. uni.navigateBack()
  568. },
  569. // tab头部点击
  570. onClickItem(e) {
  571. if (this.current !== e.index) {
  572. this.current = e.index
  573. }
  574. this.tableData = []
  575. this.pageNo = 1
  576. this.getData(this.pageNo)
  577. },
  578. // 获取数据
  579. getData(pageNo, value = '') {
  580. this.loading = true;
  581. if (this.current == 3) { //获取草稿箱内的列表
  582. this.formdata = {
  583. pageNo: 1,
  584. pageSize: 10,
  585. userId: this.$store.state.user.id,
  586. taskStatus: 0,
  587. taskType: this.taskType,
  588. taskName: this.keyword,
  589. }
  590. this.formdata.pageNo = pageNo ? pageNo : 1;
  591. this.formdata.startTime=this.datetimerange[0]?this.datetimerange[0]+' 00:00:00':'';
  592. this.formdata.endTime=this.datetimerange[1]?this.datetimerange[1]+' 23:59:59':''
  593. const json = JSON.stringify(this.formdata)
  594. draftTask(json).then(response => {
  595. // 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
  596. this.tableData = [...this.tableData, ...response.data.list]
  597. this.tableData.map(i=>{
  598. i.createTime=i.createTime?shijianc(i.createTime):''
  599. })
  600. this.total = response.data.total
  601. this.loading = false;
  602. })
  603. } else {
  604. this.loading = true;
  605. if (this.current == 0) {
  606. this.formdata = {
  607. pageNo: 1,
  608. pageSize: 10,
  609. taskStatus: 1,
  610. receiver: this.$store.state.user.id,
  611. taskType: this.taskType,
  612. taskName: this.keyword,
  613. }
  614. this.List(pageNo)
  615. } else if (this.current == 1) {
  616. this.formdata = {
  617. pageNo: 1,
  618. pageSize: 10,
  619. taskStatus: 2,
  620. receiver: this.$store.state.user.id,
  621. taskType: this.taskType,
  622. taskName: this.keyword,
  623. }
  624. console.log(this.formdata, this.keyword, '=========');
  625. this.List(pageNo)
  626. } else if (this.current == 2) {
  627. this.formdata = {
  628. pageNo: 1,
  629. pageSize: 10,
  630. taskStatus: 1,
  631. sender: this.$store.state.user.id,
  632. taskType: this.taskType,
  633. taskName: this.keyword,
  634. }
  635. console.log(this.formdata, this.keyword, '=========');
  636. this.List(pageNo)
  637. this.formdata.taskStatus = 2
  638. this.List(pageNo)
  639. } else if (this.current == 4) {
  640. this.formdata = {
  641. pageNo: 1,
  642. pageSize: 10,
  643. taskStatus: 3,
  644. taskType: this.taskType,
  645. taskName: this.keyword,
  646. }
  647. this.List(pageNo)
  648. }
  649. }
  650. // this.loading = false
  651. },
  652. List(pageNo) { //getData共用的接口
  653. this.formdata.pageNo = pageNo ? pageNo : 1;
  654. this.formdata.startTime=this.datetimerange[0]?this.datetimerange[0]+' 00:00:00':'';
  655. this.formdata.endTime=this.datetimerange[1]?this.datetimerange[1]+' 23:59:59':''
  656. const json = JSON.stringify(this.formdata)
  657. taskList(json).then(response => {
  658. this.tableData = [...this.tableData, ...response.data.list]
  659. this.tableData.map(i=>{
  660. i.createTime=i.createTime?shijianc(i.createTime):''
  661. })
  662. this.total = response.data.total
  663. this.loading = false;
  664. })
  665. },
  666. onClick(val) {
  667. uni.navigateTo({
  668. url: '/pagesA/fire/check_active/check_details/check_details?id=' + val.id,
  669. events: {
  670. // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
  671. acceptDataFromOpenedPage: function(val) {},
  672. },
  673. success: function(res) {
  674. // 通过eventChannel向被打开页面传送数据
  675. res.eventChannel.emit('acceptDataFromOpenerPage', val)
  676. }
  677. })
  678. },
  679. addClick() {
  680. console.log(this.taskType, 'this.taskType新增');
  681. uni.navigateTo({
  682. url: `/pagesA/fire/check_active/add_check/add_check?type=${this.taskType}`
  683. })
  684. },
  685. //侧边栏导航联动
  686. getHeightList() {
  687. let _this = this;
  688. let selectorQuery = uni.createSelectorQuery();
  689. selectorQuery.selectAll('.nav-left-item').boundingClientRect(function(rects) {
  690. _this.leftItemHeight = rects[0].height;
  691. _this.navLeftHeight = _this.leftItemHeight * this.list.length;
  692. _this.diff = _this.navLeftHeight - _this.height;
  693. });
  694. selectorQuery.selectAll('.box').boundingClientRect(function(rects) {
  695. let arr = [0];
  696. let top = 0;
  697. if (rects) {
  698. rects.forEach(function(rect) {
  699. top += rect.height;
  700. arr.push(top);
  701. });
  702. };
  703. _this.arr = arr;
  704. }).exec();
  705. },
  706. scroll(e) {
  707. let _this = this;
  708. if (this.timeoutId) {
  709. clearTimeout(this.timeoutId);
  710. }
  711. this.timeoutId = setTimeout(function() {
  712. //节流
  713. _this.scrollHeight = e.detail.scrollTop + 1 + _this.height / 2;
  714. //+1不要删除,解决最后一项某种情况下翻到底部,左边按钮并不会切换至最后一个
  715. //若想使切换参考线为屏幕顶部请删除 _this.height/2
  716. for (let i = 0; i < _this.arr.length; i++) {
  717. let height1 = _this.arr[i];
  718. let height2 = _this.arr[i + 1];
  719. if (!height2 || (_this.scrollHeight >= height1 && _this.scrollHeight < height2)) {
  720. _this.categoryActive = i;
  721. _this.diff > 0 && (_this.scrollLeftTop = Math.round((_this.categoryActive * _this
  722. .diff) / (this.list.length - 1)));
  723. return false;
  724. }
  725. }
  726. _this.categoryActive = 0;
  727. _this.timeoutId = undefined;
  728. }, 10);
  729. },
  730. categoryClickMain(index, item) {
  731. this.categoryActive = index;
  732. this.scrollTop == this.arr[index] ? (this.scrollTop = this.scrollTop + 1) : (this.scrollTop = this.arr[
  733. index]); //防止两次相等造成点击不触发滚动时间
  734. }
  735. // 触底的事件
  736. // scrolltolower() {
  737. // // 判断是否还有下一页数据
  738. // if (this.formdata.pageNo * this.formdata.pageSize >= this.total) return uni.showToast({
  739. // title: `数据加载完毕`
  740. // })
  741. // // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  742. // if (this.loading) return
  743. // this.formdata.pageNo += 1
  744. // this.getData(this.formdata.pageNo)
  745. // },
  746. },
  747. // 触底的事件
  748. onReachBottom() {
  749. // 判断是否还有下一页数据
  750. if (this.pageNo * this.pageSize >= this.total) return uni.showToast({
  751. title: `数据加载完毕`
  752. })
  753. // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  754. if (this.loading) return
  755. this.pageNo += 1
  756. this.getData(this.pageNo)
  757. },
  758. }
  759. </script>
  760. <style>
  761. page {
  762. background-color: #F5F7F9;
  763. }
  764. </style>
  765. <style lang="scss" scoped>
  766. body {
  767. background-color: #F5F7F9;
  768. }
  769. /deep/ .u-tabs__wrapper[data-v-0de61367],
  770. .u-tabs__wrapper.data-v-0de61367,/deep/ .u-tabs__wrapper {
  771. width: 99%;
  772. }
  773. /deep/.u-tabs__wrapper__nav__item[data-v-0de61367],
  774. /deep/.u-tabs__wrapper__nav__item.data-v-0de61367,/deep/.u-tabs__wrapper__nav__item {
  775. padding: 0 60rpx;
  776. }
  777. .addInsp {
  778. width: 40px;
  779. position: fixed;
  780. right: 4px;
  781. z-index: 99999;
  782. }
  783. ::v-deep .u-icon__icon {
  784. top: 2px !important;
  785. padding-left: 3px !important;
  786. }
  787. .an-niu {
  788. // float: right;
  789. font-size: 10px;
  790. text-align: center;
  791. display: flex;
  792. align-items: end;
  793. justify-content: flex-end;
  794. padding-bottom: 30rpx;
  795. color: #fff;
  796. margin-top: 30rpx;
  797. .detail {
  798. width: 72px;
  799. height: 60rpx;
  800. border-radius: 30px;
  801. background-color: #F7C41E;
  802. margin-right: 20rpx;
  803. text-align: center;
  804. line-height: 60rpx;
  805. }
  806. .solve {
  807. width: 62px;
  808. height: 60rpx;
  809. margin-right: 20rpx;
  810. border-radius: 30px;
  811. background-color: #4CB2B6;
  812. line-height: 60rpx;
  813. }
  814. .forword {
  815. //已转发
  816. background-color: #BBBBBB;
  817. }
  818. .deletes {
  819. width: 62px;
  820. height: 60rpx;
  821. border-radius: 60rpx;
  822. background-color: red;
  823. color: #fff;
  824. line-height: 60rpx;
  825. }
  826. }
  827. /deep/.segmented-control__item--button {
  828. background-color: rgb(76, 178, 182) !important;
  829. }
  830. /deep/.segmented-control__item--button--active {
  831. background-color: #FFFFFF !important;
  832. }
  833. /deep/.uni-card {
  834. box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
  835. border-radius: 30rpx;
  836. }
  837. .tiantupian,
  838. .caogaoxiang {
  839. width: 110rpx;
  840. height: 110rpx;
  841. position: fixed;
  842. right: 15px;
  843. bottom: 80rpx;
  844. }
  845. .caogaoxiang {
  846. bottom: 150rpx;
  847. width: 120rpx;
  848. right: 40rpx;
  849. height: 120rpx;
  850. }
  851. //列表样式
  852. .titles {
  853. font-weight: 600;
  854. margin-bottom: 10rpx;
  855. font-size: 16px;
  856. }
  857. .conts {
  858. font-size: 12px;
  859. max-width: 470rpx;
  860. display: -webkit-box;
  861. /*弹性伸缩盒子模型显示*/
  862. -webkit-box-orient: vertical;
  863. /*排列方式*/
  864. -webkit-line-clamp: 1;
  865. /*显示文本行数*/
  866. overflow: hidden;
  867. /*溢出隐藏*/
  868. color: #274647;
  869. text-overflow: ellipsis;
  870. /*不知道干嘛的*/
  871. .conts-title {
  872. margin-right: 10rpx;
  873. color: #728F90;
  874. }
  875. }
  876. //侧边联动
  877. /deep/.page-body {
  878. display: flex;
  879. background: #fff;
  880. overflow: hidden;
  881. }
  882. .nav {
  883. display: flex;
  884. width: 100%;
  885. }
  886. .nav-left {
  887. width: 25%;
  888. background: #fafafa;
  889. }
  890. .nav-left-item {
  891. height: 100upx;
  892. border-right: solid 1px #f1f1f1;
  893. border-bottom: solid 1px #f1f1f1;
  894. font-size: 30upx;
  895. display: flex;
  896. align-items: center;
  897. justify-content: center;
  898. }
  899. .nav-left-item:last-child {
  900. border-bottom: none;
  901. }
  902. .nav-right {
  903. width: 75%;
  904. }
  905. /deep/.nav-right-item {
  906. width: 100%;
  907. display: flex;
  908. flex-wrap: wrap;
  909. }
  910. /deep/.u-checkbox {
  911. width: 80% !important;
  912. margin-bottom: 30rpx !important;
  913. }
  914. /deep/ .u-checkbox-group {
  915. width: 33%;
  916. // justify-content: flex-end;
  917. }
  918. .box {
  919. display: block;
  920. overflow: hidden;
  921. border-bottom: 20upx solid #f3f3f3;
  922. /* min-height: 100vh; */
  923. /*若您的子分类过少想使得每个子分类占满屏请放开上边注视 */
  924. }
  925. .box:last-child {
  926. border: none;
  927. min-height: 100vh;
  928. }
  929. .u-checkbox-group--row.data-v-3d1b15f2 {
  930. display: flex;
  931. flex-direction: row;
  932. }
  933. .nav-right-item {
  934. margin-top: 20px;
  935. float: left;
  936. padding: 11upx;
  937. font-size: 28upx;
  938. background: #fff;
  939. /deep/.u-checkbox__icon-wrap[data-v-532d01c7],/deep/.u-checkbox__icon-wrap {
  940. //复选框的样式
  941. margin: 0 20rpx;
  942. }
  943. /deep/ uni-view[data-v-3d1b15f2] {
  944. //复选框上线的间距
  945. margin: 20rpx 0 !important;
  946. }
  947. // /deep/ .u-checkbox__icon-wrap--square{
  948. // margin: 20rpx;
  949. // }
  950. .u-checkbox-label--right[data-v-532d01c7],.u-checkbox-label--right {
  951. margin-right: 40rpx;
  952. }
  953. }
  954. .nav-right-item image {
  955. width: 150upx;
  956. height: 150upx;
  957. }
  958. .active {
  959. font-weight: 700;
  960. color: #274647;
  961. background: #fff;
  962. border-right: 0;
  963. }
  964. ::-webkit-scrollbar {
  965. /*取消小程序的默认导航条样式*/
  966. width: 0;
  967. height: 0;
  968. color: transparent;
  969. }
  970. /deep/.u-button[data-v-3bf2dba7],
  971. /deep/.u-button.data-v-3bf2dba7,/deep/.u-button {
  972. //按钮大小
  973. width: 33% !important;
  974. }
  975. //转发任务人员弹出
  976. .u-popup-slot {
  977. min-width: 300px;
  978. min-height: 400px;
  979. position: relative;
  980. .u-popup-slot-item {
  981. @include flex;
  982. justify-content: space-around;
  983. flex-direction: column;
  984. align-items: flex-start;
  985. padding: 0 40rpx;
  986. }
  987. .title {
  988. padding: 40rpx;
  989. color: #383838;
  990. font-size: 16px;
  991. font-weight: 600;
  992. }
  993. .sure-or-cancel {
  994. display: flex;
  995. position: absolute;
  996. bottom: 40px;
  997. left: 21%;
  998. }
  999. }
  1000. .person-forward {
  1001. padding-top: 40rpx;
  1002. display: flex;
  1003. flex-wrap: wrap;
  1004. }
  1005. /deep/.u-checkbox__icon-wrap--square[data-v-532d01c7],
  1006. /deep/.u-checkbox__icon-wrap--square.data-v-532d01c7,/deep/.u-checkbox__icon-wrap--square {
  1007. //转发复选框的颜色
  1008. border-color: #4CB2B6 !important;
  1009. }
  1010. .top {
  1011. display: flex;
  1012. align-items: center;
  1013. width: 90%;
  1014. margin-left: 5%;
  1015. justify-content: space-between;
  1016. .search-time {
  1017. display: flex;
  1018. align-items: center;
  1019. margin-top: 40rpx;
  1020. margin-bottom: 20rpx;
  1021. .time-item {
  1022. margin-right: 20rpx;
  1023. }
  1024. }
  1025. }
  1026. </style>