Forráskód Böngészése

feat: 设备预算完成

ZhaoJing 2 éve%!(EXTRA string=óta)
szülő
commit
150e0e9751

+ 17 - 0
src/pages/equipmentPurchaseApply/budgetOfPlant/index.vue

@@ -0,0 +1,17 @@
+<script setup>
+import myApplyFor from './myApplyFor/index.vue'
+import myAuditFor from './myAuditFor/index.vue'
+</script>
+
+<template>
+    <div>
+        <van-tabs :sticky="true">
+            <van-tab title="我申请的">
+                <myApplyFor />
+            </van-tab>
+            <van-tab title="我审核的">
+                <myAuditFor />
+            </van-tab>
+        </van-tabs>
+    </div>
+</template>

+ 121 - 0
src/pages/equipmentPurchaseApply/budgetOfPlant/myApplyFor/detail/index.vue

@@ -0,0 +1,121 @@
+<script setup>
+import { closeToast, showLoadingToast } from 'vant'
+
+const { currentRoute } = useRouter()
+const route = currentRoute.value
+const xm_id = route.query.xm_id
+const detailData = ref({})
+
+showLoadingToast({
+    message: '加载中...',
+    forbidClick: true,
+})
+request({
+    url: '/jdbg/sbcg_cgxm/detail',
+    data: {
+        xm_id,
+    },
+}).then((res) => {
+    closeToast()
+    detailData.value = res.data.one_info
+})
+</script>
+
+<template>
+    <div>
+        <div class="tableContainer">
+            <div class="topPart">
+                <table class="Tb" width="100%" cellspacing="0" cellpadding="0">
+                    <tr>
+                        <td class="titleOpt">
+                            申请科室
+                        </td>
+                        <td>{{ detailData.department_name }}</td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            申请人
+                        </td>
+                        <td>
+                            {{ detailData.xm_user_name }}
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            项目名称
+                        </td>
+                        <td>{{ detailData.xm_name }}</td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            采购的主要理由及依据
+                        </td>
+                        <td>{{ detailData.xm_lyyj }}</td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            采购类型
+                        </td>
+                        <td>{{ detailData.lb_name }}</td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            采购金额
+                        </td>
+                        <td>{{ detailData.xm_price }}</td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            采购清单
+                        </td>
+                        <td><div v-html="detailData.xm_qd"></div></td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            审核人
+                        </td>
+                        <td v-if="detailData.xm_shlc">
+                            <div v-for="item in JSON.parse(detailData.xm_shlc)">
+                                {{ item.user_name }}
+                            </div>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            状态
+                        </td>
+                        <td>
+                            <div>
+                                <span :class="{ 'text-red': detailData.xm_status === '4' }">{{
+                                    detailData.xm_status_option_n
+                                }}</span>
+                                <!-- <p v-if="detailData.xm_status === '2'">
+                                    {{ detailData.xm_status_option_n }}
+                                </p> -->
+                            </div>
+                        </td>
+                    </tr>
+                </table>
+            </div>
+        </div>
+    </div>
+</template>
+
+<style lang="scss" scoped>
+.titleOpt {
+    width: 45%;
+}
+
+.border_bottom {
+    border-bottom: 2px solid #666;
+    border-top: 2px solid #666;
+}
+
+.text-red {
+    color: red;
+}
+
+:deep(.specialTd table tbody tr td) {
+    border: 1px #CCCCCC solid !important;
+}
+</style>

+ 40 - 0
src/pages/equipmentPurchaseApply/budgetOfPlant/myApplyFor/index.vue

@@ -0,0 +1,40 @@
+<script setup>
+import { userInfo } from '~/store/user'
+
+const { user_realname } = userInfo
+const router = useRouter()
+function cellClick(xm_id) {
+    router.push({ path: '/equipmentPurchaseApply/budgetOfPlant/myApplyFor/detail', query: { xm_id } })
+}
+
+const listMyApplyFor = ref([])
+const loadingMyApplyFor = ref(false)
+const finishedMyApplyFor = ref(false)
+let pageMyApplyFor = 1
+function onLoadMyApplyFor() {
+    loadingMyApplyFor.value = true
+    request({
+        url: '/jdbg/sbcg_cgxm/index',
+        data: {
+            page: pageMyApplyFor,
+            limit: 20,
+            my_check: '',
+            my_xm: 1,
+        },
+    }).then((res) => {
+        const data = res.data
+        listMyApplyFor.value = [...listMyApplyFor.value, ...data.page_data]
+        finishedMyApplyFor.value = data.total_page === pageMyApplyFor
+        pageMyApplyFor++
+        loadingMyApplyFor.value = false
+    })
+}
+</script>
+
+<template>
+    <van-list v-model:loading="loadingMyApplyFor" :finished="finishedMyApplyFor" finished-text="没有更多了"
+        @load="onLoadMyApplyFor">
+        <van-cell v-for="(item,index) in listMyApplyFor" :key="item" :title="`${index+1}\u00A0\u00A0\u00A0${item.xm_name}`"
+            @click="cellClick(item.xm_id)" />
+    </van-list>
+</template>

+ 324 - 0
src/pages/equipmentPurchaseApply/budgetOfPlant/myAuditFor/detail/index.vue

@@ -0,0 +1,324 @@
+<script setup>
+import { closeToast, showLoadingToast, showToast } from 'vant'
+import { userInfo } from '~/store/user'
+const { user_realname, user_id } = userInfo
+const { currentRoute } = useRouter()
+const route = currentRoute.value
+const xm_id = route.query.xm_id
+const detailData = ref({})
+
+let show = $ref(false);//遮罩层
+let auditShow = $ref(false);
+let auditedShow = $ref(false);
+let auditedData = $ref({});//已审核信息
+let auditCheck = $ref();
+let rejectMsg = $ref('');
+showLoadingToast({
+    message: '加载中...',
+    forbidClick: true,
+})
+function initData() {
+    request({
+        url: '/jdbg/sbcg_cgxm/detail',
+        data: {
+            xm_id,
+        },
+    }).then((res) => {
+        closeToast()
+        detailData.value = res.data.one_info;
+        res.data.one_info.shjl.forEach(item => {
+            if (item.sh_user_id == user_id) {
+                auditedData = item;
+            }
+        })
+    })
+}
+initData();
+
+let sh_id = $ref('');
+function handleAudit() {
+    auditShow = true;
+    sh_id = detailData.value.xm_id;
+    console.log(sh_id, '222222222');
+}
+
+function onBeforeClose(action) {
+    if (action === 'confirm') {
+        auditConfirm();
+    } else {
+        auditShow = false;
+    }
+}
+function auditConfirm() {
+    if (!auditCheck) {
+        showToast("请选择是否通过~");
+    } else {
+        if (auditCheck == "3" && rejectMsg == "") {
+            return showToast("请填写反驳原因");
+        }
+        request({
+            url: '/jdbg/sbcg_cgxm/check',
+            data: {
+                sh_id,
+                sh_status: auditCheck,
+                sh_reason: rejectMsg,
+            }
+        }).then(res => {
+            if (res.code == '1') {
+                showToast(res.msg);
+                initData();
+                auditShow = false;
+            }
+        })
+    }
+}
+function handleAudited() {
+    auditedShow = true;
+    show = true;
+    console.log(user_id,'2222222222222');
+    detailData.value.shjl.forEach(el => {
+        console.log(el,'11111111');
+        if (el.sh_user_id === user_id) {
+            auditedData = el;
+        }
+    })
+    // request({
+    //     url: '/jdbg/sbcg_cgxm/detail',
+    //     data: {
+    //         xm_id: detailData.value.xm_id,
+    //     }
+    // }).then(res => {
+    //     if (res.code == '1') {
+    //         res.data.one_info.shjl.forEach(el => {
+    //             if (el.sh_user_id === user_id) {
+    //                 auditedData = el;
+    //             }
+    //         })
+    //     }
+    // })
+
+}
+function cancel() {
+    auditedShow = false;
+    show = false;
+}
+</script>
+
+<template>
+    <div>
+        <div class="tableContainer">
+            <div class="topPart">
+                <table class="Tb" width="100%" cellspacing="0" cellpadding="0">
+                    <tr>
+                        <td class="titleOpt">
+                            申请科室
+                        </td>
+                        <td>{{ detailData.department_name }}</td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            申请人
+                        </td>
+                        <td>
+                            {{ detailData.xm_user_name }}
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            项目名称
+                        </td>
+                        <td>{{ detailData.xm_name }}</td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            采购的主要理由及依据
+                        </td>
+                        <td>{{ detailData.xm_lyyj }}</td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            采购类型
+                        </td>
+                        <td>{{ detailData.lb_name }}</td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            采购金额
+                        </td>
+                        <td>{{ detailData.xm_price }}</td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            采购清单
+                        </td>
+                        <td>
+                            <div v-html="detailData.xm_qd"></div>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            审核人
+                        </td>
+                        <td v-if="detailData.xm_shlc">
+                            <div v-for="item in JSON.parse(detailData.xm_shlc)">
+                                {{ item.user_name }}
+                            </div>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class="titleOpt">
+                            状态
+                        </td>
+                        <td>
+                            <div class="flex items-center py-5px justify-between pr-10px">
+                                <div>
+                                    <span v-if="detailData.xm_status === '4' || detailData.xm_status === '5'"
+                                        :class="{ 'text-red': detailData.xm_status === '4' }">{{
+                                            detailData.xm_status_option_n
+                                        }}</span>
+                                    <span
+                                        v-else-if="detailData.xm_status !== '4' && detailData.xm_status !== '5' && detailData.is_check === 1">已审核</span>
+                                    <span
+                                        v-else-if="detailData.xm_status !== '4' && detailData.xm_status !== '5' && detailData.is_check === 0">待审核</span>
+                                </div>
+                                <van-button class="w-60px"
+                                    v-if="(detailData.xm_status == 3 && detailData.is_check === 0) || (detailData.xm_status == 2 && detailData.is_check === 0)"
+                                    type="primary" size="small" @click="handleAudit()">审核</van-button>
+                                <van-button class="w-60px bg-hex-BDBDBD border-hex-BDBDBD audited" plain
+                                    v-else-if="detailData.xm_status == 3 && detailData.is_check == 1" type="primary"
+                                    size="small" @click="handleAudited()">已审核</van-button>
+                                <van-button class="w-60px bg-hex-BDBDBD border-hex-BDBDBD audited" plain
+                                    v-else-if="detailData.xm_status == 5" type="primary" size="small"
+                                    @click="handleAudited()">已通过</van-button>
+                                <van-button class="w-60px bg-hex-BDBDBD border-hex-BDBDBD un_audited" plain
+                                    v-else-if="detailData.xm_status == 5 || detailData.xm_status == 4" type="primary"
+                                    size="small" @click="handleAudited()">已退回</van-button>
+                            </div>
+                        </td>
+                    </tr>
+                </table>
+            </div>
+        </div>
+        <van-overlay :show="show" />
+        <!-- 审核弹窗 -->
+        <van-dialog v-model:show="auditShow" title="审核" show-cancel-button class="pl-30px" :before-close="onBeforeClose">
+            <van-radio-group v-model="auditCheck">
+                <van-radio name="2">通过</van-radio>
+                <van-radio name="3">不通过</van-radio>
+            </van-radio-group>
+            <textarea class="textarea" v-if="auditCheck == 3" v-model="rejectMsg" rows="4" placeholder="填写不通过原因"></textarea>
+        </van-dialog>
+        <!-- 已审核弹窗 -->
+        <div class="plan-nav reject-nav" v-show="auditedShow">
+            <van-icon class="cha" @click="cancel" name="cross" size="5vw"></van-icon>
+            <h3>查看详情</h3>
+            <p class="text_blue">{{ auditedData.sh_status === '2' ? '通过' : '不通过' }}</p>
+            <p class="text-gray-500 mt-10px" v-if="auditedData.sh_reason">{{ auditedData.sh_reason }}</p>
+        </div>
+    </div>
+</template>
+
+<style lang="scss" scoped>
+.titleOpt {
+    width: 45%;
+}
+
+.border_bottom {
+    border-bottom: 2px solid #666;
+    border-top: 2px solid #666;
+}
+
+.text-red {
+    color: red;
+}
+
+:deep(.specialTd table tbody tr td) {
+    border: 1px #CCCCCC solid !important;
+}
+
+.textarea {
+    width: 90%;
+    /* height: 15vw; */
+    margin: 0 auto;
+    border: 1px solid #ccc;
+    border-radius: 10px;
+    padding-left: 2px;
+    background: #f2f2f2;
+}
+
+.van-radio-group {
+    margin: 20px auto;
+
+    .van-radio {
+        margin: 20px auto;
+    }
+}
+
+.text_blue {
+    color: #003EEE;
+}
+
+::v-deep .audited {
+    .van-button__text {
+        color: #fff !important;
+    }
+}
+
+::v-deep .un_audited {
+    color: red;
+}
+
+.plan-nav {
+    width: 80vw;
+    height: 70vw;
+    color: #333333;
+    background-color: #fff;
+    position: fixed;
+    top: 35vw;
+    left: 10vw;
+    border-radius: 2vw;
+    z-index: 5;
+    padding: 0 5vw;
+    box-sizing: border-box;
+}
+
+.cha {
+    display: block;
+    font-size: 20px;
+    position: absolute;
+    right: 5vw;
+    top: 5vw;
+    cursor: pointer;
+}
+
+h3 {
+    display: block;
+    width: 12vw;
+    height: 10vw;
+    font-size: 5vw;
+    font-weight: 400;
+    position: relative;
+}
+
+h3::before {
+    position: absolute;
+    content: "";
+    width: 100%;
+    height: 2vw;
+    bottom: 3.3vw;
+    left: 0;
+    border-radius: 10vw;
+    background-color: #c5c5ff;
+    opacity: 0.6;
+}
+
+.reject-nav {
+    padding: 20px;
+
+    h3 {
+        width: 25vw;
+        font-size: 4.4vw;
+        text-align: center;
+    }
+}
+</style>

+ 224 - 0
src/pages/equipmentPurchaseApply/budgetOfPlant/myAuditFor/index.vue

@@ -0,0 +1,224 @@
+<script setup>
+import { showConfirmDialog, showToast } from 'vant';
+import { userInfo } from '~/store/user'
+const { user_realname, user_id } = userInfo
+const router = useRouter()
+function cellClick(xm_id) {
+    router.push({ path: '/equipmentPurchaseApply/budgetOfPlant/myAuditFor/detail', query: { xm_id } })
+}
+
+let show = $ref(false);//遮罩层
+let auditShow = $ref(false);
+let auditedShow = $ref(false);
+let auditedData = $ref({});//已审核信息
+let auditCheck = $ref();
+let rejectMsg = $ref('');
+const listMyApplyFor = ref([])
+const loadingMyApplyFor = ref(false)
+const finishedMyApplyFor = ref(false)
+let pageMyApplyFor = 1
+function onLoadMyApplyFor() {
+    loadingMyApplyFor.value = true
+    request({
+        url: '/jdbg/sbcg_cgxm/index',
+        data: {
+            page: pageMyApplyFor,
+            limit: 20,
+            my_check: 1,
+            my_xm: '',
+        },
+    }).then((res) => {
+        const data = res.data
+        listMyApplyFor.value = [...listMyApplyFor.value, ...data.page_data]
+        finishedMyApplyFor.value = data.total_page === pageMyApplyFor
+        pageMyApplyFor++
+        loadingMyApplyFor.value = false
+    })
+}
+let sh_id = $ref('');
+function handleAudit(xm_id) {
+    auditShow = true;
+    sh_id = xm_id;
+    console.log(sh_id, '222222222');
+}
+function onBeforeClose(action) {
+    if (action === 'confirm') {
+        auditConfirm();
+    } else {
+        auditShow = false;
+    }
+}
+function auditConfirm() {
+    if (!auditCheck) {
+        showToast("请选择是否通过~");
+    } else {
+        if (auditCheck == "3" && rejectMsg == "") {
+            return showToast("请填写反驳原因");
+        }
+        request({
+            url: '/jdbg/sbcg_cgxm/check',
+            data: {
+                sh_id,
+                sh_status: auditCheck,
+                sh_reason: rejectMsg,
+            }
+        }).then(res => {
+            if (res.code == '1') {
+                showToast(res.msg);
+                // onLoadMyApplyFor();
+                auditShow = false;
+            }
+        })
+    }
+}
+function handleAudited(item) {
+    auditedShow = true;
+    show = true;
+    request({
+        url: '/jdbg/sbcg_cgxm/detail',
+        data: {
+            xm_id: item.xm_id,
+        }
+    }).then(res => {
+        if (res.code == '1') {
+            res.data.one_info.shjl.forEach(el => {
+                if (el.sh_user_id === user_id) {
+                    auditedData = el;
+                }
+            })
+        }
+    })
+
+}
+function cancel() {
+    auditedShow = false;
+    show = false;
+}
+</script>
+
+<template>
+    <van-list v-model:loading="loadingMyApplyFor" :finished="finishedMyApplyFor" finished-text="没有更多了"
+        @load="onLoadMyApplyFor">
+        <van-cell v-for="(item, index) in listMyApplyFor" :key="item">
+            <template #title>
+                <span @click="cellClick(item.xm_id)" class="custom-title">{{ index + 1 }} {{ item.xm_name }}</span>
+            </template>
+            <template #right-icon>
+                <van-button class="w-60px"
+                    v-if="(item.xm_status == 3 && item.is_check === 0) || (item.xm_status == 2 && item.is_check === 0)"
+                    type="primary" size="small" @click="handleAudit(item.xm_id)">审核</van-button>
+                <van-button class="w-60px bg-hex-BDBDBD border-hex-BDBDBD audited" plain
+                    v-else-if="item.xm_status == 3 && item.is_check == 1" type="primary" size="small" @click="handleAudited(item)">已审核</van-button>
+                <van-button class="w-60px bg-hex-BDBDBD border-hex-BDBDBD audited" plain v-else-if="item.xm_status == 5"
+                    type="primary" size="small" @click="handleAudited(item)">已通过</van-button>
+                <van-button class="w-60px bg-hex-BDBDBD border-hex-BDBDBD un_audited" plain
+                    v-else-if="item.xm_status == 5 || item.xm_status == 4" type="primary" size="small"
+                    @click="handleAudited(item)">已退回</van-button>
+            </template>
+        </van-cell>
+    </van-list>
+    <van-overlay :show="show" />
+    <!-- 审核弹窗 -->
+    <van-dialog v-model:show="auditShow" title="审核" show-cancel-button class="pl-30px" :before-close="onBeforeClose">
+        <van-radio-group v-model="auditCheck">
+            <van-radio name="2">通过</van-radio>
+            <van-radio name="3">不通过</van-radio>
+        </van-radio-group>
+        <!-- <input type="textarea" v-if="auditCheck==2" v-model="rejectMsg" class="textarea" cols="30" rows="3"></input> -->
+        <textarea class="textarea" v-if="auditCheck == 3" v-model="rejectMsg" rows="4" placeholder="填写不通过原因"></textarea>
+    </van-dialog>
+    <!-- 已审核弹窗 -->
+    <div class="plan-nav reject-nav" v-show="auditedShow">
+        <van-icon class="cha" @click="cancel" name="cross" size="5vw"></van-icon>
+        <h3>查看详情</h3>
+        <p class="text_blue">{{ auditedData.sh_status === '2' ? '通过' : '不通过' }}</p>
+        <p class="text-gray-500 mt-10px" v-if="auditedData.sh_reason">{{ auditedData.sh_reason }}</p>
+    </div>
+</template>
+
+<style lang="scss" scoped>
+.textarea {
+    width: 90%;
+    /* height: 15vw; */
+    margin: 0 auto;
+    border: 1px solid #ccc;
+    border-radius: 10px;
+    padding-left: 2px;
+    background: #f2f2f2;
+}
+
+.van-radio-group {
+    margin: 20px auto;
+
+    .van-radio {
+        margin: 20px auto;
+    }
+}
+
+.text_blue {
+    color: #003EEE;
+}
+
+::v-deep .audited {
+    .van-button__text {
+        color: #fff !important;
+    }
+}
+::v-deep .un_audited{
+    color: red;
+}
+
+.plan-nav {
+    width: 80vw;
+    height: 70vw;
+    color: #333333;
+    background-color: #fff;
+    position: fixed;
+    top: 35vw;
+    left: 10vw;
+    border-radius: 2vw;
+    z-index: 5;
+    padding: 0 5vw;
+    box-sizing: border-box;
+}
+
+.cha {
+    display: block;
+    font-size: 20px;
+    position: absolute;
+    right: 5vw;
+    top: 5vw;
+    cursor: pointer;
+}
+
+h3 {
+    display: block;
+    width: 12vw;
+    height: 10vw;
+    font-size: 5vw;
+    font-weight: 400;
+    position: relative;
+}
+
+h3::before {
+    position: absolute;
+    content: "";
+    width: 100%;
+    height: 2vw;
+    bottom: 3.3vw;
+    left: 0;
+    border-radius: 10vw;
+    background-color: #c5c5ff;
+    opacity: 0.6;
+}
+
+.reject-nav {
+    padding: 20px;
+
+    h3 {
+        width: 25vw;
+        font-size: 4.4vw;
+        text-align: center;
+    }
+}
+</style>