Pārlūkot izejas kodu

feat:三重一大项目申请完成

coder 2 gadi atpakaļ
vecāks
revīzija
3f6166e6c7

+ 255 - 0
src/pages/sanZhongYiDa/projectApply/detail/index.vue

@@ -0,0 +1,255 @@
+<script setup>
+import { closeToast, showLoadingToast, showToast } from 'vant'
+
+const { currentRoute } = useRouter()
+const route = currentRoute.value
+const xm_id = route.query.xm_id
+const detailData = ref({})
+const shjl = ref([])
+const fileFinalArr = ref([])
+function getData() {
+  showLoadingToast({
+    message: '加载中...',
+    forbidClick: true,
+  })
+  request({
+    url: '/jdbg/xmlxsb_xmsq/detail',
+    data: {
+      xm_id,
+    },
+  }).then((res) => {
+    closeToast()
+    detailData.value = res.data.one_info
+    shjl.value = res.data.one_info.shjl
+
+    // 判断是几个附件
+    const ifOneB = res.data.one_info.xm_file.indexOf(',')
+    if (ifOneB != '-1') { // 能找到,不止一个附件
+      const muilArr = res.data.one_info.xm_file.split(',')
+      const flileArr = []
+      muilArr.forEach((item) => {
+        const secSpil = item.split('|')
+        flileArr.push({
+          fileUrl: secSpil[0],
+          fileName: secSpil[1],
+        })
+      })
+      fileFinalArr.value = flileArr
+    }
+    else {
+      const singleArr = res.data.one_info.xm_file.split('|')
+      fileFinalArr.value = [{
+        fileUrl: singleArr[0],
+        fileName: singleArr[1],
+      }]
+    }
+  })
+}
+getData()
+
+const auditchecked = ref('')
+const auditDialogShow = ref(false)
+const sh_reason = ref('')
+function clickAudit() {
+  auditchecked.value = ''
+  sh_reason.value = ''
+  auditDialogShow.value = true
+}
+function beforeCloseDialog(action) {
+  if (action == 'confirm') {
+    if (auditchecked.value == '') {
+      showToast('请选择审核结果')
+      return false
+    }
+    else if ((auditchecked.value === '2') && sh_reason.value == '') {
+      showToast('请填写意见')
+      return false
+    }
+    else {
+      dialogSubmit()
+      return true
+    }
+  }
+  else {
+    return true
+  }
+}
+function dialogSubmit() {
+  const transObj = {
+    xm_id,
+    sh_status: auditchecked.value, // 待审核 1通过 2驳回
+    sh_reason: sh_reason.value, // 处理意见
+  }
+  showLoadingToast({
+    message: '提交中...',
+    forbidClick: true,
+  })
+  request({
+    url: '/jdbg/gwgl_gw/check',
+    data: transObj,
+  }).then((res) => {
+    closeToast()
+    if (res.code == 1) {
+      showToast(res.msg)
+      getData()
+    }
+  })
+}
+</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.xm_name }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              项目类别:
+            </td>
+            <td>{{ detailData.lb_name }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              项目理由:
+            </td>
+            <td>{{ detailData.xm_reason }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              申请科室:
+            </td>
+            <td>{{ detailData.department_name }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              项目预算:
+            </td>
+            <td>{{ detailData.xm_price }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              申报时间:
+            </td>
+            <td>{{ detailData.xm_sbsj }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              项目内容:
+            </td>
+            <td>
+              <div class="specialTd" v-html="detailData.xm_content" />
+            </td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              项目方式:
+            </td>
+            <td>{{ detailData.xm_type }}</td>
+          </tr>
+
+          <tr>
+            <td class="titleOpt">
+              项目附件:
+            </td>
+            <td style="color:#1989fa">
+              <div v-for="(item, index) in fileFinalArr" :key="index" class="singleD">
+                <a :href="item.fileUrl" target="_blank">{{ item.fileName }}</a>
+              </div>
+            </td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              状态:
+            </td>
+            <td>{{ detailData.xm_status_option_n }}</td>
+          </tr>
+
+          <tbody v-for="(item, index) in shjl" :key="index" class="bg-hex-fffff9 border_bottom">
+            <tr>
+              <td class="titleOpt">
+                序号:
+              </td>
+              <td>
+                <div class="specialTd">
+                  {{ index + 1 }}
+                </div>
+              </td>
+            </tr>
+            <tr>
+              <td class="titleOpt">
+                审核部门:
+              </td>
+              <td>
+                <div class="specialTd">
+                  {{ item.sh_user_name }}
+                </div>
+              </td>
+            </tr>
+            <tr>
+              <td class="titleOpt">
+                审核人:
+              </td>
+              <td>
+                <div class="specialTd">
+                  {{ item.sh_user_name }}
+                </div>
+              </td>
+            </tr>
+            <tr>
+              <td class="titleOpt">
+                审核时间:
+              </td>
+              <td>
+                <div class="specialTd">
+                  {{ item.sh_user_name }}
+                </div>
+              </td>
+            </tr>
+
+            <tr>
+              <td class="titleOpt">
+                状态:
+              </td>
+              <td>
+                <div :style="{ color: item.sh_status == 3 ? 'red' : '' }">
+                  {{ item.sh_status == 1 ? "未处理" : (item.sh_status == 2 ? '通过' : '不通过') }}
+                </div>
+              </td>
+            </tr>
+            <tr>
+              <td class="titleOpt">
+                处理意见:
+              </td>
+              <td>
+                <div class="specialTd">
+                  {{ item.sh_reason }}
+                </div>
+              </td>
+            </tr>
+          </tbody>
+        </table>
+      </div>
+    </div>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+.rightButton {
+  height: 30px;
+  width: 75px;
+}
+
+.titleOpt {
+  min-width: 90px;
+}
+
+:deep(.specialTd table tbody tr td) {
+  border: 1px #CCCCCC solid !important;
+}
+</style>

+ 21 - 0
src/pages/sanZhongYiDa/projectApply/index.vue

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

+ 40 - 0
src/pages/sanZhongYiDa/projectApply/myApplyFor/index.vue

@@ -0,0 +1,40 @@
+<script setup>
+const router = useRouter()
+function cellClick(xm_id) {
+  router.push({ path: '/sanZhongYiDa/projectApply/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/xmlxsb_xmsq/index',
+    data: {
+      page: pageMyApplyFor,
+      limit: 20,
+      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${item.xm_name}`"
+      @click="cellClick(item.xm_id)"
+    />
+  </van-list>
+</template>

+ 142 - 0
src/pages/sanZhongYiDa/projectApply/myAuditFor/index.vue

@@ -0,0 +1,142 @@
+<script setup>
+import { closeToast, showLoadingToast, showToast } from 'vant'
+
+const router = useRouter()
+function cellClick(xm_id) {
+  router.push({ path: '/sanZhongYiDa/projectApply/detail', query: { xm_id } })
+}
+
+const listMyAuditFor = ref([])
+const loadingMyAuditFor = ref(false)
+const finishedMyAuditFor = ref(false)
+let pageMyAuditFor = 1
+function onLoadMyAuditFor() {
+  loadingMyAuditFor.value = true
+  request({
+    url: '/jdbg/xmlxsb_xmsq/index',
+    data: {
+      page: pageMyAuditFor,
+      limit: 20,
+      my_check: 1,
+    },
+  }).then((res) => {
+    const data = res.data
+    listMyAuditFor.value = [...listMyAuditFor.value, ...data.page_data]
+    finishedMyAuditFor.value = data.total_page === pageMyAuditFor
+    pageMyAuditFor++
+    loadingMyAuditFor.value = false
+  })
+}
+
+const auditchecked = ref('')
+const auditDialogShow = ref(false)
+const sh_reason = ref('')
+const operaItem = ref({})
+
+function clickAudit(item) {
+  operaItem.value = item
+  auditchecked.value = ''
+  sh_reason.value = ''
+  auditDialogShow.value = true
+}
+function beforeCloseDialog(action) {
+  if (action == 'confirm') {
+    if (auditchecked.value == '') {
+      showToast('请选择审核结果')
+      return false
+    }
+    else if ((auditchecked.value === '3') && sh_reason.value == '') {
+      showToast('请填写意见')
+      return false
+    }
+    else {
+      dialogSubmit()
+      return true
+    }
+  }
+  else {
+    return true
+  }
+}
+function dialogSubmit() {
+  const transObj = {
+    sh_id: operaItem.value.xm_id,
+    sh_status: auditchecked.value, // 待审核 1通过 2驳回
+    sh_reason: sh_reason.value, // 处理意见
+
+  }
+  showLoadingToast({
+    message: '提交中...',
+    forbidClick: true,
+  })
+  request({
+    url: '/jdbg/xmlxsb_xmsq/check',
+    data: transObj,
+  }).then((res) => {
+    closeToast()
+    if (res.code == 1) {
+      showToast(res.msg)
+      listMyAuditFor.value = []
+      pageMyAuditFor = 1
+      onLoadMyAuditFor()
+    }
+  })
+}
+</script>
+
+<template>
+  <van-list
+    v-model:loading="loadingMyAuditFor" :finished="finishedMyAuditFor" finished-text="没有更多了"
+    @load="onLoadMyAuditFor"
+  >
+    <van-cell
+      v-for="(item, index) in listMyAuditFor" :key="item" :title="`${index + 1}.\u00A0\u00A0${item.xm_name}`"
+      @click="cellClick(item.xm_id)"
+    >
+      <template #value>
+        <van-button
+          v-if="item.xm_status_option_k == '1' || item.xm_status_option_k == '2' || item.xm_status_option_k == '3'"
+          class="rightButton" type="primary" @click.stop="clickAudit(item)"
+        >
+          审核
+        </van-button>
+        <van-button
+          v-if="item.xm_status_option_k > '3' && item.xm_status_option_k <= '5'" color="#BDBDBD"
+          class="rightButton"
+        >
+          已审核
+        </van-button>
+      </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 = '2'">
+            <template #right-icon>
+              <van-radio name="2" />
+            </template>
+          </van-cell>
+          <van-cell title="不通过" clickable @click="auditchecked = '3'">
+            <template #right-icon>
+              <van-radio name="3" />
+            </template>
+          </van-cell>
+        </van-cell-group>
+      </van-radio-group>
+      <van-field v-if="auditchecked === '3'" v-model="sh_reason" rows="3" autosize type="textarea" placeholder="填写意见" />
+    </div>
+  </van-dialog>
+</template>
+
+<style lang="scss" scoped>
+.rightButton {
+  height: 30px;
+  width: 75px;
+}
+</style>

+ 40 - 0
src/pages/sanZhongYiDa/projectApply/myAudited/index.vue

@@ -0,0 +1,40 @@
+<script setup>
+const router = useRouter()
+function cellClick(xm_id) {
+  router.push({ path: '/sanZhongYiDa/projectApply/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/xmlxsb_xmsq/index',
+    data: {
+      page: pageMyApplyFor,
+      limit: 20,
+      xm_status: 5,
+    },
+  }).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${item.xm_name}`"
+      @click="cellClick(item.xm_id)"
+    />
+  </van-list>
+</template>