<template>
|
<view class="container">
|
<cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask">
|
<block slot="backText">返回</block>
|
<block slot="content">待办</block>
|
<block slot="right">
|
<view @click="search">
|
<image class="search" src="/static/icon/sear.png" style="width: 25px; height: 25px;" alt="" />
|
</view>
|
</block>
|
</cu-custom>
|
|
<view style="width: 100%;">
|
<uni-popup ref="popup" background-color="#fff" :type="type">
|
<view class="popupView">
|
<!-- 基础表单校验 -->
|
<uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext">
|
<uni-group title="" top="0">
|
<uni-forms-item name="num" :labelWidth="80" label="流程分类:">
|
|
|
<uni-data-select v-model="formData.type" :localdata="typeList" @change="changetypeList"
|
placeholder="请选择流程" />
|
</uni-forms-item>
|
<uni-forms-item name="name" :labelWidth="80" label="设备编号:">
|
<uni-easyinput v-model="formData.num" placeholder="请输入设备编号" />
|
</uni-forms-item>
|
</uni-group>
|
</uni-forms>
|
<view class="flex">
|
|
<view
|
class="cuIcon-search flex-sub bg-blue padding-sm margin-xs margin-left-lg margin-right-lg text-sm text-center"
|
@click="getSera">查询
|
</view>
|
<view
|
class="cuIcon-refresh flex-sub bg-white solids padding-sm margin-xs radius text-sm text-center margin-left-lg margin-right-lg"
|
@click="resetTask">重置</view>
|
</view>
|
|
</view>
|
</uni-popup>
|
</view>
|
|
<view class="container">
|
|
<mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback">
|
<!-- 列表信息开始 -->
|
<view class="content">
|
<uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index"
|
@click="onClickProductionTask(item)">
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">流程分类:</view>
|
<view class="flex-sub bg-white padding-xs margin-xs text-bold text-blue radius text-right">
|
{{item.category_dictText}}
|
</view>
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">流程名称:</view>
|
<view class="flex-sub bg-white padding-xs margin-xs text-bold radius text-right">
|
{{item.flowName}}
|
</view>
|
</view>
|
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">之前处理人:</view>
|
<view class="flex-sub bg-white padding-xs margin-xs radius text-right">
|
{{item.preNodeAssignee_dictText}}
|
</view>
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">前驱节点:</view>
|
<view class="flex-sub bg-white padding-xs margin-xs text-yellow radius text-right">
|
{{item.preNode}}
|
</view>
|
</view>
|
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">当前节点:</view>
|
<view class="flex-sub bg-white padding-xs margin-xs text-olive radius text-right">
|
{{item.name}}
|
</view>
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">流程描述:</view>
|
<view class="flex-sub bg-white padding-xs margin-xs radius text-right">
|
{{item.title}}
|
</view>
|
</view>
|
</uni-card>
|
</view>
|
|
</mescroll-uni>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
export default {
|
mixins: [MescrollMixin], // 使用mixin
|
data() {
|
return {
|
type: 'top',
|
scrollLeft: 0,
|
formData: {
|
num: '',
|
type: ''
|
},
|
NavBarColor: this.NavBarColor,
|
activeColor: '#5277A6',
|
url: {
|
flowType: "/sys/dict/getDictItems/flow_type",
|
stallList: "/assign/flow/toTaskBySelf"
|
},
|
|
upOption: {
|
page: {
|
num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
|
size: 10 // 每页数据的数量
|
},
|
noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
|
empty: {
|
tip: '~ 暂无数据 ~', // 提示
|
},
|
loading: '',
|
text: '全部',
|
isShowNoMore: false,
|
textNoMore: '我是有底线的 >_<'
|
},
|
styles: {
|
color: '#2979FF',
|
borderColor: '#2979FF'
|
},
|
typeList: [],
|
msgList: [], //列表数据
|
announcement1: [],
|
msg1Count: 0,
|
msg2Count: 0,
|
msg1Title: ""
|
}
|
},
|
computed: {
|
top() {
|
return this.CustomBar * 2 + 50
|
},
|
style() {
|
var StatusBar = this.StatusBar;
|
var CustomBar = this.CustomBar;
|
var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
|
return style
|
},
|
},
|
|
|
onShow() {
|
if (this.mescroll) {
|
this.mescroll.resetUpScroll()
|
}
|
},
|
|
created() {
|
this.getTypeList()
|
},
|
methods: {
|
/**
|
* 流程分类列表事件
|
*/
|
getTypeList() {
|
this.$http.get(this.url.flowType).then(res => {
|
//设置列表数据
|
if (res.data.success) {
|
console.log(res)
|
this.typeList = res.data.result
|
}
|
}).catch(() => {
|
//联网失败, 结束加载
|
})
|
|
},
|
changetypeList(e) {
|
this.formData.type = e;
|
},
|
/**
|
* @param {Object} item
|
* 详情页面
|
*/
|
onClickProductionTask(item) {
|
const name = item.name;
|
const type = item.category_dictText;
|
let url = '';
|
|
switch (true) {
|
case (name === '是否需要领用备件' && type === '设备维修'):
|
url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts';
|
break;
|
case (name === '点检执行' && type === '设备点检'):
|
url = '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils';
|
break;
|
case (name === '周保执行' && type === '设备周保'):
|
url = '/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou';
|
break;
|
case (name === '班组长确认' && type === '设备点检'):
|
url = '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure';
|
break;
|
case (name === '班组长确认' && type === '设备周保'):
|
url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure';
|
break;
|
case (name === '设管员初验' && type === '设备周保'):
|
url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure';
|
break;
|
case (name === '设能部终验' && type === '设备周保'):
|
url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure';
|
break;
|
case (name === '管理员领用备件' && type === '设备维修'):
|
url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts';
|
break;
|
case (name === '操作工确认' && type === '设备维修'):
|
url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts';
|
break;
|
case (name === '维修执行' && type === '设备维修'):
|
url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts';
|
break;
|
case (name === '点检工单' && type === '设备点检'):
|
url = '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils';
|
|
break;
|
default:ToDoCheckDetils
|
console.warn(`No URL found for name: ${name} and type: ${type}`);
|
return;
|
}
|
|
if (url) {
|
uni.redirectTo({
|
url: `${url}?item=${encodeURIComponent(JSON.stringify(item))}`
|
});
|
}
|
},
|
|
|
search() {
|
this.$refs.popup.open();
|
},
|
|
upCallback(page) {
|
this.$http.get(this.url.stallList, {
|
params: {
|
pageNo: page.num,
|
pageSize: page.size,
|
order: 'desc',
|
column: 'createTime'
|
},
|
|
}).then(res => {
|
this.announcement1 = res.data.result.records
|
this.mescroll.endSuccess(this.announcement1.length);
|
console.log("url", res)
|
//设置列表数据
|
if (res.data.success) {
|
console.log("res", res.data)
|
this.msg1Count = res.data.result.total
|
this.msg1Title = "通知(" + res.data.result.total + ")";
|
for (let annItem of this.announcement1) {
|
this.msgList.push(annItem)
|
}
|
}
|
if (page.num == 1) {
|
this.msgList = []; //如果是第一页需手动制空列表
|
this.msgList = this.msgList.concat(this.announcement1); //追加新数据
|
}
|
|
}).catch(() => {
|
//联网失败, 结束加载
|
this.mescroll.endErr();
|
})
|
|
},
|
|
|
resetTask() {
|
this.formData.num = ''
|
this.formData.type = ''
|
this.$refs.popup.close();
|
this.mescroll.resetUpScroll()
|
|
},
|
/* 检索 */
|
getSera() {
|
this.$refs.popup.close();
|
this.msgList = [];
|
this.$http.get(this.url.stallList, {
|
params: {
|
pageNo: 1,
|
pageSize: 9999,
|
order: "desc",
|
column: "createTime",
|
title: this.formData.num,
|
category: this.formData.type
|
|
}
|
}).then(res => {
|
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
|
this.announcement1 = res.data.result.records
|
this.mescroll.endSuccess(this.announcement1.length);
|
console.log("url", res)
|
//设置列表数据
|
if (res.data.success) {
|
console.log("res", res.data)
|
this.msg1Count = res.data.result.total
|
this.msg1Title = "通知(" + res.data.result.total + ")";
|
for (let annItem of this.announcement1) {
|
this.msgList.push(annItem)
|
}
|
}
|
if (page.num == 1) {
|
this.msgList = []; //如果是第一页需手动制空列表
|
this.msgList = this.msgList.concat(this.announcement1); //追加新数据
|
}
|
|
}).catch(() => {
|
//联网失败, 结束加载
|
this.mescroll.endErr();
|
})
|
},
|
|
|
mescrollInit(mescroll) {
|
console.log('mescrollInit')
|
this.mescroll = mescroll;
|
},
|
},
|
|
}
|
</script>
|
|
<style>
|
.is-hover {
|
color: rgba(255, 255, 255, 0.6);
|
background-color: #55aaff;
|
border-color: #55aaff;
|
}
|
|
|
|
.content {
|
margin-top: 5px;
|
}
|
|
.content scroll-view {
|
scrollIndicator: "none"
|
}
|
|
.popupView {
|
margin-top: 85px;
|
height: auto;
|
}
|
</style>
|