qa-regulatory-gwj-app/pages/key-project-management/hidden-management/list.vue

280 lines
9.1 KiB
Vue
Raw Permalink Normal View History

2023-11-07 10:08:37 +08:00
<template>
<view class="content">
<u-tabs
2024-07-27 15:13:42 +08:00
lineWidth="336rpx"
2023-11-07 10:08:37 +08:00
:list="tabsList"
2024-07-27 15:13:42 +08:00
itemStyle="height:80rpx;padding-bottom:10rpx;background-color: #fff;"
2023-11-07 10:08:37 +08:00
@click="tabsClick"
></u-tabs>
<u-list @scrolltolower="scrolltolower" v-if="list.length > 0">
<u-list-item v-for="(item, index) in list" :key="index">
<view>
<view class="flex-between main-title">
2024-10-10 10:14:31 +08:00
<text>{{ item.OUTSOURCED_NAME ? item.OUTSOURCED_NAME : item.AIOUTSOURCED_NAME }}</text>
2023-11-07 10:08:37 +08:00
</view>
<view class="flex-between mt-10 subtitle">
<text>
隐患来源{{ sourceState[item.SOURCE] }}
</text>
</view>
<view class="flex-between mt-10 subtitle">
<text>隐患描述{{ item.HIDDENDESCR }}</text>
</view>
<view class="flex-between mt-10 subtitle">
2024-10-10 10:14:31 +08:00
<text>隐患发现人{{ item.CREATOR_NAME || item.CREATOR_NAMES }}</text>
2023-11-07 10:08:37 +08:00
</view>
<view class="flex-between mt-10 subtitle">
2024-10-10 10:14:31 +08:00
<text>隐患发现时间{{ item.CREATTIME }}</text>
2023-11-07 10:08:37 +08:00
</view>
<view class="flex-between mt-10 subtitle">
2024-10-10 10:14:31 +08:00
<text>隐患整改人{{ item.RECTIFICATIONOR_NAME }}</text>
<text>整改时间{{ item.RECTIFICATIONTIME }}</text>
2023-11-07 10:08:37 +08:00
</view>
<view class="flex-between mt-10 subtitle">
2024-10-10 10:14:31 +08:00
<text>隐患验收人{{ item.CREATOR_NAME }}</text>
<text>验收时间{{ item.CHECKTIME }}</text>
2023-11-07 10:08:37 +08:00
</view>
<view class="flex-between mt-10 subtitle">
2024-10-10 10:14:31 +08:00
<text>隐患状态{{ state[item.STATE] }}</text>
2023-11-07 10:08:37 +08:00
<text>是否处罚{{ item.ISPUNISH && (item.ISPUNISH === "1" ? "是" : "否") }}</text>
</view>
<view class="flex-end mt-10 subtitle">
2024-07-27 15:46:35 +08:00
<view v-if="item.CREATOR == userInfo.USER_ID && tabsType === '1'">
2024-10-10 10:14:31 +08:00
<u-button type="primary" text="验收" size="mini"
@click="fnNavigatorDetail(item.HIDDEN_ID,'acceptance')"></u-button>
2024-07-27 15:46:35 +08:00
</view>
2024-10-10 10:14:31 +08:00
<view class="ml-10">
<u-button type="primary" text="查看" size="mini"
@click="fnNavigatorDetail(item.HIDDEN_ID,'view')"></u-button>
2024-07-27 15:46:35 +08:00
</view>
2024-10-10 10:14:31 +08:00
<!-- <u-button
v-if="item.ISPUNISH !== '2'
&& !item.KEYPROJECTPUNISH_ID
&& item.PUNISH_THE_PERSON
&& item.PUNISH_THE_PERSON.includes(userInfo.USER_ID )
"
color="linear-gradient(to right, #ff6034, #ee0a24)"
text="处罚" size="mini" class="bth-mini ml-10"
@click="fnModalShow(item)"></u-button> -->
<view></view>
2023-11-07 10:08:37 +08:00
</view>
</view>
</u-list-item>
</u-list>
<empty v-else></empty>
<u-modal :show="modalShow" title="处罚" showCancelButton @cancel="modalShow = false" @confirm="fnSubmit">
<view style="flex: 1">
<u-cell-group :border="false">
2024-10-10 10:14:31 +08:00
<view class="cu-form-group">
<view class="title">是否进行罚款</view>
<radio-group @change="changeRadioGroup($event)">
<label class="radio">
<radio value="1" :checked="punishForm.ISPUNISH === '1'" :disabled="TabCur == 2"/>
</label>
<label class="radio">
<radio value="2" :checked="punishForm.ISPUNISH === '2'" :disabled="TabCur == 2"/>
</label>
</radio-group>
</view>
<view v-if="punishForm.ISPUNISH==1">
<u-cell>
<view slot="title" class="title required">
处罚原因
</view>
<view slot="value">
<u--input v-model="punishForm.REASON" border="none" inputAlign="right"></u--input>
</view>
</u-cell>
<u-cell>
<view slot="title" class="title required">
处罚金额
</view>
<view slot="value">
<u--input v-model="punishForm.AMOUT" border="none" type="number" inputAlign="right"></u--input>
</view>
</u-cell>
<u-cell>
<view slot="title" class="title required">
被处罚单位
</view>
<view slot="value">{{ punishForm.RECTIFICATIONDEPT_NAME }}</view>
</u-cell>
<u-cell>
<view slot="title" class="title required">
被处罚人
</view>
<view slot="value">{{ punishForm.RECTIFICATIONOR_NAME }}</view>
</u-cell>
<u-cell>
<view slot="title" class="title required">下发处罚时间</view>
<view slot="value">
<text @click="timeShow = true">{{ punishForm.DATE || '请选择' }}</text>
<u-datetime-picker :show="timeShow" :value="punishForm.DATE"
:minDate="Number(1970)"
@cancel="timeShow = false"
@confirm="timeConfirm"></u-datetime-picker>
</view>
</u-cell>
</view>
2023-11-07 10:08:37 +08:00
</u-cell-group>
</view>
</u-modal>
</view>
</template>
<script>
2024-10-10 10:14:31 +08:00
import {getKeyProjectsCheckHiddenList, getKeyProjectsPunishAdd, editHiddenIspunish} from "../../../api";
2023-11-07 10:08:37 +08:00
export default {
data() {
return {
2024-10-10 10:14:31 +08:00
TabCur: 0, //迁移变量,作用未知
2023-11-07 10:08:37 +08:00
tabsList: [
{name: '待验收隐患', id: '1'},
{name: '已验收隐患', id: '2'}
],
tabsType: '1',
2024-10-10 10:14:31 +08:00
CORPINFO_ID: '',
2023-11-07 10:08:37 +08:00
pageSize: 10,
currentPage: 1,
totalPage: 0,
list: [],
sourceState: {
1: "AI报警",
2: "AI报警(企业端)",
4: "安全环保检查(监管端)",
5: "安全环保检查(企业端)",
},
state: {
1: "未整改",
2: "已整改",
4: "已验收",
},
2024-10-10 10:14:31 +08:00
modalShow: false,
punishForm: {
ISPUNISH: '',
HIDDEN_ID: '',
RECTIFICATIONDEPT_NAME: '',
RECTIFICATIONOR_NAME: '',
REASON: '',
AMOUT: '',
DATE: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM'),
2023-11-07 10:08:37 +08:00
},
punishRules: {
'REASON': '请填写处罚原因',
'AMOUT': '请填写处罚金额',
'DATE': '请选择下发处罚时间',
},
2024-10-10 10:14:31 +08:00
timeShow: false
2023-11-07 10:08:37 +08:00
}
},
onShow() {
this.resetList()
},
onLoad(e) {
this.CORPINFO_ID = e.CORPINFO_ID
},
2023-11-07 10:08:37 +08:00
computed: {
userInfo() {
return this.$store.getters.getUserInfo
}
},
2024-10-10 10:14:31 +08:00
methods: {
async getData() {
2023-11-07 10:08:37 +08:00
let resData = await getKeyProjectsCheckHiddenList({
showCount: this.pageSize,
currentPage: this.currentPage,
CREATOR: this.userInfo.USER_ID,
2024-10-10 10:14:31 +08:00
CORPINFO_ID: this.CORPINFO_ID,
2023-11-07 10:08:37 +08:00
ISCHECK: this.tabsType
});
2024-10-10 10:14:31 +08:00
this.list = [...this.list, ...resData.varList];
2023-11-07 10:08:37 +08:00
this.totalPage = resData.page.totalPage;
},
resetList() {
2024-10-10 10:14:31 +08:00
this.pageSize = 10
this.currentPage = 1
2023-11-07 10:08:37 +08:00
this.list = []
this.getData()
},
2024-10-10 10:14:31 +08:00
fnNavigatorDetail(HIDDEN_ID, type) {
2023-11-07 10:08:37 +08:00
uni.$u.route({
url: '/pages/key-project-management/hidden-management/view',
params: {
HIDDEN_ID,
2024-07-27 15:13:42 +08:00
type: type
2023-11-07 10:08:37 +08:00
}
})
},
scrolltolower() {
this.currentPage++;
2024-10-10 10:14:31 +08:00
if (this.totalPage >= this.currentPage) this.getData();
2023-11-07 10:08:37 +08:00
},
tabsClick(e) {
this.tabsType = e.id
this.resetList()
},
2024-10-10 10:14:31 +08:00
fnModalShow(item) {
2023-11-07 10:08:37 +08:00
this.punishForm.HIDDEN_ID = item.HIDDEN_ID
this.punishForm.RECTIFICATIONDEPT_NAME = item.RECTIFICATIONDEPT_NAME
this.punishForm.RECTIFICATIONOR_NAME = item.RECTIFICATIONOR_NAME
this.modalShow = true
},
2024-10-10 10:14:31 +08:00
timeConfirm(e) {
2023-11-07 10:08:37 +08:00
this.punishForm.DATE = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM')
this.timeShow = false;
},
2024-10-10 10:14:31 +08:00
changeRadioGroup(e) {
console.log(e.detail.value)
if (this.TabCur == 2) return
this.punishForm.ISPUNISH = e.detail.value
},
async fnSubmit() {
if (this.punishForm.ISPUNISH == 1) {
for (const key in this.punishRules) {
if (!this.punishForm[key]) {
uni.showToast({
title: this.punishRules[key],
icon: 'none'
})
return
}
}
await getKeyProjectsPunishAdd({
...this.punishForm,
CREATOR: this.userInfo.USER_ID,
OPERATOR: this.userInfo.USER_ID
})
this.punishForm = {
HIDDEN_ID: '',
ISPUNISH: '',
RECTIFICATIONDEPT_NAME: '',
RECTIFICATIONOR_NAME: '',
REASON: '',
AMOUT: '',
DATE: formatDate(new Date(), 'yyyy-MM-dd hh:mm'),
},
await this.editHiddenIspunishIndex(1)
} else {
await this.editHiddenIspunishIndex(2)
}
},
editHiddenIspunishIndex(Ispunish) {
// 如果不处罚 修改隐患
editHiddenIspunish({
...this.punishForm,
ISPUNISH: Ispunish
})
this.modalShow = false
this.resetList()
2023-11-07 10:08:37 +08:00
},
}
}
</script>
<style scoped>
</style>