| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <template>
- <view class="handlecase">
- <!-- <view class="" v-if="sysType == 2">
- <button type="primary" @tap="newlyAddedCases" v-if="checkPermi(['caseManagement:list:add'])">新增案件</button>
- </view> -->
- <List class="caseList" @pDeleteCase='deleteCase' v-for="(item,index) in caseList" :defalutVal='item'
- :buttonList='buttonList' :key="index" :sysType='sysType'>
- </List>
- <view class="emptyBox" v-if="caseList.length == 0">
- <luanqing-empty :show="true" textColor="#000"></luanqing-empty>
- </view>
- </view>
- </template>
-
- <script>
- import List from './component/list.vue'
- import {
- respondentList,
- caseApplicationTj,
- queryCaseFlowInfo
- } from '../../api/handlecase/index.js'
- import LuanqingEmpty from "@/components/luanqing-empty.vue"
- export default {
- components: {
- List,
- 'luanqing-empty': LuanqingEmpty,
- },
- data() {
- return {
- caseList: [],
- pageNum: 1,
- pageSize: 50,
- sysType: null,
- total: null,
- buttonList: []
- }
- },
- methods: {
- /**查询按钮列表 */
- getButtonList() {
- queryCaseFlowInfo({
- pageNum: 1,
- pageSize: 100000
- }).then(res => {
- res.rows.forEach(item => {
- if (item.id != 11 && item.id != 17) {
- this.buttonList.push(item)
- }
- });
- })
- },
- getList(parms) {
- console.log(111)
- this.caseList = [];
- if (this.sysType == 1) {
- respondentList(parms).then(res => {
- // this.caseList = res.rows;
- if (res.rows) {
- this.caseList = [...this.caseList, ...res.rows];
- } else {
- this.caseList = []
- }
-
- console.log(res.rows,this.caseList)
-
- })
- } else if (this.sysType == 2) {
- parms.miniProgressFlag = 1;
- caseApplicationTj(parms).then(res => {
- this.total = res.total;
- if (res.rows) {
- this.caseList = [...this.caseList, ...res.rows];
- } else {
- this.caseList = []
- }
- })
-
- }
-
- },
- // 新增案件
- newlyAddedCases() {
- uni.navigateTo({
- url: `/pages/handlecase/component/newlyAddedCase?title=新增案件`
- })
- },
- // 触底
- onReachBottom() {
- if (this.caseList.length < 1) {
- return
- } else if (this.total == this.caseList.length) {
- uni.showToast({
- title: '没有数据啦',
- icon: 'none',
- duration: 1000
- })
- return
- } else if (this.caseList.length < 10) {
- uni.showToast({
- title: '没有数据啦',
- icon: 'none',
- duration: 1000
- })
- return
- }
- this.pageNum++;
- let obj = {};
- if (this.sysType == 1) {
- obj = {
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- }
- } else if (this.sysType == 2) {
- obj = {
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- }
- }
- this.getList(obj)
- },
- },
- onShow() {
- this.buttonList = []
- this.sysType = uni.getStorageSync('sysType');
- let obj = {}
- if (this.sysType == 1) {
- obj = {
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- }
- } else if (this.sysType == 2) {
- obj = {
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- caseFlowId:this.caseFlowId
- }
- this.getButtonList();
- }
- this.getList(obj)
- // this.getButtonList()
- },
- onLoad(data) {
- this.caseFlowId = data.caseFlowId
- // let obj = {
- // pageNum: this.pageNum,
- // pageSize: this.pageSize,
- // caseStatus:4
- // }
- // this.getList(obj)
- },
- onUnload(){
- uni.reLaunch({
- url: '/pages/work/index'
- })
- }
-
- }
- </script>
-
- <style lang="scss">
- .handlecase {
- .caseList {
- // height: 360rpx;
- // background-color: #ffffff;
- // border-radius: 30rpx;
- // margin-top: 20rpx;
- }
- }
- </style>
|