|
@@ -77,7 +77,7 @@
|
|
|
<span class="cuIcon-title" style="color: #f67e1f;margin-right: 5px;"></span>
|
|
|
<span v-if="userInfo.roleNames == '过磅专员' " style="font-weight: bold">过磅记录</span>
|
|
|
<span v-if="userInfo.roleNames == '村负责人' " style="font-weight: bold">清运记录</span>
|
|
|
- <span v-if="userInfo.roleNames == '巡视员' " style="font-weight: bold">垃圾巡视</span>
|
|
|
+ <span v-if="userInfo.roleNames == '巡视员' || userInfo.roleNames == '乡镇巡查员' " style="font-weight: bold">垃圾巡视</span>
|
|
|
</span>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -148,14 +148,17 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="text-grey text-sm" style="font-size: 16px">
|
|
|
- <div style="margin-right: 20px; float: left">
|
|
|
+ <div style="margin-right: 20px; float: left" v-if="row.status === '2'">
|
|
|
<u-tag-small text="进行中" plain shape="circle" type="error"></u-tag-small>
|
|
|
</div>
|
|
|
- <div style="margin-right: 10px; float: left">
|
|
|
+ <div style="margin-right: 20px; float: left" v-else>
|
|
|
+ <u-tag-small text="已处理" plain shape="circle" type="error"></u-tag-small>
|
|
|
+ </div>
|
|
|
+ <div style="margin-right: 10px; float: left" v-if="row.transportMileage">
|
|
|
<span class="cuIcon-deliver" style="color: #d95141;margin-right: 5px;"></span>
|
|
|
<span>{{row.transportMileage}}km</span>
|
|
|
</div>
|
|
|
- <div style="margin-right: 10px;">
|
|
|
+ <div style="margin-right: 10px;" v-if="row.weight">
|
|
|
<span class="cuIcon-deletefill" style="color: #38b64b;margin-right: 5px;"></span>
|
|
|
<span>{{row.weight}}t</span>
|
|
|
</div>
|
|
@@ -177,7 +180,7 @@
|
|
|
|
|
|
<!-- 页脚区域 -->
|
|
|
<view class="footer-div">
|
|
|
- <u-button v-if="userInfo.roleNames == '巡视员' " type="primary" text="巡视工单" @click="openPatrolWorkOrderForm()"></u-button>
|
|
|
+ <u-button v-if="userInfo.roleNames == '巡视员' || userInfo.roleNames == '乡镇巡查员' " type="primary" text="巡视工单" @click="openPatrolWorkOrderForm()"></u-button>
|
|
|
<u-button v-if="userInfo.roleNames == '村负责人' " type="primary" text="清运工单" @click="start()"></u-button>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -226,6 +229,7 @@
|
|
|
import userService from "@/api/sys/userService"
|
|
|
import { EventBus } from '@/store/eventBus.js';
|
|
|
import disposeRubbishService from '@/api/garbageClearance/disposeRubbishService'
|
|
|
+ import flowCopyService from "@/api/flowable/flowCopyService"
|
|
|
export default {
|
|
|
components:{
|
|
|
userSelect
|
|
@@ -237,7 +241,8 @@
|
|
|
showType: 'task',
|
|
|
status: 'loadmore',
|
|
|
searchForm: {
|
|
|
- title: ''
|
|
|
+ title: '',
|
|
|
+ procInsName: ''
|
|
|
},
|
|
|
sprocessForm: {
|
|
|
filterText: ''
|
|
@@ -328,7 +333,7 @@
|
|
|
backgroundImage: 'linear-gradient(to right, #0285f7 0%, #19b3bd 100%)'
|
|
|
};
|
|
|
case '巡视员':
|
|
|
- case '镇巡视员':
|
|
|
+ case '乡镇巡查员':
|
|
|
return {
|
|
|
height: '130px',
|
|
|
borderRadius: '15px',
|
|
@@ -368,8 +373,15 @@
|
|
|
},
|
|
|
tabSelect(index) {
|
|
|
this.tabIndex = index;
|
|
|
+ this.tablePage.currentPage = 0
|
|
|
if(1 === index){
|
|
|
- this.haveDone()
|
|
|
+ const roleNames = this.userInfo.roleNames;
|
|
|
+ // 根据从 Vuex 获取的状态来判断样式
|
|
|
+ if('村负责人' === roleNames){
|
|
|
+ this.flowCopyShow()
|
|
|
+ }else{
|
|
|
+ this.haveDone()
|
|
|
+ }
|
|
|
}else {
|
|
|
this.loadmore()
|
|
|
}
|
|
@@ -411,6 +423,7 @@
|
|
|
},
|
|
|
// 跳转到详细页面
|
|
|
toDetail (row) {
|
|
|
+ console.log(row)
|
|
|
taskService.getTaskDef({
|
|
|
taskDefKey: row.taskDefinitionKey,
|
|
|
procInsId: row.processInstanceId,
|
|
@@ -460,8 +473,18 @@
|
|
|
orders: this.tablePage.orders,
|
|
|
...this.searchForm
|
|
|
}).then((data)=>{
|
|
|
+ console.log(this.dataList)
|
|
|
+ console.log(data.records)
|
|
|
+ var idList = []
|
|
|
+ for (const value of this.dataList) {
|
|
|
+ idList.push(value.task.id)
|
|
|
+ }
|
|
|
+ for (const value of data.records) {
|
|
|
+ if(!idList.includes(value.task.id)){
|
|
|
+ this.dataList=this.dataList.concat(value);
|
|
|
+ }
|
|
|
+ }
|
|
|
//追加新数据
|
|
|
- this.dataList=this.dataList.concat(data.records);
|
|
|
this.tablePage.pages = data.pages;
|
|
|
if(this.tablePage.pages <= this.tablePage.currentPage){
|
|
|
this.status = 'nomore'
|
|
@@ -505,13 +528,87 @@
|
|
|
});
|
|
|
|
|
|
// 使用 for...of 和 await 来处理异步操作
|
|
|
+ var procInsIdList = []
|
|
|
for (const value of data.records) {
|
|
|
if('垃圾处理流程' === value.processDefinitionName && '1' === value.vars.disposeType ){
|
|
|
- if(!value.currentTask){
|
|
|
- const rubbishStation = await disposeRubbishService.getByProcInsId(value.processInstanceId);
|
|
|
- value.weight = rubbishStation.weight;
|
|
|
- value.transportMileage = rubbishStation.transportMileage;
|
|
|
- value.subsidy = rubbishStation.subsidy;
|
|
|
+ procInsIdList.push(value.processInstanceId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(procInsIdList){
|
|
|
+ const rubbishStationList = await disposeRubbishService.getByProcInsId(procInsIdList);
|
|
|
+ for (const rubbishStation of rubbishStationList) {
|
|
|
+ for (const value of data.records) {
|
|
|
+ if(value.processInstanceId === rubbishStation.procInsId){
|
|
|
+ value.weight = rubbishStation.weight;
|
|
|
+ value.transportMileage = rubbishStation.transportMileage;
|
|
|
+ value.subsidy = rubbishStation.subsidy;
|
|
|
+ value.status = rubbishStation.status;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.dataList = this.dataList.concat(data.records);
|
|
|
+ this.tablePage.pages = data.pages;
|
|
|
+ this.status = this.tablePage.pages <= this.tablePage.currentPage ? 'nomore' : 'loadmore';
|
|
|
+
|
|
|
+ if(this.showType === 'task'){
|
|
|
+ this.dataList = []
|
|
|
+ this.tablePage.currentPage = 0;
|
|
|
+ this.loadmore()
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('Error loading data:', error);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 获取未读通知数量
|
|
|
+ const unreadCount = await notifyService.getUnreadCountByIsSelf({
|
|
|
+ isSelf: true,
|
|
|
+ ...this.searchForm
|
|
|
+ });
|
|
|
+ EventBus.$emit('dataFromMessage', unreadCount);
|
|
|
+ } catch (error) {
|
|
|
+ console.error('Error getting unread count:', error);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //抄送数据
|
|
|
+ async flowCopyShow() {
|
|
|
+
|
|
|
+ if(this.showType === 'task'){
|
|
|
+ this.dataList = [];
|
|
|
+ this.showType = 'history';
|
|
|
+ this.tablePage.currentPage = 0;
|
|
|
+ }
|
|
|
+ this.tablePage.currentPage++;
|
|
|
+ this.status = 'loading';
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 获取历史数据
|
|
|
+ const data = await flowCopyService.list({
|
|
|
+ current: this.tablePage.currentPage,
|
|
|
+ size: this.tablePage.pageSize,
|
|
|
+ orders: this.tablePage.orders,
|
|
|
+ ...this.searchForm
|
|
|
+ });
|
|
|
+ console.log(data)
|
|
|
+
|
|
|
+ // 使用 for...of 和 await 来处理异步操作
|
|
|
+ var procInsIdList = []
|
|
|
+ for (const value of data.records) {
|
|
|
+ procInsIdList.push(value.processInstanceId)
|
|
|
+ }
|
|
|
+ console.log(procInsIdList)
|
|
|
+ if(procInsIdList){
|
|
|
+ const rubbishStationList = await disposeRubbishService.getByProcInsId(procInsIdList);
|
|
|
+ for (const rubbishStation of rubbishStationList) {
|
|
|
+ for (const value of data.records) {
|
|
|
+ if(value.processInstanceId === rubbishStation.procInsId){
|
|
|
+ value.weight = rubbishStation.weight;
|
|
|
+ value.transportMileage = rubbishStation.transportMileage;
|
|
|
+ value.subsidy = rubbishStation.subsidy;
|
|
|
+ value.status = rubbishStation.status;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|