jszjdy-regulatory-app/pages/supervision_inspection/enterprise_hidden_list.vue

267 lines
7.1 KiB
Vue

<template>
<view>
<view class="searcher">
<view>
<u-search
v-model="searchForm.keyword"
placeholder="请输入关键字"
shape="round"
bg-color="#f7f7f8"
action-text="搜索"
@search="fnResetPaging"
@custom="fnResetPaging"
/>
</view>
<view class="mt-10">
<u-radio-group
v-model="searchForm.state"
style="width: 100%; display: flex; justify-content: space-between"
@change="fnResetPaging"
>
<u-radio
v-for="(item, index) in stateList"
:key="index"
:name="item.ID"
:label="item.NAME"
/>
</u-radio-group>
</view>
<view class="mt-10">
<u-checkbox-group
v-model="searchForm.isMine"
placement="column"
@change="checkMine"
>
<u-checkbox
v-for="(item, index) in isMineList"
:key="index"
:custom-style="{ marginBottom: '8px' }"
:name="item.ID"
:label="item.NAME"
>
</u-checkbox>
</u-checkbox-group>
</view>
</view>
<view class="info_mainer">
<view v-if="list.length > 0">
<u-list @scrolltolower="scrolltolower">
<u-list-item
v-for="item in list"
:key="item.SUPERVISE_INSPECT_HIDDEN_ID"
class="wrap"
>
<view class="tit">
<view class="u-line-2">{{ item.CORP_NAME }}</view>
</view>
<view class="text">
<text>隐患编码:</text>
{{ item.CODE }}
</view>
<view class="text">
<text>帮扶部门:</text>
{{ item.INSPECT_DEPARTMENT_NAME }}
</view>
<view class="text">
<text>帮扶人员:</text>
{{ item.INSPECT_USER_NAME }}
</view>
<view class="text">
<text>发现时间:</text>
{{ item.DISCOVER_TIME }}
</view>
<view class="text">
<text>整改截止时间:</text>
{{ item.RECTIFY_DEADLINE }}
</view>
<view class="text">
<text>整改意见:</text>
{{ item.DISPOSE }}
</view>
<view class="text">
<text>隐患状态:</text>
<template v-if="item.STATE === '1'">待整改</template>
<template v-if="item.STATE === '2'">待复查</template>
<template v-if="item.STATE === '3'">已复查</template>
</view>
<view class="bottem">
<u-button
v-if="item.STATE === '2'"
text="复查"
color="linear-gradient(to right, #27a0ff, #2a56f7)"
custom-style="width:150upx; height:60upx; margin-left: 20upx;margin-right: 0;"
@click="
$u.route({
url: '/pages/supervision_inspection/hidden_review',
params: {
SUPERVISE_INSPECT_HIDDEN_ID:
item.SUPERVISE_INSPECT_HIDDEN_ID,
},
})
"
/>
<u-button
text="查看"
color="linear-gradient(to right, #27a0ff, #2a56f7)"
custom-style="width:150upx; height:60upx; margin-left: 20upx;margin-right: 0;"
@click="
$u.route({
url: '/pages/supervision_inspection/hidden_view',
params: {
SUPERVISE_INSPECT_HIDDEN_ID:
item.SUPERVISE_INSPECT_HIDDEN_ID,
},
})
"
/>
<u-button
text="删除"
type="error"
custom-style="width:150upx; height:60upx; margin-left: 20upx;margin-right: 0;"
@click="fnDelete(item.SUPERVISE_INSPECT_HIDDEN_ID)"
/>
</view>
</u-list-item>
</u-list>
</view>
<empty v-else />
</view>
</view>
</template>
<script>
import {
getSupervisionInspectionEnterpriseHiddenList,
setSupervisionInspectionEnterpriseHiddenDelete,
} from "@/api";
export default {
data() {
return {
list: [],
pageSize: 10,
currentPage: 1,
totalPage: 0,
searchForm: {
keyword: "",
state: "",
isMine: [],
},
stateList: [
{ ID: "", NAME: "全部" },
{ ID: "1", NAME: "待整改" },
{ ID: "2", NAME: "待复查" },
{ ID: "3", NAME: "已复查" },
],
isMineList: [{ ID: "1", NAME: "只看自己" }],
};
},
created() {
this.searchForm.isMine.push("1");
this.fnGetData();
},
methods: {
async fnGetData() {
const resData = await getSupervisionInspectionEnterpriseHiddenList({
showCount: this.pageSize,
currentPage: this.currentPage,
KEYWORDS: this.searchForm.keyword,
STATE: this.searchForm.state,
ISMINE:
this.searchForm.isMine.length > 0 ? this.searchForm.isMine[0] : "",
});
this.list = [...this.list, ...resData.varList];
this.totalPage = resData.page.totalPage;
},
scrolltolower() {
this.currentPage++;
if (this.totalPage >= this.currentPage) this.fnGetData();
},
checkMine(n) {
this.searchForm.isMine = n;
this.list = [];
this.currentPage = 1;
this.fnGetData();
},
fnResetPaging() {
this.list = [];
this.currentPage = 1;
this.fnGetData();
},
fnDelete(SUPERVISE_INSPECT_HIDDEN_ID) {
uni.showModal({
title: "提示",
content: "确认要删除吗?",
success: async (res) => {
if (res.confirm) {
await setSupervisionInspectionEnterpriseHiddenDelete({
SUPERVISE_INSPECT_HIDDEN_ID,
});
setTimeout(() => {
uni.$u.toast("删除成功");
});
this.fnResetPaging();
}
},
});
},
},
};
</script>
<style scoped lang="scss">
.searcher {
width: 100%;
background: #ffffff;
padding: 20upx;
box-sizing: border-box;
margin-top: 20upx;
border-bottom: 1px solid #eeeeee;
.mainer {
width: 100%;
display: flex;
justify-content: space-between;
margin-top: 20upx;
align-items: center;
font-size: 28upx;
}
}
.info_mainer {
width: 100%;
margin-top: 20upx;
.wrap {
width: 100%;
background: #ffffff;
margin-bottom: 20upx;
padding: 20upx;
line-height: 2;
box-sizing: border-box;
.tit {
font-weight: bold;
display: flex;
justify-content: space-between;
align-items: center;
}
.text text {
color: #999999;
margin-right: 10upx;
}
.bottem {
width: 100%;
border-top: 1px solid #eeeeee;
margin-top: 20upx;
display: flex;
justify-content: flex-end;
padding: 20upx 0 0;
}
}
}
</style>