动火list

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

View File

@ -2,12 +2,14 @@
<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">
<uni-icons slot="searchIcon" color="#999999" size="16" type="search" class="search-slot" />
</uni-search-bar>
<view class="filter filter-status" @click="handleShowPicker({title: '状态', name: 'status'})"> <view class="filter filter-status" @click="handleShowPicker({title: '状态', name: 'status'})">
<text>{{statusFilterTxt}}</text> <text>{{statusFilterTxt}}</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>
@ -16,34 +18,26 @@
</u-sticky> </u-sticky>
<view class="main"> <view class="main">
<view class="content-list"> <view class="content-list">
<common-card <common-card :dataSource="item" v-for="item in lists" class="content" @click="showDetail(item.ID)">
:dataSource="item"
v-for="item in lists"
class="content"
@click="handleToEdit"
>
<view> <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"> <view class="field">
<text class="label">作业申请</text> <text class="label">发起人</text>
<text class="value">{{item.Nav_ApplyUser ? item.Nav_ApplyUser.NAME : ''}}</text> <text class="value">{{item.Nav_ApplyUser ? item.Nav_ApplyUser.NAME : ''}}</text>
</view> </view>
<view class="field"> <view class="field">
<text class="label">创建时间</text> <text class="label">发起部门</text>
<text class="value">{{$u.timeFormat(item.CREATE_TIME,'yyyy-mm-dd')}}</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>
<view class="field"> <view class="field">
<text class="label">状态</text> <text class="label">状态</text>
<text class="status">{{item.IS_PUBLISH}}</text> <text class="status">{{item.STATUS}}</text>
</view> </view>
</view> </view>
</common-card> </common-card>
</view> </view>
<view v-if="!lists.length" class="empty-wrap"> <view v-if="!lists.length" class="empty-wrap">
@ -51,29 +45,25 @@
</u-empty> </u-empty>
</view> </view>
</view> </view>
<u-picker <u-picker :show="comPickerInfo.showPicker" :columns="comPickerInfo.columns" @confirm="onConfirmPicker"
:show="comPickerInfo.showPicker" :defaultIndex="[0]" @cancel="closePicker"></u-picker>
:columns="comPickerInfo.columns"
@confirm="onConfirmPicker"
:defaultIndex="[0]"
@cancel="closePicker"
></u-picker>
</view> </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, extendRule, extendInclude,
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,
@ -89,64 +79,67 @@
columns: [], columns: [],
title: '', title: '',
name: '' name: ''
} },
listStatus: '',
} }
}, },
onLoad() { onLoad() {
this.loadData() this.getEnums()
}, },
methods: { methods: {
handleSearch(obj) { handleSearch(obj) {
this.keyword = obj.value this.keyword = obj.value
}, },
handleToEdit(obj) { getEnums() {
uni.navigateTo({ var dataParm = {
url: '/pages/apply/subPages/FO2/jobShow?ID=' + obj.ID 'name': "PFStandardStatus"
}
getEnum(dataParm).then(res => {
this.listStatus = res
this.loadData()
}) })
}, },
getNameById(id) {
const item = this.listStatus.find(item => item.ID === id);
return item ? item.NAME : '--';
},
handleCancelSearch() { handleCancelSearch() {
this.keyword = '' this.keyword = ''
}, },
loadData() { loadData() {
const orgId = uni.getStorageSync('orgId') const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "CREATE_TIME", 1, this.pageIndex) const json = initFilter(orgId, "", "CREATE_TIME", 1, this.pageIndex)
extendInclude(json, 'Nav_OperationStep');
extendInclude(json, 'Nav_ApplyUser'); extendInclude(json, 'Nav_ApplyUser');
extendInclude(json, 'Nav_ApplyDepartment');
extendInclude(json, 'Nav_Company');
extendInclude(json, 'Nav_ProductionUnit');
extendInclude(json, 'Nav_OperationStep');
extendInclude(json, 'Nav_FireUser');
extendInclude(json, 'Nav_FireDepartment');
extendInclude(json, 'Nav_SafeUser');
extendInclude(json, 'Nav_Area');
extendInclude(json, 'Nav_MonitorUser'); extendInclude(json, 'Nav_MonitorUser');
if (this.keyword) { if (this.keyword) {
extendRule(json, 'Nav_OperationStep.NAME', 9, this.keyword) extendRule(json, 'Nav_ApplyDepartment.NAME', 9, this.keyword)
} }
if (this.searchStartTime) { if (this.searchStartTime) {
extendRule(json, 'CREATE_TIME', 6, this.searchStartTime) extendRule(json, 'MEETING_TIME', 6, this.searchStartTime)
} }
if (this.filterStatus !== null) { if (this.filterStatus !== null) {
extendRule(json, 'IS_PUBLISH', 1, this.filterStatus) extendRule(json, 'STATUS', 1, this.filterStatus)
} }
getRequestOrderPage(json,"/FO/CrucialLicenseJob/OrderPaged").then(res => { getRequestOrderPage(json, "/FO/FireJob/OrderPaged").then(res => {
this.total = res.TotalCount this.total = res.TotalCount;
for (let i = 0; i < res.Data.length; i++) { for (let i = 0; i < res.Data.length; i++) {
if (res.Data[i].IS_PUBLISH == 0) { res.Data[i].STATUS = this.getNameById(res.Data[i].STATUS)
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) { let newRes = (res.Data || []).map(i => {
res.Data[i].IS_PUBLISH = "归档";
}
else if(res.Data[i].IS_PUBLISH == 9) {
res.Data[i].IS_PUBLISH = "审批拒绝";
}
}
const newRes = (res.Data || []).map(i => {
return { return {
...i, ...i,
title: i.Nav_OperationStep?.NAME, title: i.Nav_OperationStep?i.Nav_OperationStep.NAME:'',
} }
}) })
if (this.pageIndex !== 1) { if (this.pageIndex !== 1) {
this.lists = this.lists.concat(newRes) this.lists = this.lists.concat(newRes)
} else { } else {
@ -154,13 +147,23 @@
} }
}) })
}, },
showDetail(id) {
uni.navigateTo({
url: '/pages/apply/subPages/FO/FO041Show?ID=' + id
})
},
handleShowPicker(p) { handleShowPicker(p) {
let column = [] let column = []
if (p.name === 'dateRange') { if (p.name === 'dateRange') {
column = ['全部', '当天', '最近三天', '最近一周', '最近一月'] column = ['全部', '当天', '最近三天', '最近一周', '最近一月']
} }
if (p.name === 'status') { if (p.name === 'status') {
column = ['全部', '草稿', '分析中','签到中','审核中','审批拒绝', '归档'] let arr = []
arr.push('全部')
this.listStatus.map(item => {
arr.push(item.NAME)
})
column = arr
} }
this.comPickerInfo = { this.comPickerInfo = {
showPicker: true, showPicker: true,
@ -188,33 +191,10 @@
} }
} }
if (this.comPickerInfo.name === 'status') { if (this.comPickerInfo.name === 'status') {
if (e.indexs[0] === 1) { if (e.indexs[0] == 0) {
// 稿 0
this.filterStatus = 0
} else if (e.indexs[0] === 2) {
// 1
this.filterStatus = 1
} else if (e.indexs[0] === 3) {
// 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) {
//
this.filterStatus = null this.filterStatus = null
this.statusFilterTxt = '状态筛选'
} else { } else {
this.statusFilterTxt = e.value[0] this.filterStatus = this.listStatus[e.indexs[0] - 1].ID
} }
} }
this.closePicker() this.closePicker()
@ -232,7 +212,6 @@
// +1 // +1
if (this.total > 10 * this.pageIndex) if (this.total > 10 * this.pageIndex)
this.pageIndex++ this.pageIndex++
//
}, },
watch: { watch: {
pageIndex(n, o) { pageIndex(n, o) {