index.vue 32 KB

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