123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107 |
- <template>
- <view class="uni-container uni-container-bg">
- <!-- 搜索框 -->
- <!-- <uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
- <uni-col :span="24">
- <view class="u-page__tag-item">
- <u-search :showAction="true" placeholder="请输入" bgColor="#edf6f9" borderColor="#4cb2b6"
- v-model="keyword" @search="handleQuery" @custom="handleQuery(keyword)"></u-search>
- </view>
- </uni-col>
- </uni-row> -->
- <view class="top">
- <view>
- <view class="search-time">
- <!-- <text class="time-item">开始时间:</text> -->
- <uni-datetime-picker class="time-item-check" type="daterange" v-model="datetimerange" />
- </view>
- <!-- <view class="search-time">
- <text class="time-item">结束时间:</text>
- <uni-datetime-picker class="time-item-check" type="date" v-model="endSingle" />
- </view> -->
- </view>
- <view class="search-icon">
- <u-icon name="search" color="#4CB2B6" size="30" @click="handleQuery"></u-icon>
- </view>
- </view>
- <view style="margin-bottom: 20rpx;">
- <u-tabs :list="items" @click="onClickItem" activeStyle="color:#4CB2B6" inactiveStyle="color:#000"
- :current="current" :scrollable="true" lineWidth="60" lineColor="#4CB2B6"></u-tabs>
- <view style="height: 2rpx;background-color: #E5E5E5;margin-top: 10rpx;"></view>
- </view>
- <view v-if="current == 0">
- <view class="" v-if="tableData.length>0">
- <uni-card v-for="(item, index) in tableData" :key="index" class="last-margin">
- <view class="titles">{{item.taskName}}</view>
- <view style="" v-if="item.taskContent">
- <span class="name-align-task">任务说明:</span>
- <span class="uni-ellipsis-set">{{item.taskContent?item.taskContent:''}}</span>
- </view>
- <!-- <text class="conts">{{item.taskContent}}</text> -->
- <!-- <view class="">
- <rich-text :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
- </view> -->
- <view class="">
- <span class="name-align-task">接收时间:</span>
- <span>{{item.createTime}}</span>
- </view>
- <view class="an-niu">
- <text @click="addClickDetail(item.broadId)" class="detail">查看详情</text>
- <text v-if="item.isforward" class="solve forword">已转发</text>
- <text @click="addClickModify(item)" v-else class="solve">去完成</text>
- <text @click="forward(item)" class="solve">转发任务</text>
- </view>
- </uni-card>
- </view>
- <view style="text-align: center;" v-else>
- <view class="text-gray" style="padding-top: 20px;"> 暂无检查任务 </view>
- </view>
- <view>
- <image :src="Group" @click="addClick" class="tiantupian"></image>
- </view>
- </view>
- <view v-if="current == 1">
- <view class="" v-if="tableData.length>0">
- <uni-card v-for="(item, index) in tableData" :key="index" class="last-margin">
- <view class="titles">{{item.taskName}}</view>
- <view style="float: left;width: 130rpx;" v-if="item.taskContent">任务说明:</view>
- <view>
- <rich-text :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
- </view>
- <view class="">
- <text class="name-align-task">接收时间:</text>{{item.createTime}}
- </view>
- <view class="an-niu">
- <text @click="addClickDetail(item.broadId)" class="detail">查看详情</text>
- <text class="solve" style="background-color:#3491FA">待审核</text>
- </view>
- </uni-card>
- </view>
- <view style="text-align: center;" v-else>
- <view class="text-gray" style="padding-top: 20px;" > 暂无检查任务 </view>
- <!-- <view class="" style="padding-top: 40px;width: 120px;">
- <image :src="jiezhiTime" @click="addClick" class="caogaoxiang"></image>
- </view> 草稿箱-->
- </view>
-
- <view>
- <image :src="Group" @click="addClick" class="tiantupian"></image>
- </view>
- </view>
- <!-- 已发布 -->
- <view v-if="current ==2">
- <view class="" v-if="tableData.length!=0">
- <uni-card v-for="(item, index) in tableData" :key="index" class="last-margin">
- <view class="titles">{{item.taskName}}</view>
- <view class="">
- <view style="float: left;" class="name-align-task" >任务说明:</view>
- <rich-text :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
- </view>
- <!-- <view class="">
- 时间:{{item.createTime}}
- </view> -->
- <view><text class="name-align-task" >接收单位:</text>{{item.orgId}}</view>
- <view><text class="name-align-task" >接收人员:</text>{{item.receiverName}}</view>
- <view><text class="name-align-task" >发送者:</text>{{item.senderName}}</view>
- <view class="buju" style="display: flex;justify-content: space-between;align-items: center;">
- <view><text class="name-align-task" >发布时间:</text>{{item.createTime}}</view>
- <view class="an-niu">
- <text @click="showModal(item.id,item.broadId)" class="detail"
- v-if="item.taskStatus==2">审核</text>
- <text @click="addClickDetail(item.broadId)" class="solve"
- v-if="item.taskStatus==1||2">查看详情</text>
- </view>
- </view>
- </uni-card>
- </view>
- <view style="text-align: center;">
- <view class="text-gray" style="padding-top: 20px;" v-if="tableData.length==0"> 暂无检查任务 </view>
- </view>
- <view>
- <image :src="Group" @click="addClick" class="tiantupian"></image>
- </view>
- <u-modal title="审核是否通过" :show="showShenHe" showCancelButton closeOnClickOverlay confirmText="审核通过"
- cancelText="审核不通过" @confirm="confirm" :closeOnClickOverlay="true" @cancel="cancel" @close="close">
- </u-modal>
- </view>
- <!-- 草稿箱 -->
- <view v-if="current == 3">
- <!-- <u-list @scrolltolower="scrolltolower">
- <u-list-item> -->
- <view class="" v-if="tableData.length!=0" class="last-margin">
- <uni-card v-for="(item, index) in tableData" :key="index">
- <view class="titles">{{item.taskName}}</view>
- <view style="float: left;width: 130rpx;" v-if="item.taskContent">任务说明:</view>
- <view class="">
- <rich-text :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
- </view>
- <view class="">
- <text class="name-align-task">创建时间:</text>{{item.createTime}}
- </view>
- <view class="an-niu">
- <!-- 发布任务以前是查看详情 -->
- <text @click="showToasts(item.id)" class="detail">发布任务</text>
- <text @click="goAddCheck(item.id)" class="solve">修改任务</text>
- <text @click="deletes(item.id)" class="deletes">删除</text>
- </view>
- </uni-card>
- </view>
- <view style="text-align: center;">
- <view class="text-gray" style="padding-top: 20px;" v-if="tableData.length==0"> 暂无检查任务 </view>
- </view>
- <view>
- <image :src="Group" @click="addClick" class="tiantupian"></image>
- </view>
- <!-- </u-list-item>
- </u-list> -->
- </view>
- <!-- 归档 -->
- <view v-if="current == 4">
- <view class="" v-if="tableData.length!=0">
- <uni-card v-for="(item, index) in tableData" :key="index" class="last-margin">
- <view class="titles">{{item.taskName}}</view>
- <view style="float: left;width: 130rpx;" v-if="item.taskContent">任务说明:</view>
- <view class="">
- <rich-text :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
- </view>
- <view class="">
- <text class="name-align-task">完成时间:</text>{{item.createTime}}
- </view>
- <view class="an-niu">
- <text @click="addClickDetail(item.broadId)" class="detail">查看详情</text>
- </view>
-
- </uni-card>
- </view>
- <view style="text-align: center;">
- <view class="text-gray" style="padding-top: 20px;" v-if="tableData.length==0"> 暂无检查任务 </view>
- </view>
- <view>
- <image :src="Group" @click="addClick" class="tiantupian"></image>
- </view>
- </view>
- <!-- 多选closeable closeOnClickOverlay--点击遮罩层不可关闭检查项的弹出内容选中 ,选择单位-->
- <!-- 支队大队进来转发任务显示单位,不能删 -->
- <!-- <u-popup :show="checkboxShow2" :round="10" @close="checkboxShow2=false" style="position: relative;">
- <view style="width: 100%;position: absolute;left:0;bottom:30rpx;z-index: 9999;">
- <uni-row>
- <uni-col :span='12'>
- <u-button shape="circle" type="primary" color="#4CB2B6" text="确定" @click="checkboxConfirm2">
- </u-button>
- </uni-col>
- <uni-col :span='12'>
- <u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle"
- @click="checkboxCancel2">
- </u-button>
- </uni-col>
- </uni-row>
- </view>
- <view class="page-body" :style="'height:' + height + 'px'">
- <scroll-view class="nav-left" scroll-y :style="'height:' + height + 'px'" :scroll-top="scrollLeftTop"
- scroll-with-animation>
- <view class="nav-left-item" :class="index == categoryActive ? 'active' : ''"
- v-for="(item, index) in list2" @click="categoryClickMain(index,item)" :key="index">
- {{ `单位${item.id}` }}
- </view>
- </scroll-view>
- <scroll-view class="nav-right" scroll-y :scroll-top="scrollTop" @scroll="scroll"
- :style="'height:' + height + 'px'" scroll-with-animation>
- <view v-for="(item, index) in list2" :key="index" class="box">
- <view style="height: 60rpx;font-size: 32rpx;color:#000;font-weight: 600;padding: 25rpx;">
- {{ `单位${item.id}` }}
- </view>
- <view class="nav-right-item">
- <u-checkbox-group size='20' iconSize='18' placement="row" iconPlacement='right'
- v-model="items.checkedList2" v-for="(items, i) in item.orgDOList" :key="i"
- @change="checkboxChange2(items.id,$event)">
- <u-checkbox activeColor="green" :customStyle="{marginBottom: '5px'}"
- :label="items.orgName" :name="items.id">
- </u-checkbox>
- </u-checkbox-group>
- </view>
- </view>
- </scroll-view>
- </view>
- </u-popup> -->
- <!-- 单位进来转发任务显示人员 -->
- <u-popup :show="checkboxShow2" :round="10" @close="checkboxShow2=false" style="position: relative;"
- mode="center">
- <view style="width: 90vw;padding: 10px;">
- <text class="text-xl">检查人员</text>
- <view class="" class="person-forward">
- <u-checkbox-group v-model="item.checkboxValue1" v-for="(item, index) in personInfo" :key="index"
- placement="column" @change="checkboxChange2(item.user_id,$event)" activeColor="#4CB2B6">
- <u-checkbox :customStyle="{marginBottom: '8px'}" :label="item.nickname" :name="item.user_id">
- </u-checkbox>
- </u-checkbox-group>
- </view>
- <view class="flex flex-direction-row " style="margin: 30rpx 0;">
- <u-button shape="circle" type="primary" color="#4CB2B6" text="确定" @click="checkboxConfirm2"
- customStyle="margin-right:20px;padding:0 30px">
- </u-button>
- <u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle" @click="checkboxCancel2"
- customStyle="padding:0 30px">
- </u-button>
- </view>
- </view>
- </u-popup>
- <!-- 加载中 -->
- <isLodingModel></isLodingModel>
- </view>
- </template>
- <script>
- import {
- getCheckActiveList,
- getCheckActivePendList, // 主动检查提交历史列表
- draftTask, //获取草稿箱任务列表
- taskList, //获取除草稿箱以外的列表
- saveCheckRelease, //发布任务
- deleteTask, //删除任务
- addCheckActiveCompany, //获取单位
- checkSubmitForwardTask, //确认转发任务
- checkGetPerson, //单位转发任务获取人员
- verifytask //审核
- } from "@/api/check_active";
- import {
- shijianc
- } from '@/utils/common.js'
- import config from '@/config'
- const baseUrlImg = config.baseUrlImg
- // import jiezhiTime from '@/static/images/checkActive/jiezhiTime.png'; //暂时用的草稿箱图片
- export default {
- data() {
- return {
- startSingle: '',
- endSingle: '',
- datetimerange:[],
- checkedList2: [], //检查单位已选择列表
- list2: [], //选择单位项目的数据
- Group: `${baseUrlImg}/checkActive/Group.png`,
- // jiezhiTime: jiezhiTime, //暂时用的草稿箱图片
- current: 0,
- items: [{
- name: '待完成'
- }, {
- name: '已完成'
- }, {
- name: '已发布'
- }, {
- name: '草稿箱'
- }, {
- name: '归档'
- }],
- tableData: [],
- // 每页数据量
- pageSize: 10,
- // 当前页
- pageNo: 1,
- // 数据总量
- total: 0,
- taskStatus: 0, //任务状态,0代表未执行刚建好,可修改,1表示已执行不能改
- // tableData数据加载中
- loading: false,
- // 初始化时搜索框的值
- keyword: '',
- // 开始时间与结束时间
- formData: {
- start: '请选择开始时间',
- end: '请选择结束时间',
- },
- showtimeStart: false,
- showtimeEnd: false,
- showShenHe: false,
- checkboxShow2: false, //待完成转发弹窗
- taskType: '',
- formdata: {
- pageNo: 1,
- pageSize: 10,
- creator: this.$store.state.user.id,
- taskStatus: 0,
- taskType: '',
- taskName: ''
- },
- ids: '', //当前点击转发任务的id
- FormDataTask: {
- "broadId": 0,
- "deptId": [],
- "id": 0,
- "orgId": [],
- "sender": this.$store.state.user.id,
- "receiver": [],
- "status": 0,
- "taskContent": "",
- "taskName": "",
- "taskStatus": 0,
- "taskType": "" //任务类型 1对应主动检查
- },
- personInfo: [], //转发任务的人员信息
- taskShen: 0, //审核通过状态改为3,不通过1
- taskId: 0,
- broad: 0,
- checkboxValue1: [], // u-checkbox-group的v-model绑定的值如果设置为某个checkbox的name,就会被默认选中
- //侧边栏联动
- height: 0,
- categoryActive: 0,
- scrollTop: 0,
- scrollLeftTop: 0,
- arr: [0, 584, 1168, 1752, 2336, 2805, 3274, 3858, 4442, 4911, 5380, 5734, 6203, 6672,
- 7017
- ], //初始值,后边计算会根据手机适配覆盖
- leftItemHeight: 51, //49行会计算出新值进行覆盖
- navLeftHeight: 0, //左边scroll-view 内层nav的总高度
- diff: 0, //左边scroll-view 内层nav的总高度与视口之差
- tabBarHeight: 0 //如果此页面为Tab页面,自己改变高度值,,一般tab高度为51
- }
- },
- watch: {
- loading: {
- handler(newLength, oldLength) {
- this.$modal.isLoadingModel(this.loading)
- },
- immediate: true
- }
- },
- // 在 vue页面,向起始页通过事件传递数据
- onLoad: function(option) {
- console.log(option, 'optionoptionoption');
- uni.setNavigationBarTitle({
- title: option.title
- })
- if (option.type) {
- this.FormDataTask.taskType = option.type
- this.taskType = option.type
- }
- if (option.current) {
- this.current = option.current
- }
- },
- onShow() {
- this.checkedTotal(this.pageNo)
- this.tableData = []
- this.getData(this.formData.pageNo)
- this.height = uni.getSystemInfoSync().windowHeight - this.tabBarHeight //设置侧边联动的高
- },
- mixins: [uni.$u.mixin],
- methods: {
- //搜索
- /** 搜索按钮操作 */
- /** 搜索按钮操作 */
- handleQuery() {
- // const end = new Date(this.endSingle).getTime()
- // const start = new Date(this.startSingle).getTime()
- // if (!this.endSingle && !this.startSingle) {
- // this.pageNo = 1;
- // this.tableData=[]
- // this.getData(1);
- // } else if (this.endSingle && this.startSingle && start <= end) {
- // // } else{
- this.pageNo = 1;
- this.tableData=[]
- this.getData(1);
- // } else if (start > end) {
- // this.$modal.msgError('结束时间不能小于事件时间')
- // } else {
- // this.$modal.msgError('请选择事件时间和结束时间')
- // }
- },
- //popup检查单位确定============
- checkboxConfirm2() {
- // this.checkedList2.map(v => { //选择检查单位,不能删,支队和大队时放开
- // v.map(i => {
- // this.FormDataTask.orgId.push(i)
- // })
- // })
- this.FormDataTask.receiver = this.checkedList2 //选择检查人员,不能删,支队和大队时放开
- checkSubmitForwardTask(JSON.stringify(this.FormDataTask)).then(response => {
- if (response.data) {
- this.$modal.msg('转发成功')
- this.checkboxShow2 = false
- this.tableData = []
- this.getData(this.pageNo)
- } else {
- this.$modal.msgError(response.msg)
- }
- })
- },
- //popup取消
- checkboxCancel2() {
- this.checkboxShow2 = false
- this.checkedList2 = []
- },
- checkboxChange2(i, n) {
- if (i && n.length != 0) {
- this.checkedList2.push(i)
- } else if (i && n.length == 0) {
- this.checkedList2 = this.checkedList2.filter(item => item != i)
- }
- },
- checkedTotal(pageNo, value = '') {
- // this.loading = true
- this.pageNo = pageNo
- const form = {
- // pageNo: this.pageNo,
- // pageSize: this.pageSize,
- userId: this.$store.state.user.id
- }
- addCheckActiveCompany( //获取所属单位
- form
- ).then(response => {
- this.list2 = response.data
- });
- },
- //========
- close() {
- this.showShenHe = false
- },
- //发布任务弹框
- showToasts(val) {
- saveCheckRelease({
- id: val
- }).then(response => {
- if (response.data) {
- this.tableData = []
- this.getData(this.pageNo)
- setTimeout(() => {
- uni.showToast({
- title: `发布成功`
- })
- }, 500)
- this.current = 2
- this.getData(this.pageNo)
- }
- })
- },
- //转发
- forward(val) { //展示转发的弹出层
- this.ids = val.id //当前点击任务的id
- this.checkboxShow2 = true
- this.FormDataTask.broadId = val.broadId
- this.FormDataTask.id = this.ids
- this.FormDataTask.taskName = val.taskName
- this.FormDataTask.taskStatus = val.taskStatus
- this.FormDataTask.taskContent = val.taskContent
- this.FormDataTask.orgId.push(val.orgId)
- checkGetPerson({
- orgId: val.orgId
- }).then(response => {
- this.personInfo = response.data
- })
- },
- //草稿箱删除
- deletes(val) {
- deleteTask({
- id: val
- }).then(response => {
- if (response.code == 0) {
- this.tableData = []
- this.getData(this.pageNo)
- uni.showToast({
- title: '删除成功',
- icon: "none"
- }, 200)
- }
- })
- },
- //审核模态框
- showModal(taskId, broad) {
- this.showShenHe = true
- this.taskId = taskId
- this.broad = broad
- },
- //审核通过
- confirm() {
- this.taskShen = 3
- this.showShenHe = false
- verifytask({
- taskId: this.taskId,
- broadId: this.broad,
- status: this.taskShen
- }).then(response => {
- if (response.data) {
- this.tableData = []
- this.current = 4
- this.getData(this.pageNo)
- }
- })
- },
- //审核不通过
- cancel() {
- this.taskShen = 1
- this.showShenHe = false
- verifytask({
- taskId: this.taskId,
- broadId: this.broad,
- status: this.taskShen
- }).then(response => {
- if (response.data) {
- this.tableData = []
- this.getData(this.pageNo)
- }
- })
- },
- //修改任务
- goAddCheck(val) {
- console.log(this.taskType, 'this.taskType修改');
- uni.navigateTo({
- url: `/pagesA/fire/check_active/add_check/add_check?id=${val}&type=${this.taskType}`
- })
- },
- //去完成
- addClickModify(val) {
- uni.navigateTo({
- url: `/pagesA/fire/check_active/check_implement/check_implement?id=${val.id}&broadId=${val.broadId}&orgId=${val.orgId}&type=${this.taskType}`,
- // url:'/pagesA/fire/xiangjiceshi/xiangjiceshi',
- success: function(res) {
- res.eventChannel.emit('acceptDataFromOpenerPage', val);
- }
- })
- },
- //查看详情
- addClickDetail(val) {
- uni.navigateTo({
- url: `/pagesA/fire/check_active/check_list/check_list?id=${val}¤t=${this.current}`,
- success: function(res) {
- res.eventChannel.emit('acceptDataFromOpenerPage', val);
- }
- })
- },
- navigateBack() {
- uni.navigateBack()
- },
- // tab头部点击
- onClickItem(e) {
- if (this.current !== e.index) {
- this.current = e.index
- }
- this.tableData = []
- this.pageNo = 1
- this.getData(this.pageNo)
- },
- // 获取数据
- getData(pageNo, value = '') {
- this.loading = true;
- if (this.current == 3) { //获取草稿箱内的列表
- this.formdata = {
- pageNo: 1,
- pageSize: 10,
- userId: this.$store.state.user.id,
- taskStatus: 0,
- taskType: this.taskType,
- taskName: this.keyword,
- }
- this.formdata.pageNo = pageNo ? pageNo : 1;
- this.formdata.startTime=this.datetimerange[0]?this.datetimerange[0]+' 00:00:00':'';
- this.formdata.endTime=this.datetimerange[1]?this.datetimerange[1]+' 23:59:59':''
- const json = JSON.stringify(this.formdata)
- draftTask(json).then(response => {
- // 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
- this.tableData = [...this.tableData, ...response.data.list]
- this.tableData.map(i=>{
- i.createTime=i.createTime?shijianc(i.createTime):''
- })
- this.total = response.data.total
- this.loading = false;
- })
- } else {
- this.loading = true;
- if (this.current == 0) {
- this.formdata = {
- pageNo: 1,
- pageSize: 10,
- taskStatus: 1,
- receiver: this.$store.state.user.id,
- taskType: this.taskType,
- taskName: this.keyword,
- }
- this.List(pageNo)
- } else if (this.current == 1) {
- this.formdata = {
- pageNo: 1,
- pageSize: 10,
- taskStatus: 2,
- receiver: this.$store.state.user.id,
- taskType: this.taskType,
- taskName: this.keyword,
- }
- console.log(this.formdata, this.keyword, '=========');
- this.List(pageNo)
- } else if (this.current == 2) {
- this.formdata = {
- pageNo: 1,
- pageSize: 10,
- taskStatus: 1,
- sender: this.$store.state.user.id,
- taskType: this.taskType,
- taskName: this.keyword,
- }
- console.log(this.formdata, this.keyword, '=========');
- this.List(pageNo)
- this.formdata.taskStatus = 2
- this.List(pageNo)
- } else if (this.current == 4) {
- this.formdata = {
- pageNo: 1,
- pageSize: 10,
- taskStatus: 3,
- taskType: this.taskType,
- taskName: this.keyword,
- }
- this.List(pageNo)
- }
- }
- // this.loading = false
- },
- List(pageNo) { //getData共用的接口
- this.formdata.pageNo = pageNo ? pageNo : 1;
- this.formdata.startTime=this.datetimerange[0]?this.datetimerange[0]+' 00:00:00':'';
- this.formdata.endTime=this.datetimerange[1]?this.datetimerange[1]+' 23:59:59':''
- const json = JSON.stringify(this.formdata)
- taskList(json).then(response => {
- this.tableData = [...this.tableData, ...response.data.list]
- this.tableData.map(i=>{
- i.createTime=i.createTime?shijianc(i.createTime):''
- })
- this.total = response.data.total
- this.loading = false;
- })
- },
- onClick(val) {
- uni.navigateTo({
- url: '/pagesA/fire/check_active/check_details/check_details?id=' + val.id,
- events: {
- // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
- acceptDataFromOpenedPage: function(val) {},
- },
- success: function(res) {
- // 通过eventChannel向被打开页面传送数据
- res.eventChannel.emit('acceptDataFromOpenerPage', val)
- }
- })
- },
- addClick() {
- console.log(this.taskType, 'this.taskType新增');
- uni.navigateTo({
- url: `/pagesA/fire/check_active/add_check/add_check?type=${this.taskType}`
- })
- },
- //侧边栏导航联动
- getHeightList() {
- let _this = this;
- let selectorQuery = uni.createSelectorQuery();
- selectorQuery.selectAll('.nav-left-item').boundingClientRect(function(rects) {
- _this.leftItemHeight = rects[0].height;
- _this.navLeftHeight = _this.leftItemHeight * this.list.length;
- _this.diff = _this.navLeftHeight - _this.height;
- });
- selectorQuery.selectAll('.box').boundingClientRect(function(rects) {
- let arr = [0];
- let top = 0;
- if (rects) {
- rects.forEach(function(rect) {
- top += rect.height;
- arr.push(top);
- });
- };
- _this.arr = arr;
- }).exec();
- },
- scroll(e) {
- let _this = this;
- if (this.timeoutId) {
- clearTimeout(this.timeoutId);
- }
- this.timeoutId = setTimeout(function() {
- //节流
- _this.scrollHeight = e.detail.scrollTop + 1 + _this.height / 2;
- //+1不要删除,解决最后一项某种情况下翻到底部,左边按钮并不会切换至最后一个
- //若想使切换参考线为屏幕顶部请删除 _this.height/2
- for (let i = 0; i < _this.arr.length; i++) {
- let height1 = _this.arr[i];
- let height2 = _this.arr[i + 1];
- if (!height2 || (_this.scrollHeight >= height1 && _this.scrollHeight < height2)) {
- _this.categoryActive = i;
- _this.diff > 0 && (_this.scrollLeftTop = Math.round((_this.categoryActive * _this
- .diff) / (this.list.length - 1)));
- return false;
- }
- }
- _this.categoryActive = 0;
- _this.timeoutId = undefined;
- }, 10);
- },
- categoryClickMain(index, item) {
- this.categoryActive = index;
- this.scrollTop == this.arr[index] ? (this.scrollTop = this.scrollTop + 1) : (this.scrollTop = this.arr[
- index]); //防止两次相等造成点击不触发滚动时间
- }
- // 触底的事件
- // scrolltolower() {
- // // 判断是否还有下一页数据
- // if (this.formdata.pageNo * this.formdata.pageSize >= this.total) return uni.showToast({
- // title: `数据加载完毕`
- // })
- // // 判断是否正在请求其它数据,如果是,则不发起额外的请求
- // if (this.loading) return
- // this.formdata.pageNo += 1
- // this.getData(this.formdata.pageNo)
- // },
- },
- // 触底的事件
- onReachBottom() {
- // 判断是否还有下一页数据
- if (this.pageNo * this.pageSize >= this.total) return uni.showToast({
- title: `数据加载完毕`
- })
- // 判断是否正在请求其它数据,如果是,则不发起额外的请求
- if (this.loading) return
- this.pageNo += 1
- this.getData(this.pageNo)
- },
- }
- </script>
- <style>
- page {
- background-color: #F5F7F9;
- }
- </style>
- <style lang="scss" scoped>
- body {
- background-color: #F5F7F9;
- }
- /deep/ .u-tabs__wrapper[data-v-0de61367],
- .u-tabs__wrapper.data-v-0de61367,/deep/ .u-tabs__wrapper {
- width: 99%;
- }
- /deep/.u-tabs__wrapper__nav__item[data-v-0de61367],
- /deep/.u-tabs__wrapper__nav__item.data-v-0de61367,/deep/.u-tabs__wrapper__nav__item {
- padding: 0 60rpx;
- }
- .addInsp {
- width: 40px;
- position: fixed;
- right: 4px;
- z-index: 99999;
- }
- ::v-deep .u-icon__icon {
- top: 2px !important;
- padding-left: 3px !important;
- }
- .an-niu {
- // float: right;
- font-size: 10px;
- text-align: center;
- display: flex;
- align-items: end;
- justify-content: flex-end;
- padding-bottom: 30rpx;
- color: #fff;
- margin-top: 30rpx;
- .detail {
- width: 72px;
- height: 60rpx;
- border-radius: 30px;
- background-color: #F7C41E;
- margin-right: 20rpx;
- text-align: center;
- line-height: 60rpx;
- }
- .solve {
- width: 62px;
- height: 60rpx;
- margin-right: 20rpx;
- border-radius: 30px;
- background-color: #4CB2B6;
- line-height: 60rpx;
- }
- .forword {
- //已转发
- background-color: #BBBBBB;
- }
- .deletes {
- width: 62px;
- height: 60rpx;
- border-radius: 60rpx;
- background-color: red;
- color: #fff;
- line-height: 60rpx;
- }
- }
- /deep/.segmented-control__item--button {
- background-color: rgb(76, 178, 182) !important;
- }
- /deep/.segmented-control__item--button--active {
- background-color: #FFFFFF !important;
- }
- /deep/.uni-card {
- box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
- border-radius: 30rpx;
- }
- .tiantupian,
- .caogaoxiang {
- width: 110rpx;
- height: 110rpx;
- position: fixed;
- right: 15px;
- bottom: 80rpx;
- }
- .caogaoxiang {
- bottom: 150rpx;
- width: 120rpx;
- right: 40rpx;
- height: 120rpx;
- }
- //列表样式
- .titles {
- font-weight: 600;
- margin-bottom: 10rpx;
- font-size: 16px;
- }
- .conts {
- font-size: 12px;
- max-width: 470rpx;
- display: -webkit-box;
- /*弹性伸缩盒子模型显示*/
- -webkit-box-orient: vertical;
- /*排列方式*/
- -webkit-line-clamp: 1;
- /*显示文本行数*/
- overflow: hidden;
- /*溢出隐藏*/
- color: #274647;
- text-overflow: ellipsis;
- /*不知道干嘛的*/
- .conts-title {
- margin-right: 10rpx;
- color: #728F90;
- }
- }
- //侧边联动
- /deep/.page-body {
- display: flex;
- background: #fff;
- overflow: hidden;
- }
- .nav {
- display: flex;
- width: 100%;
- }
- .nav-left {
- width: 25%;
- background: #fafafa;
- }
- .nav-left-item {
- height: 100upx;
- border-right: solid 1px #f1f1f1;
- border-bottom: solid 1px #f1f1f1;
- font-size: 30upx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .nav-left-item:last-child {
- border-bottom: none;
- }
- .nav-right {
- width: 75%;
- }
- /deep/.nav-right-item {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- }
- /deep/.u-checkbox {
- width: 80% !important;
- margin-bottom: 30rpx !important;
- }
- /deep/ .u-checkbox-group {
- width: 33%;
- // justify-content: flex-end;
- }
- .box {
- display: block;
- overflow: hidden;
- border-bottom: 20upx solid #f3f3f3;
- /* min-height: 100vh; */
- /*若您的子分类过少想使得每个子分类占满屏请放开上边注视 */
- }
- .box:last-child {
- border: none;
- min-height: 100vh;
- }
- .u-checkbox-group--row.data-v-3d1b15f2 {
- display: flex;
- flex-direction: row;
- }
- .nav-right-item {
- margin-top: 20px;
- float: left;
- padding: 11upx;
- font-size: 28upx;
- background: #fff;
- /deep/.u-checkbox__icon-wrap[data-v-532d01c7],/deep/.u-checkbox__icon-wrap {
- //复选框的样式
- margin: 0 20rpx;
- }
- /deep/ uni-view[data-v-3d1b15f2] {
- //复选框上线的间距
- margin: 20rpx 0 !important;
- }
- // /deep/ .u-checkbox__icon-wrap--square{
- // margin: 20rpx;
- // }
- .u-checkbox-label--right[data-v-532d01c7],.u-checkbox-label--right {
- margin-right: 40rpx;
- }
- }
- .nav-right-item image {
- width: 150upx;
- height: 150upx;
- }
- .active {
- font-weight: 700;
- color: #274647;
- background: #fff;
- border-right: 0;
- }
- ::-webkit-scrollbar {
- /*取消小程序的默认导航条样式*/
- width: 0;
- height: 0;
- color: transparent;
- }
- /deep/.u-button[data-v-3bf2dba7],
- /deep/.u-button.data-v-3bf2dba7,/deep/.u-button {
- //按钮大小
- width: 33% !important;
- }
- //转发任务人员弹出
- .u-popup-slot {
- min-width: 300px;
- min-height: 400px;
- position: relative;
- .u-popup-slot-item {
- @include flex;
- justify-content: space-around;
- flex-direction: column;
- align-items: flex-start;
- padding: 0 40rpx;
- }
- .title {
- padding: 40rpx;
- color: #383838;
- font-size: 16px;
- font-weight: 600;
- }
- .sure-or-cancel {
- display: flex;
- position: absolute;
- bottom: 40px;
- left: 21%;
- }
- }
- .person-forward {
- padding-top: 40rpx;
- display: flex;
- flex-wrap: wrap;
- }
- /deep/.u-checkbox__icon-wrap--square[data-v-532d01c7],
- /deep/.u-checkbox__icon-wrap--square.data-v-532d01c7,/deep/.u-checkbox__icon-wrap--square {
- //转发复选框的颜色
- border-color: #4CB2B6 !important;
- }
- .top {
- display: flex;
- align-items: center;
- width: 90%;
- margin-left: 5%;
- justify-content: space-between;
- .search-time {
- display: flex;
- align-items: center;
- margin-top: 40rpx;
- margin-bottom: 20rpx;
- .time-item {
- margin-right: 20rpx;
- }
- }
- }
- </style>
|