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

feat:加班餐费补贴-工作台 完成

DESKTOP-07F1812\coder 2 éve%!(EXTRA string=óta)
szülő
commit
db53e3785c

+ 17 - 0
src/pages/overtimeMealFeeSubsidy/workbench/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>

+ 123 - 0
src/pages/overtimeMealFeeSubsidy/workbench/myApplyFor/detail/index.vue

@@ -0,0 +1,123 @@
+<script setup>
+import { closeToast, showLoadingToast } from 'vant'
+
+const { currentRoute } = useRouter()
+const route = currentRoute.value
+const jbcb_id = route.query.jbcb_id
+const detailData = ref({})
+
+showLoadingToast({
+  message: '加载中...',
+  forbidClick: true,
+})
+request({
+  url: '/jdbg/jbcb/detail',
+  data: {
+    jbcb_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.jbcb_sqr }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              申请科室
+            </td>
+            <td>
+              {{ detailData.jbcb_zwgw_mc }}
+            </td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              加班事由
+            </td>
+            <td>{{ detailData.jbcb_jbsy }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              加班类型
+            </td>
+            <td>{{ detailData.jbcb_jblx_mc }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              加班地点
+            </td>
+            <td>{{ detailData.jbcb_jbdd }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              加班时间
+            </td>
+            <td>{{ detailData.jbcb_jbsj_ks }}->{{ detailData.jbcb_jbsj_js }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              加班时长
+            </td>
+            <td>{{ detailData.jbcb_jbsc }}小时</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              补贴金额
+            </td>
+            <td>{{ detailData.jbcb_btje }}元</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              审批人
+            </td>
+            <td>{{ detailData.jbcb_spr_mc }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              状态
+            </td>
+            <td>
+              <div>
+                <span :class="{ 'text-red': detailData.jbcb_shzt === '2' }">{{
+                  detailData.jbcb_shzt_option_n
+                }}</span>
+                <p v-if="detailData.jbcb_shzt === '2'">
+                  {{ detailData.jbcb_clyj }}
+                </p>
+              </div>
+            </td>
+          </tr>
+        </table>
+      </div>
+    </div>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+.titleOpt {
+  width: 30%;
+}
+
+.border_bottom {
+  border-bottom: 2px solid #666;
+  border-top: 2px solid #666;
+}
+
+.text-red {
+  color: red;
+}
+
+::v-deep .specialTd table tbody tr td {
+  border: 1px #CCCCCC solid !important;
+}
+</style>

+ 43 - 0
src/pages/overtimeMealFeeSubsidy/workbench/myApplyFor/index.vue

@@ -0,0 +1,43 @@
+<script setup>
+import { userInfo } from '~/store/user'
+
+const { user_realname } = userInfo
+const router = useRouter()
+function cellClick(jbcb_id) {
+  router.push({ path: '/overtimeMealFeeSubsidy/workbench/myApplyFor/detail', query: { jbcb_id } })
+}
+
+const listMyApplyFor = ref([])
+const loadingMyApplyFor = ref(false)
+const finishedMyApplyFor = ref(false)
+let pageMyApplyFor = 1
+function onLoadMyApplyFor() {
+  loadingMyApplyFor.value = true
+  request({
+    url: '/jdbg/jbcb/index',
+    data: {
+      page: pageMyApplyFor,
+      limit: 20,
+      jbcb_sqr: user_realname,
+    },
+  }).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 in listMyApplyFor" :key="item" :title="`${item.jbcb_sqr}\u00A0\u00A0\u00A0${item.jbcb_jbsy}`"
+      @click="cellClick(item.jbcb_id)"
+    />
+  </van-list>
+</template>

+ 213 - 0
src/pages/overtimeMealFeeSubsidy/workbench/myAuditFor/detail/index.vue

@@ -0,0 +1,213 @@
+<script setup>
+import { closeToast, showLoadingToast, showToast } from 'vant'
+
+const { currentRoute } = useRouter()
+const route = currentRoute.value
+const jbcb_id = route.query.jbcb_id
+const detailData = ref({})
+
+showLoadingToast({
+  message: '加载中...',
+  forbidClick: true,
+})
+function getData() {
+  request({
+    url: '/jdbg/jbcb/detail',
+    data: {
+      jbcb_id,
+    },
+  }).then((res) => {
+    closeToast()
+    detailData.value = res.data.one_info
+  })
+}
+getData()
+
+const auditchecked = ref('')
+const auditDialogShow = ref(false)
+const jbcb_clyj = ref('')
+const operaItem = ref({})
+function clickAudit() {
+  auditchecked.value = ''
+  jbcb_clyj.value = ''
+  auditDialogShow.value = true
+}
+function beforeCloseDialog(action) {
+  if (action == 'confirm') {
+    if (auditchecked.value == '') {
+      showToast('请选择审核结果')
+      return false
+    }
+    else if ((auditchecked.value === '2') && jbcb_clyj.value == '') {
+      showToast('请填写意见')
+      return false
+    }
+    else {
+      dialogSubmit()
+      return true
+    }
+  }
+  else {
+    return true
+  }
+}
+function dialogSubmit() {
+  const transObj = {
+    jbcb_id,
+    jdbg_jbcb: {
+      jbcb_shzt: auditchecked.value, // 待审核 1通过 2驳回
+      jbcb_clyj: jbcb_clyj.value, // 处理意见
+    },
+  }
+  showLoadingToast({
+    message: '提交中...',
+    forbidClick: true,
+  })
+  request({
+    url: '/jdbg/jbcb/edit',
+    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.jbcb_sqr }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              申请科室
+            </td>
+            <td>
+              {{ detailData.jbcb_zwgw_mc }}
+            </td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              加班事由
+            </td>
+            <td>{{ detailData.jbcb_jbsy }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              加班类型
+            </td>
+            <td>{{ detailData.jbcb_jblx_mc }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              加班地点
+            </td>
+            <td>{{ detailData.jbcb_jbdd }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              加班时间
+            </td>
+            <td>{{ detailData.jbcb_jbsj_ks }}->{{ detailData.jbcb_jbsj_js }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              加班时长
+            </td>
+            <td>{{ detailData.jbcb_jbsc }}小时</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              补贴金额
+            </td>
+            <td>{{ detailData.jbcb_btje }}元</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              审批人
+            </td>
+            <td>{{ detailData.jbcb_spr_mc }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              状态
+            </td>
+            <td>
+              <div v-if="detailData.jbcb_shzt !== '0'">
+                <span :class="{ 'text-red': detailData.jbcb_shzt === '2' }">{{
+                  detailData.jbcb_shzt_option_n
+                }}</span>
+                <p v-if="detailData.jbcb_shzt === '2'">
+                  {{ detailData.jbcb_clyj }}
+                </p>
+              </div>
+              <div v-if="detailData.jbcb_shzt === '0'">
+                <van-button
+                  v-if="detailData.jbcb_shzt === '0'" class="rightButton" type="primary"
+                  @click.stop="clickAudit(item)"
+                >
+                  审核
+                </van-button>
+              </div>
+            </td>
+          </tr>
+        </table>
+      </div>
+    </div>
+    <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="jbcb_clyj" rows="3" autosize type="textarea" placeholder="填写意见" />
+      </div>
+    </van-dialog>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+.titleOpt {
+  width: 30%;
+}
+
+.border_bottom {
+  border-bottom: 2px solid #666;
+  border-top: 2px solid #666;
+}
+
+.text-red {
+  color: red;
+}
+
+::v-deep .specialTd table tbody tr td {
+  border: 1px #CCCCCC solid !important;
+}
+
+.rightButton {
+  height: 30px;
+  width: 75px;
+}
+</style>

+ 156 - 0
src/pages/overtimeMealFeeSubsidy/workbench/myAuditFor/index.vue

@@ -0,0 +1,156 @@
+<script setup>
+import { closeToast, showLoadingToast, showToast } from 'vant'
+import { userInfo } from '~/store/user'
+
+const { user_id } = userInfo
+
+const router = useRouter()
+function cellClick(jbcb_id) {
+  router.push({ path: '/overtimeMealFeeSubsidy/workbench/myAuditFor/detail', query: { jbcb_id } })
+}
+
+const listMyAuditFor = ref([])
+const loadingMyAuditFor = ref(false)
+const finishedMyAuditFor = ref(false)
+let pageMyAuditFor = 1
+function onLoadMyAuditFor() {
+  loadingMyAuditFor.value = true
+  request({
+    url: '/jdbg/jbcb/index',
+    data: {
+      page: pageMyAuditFor,
+      limit: 20,
+      jbcb_spr_id: user_id,
+    },
+  }).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 jbcb_clyj = ref('')
+const operaItem = ref({})
+const resultDialogShow = ref(false)
+function clickAudit(item) {
+  operaItem.value = item
+  if (item.jbcb_shzt === '待审核') {
+    auditchecked.value = ''
+    jbcb_clyj.value = ''
+    auditDialogShow.value = true
+  }
+  else {
+    resultDialogShow.value = true
+  }
+}
+function beforeCloseDialog(action) {
+  if (action == 'confirm') {
+    if (auditchecked.value == '') {
+      showToast('请选择审核结果')
+      return false
+    }
+    else if ((auditchecked.value === '2') && jbcb_clyj.value == '') {
+      showToast('请填写意见')
+      return false
+    }
+    else {
+      dialogSubmit()
+      return true
+    }
+  }
+  else {
+    return true
+  }
+}
+function dialogSubmit() {
+  const transObj = {
+    jbcb_id: operaItem.value.jbcb_id,
+    jdbg_jbcb: {
+      jbcb_shzt: auditchecked.value, // 待审核 1通过 2驳回
+      jbcb_clyj: jbcb_clyj.value, // 处理意见
+    },
+  }
+  showLoadingToast({
+    message: '提交中...',
+    forbidClick: true,
+  })
+  request({
+    url: '/jdbg/jbcb/edit',
+    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 in listMyAuditFor" :key="item" :title="`${item.jbcb_sqr}\u00A0\u00A0\u00A0${item.jbcb_jbsy}`"
+      @click="cellClick(item.jbcb_id)"
+    >
+      <template #value>
+        <van-button v-if="item.jbcb_shzt === '待审核'" class="rightButton" type="primary" @click.stop="clickAudit(item)">
+          审核
+        </van-button>
+        <van-button v-else color="#BDBDBD" class="rightButton" @click.stop="clickAudit(item)">
+          已审核
+        </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 = '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="jbcb_clyj" rows="3" autosize type="textarea" placeholder="填写意见" />
+    </div>
+  </van-dialog>
+
+  <van-dialog v-model:show="resultDialogShow" title="审核详情">
+    <div class="dialogDiv">
+      <van-radio-group v-model="auditchecked">
+        <van-cell-group inset>
+          <van-cell :title="operaItem.jbcb_shzt" />
+        </van-cell-group>
+      </van-radio-group>
+      <van-field v-model="operaItem.jbcb_clyj" disabled rows="3" autosize type="textarea" />
+    </div>
+  </van-dialog>
+</template>
+
+<style lang="scss" scoped>
+.rightButton {
+  height: 30px;
+  width: 75px;
+}
+</style>