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

260 lines
8.0 KiB
Vue
Raw 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">
<text>{{ item.HIDDENDESCR }}</text>
</view>
<view class="flex-between mt-10 subtitle">
2024-10-10 10:14:31 +08:00
<text>被处罚单位{{ item.UNITS_NAME }}</text>
<text v-show="item.ISPUNISH==='1'&&item.HANDLED==='0'">{{ item.PERSON_NAME }}</text>
</view>
<view v-show="item.ISPUNISH==='1'" class="flex-between mt-10 subtitle">
<text>
处罚原因{{ item.REASON }}
</text>
</view>
<view v-show="item.ISPUNISH" class="flex-between mt-10 subtitle">
<text>下发人{{ item.CREATOR_NAME }}</text>
<text>是否处罚{{ item.ISPUNISH == "2" ? "否" : "是" }}</text>
</view>
<view class="flex-between mt-10 subtitle">
<text>处罚处理状态{{
item.ISPUNISH == "2" ? "不处罚" : item.HANDLED == "1" ? "已完成" : item.ISPUNISH == "1" ? "待反馈" : "待处罚"
}}
</text>
2024-07-27 15:46:35 +08:00
</view>
<view class="flex-end">
2024-10-10 10:14:31 +08:00
<view v-if="!item.ISPUNISH">
<u-button
color="linear-gradient(to right, #ff6034, #ee0a24)"
text="处罚" size="mini"
@click="fnModalShow(item)"></u-button>
</view>
<view class="ml-10">
<u-button type="primary" text="查看" size="mini"
@click="fnNavigatorDetail(item.HIDDEN_ID)"></u-button>
</view>
2024-07-27 15:46:35 +08:00
2023-11-07 10:08:37 +08:00
</view>
</view>
</u-list-item>
</u-list>
<empty v-else></empty>
2024-10-10 10:14:31 +08:00
<u-modal :show="modalShow" title="处罚" showCancelButton @cancel="modalShow = false" @confirm="fnSubmit">
2023-11-07 10:08:37 +08:00
<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" style="flex: 1;">
<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>
2024-10-10 10:14:31 +08:00
</view>
</template>
2023-11-07 10:08:37 +08:00
<script>
2024-10-10 10:14:31 +08:00
import {
setKeyProjectsPunishList,
getKeyProjectsPunishList,
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',
pageSize: 10,
currentPage: 1,
totalPage: 0,
list: [],
2024-10-10 10:14:31 +08:00
modalShow: false,
punishForm: {
HIDDEN_ID: '',
ISPUNISH: '',
RECTIFICATIONDEPT_NAME: '',
RECTIFICATIONOR_NAME: '',
REASON: '',
CORPINFO_ID: '',
AMOUT: '',
DATE: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM'),
},
timeShow: false
2023-11-07 10:08:37 +08:00
}
},
onShow() {
this.resetList()
},
onLoad(e) {
2024-10-10 10:14:31 +08:00
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 getKeyProjectsPunishList({
showCount: this.pageSize,
currentPage: this.currentPage,
2024-10-10 10:14:31 +08:00
CORPINFO_ID: this.CORPINFO_ID,
2023-11-07 10:08:37 +08:00
HANDLED: this.tabsType,
2024-10-10 10:14:31 +08:00
loginUserId: this.userInfo.USER_ID
2023-11-07 10:08:37 +08:00
});
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) {
2023-11-07 10:08:37 +08:00
uni.$u.route({
url: '/pages/key-project-management/penalty-management/viewHidden',
params: {
HIDDEN_ID,
2024-10-10 10:14:31 +08:00
type: 'view'
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) {
this.punishForm.HIDDEN_ID = item.HIDDEN_ID
this.punishForm.RECTIFICATIONDEPT_NAME = item.UNITS_NAME
this.punishForm.RECTIFICATIONOR_NAME = item.RECTIFICATIONOR_NAME
this.punishForm.ISPUNISH = '2'
this.modalShow = true
},
changeRadioGroup(e) {
if (this.TabCur == 2) return
this.punishForm.ISPUNISH = e.detail.value
},
timeConfirm(e) {
this.punishForm.DATE = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM')
this.timeShow = false;
},
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
})
await this.editHiddenIspunishIndex(1)
} else {
await this.editHiddenIspunishIndex(2)
}
},
editHiddenIspunishIndex(Ispunish) {
// 如果不处罚 修改隐患
editHiddenIspunish({
...this.punishForm,
ISPUNISH: Ispunish,
PUNISH_PERSON: this.userInfo.USER_ID
})
this.punishForm = {
HIDDEN_ID: '',
ISPUNISH: '',
RECTIFICATIONDEPT_NAME: '',
RECTIFICATIONOR_NAME: '',
REASON: '',
AMOUT: '',
DATE: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM'),
},
this.modalShow = false
this.resetList()
},
2023-11-07 10:08:37 +08:00
}
}
</script>
2024-07-27 15:46:35 +08:00
<style scoped lang="scss">
2024-10-10 10:14:31 +08:00
.wrap {
2024-07-27 15:46:35 +08:00
width: 200rpx;
margin: 0 10rpx;
}
2023-11-07 10:08:37 +08:00
</style>