This commit is contained in:
dzc committed 2024-11-13 07:02:40 +08:00
1 parent 328489c6dd
commit 037dd3a17f
28 files changed
+958 -275

No files matched your search

+60 -26
View File
@@ -1,13 +1,16 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { isEmpty } from "radash"
import dayjs from "dayjs"
import { hooks, router } from "@@/index"
import { applyApi } from "@@/api"
const state = reactive<any>({
detailType: "add",
detailId: null,
detail: null,
})
const applyForm = reactive<any>({
displayTimeRange: "",
@@ -26,13 +29,37 @@ const applyFormRules = reactive<any>({
]
})
onLoad(() => {
onLoad((options: any) => {
const { type, id } = options
if (!isEmpty(type)) state.detailType = type
if (!isEmpty(id)) state.detailId = id
if (type === 'view') {
getDetail()
}
});
onShow(() => {
})
const getDetail = async () => {
if (isEmpty(state.detailId)) return
const _pa = { id: state.detailId }
const { data } = await applyApi.foreignDetail(_pa)
if (!isEmpty(data)) {
state.detail = data
const startTime = hooks.useTime(data.applyStartTime, "{y}-{m}-{d}")
const endTime = hooks.useTime(data.applyEndTime, "{y}-{m}-{d}")
applyForm.displayTimeRangeStr = startTime + "~" + endTime
applyForm.count = data.count
if (isEmpty(data.remark)) {
applyForm.remark = "无"
} else {
applyForm.remark = data.remark
}
}
}
const applyFormRef = ref<any>(null)
const doSubmit = async () => {
applyFormRef.value.submit()
@@ -64,29 +91,36 @@ const doSubmit = async () => {
<template>
<crud-layout title="外来人员就餐" bg="/static/page/blue-bg.png">
<view class="h-30rpx" />
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
<tm-form-item name="displayTimeRangeStr" label="使用时间" :showBottom="false">
<tm-between-time start="2020-1-1" end="2030-1-1" v-model="applyForm.displayTimeRange"
v-model:model-str="applyForm.displayTimeRangeStr" format="YYYY-MM-DD">
<view style="pointer-events: none;">
<tm-input v-model="applyForm.displayTimeRangeStr" disabled placeholder="请选择使用时间..">
<template v-slot:rightIcon>
<text class="p-0.5rem color-#b1b1b1 iconfont icon-xiangxiajiantouxiao"></text>
</template>
</tm-input>
</view>
</tm-between-time>
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="count" label="申请数量" :showBottom="false">
<tm-input v-model="applyForm.count" type="number" showClear placeholder="请输入申请数量.." />
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="remark" label="备注" :required="false" :showBottom="false">
<tm-input v-model="applyForm.remark" type="textarea" showClear placeholder="请输入备注.."></tm-input>
</tm-form-item>
</tm-form>
<view class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
<view class="card p-x-30rpx p-y-40rpx">
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
<tm-form-item name="displayTimeRangeStr" label="使用时间" :showBottom="false">
<tm-between-time start="2020-1-1" end="2030-1-1" v-model="applyForm.displayTimeRange"
v-model:model-str="applyForm.displayTimeRangeStr" format="YYYY-MM-DD">
<view :style="{ pointerEvents: state.detailType == 'view' ? 'auto' : 'none' }">
<tm-input v-model="applyForm.displayTimeRangeStr" disabled placeholder="请选择使用时间..">
<template v-slot:rightIcon>
<text v-if="state.detailType != 'view'"
class="p-0.5rem color-#b1b1b1 iconfont icon-xiangxiajiantouxiao"></text>
</template>
</tm-input>
</view>
</tm-between-time>
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="count" label="申请数量" :showBottom="false">
<tm-input v-model="applyForm.count" type="number" :disabled="state.detailType == 'view'"
:showClear="state.detailType != 'view'" placeholder="请输入申请数量.." />
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="remark" label="备注" :required="false" :showBottom="false">
<tm-input v-model="applyForm.remark" type="textarea" :disabled="state.detailType == 'view'"
:showClear="state.detailType != 'view'"
:placeholder="state.detailType == 'view' ? '' : '请输入备注..'"></tm-input>
</tm-form-item>
</tm-form>
</view>
<view v-if="state.detailType != 'view'"
class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
@tap="doSubmit">
提交
</view>
+9 -20
View File
@@ -6,11 +6,7 @@ import { isEmpty } from 'radash'
import { hooks, router } from "@@/index"
import { applyApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const data = {
tabs: ['待审核', '已通过', '已拒绝'],
}
const state = reactive<any>({
pa: {
id: null,
@@ -33,14 +29,6 @@ onShow(() => {
})
const doTab = (e: any) => {
if (state.pa.status != e + 1) {
state.pa.status = e + 1
pageRef.value.reload(true)
}
}
</script>
@@ -52,18 +40,19 @@ const doTab = (e: any) => {
<template #top>
<view class="h-30rpx" />
</template>
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i">
<view class="flex-row items-center justify-between">
<view class="">
<view class="flex-row items-center justify-between card p-x-20rpx p-y-30rpx m-b-20rpx"
v-for="(v, i) in pageHook.list" :key="i" @tap="hooks.usePreviewImage(v.code)">
<view class="flex-row items-center">
<view class="flex-row items-center">
<tm-tag v-if="v.status == 1" size="m" color="info">未使用</tm-tag>
<tm-tag v-if="v.status == 2" size="m" color="success">已使用</tm-tag>
<view class="m-t-10rpx sub-text-26">
<text>{{ v.userNameStr }}</text>
<text class="m-l-10rpx">{{ v.userMobile }}</text>
</view>
</view>
<image class="w-100rpx h-100rpx" :src="v.code" mode="aspectFill" />
<view class="flex-row items-center sub-text-28">
<text class="m-l-30rpx">{{ v.userNameStr }}</text>
<text class="m-l-30rpx">{{ v.userMobile }}</text>
</view>
</view>
<view class="iconfont icon-erweima font-size-40rpx! color-blue" />
</view>
</z-paging>
</crud-layout>
+48 -15
View File
@@ -8,11 +8,16 @@ import { applyApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const data = {
tabs: ['待审核', '已通过', '已拒绝'],
tabs: [
{ id: null, name: '全部', disabled: false },
{ id: 1, name: '待审核', disabled: false },
{ id: 2, name: '已通过', disabled: false },
{ id: 3, name: '已拒绝', disabled: false },
]
}
const state = reactive<any>({
pa: {
status: 1,
status: data.tabs[0].id,
},
})
@@ -26,23 +31,26 @@ onLoad(() => {
});
onShow(() => {
pageRef.value.reload(false)
if (pageRef.value) {
pageRef.value.reload(false)
}
})
const doTab = (e: any) => {
if (state.pa.status != e + 1) {
state.pa.status = e + 1
pageRef.value.reload(true)
}
const target = data.tabs[e];
state.pa.status = target.id
pageRef.value.reload(true)
}
const doApply = async () => {
router.jump("/pages/apply/foreign-apply")
router.jump("/pages/apply/foreign-apply", { type: 'add' })
}
const doCard = (v: any) => {
if (v.status == 2) {
router.jump("/pages/apply/foreign-items", { id: v.id })
} else {
router.jump("/pages/apply/foreign-apply", { type: 'view', id: v.id })
}
}
@@ -64,11 +72,23 @@ const doCard = (v: any) => {
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i"
@tap="doCard(v)">
<view class="flex-row items-center justify-between">
<view class="sub-text-28">电子餐券</view>
<view class="sub-text-24">{{ hooks.useTime(v.createTime, "") }}</view>
<view class="sub-text-30">电子餐券</view>
<view class="flex-row items-center">
<view class="second-text-26">{{ hooks.useTime(v.createTime, "") }}</view>
<view class="flex-row-center m-l-20rpx">
<tm-tag v-if="v.status == 1" size="xs" color="info">待审核</tm-tag>
<tm-tag v-if="v.status == 2" size="xs" color="success">已通过</tm-tag>
<tm-tag v-if="v.status == 3" size="xs" color="error">已拒绝</tm-tag>
</view>
</view>
</view>
<view class="sub-text-24">
<view class="m-t-20rpx">
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
<view class="flex items-center justify-between second-text-26">
<view class="flex items-center">
<text>数量</text>
<text class="m-l-10rpx">{{ v.count }}</text>
</view>
<view class="flex items-center">
<text>有效期</text>
<text class="m-l-10rpx">
{{ hooks.useTime(v.applyStartTime, " {y}-{m}-{d}") }}
@@ -76,11 +96,24 @@ const doCard = (v: any) => {
{{ hooks.useTime(v.applyEndTime, "{y}-{m}-{d}") }}
</text>
</view>
<view class="m-t-20rpx">
<text>数量</text>
<text class="m-l-10rpx">{{ v.count }}</text>
</view>
<view v-if="v.status != 1">
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
<view class="flex items-center justify-between second-text-26">
<view class="flex items-center">
<text>审核人</text>
<text class="m-l-10rpx">{{ v.checkUserName }}</text>
</view>
<view class="flex items-center">
<text>审核时间</text>
<text class="m-l-10rpx"> {{ hooks.useTime(v.checkTime, "") }}</text>
</view>
</view>
</view>
<view class="flex items-center justify-end m-t-25rpx">
<text v-if="v.status == 2" class="botder_btn">使用</text>
<text v-else class="botder_btn">查看</text>
</view>
</view>
<template #bottom>
<view
+43 -12
View File
@@ -1,11 +1,15 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { isEmpty } from "radash"
import { hooks, router } from "@@/index"
import { applyApi } from "@@/api"
const state = reactive<any>({
detailType: "add",
detailId: null,
detail: null,
})
const applyForm = reactive<any>({
@@ -19,13 +23,34 @@ const applyFormRules = reactive<any>({
{ required: true, max: 20, message: '最多申请20张' },
]
})
onLoad(() => {
onLoad((options: any) => {
const { type, id } = options
if (!isEmpty(type)) state.detailType = type
if (!isEmpty(id)) state.detailId = id
if (type === 'view') {
getDetail()
}
});
onShow(() => {
})
const getDetail = async () => {
if (isEmpty(state.detailId)) return
const _pa = { id: state.detailId }
const { data } = await applyApi.strideDetail(_pa)
if (!isEmpty(data)) {
state.detail = data
applyForm.count = data.count
if (isEmpty(data.remark)) {
applyForm.remark = "无"
} else {
applyForm.remark = data.remark
}
}
}
const applyFormRef = ref<any>(null)
const doSubmit = async () => {
applyFormRef.value.submit()
@@ -55,16 +80,22 @@ const doSubmit = async () => {
<template>
<crud-layout title="外来人员就餐" bg="/static/page/blue-bg.png">
<view class="h-30rpx" />
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
<tm-form-item name="count" label="申请数量" :showBottom="false">
<tm-input v-model="applyForm.count" type="number" showClear placeholder="请输入申请数量.." />
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="remark" label="备注" :required="false" :showBottom="false">
<tm-input v-model="applyForm.remark" type="textarea" showClear placeholder="请输入备注.."></tm-input>
</tm-form-item>
</tm-form>
<view class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
<view class="card p-x-30rpx p-y-40rpx">
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
<tm-form-item name="count" label="申请数量" :showBottom="false">
<tm-input v-model="applyForm.count" type="number" :disabled="state.detailType == 'view'"
:showClear="state.detailType != 'view'" placeholder="请输入申请数量.." />
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="remark" label="备注" :required="false" :showBottom="false">
<tm-input v-model="applyForm.remark" type="textarea" :disabled="state.detailType == 'view'"
:showClear="state.detailType != 'view'"
:placeholder="state.detailType == 'view' ? '' : '请输入备注..'"></tm-input>
</tm-form-item>
</tm-form>
</view>
<view v-if="state.detailType != 'view'"
class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
@tap="doSubmit">
提交
</view>
+10 -22
View File
@@ -6,11 +6,6 @@ import { isEmpty } from 'radash'
import { hooks, router } from "@@/index"
import { applyApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const data = {
tabs: ['待审核', '已通过', '已拒绝'],
}
const state = reactive<any>({
pa: {
id: null,
@@ -19,7 +14,7 @@ const state = reactive<any>({
})
const pageRef = ref<any>(null)
const pageHook = hooks.usePage(pageRef, applyApi.foreignItems, null, 'data')
const pageHook = hooks.usePage(pageRef, applyApi.strideItems, null, 'data')
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.pa);
}
@@ -33,14 +28,6 @@ onShow(() => {
})
const doTab = (e: any) => {
if (state.pa.status != e + 1) {
state.pa.status = e + 1
pageRef.value.reload(true)
}
}
</script>
@@ -52,18 +39,19 @@ const doTab = (e: any) => {
<template #top>
<view class="h-30rpx" />
</template>
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i">
<view class="flex-row items-center justify-between">
<view class="">
<view class="flex-row items-center justify-between card p-x-20rpx p-y-30rpx m-b-20rpx"
v-for="(v, i) in pageHook.list" :key="i" @tap="hooks.usePreviewImage(v.code)">
<view class="flex-row items-center">
<view class="flex-row items-center">
<tm-tag v-if="v.status == 1" size="m" color="info">未使用</tm-tag>
<tm-tag v-if="v.status == 2" size="m" color="success">已使用</tm-tag>
<view class="m-t-10rpx sub-text-26">
<text>{{ v.userNameStr }}</text>
<text class="m-l-10rpx">{{ v.userMobile }}</text>
</view>
</view>
<image class="w-100rpx h-100rpx" :src="v.code" mode="aspectFill" />
<view class="flex-row items-center sub-text-26">
<text class="m-l-30rpx">{{ v.username }}</text>
<text class="m-l-30rpx">{{ v.userMobile }}</text>
</view>
</view>
<view class="iconfont icon-erweima font-size-40rpx! color-blue" />
</view>
</z-paging>
</crud-layout>
+58 -8
View File
@@ -8,11 +8,16 @@ import { applyApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const data = {
tabs: ['待审核', '已通过', '已拒绝'],
tabs: [
{ id: null, name: '全部', disabled: false },
{ id: 1, name: '待审核', disabled: false },
{ id: 2, name: '已通过', disabled: false },
{ id: 3, name: '已拒绝', disabled: false },
]
}
const state = reactive<any>({
pa: {
status: 1,
status: data.tabs[0].id,
},
})
@@ -26,20 +31,29 @@ onLoad(() => {
});
onShow(() => {
if (pageRef.value) {
pageRef.value.reload(false)
}
})
const doTab = (e: any) => {
if (state.pa.status != e + 1) {
state.pa.status = e + 1
pageRef.value.reload(true)
}
const target = data.tabs[e];
state.pa.status = target.id
pageRef.value.reload(true)
}
const doApply = async () => {
router.jump("/pages/apply/stride-apply")
}
const doCard = (v: any) => {
if (v.status == 2) {
router.jump("/pages/apply/stride-items", { id: v.id })
} else {
router.jump("/pages/apply/stride-apply", { type: 'view', id: v.id })
}
}
</script>
@@ -55,7 +69,43 @@ const doApply = async () => {
</view>
</template>
<view class="h-20rpx" />
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i">
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i"
@tap="doCard(v)">
<view class="flex-row items-center justify-between">
<view class="sub-text-30">跨单位就餐</view>
<view class="flex-row items-center">
<view class="second-text-26">{{ hooks.useTime(v.createTime, "") }}</view>
<view class="flex-row-center m-l-20rpx">
<tm-tag v-if="v.status == 1" size="xs" color="info">待审核</tm-tag>
<tm-tag v-if="v.status == 2" size="xs" color="success">已通过</tm-tag>
<tm-tag v-if="v.status == 3" size="xs" color="error">已拒绝</tm-tag>
</view>
</view>
</view>
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
<view class="flex items-center justify-between second-text-26">
<view class="flex items-center">
<text>数量</text>
<text class="m-l-10rpx">{{ v.count }}</text>
</view>
</view>
<view v-if="v.status != 1">
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
<view class="flex items-center justify-between second-text-26">
<view class="flex items-center">
<text>审核人</text>
<text class="m-l-10rpx">{{ v.checkUserName }}</text>
</view>
<view class="flex items-center">
<text>审核时间</text>
<text class="m-l-10rpx"> {{ hooks.useTime(v.checkTime, "") }}</text>
</view>
</view>
</view>
<view class="flex items-center justify-end m-t-25rpx">
<text v-if="v.status == 2" class="botder_btn">使用</text>
<text v-else class="botder_btn">查看</text>
</view>
</view>
<template #bottom>
<view