123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- <script setup>
- import { closeToast, showLoadingToast, showToast } from "vant";
- import { userInfo } from '~/store/user'
- const { uo_type } = userInfo
- const isBureau = ref(false)// 当前用户是否局端
- isBureau.value = uo_type === '1'
- const list = ref([])
- const loading = ref(false)
- const finished = ref(false)
- let page = 1
- const param = $ref({
- keyword: '',
- xhz_cdmc: '',
- xhz_ssbm: '',
- xhz_jyr: '',
- xhz_pzr: '',
- xhz_zt: ''
- })
- function onLoad() {
- loading.value = true
- request({
- url: '/xdhq/hqgl_zyyy/index',
- method: 'post',
- data: {
- ...param,
- page,
- limit: 20,
- },
- }).then((res) => {
- const data = res.data
- list.value = [...list.value, ...data.page_data]
- finished.value = data.total_page === page
- page++
- loading.value = false
- })
- }
- function onClickSearch() {
- reGetList()
- }
- const itemRef1 = ref(null)
- const itemRef2 = ref(null)
- const itemRef3 = ref(null)
- const itemRef4 = ref(null)
- function onConfirm(num) {
- let temp = [itemRef1, itemRef2, itemRef3, itemRef4]
- temp[num].value.toggle()
- reGetList()
- }
- function reGetList() {
- page = 1
- list.value = []
- finished.value = false
- onLoad()
- }
- const statusOption = $ref([{ text: '状态', value: '' }, { text: '通过', value: '1' }, { text: '未通过', value: '2' }, { text: '待审核', value: '3' }])
- function dropItemChange() {
- reGetList()
- }
- const auditDialogShow = ref(false);
- const auditchecked = ref("");
- const xhz_yy = ref('')
- let operaItem = {}
- function audit(item) {
- operaItem = item
- auditDialogShow.value = true
- }
- function beforeCloseDialog(action) {
- if (action == "confirm") {
- if (auditchecked.value == "") {
- showToast("请选择审核结果");
- return false;
- } else if (auditchecked.value === "2" && xhz_yy.value == "") {
- showToast("请填写意见");
- return false;
- } else {
- dialogSubmit();
- return true;
- }
- } else {
- return true;
- }
- }
- function dialogSubmit() {
- const transObj = {
- xhz_id: operaItem.xhz_id,
- xdhq_hqgl_zyyy: {
- xhz_zt: auditchecked.value, // 待审核 1通过 2驳回
- xhz_yy: xhz_yy.value, // 处理意见
- },
- };
- showLoadingToast({
- message: "提交中...",
- forbidClick: true,
- });
- request({
- url: "/xdhq/hqgl_zyyy/edit",
- data: transObj,
- }).then((res) => {
- closeToast();
- if (res.code == 1) {
- showToast(res.msg);
- list.value = [];
- page = 1;
- onLoad();
- }
- });
- }
- </script>
- <template>
- <div v-show="isBureau">
- <div style="width: 100%;text-align: center;"><span style="font-size: 20px;">本功能仅对校端用户开放</span></div>
- </div>
- <div class="index" v-show="!isBureau">
- <van-search v-model="param.keyword" :clearable="false" show-action placeholder="请输入搜索关键词" @search="onClickSearch">
- <template #action>
- <div @click="onClickSearch">
- 搜索
- </div>
- </template>
- </van-search>
- <van-dropdown-menu>
- <van-dropdown-item ref="itemRef1" title="场地名称">
- <van-cell-group inset>
- <van-field v-model="param.xhz_cdmc" placeholder="请输入场地名称" />
- </van-cell-group>
- <div style="padding: 5px 16px;">
- <van-button type="primary" block round @click="onConfirm(0)">
- 确认
- </van-button>
- </div>
- </van-dropdown-item>
- <van-dropdown-item ref="itemRef2" title="所属部门">
- <van-cell-group inset>
- <van-field v-model="param.xhz_ssbm" placeholder="请输入所属部门" />
- </van-cell-group>
- <div style="padding: 5px 16px;">
- <van-button type="primary" block round @click="onConfirm(1)">
- 确认
- </van-button>
- </div>
- </van-dropdown-item>
- <van-dropdown-item ref="itemRef3" title="借用人">
- <van-cell-group inset>
- <van-field v-model="param.xhz_jyr" placeholder="请输入借用人" />
- </van-cell-group>
- <div style="padding: 5px 16px;">
- <van-button type="primary" block round @click="onConfirm(2)">
- 确认
- </van-button>
- </div>
- </van-dropdown-item>
- <van-dropdown-item ref="itemRef4" title="批准人">
- <van-cell-group inset>
- <van-field v-model="param.xhz_pzr" placeholder="请输入批准人" />
- </van-cell-group>
- <div style="padding: 5px 16px;">
- <van-button type="primary" block round @click="onConfirm(3)">
- 确认
- </van-button>
- </div>
- </van-dropdown-item>
- <van-dropdown-item v-model="param.xhz_zt" :options="statusOption" @change="dropItemChange" />
- </van-dropdown-menu>
- <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
- <van-cell v-for="item in list" :key="item">
- <template #title>
- <span>{{ `${item.xhz_cdmc}` }}</span>
- </template>
- <template #value>
- <div>
- <van-button class="w-60px" type="primary" size="small" @click="audit(item)"
- v-show="item.xhz_zt_option_k == 3">审核</van-button>
- </div>
- </template>
- <template #label>
- <div><span>{{ `所属部门:${item.xhz_ssbm}\u00A0\u00A0\u00A0状态:${item.xhz_zt}` }}</span></div>
- <div style="color: black;">
- <div><span>{{ `借用人:${item.xhz_jyr}\u00A0\u00A0\u00A0批准人:${item.xhz_pzr}` }}</span>
- </div>
- <div><span>借用时间:{{ item.xhz_jysj_ks + '至' + item.xhz_jysj_js }}</span></div>
- </div>
- </template>
- </van-cell>
- </van-list>
- <van-dialog v-model:show="auditDialogShow" title="审核" confirm-button-text="提交" show-cancel-button
- :before-close="beforeCloseDialog">
- <div class="dialogDiv">
- <van-radio-group v-model="auditchecked">
- <van-cell-group inset>
- <van-cell title="通过" clickable @click="auditchecked = '1'">
- <template #right-icon>
- <van-radio name="1" />
- </template>
- </van-cell>
- <van-cell title="不通过" clickable @click="auditchecked = '2'">
- <template #right-icon>
- <van-radio name="2" />
- </template>
- </van-cell>
- </van-cell-group>
- </van-radio-group>
- <van-field v-if="auditchecked === '2'" v-model="xhz_yy" rows="3" autosize type="textarea" placeholder="填写原因" />
- </div>
- </van-dialog>
- </div>
- </template>
- <style lang="scss" scoped>
- :deep(.van-cell__title) {
- width: 70% !important;
- flex: auto
- }
- :deep(.van-cell__value) {
- width: 30% !important;
- flex: auto
- }
- :deep(.van-ellipsis) {
- font-size: 14px !important;
- }
- </style>
|