动火list

This commit is contained in:
yunkexin 2025-12-26 16:06:56 +08:00
parent 35333fc27e
commit 98baa94fb5

View File

@ -1,260 +1,239 @@
<template> <template>
<view class="risk-record-page"> <view class="risk-record-page">
<u-sticky> <u-sticky>
<view class="filter-bar"> <view class="filter-bar">
<view class="filter filter-date-range" @click="handleShowPicker({title: '时间区间', name: 'dateRange'})"> <!-- <view class="filter filter-date-range" @click="handleShowPicker({title: '时间区间', name: 'dateRange'})">
<text>{{dateFilterTxt}}</text> <text>{{dateFilterTxt}}</text>
<u-icon size="14" style="margin-left: 4px;" name="arrow-down"></u-icon> <u-icon size="14" style="margin-left: 4px;" name="arrow-down"></u-icon>
</view> </view> -->
<uni-search-bar class="search-bar" radius="100" :value="keyword" @confirm="handleSearch" <uni-search-bar class="search-bar" radius="100" v-model="keyword" @confirm="handleSearch"
@cancel="handleCancelSearch" @clear="handleCancelSearch" placeholder="搜索"></uni-search-bar> @cancel="handleCancelSearch" @clear="handleCancelSearch" placeholder="发起部门搜索" cancel-button="none">
<view class="filter filter-status" @click="handleShowPicker({title: '状态', name: 'status'})"> <uni-icons slot="searchIcon" color="#999999" size="16" type="search" class="search-slot" />
<text>{{statusFilterTxt}}</text> </uni-search-bar>
<u-icon size="14" style="margin-left: 4px;" name="arrow-down"></u-icon> <view class="filter filter-status" @click="handleShowPicker({title: '状态', name: 'status'})">
</view> <text>{{statusFilterTxt}}</text>
</view> <u-icon size="14" style="margin-left: 4px;" name="arrow-down"></u-icon>
</u-sticky> </view>
<view class="main">
<view class="content-list">
<common-card
:dataSource="item"
v-for="item in lists"
class="content"
@click="handleToEdit"
>
<view>
<!-- <view class="field">
<text class="label">开始时间</text>
<text class="value">{{$u.timeFormat(item.JOB_DATE,'yyyy-mm-dd')}}</text>
</view> -->
<!-- <view class="field">
<text class="label">结束时间</text>
<text class="value">{{$u.timeFormat(item.JOB_END_DATE,'yyyy-mm-dd')}}</text>
</view> -->
<view class="field">
<text class="label">作业申请人</text>
<text class="value">{{item.Nav_ApplyUser ? item.Nav_ApplyUser.NAME : ''}}</text>
</view>
<view class="field">
<text class="label">创建时间</text>
<text class="value">{{$u.timeFormat(item.CREATE_TIME,'yyyy-mm-dd')}}</text>
</view> </view>
<view class="field"> </u-sticky>
<text class="label">状态</text> <view class="main">
<text class="status">{{item.IS_PUBLISH}}</text> <view class="content-list">
<common-card :dataSource="item" v-for="item in lists" class="content" @click="showDetail(item.ID)">
<view>
<view class="field">
<text class="label">发起人</text>
<text class="value">{{item.Nav_ApplyUser ? item.Nav_ApplyUser.NAME : ''}}</text>
</view>
<view class="field">
<text class="label">发起部门</text>
<text class="value">{{item.Nav_ApplyDepartment ? item.Nav_ApplyDepartment.NAME : ''}}</text>
</view>
<view class="field">
<text class="label">动火区域</text>
<text class="value">{{item.Nav_Area?item.Nav_Area.NAME:''}}</text>
</view>
<view class="field">
<text class="label">状态</text>
<text class="status">{{item.STATUS}}</text>
</view>
</view>
</common-card>
</view>
<view v-if="!lists.length" class="empty-wrap">
<u-empty text="暂无数据" icon="/static/empty@2x.png">
</u-empty>
</view> </view>
</view> </view>
</common-card> <u-picker :show="comPickerInfo.showPicker" :columns="comPickerInfo.columns" @confirm="onConfirmPicker"
</view> :defaultIndex="[0]" @cancel="closePicker"></u-picker>
<view v-if="!lists.length" class="empty-wrap"> </view>
<u-empty text="暂无数据" icon="/static/empty@2x.png">
</u-empty>
</view>
</view>
<u-picker
:show="comPickerInfo.showPicker"
:columns="comPickerInfo.columns"
@confirm="onConfirmPicker"
:defaultIndex="[0]"
@cancel="closePicker"
></u-picker>
</view>
</template> </template>
<script> <script>
import { import {
getRequestOrderPage getRequestOrderPage
// getJobData } from '../../../../services/apply/FOServices/FOServices.js'
} from '../../../../services/apply/FOServices/FOServices.js' import {
import { extendInclude,
extendInclude, extendRule, extendRule,
initFilter initFilter
} from '../../../../utils/common' } from '../../../../utils/common'
import UniSearchBar from '../../../../uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue' import {
getEnum
} from '../../../../services/common';
export default { export default {
components: { UniSearchBar }, data() {
data() { return {
return { pageIndex: 1,
pageIndex: 1, total: 0,
total: 0, lists: [],
lists: [], keyword: '',
keyword: '', searchStartTime: '',
searchStartTime: '', filterStatus: null,
filterStatus: null, dateFilterTxt: '时间区间',
dateFilterTxt: '时间区间', statusFilterTxt: '状态筛选',
statusFilterTxt: '状态筛选', comPickerInfo: {
comPickerInfo: { showPicker: false,
showPicker: false, columns: [],
columns: [], title: '',
title: '', name: ''
name: '' },
} listStatus: '',
}
},
onLoad() {
this.loadData()
},
methods: {
handleSearch(obj) {
this.keyword = obj.value
},
handleToEdit(obj) {
uni.navigateTo({
url: '/pages/apply/subPages/FO2/jobShow?ID=' + obj.ID
})
},
handleCancelSearch() {
this.keyword = ''
},
loadData() {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "CREATE_TIME", 1, this.pageIndex)
extendInclude(json, 'Nav_OperationStep');
extendInclude(json, 'Nav_ApplyUser');
extendInclude(json, 'Nav_MonitorUser');
if (this.keyword) {
extendRule(json, 'Nav_OperationStep.NAME', 9, this.keyword)
}
if (this.searchStartTime) {
extendRule(json, 'CREATE_TIME', 6, this.searchStartTime)
}
if (this.filterStatus !== null) {
extendRule(json, 'IS_PUBLISH', 1, this.filterStatus)
}
getRequestOrderPage(json,"/FO/CrucialLicenseJob/OrderPaged").then(res => {
this.total = res.TotalCount
for (let i = 0; i < res.Data.length; i++) {
if (res.Data[i].IS_PUBLISH == 0) {
res.Data[i].IS_PUBLISH = "草稿";
}else if(res.Data[i].IS_PUBLISH == 1) {
res.Data[i].IS_PUBLISH = "分析中";
}else if(res.Data[i].IS_PUBLISH == 2) {
res.Data[i].IS_PUBLISH = "签到中";
}else if(res.Data[i].IS_PUBLISH == 4) {
res.Data[i].IS_PUBLISH = "审核中";
}
else if(res.Data[i].IS_PUBLISH == 5) {
res.Data[i].IS_PUBLISH = "归档";
}
else if(res.Data[i].IS_PUBLISH == 9) {
res.Data[i].IS_PUBLISH = "审批拒绝";
} }
} },
const newRes = (res.Data || []).map(i => { onLoad() {
return { this.getEnums()
...i, },
title: i.Nav_OperationStep?.NAME, methods: {
} handleSearch(obj) {
}) this.keyword = obj.value
if (this.pageIndex !== 1) { },
this.lists = this.lists.concat(newRes) getEnums() {
} else { var dataParm = {
this.lists = newRes 'name': "PFStandardStatus"
} }
}) getEnum(dataParm).then(res => {
}, this.listStatus = res
handleShowPicker(p) { this.loadData()
let column = [] })
if (p.name === 'dateRange') { },
column = ['全部', '当天', '最近三天', '最近一周', '最近一月'] getNameById(id) {
} const item = this.listStatus.find(item => item.ID === id);
if (p.name === 'status') { return item ? item.NAME : '--';
column = ['全部', '草稿', '分析中','签到中','审核中','审批拒绝', '归档'] },
} handleCancelSearch() {
this.comPickerInfo = { this.keyword = ''
showPicker: true, },
title: p.title, loadData() {
name: p.name, const orgId = uni.getStorageSync('orgId')
columns: [column] const json = initFilter(orgId, "", "CREATE_TIME", 1, this.pageIndex)
} extendInclude(json, 'Nav_ApplyUser');
}, extendInclude(json, 'Nav_ApplyDepartment');
onConfirmPicker(e) { extendInclude(json, 'Nav_Company');
if (this.comPickerInfo.name === 'dateRange') { extendInclude(json, 'Nav_ProductionUnit');
let currentDate = new Date(); extendInclude(json, 'Nav_OperationStep');
if (e.indexs[0] === 2) { extendInclude(json, 'Nav_FireUser');
currentDate.setDate(currentDate.getDate() - 3); extendInclude(json, 'Nav_FireDepartment');
} else if (e.indexs[0] === 3) { extendInclude(json, 'Nav_SafeUser');
currentDate.setDate(currentDate.getDate() - 7); extendInclude(json, 'Nav_Area');
} else if (e.indexs[0] === 4) { extendInclude(json, 'Nav_MonitorUser');
currentDate.setDate(currentDate.getMonth()); if (this.keyword) {
} extendRule(json, 'Nav_ApplyDepartment.NAME', 9, this.keyword)
if (e.indexs[0] === 0) { }
this.searchStartTime = '' if (this.searchStartTime) {
this.dateFilterTxt = '时间区间' extendRule(json, 'MEETING_TIME', 6, this.searchStartTime)
} else { }
this.dateFilterTxt = e.value[0] if (this.filterStatus !== null) {
this.searchStartTime = uni.$u.timeFormat(currentDate, 'yyyy-mm-dd 00:00:00'); extendRule(json, 'STATUS', 1, this.filterStatus)
} }
} getRequestOrderPage(json, "/FO/FireJob/OrderPaged").then(res => {
if (this.comPickerInfo.name === 'status') { this.total = res.TotalCount;
if (e.indexs[0] === 1) { for (let i = 0; i < res.Data.length; i++) {
// 稿 0 res.Data[i].STATUS = this.getNameById(res.Data[i].STATUS)
this.filterStatus = 0 }
} else if (e.indexs[0] === 2) { let newRes = (res.Data || []).map(i => {
// 1 return {
this.filterStatus = 1 ...i,
} else if (e.indexs[0] === 3) { title: i.Nav_OperationStep?i.Nav_OperationStep.NAME:'',
// 2 }
this.filterStatus = 2 })
}else if (e.indexs[0] === 4) {
// 4
this.filterStatus = 4
}else if (e.indexs[0] === 5) {
// 9
this.filterStatus = 9
}
else if (e.indexs[0] === 6) {
// 5
this.filterStatus = 5
}
if (e.indexs[0] === 0) { if (this.pageIndex !== 1) {
// this.lists = this.lists.concat(newRes)
this.filterStatus = null } else {
this.statusFilterTxt = '状态筛选' this.lists = newRes
} else { }
this.statusFilterTxt = e.value[0] })
} },
} showDetail(id) {
this.closePicker() uni.navigateTo({
}, url: '/pages/apply/subPages/FO/FO041Show?ID=' + id
closePicker() { })
this.comPickerInfo = { },
showPicker: false, handleShowPicker(p) {
columns: [], let column = []
title: '', if (p.name === 'dateRange') {
name: '' column = ['全部', '当天', '最近三天', '最近一周', '最近一月']
} }
}, if (p.name === 'status') {
}, let arr = []
onReachBottom() { arr.push('全部')
// +1 this.listStatus.map(item => {
if (this.total > 10 * this.pageIndex) arr.push(item.NAME)
this.pageIndex++ })
// column = arr
}, }
watch: { this.comPickerInfo = {
pageIndex(n, o) { showPicker: true,
this.loadData() title: p.title,
name: p.name,
columns: [column]
}
},
onConfirmPicker(e) {
if (this.comPickerInfo.name === 'dateRange') {
let currentDate = new Date();
if (e.indexs[0] === 2) {
currentDate.setDate(currentDate.getDate() - 3);
} else if (e.indexs[0] === 3) {
currentDate.setDate(currentDate.getDate() - 7);
} else if (e.indexs[0] === 4) {
currentDate.setDate(currentDate.getMonth());
}
if (e.indexs[0] === 0) {
this.searchStartTime = ''
this.dateFilterTxt = '时间区间'
} else {
this.dateFilterTxt = e.value[0]
this.searchStartTime = uni.$u.timeFormat(currentDate, 'yyyy-mm-dd 00:00:00');
}
}
if (this.comPickerInfo.name === 'status') {
if (e.indexs[0] == 0) {
this.filterStatus = null
} else {
this.filterStatus = this.listStatus[e.indexs[0] - 1].ID
}
}
this.closePicker()
},
closePicker() {
this.comPickerInfo = {
showPicker: false,
columns: [],
title: '',
name: ''
}
},
}, },
keyword(n, o) { onReachBottom() {
this.pageIndex = 1 // +1
this.keyword = n if (this.total > 10 * this.pageIndex)
this.loadData() this.pageIndex++
}, },
searchStartTime(n, o) { watch: {
this.pageIndex = 1 pageIndex(n, o) {
this.searchStartTime = n this.loadData()
this.loadData() },
}, keyword(n, o) {
filterStatus(n, o) { this.pageIndex = 1
this.pageIndex = 1 this.keyword = n
this.filterStatus = n this.loadData()
this.loadData() },
searchStartTime(n, o) {
this.pageIndex = 1
this.searchStartTime = n
this.loadData()
},
filterStatus(n, o) {
this.pageIndex = 1
this.filterStatus = n
this.loadData()
}
} }
} }
}
</script> </script>
<style> <style>
@ -263,60 +242,60 @@
} }
.risk-record-page .main { .risk-record-page .main {
padding: 0px 16px; padding: 0px 16px;
position: relative; position: relative;
}
.risk-record-page>>>.uni-searchbar {
padding: 0px;
display: flex;
align-items: center;
font-size: 12px;
.uni-searchbar__box {
height: 30px;
} }
.risk-record-page>>>.uni-searchbar { .uni-searchbar__box-icon-clear {
padding: 0px;
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 12px;
.uni-searchbar__box {
height: 30px;
}
.uni-searchbar__box-icon-clear {
display: flex;
align-items: center;
}
.uni-input-placeholder {}
.uni-searchbar__box-search-input {
font-size: 12px;
}
.uni-searchbar__text-placeholder {
font-size: 12px;
margin-left: 0px;
}
.uni-text {
font-size: 12px;
}
} }
.filter-bar .search-bar { .uni-input-placeholder {}
margin-left: 20px;
margin-right: 20px; .uni-searchbar__box-search-input {
width: 100%;
display: flex;
flex: 1;
align-items: center;
font-size: 12px; font-size: 12px;
} }
.filter-bar { .uni-searchbar__text-placeholder {
display: flex; font-size: 12px;
justify-content: space-between; margin-left: 0px;
align-items: center;
background-color: #ffffff;
padding: 10px 16px 10px 16px;
box-shadow: 0px 0px 5px 0px #eaedf4;
} }
.uni-text {
font-size: 12px;
}
}
.filter-bar .search-bar {
margin-left: 20px;
margin-right: 20px;
width: 100%;
display: flex;
flex: 1;
align-items: center;
font-size: 12px;
}
.filter-bar {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #ffffff;
padding: 10px 16px 10px 16px;
box-shadow: 0px 0px 5px 0px #eaedf4;
}
.filter-bar .filter { .filter-bar .filter {
display: flex; display: flex;
align-items: center; align-items: center;