提交 37eca898 authored 作者: 刘旭's avatar 刘旭

更新

上级 e231bce1
......@@ -24,3 +24,15 @@ export const verification = (Phone: any) =>
"POST",
{ Phone }
)
/**
* @brief 查询日期时间
* @param data
* @return
*/
export const selectDateTime = (data: any) =>
request(
"/LQKJ.K3.FileSystem.WebApi.WebApiService.SelectDateTime,LQKJ.K3.FileSystem.WebApi.common.kdsvc",
"POST",
data
)
......@@ -31,14 +31,14 @@
:type="isDate ? 'primary' : ''"
size="mini"
shape="circle"
@tap="btnChange(isDate)"
@tap="btnChange('morning')"
>上午</u-button
>
<u-button
:type="isDate ? '' : 'primary'"
size="mini"
shape="circle"
@tap="btnChange(isDate)"
@tap="btnChange('afternoon')"
>下午</u-button
>
</view>
......@@ -47,32 +47,58 @@
<u-grid-item
v-for="(item, index) in appointmentTime"
:key="index"
:bg-color="item.bgColor"
@tap="gridItem(index)"
:style="{ color: item.bgColor ? '#fff' : '' }"
:bg-color="item.FID === FID ? '#2b85e4' : ''"
@tap="gridItem(item)"
:style="{
color: item.FID === FID ? '#fff' : '',
}"
>
<view>{{ item.time }}</view>
<view
style="color: #2979ff"
:style="{ color: item.bgColor ? '#fff' : '' }"
>余&nbsp;{{ item.num }}</view
>余&nbsp;{{ item.FREMAINDERNUMBER }}</view
>
</u-grid-item>
</u-grid>
<u-button
v-if="btnDisable"
:disabled="FID ? false : true"
type="primary"
style="margin: 50rpx 20rpx 0"
@tap="onConfirm"
>立即预约</u-button
>
</view>
</template>
<script setup lang="ts">
import { toast } from "@/utils/util"
const props = defineProps({
list: Array,
list: {
type: Array,
default: [],
},
current: {
type: Number,
default: 0,
},
disabled: {
type: Boolean,
default: false,
},
btnDisable: {
type: Boolean,
default: false,
},
})
const emits = defineEmits(["change", "onConfirm"])
const uniA: any = uni
const isDate: any = ref(true)
const FID = ref()
const state = reactive({
list: props.list as any,
......@@ -106,12 +132,14 @@ const tabBarStyle = computed(() => {
const appointmentTime = computed(() => {
return isDate.value
? state.list[state.current].morning
: state.list[state.current].afternoon
? state.list[state.current]?.morning
: state.list[state.current]?.afternoon
})
const change = (item: any, index: number) => {
if (index == state.current) return
FID.value = null
emits("change", "")
state.current = index
state.list.map((item: any, i: number) => {
if (index === i) {
......@@ -122,24 +150,19 @@ const change = (item: any, index: number) => {
})
}
const btnChange = (is: boolean) => {
isDate.value = !isDate.value
const btnChange = (type: string) => {
if (type === "morning") isDate.value = true
else isDate.value = false
}
const gridItem = (index: number) => {
state.list.map((item: any) => {
if (isDate.value) {
item.morning.map((col: any, i: number) => {
if (i != index) col.bgColor = ""
else col.bgColor = "#2b85e4"
})
} else {
item.afternoon.map((col: any, i: number) => {
if (i != index) col.bgColor = ""
else col.bgColor = "#2b85e4"
})
}
})
const onConfirm = () => emits("onConfirm")
const gridItem = (item: any) => {
if (item.FREMAINDERNUMBER <= 0) return
if (props.disabled) return toast("请先完成第一步")
if (FID.value === item.FID) return
emits("change", item)
FID.value = item.FID
}
// 滚动scroll-view,让活动的tab处于屏幕的中间位置
......@@ -201,6 +224,7 @@ const init = async () => {
}
defineExpose({
...toRefs(state),
init,
})
</script>
......@@ -258,7 +282,6 @@ defineExpose({
justify-content: space-evenly;
margin: 40rpx 0;
width: 100%;
.u-btn {
width: 25%;
}
......
......@@ -8,12 +8,6 @@
},
"pages": [
{
"path": "pages/deposit/index",
"style": {
"navigationBarTitleText": "档案存放预约"
}
},
{
"path": "pages/transfer/index",
"style": {
"navigationBarTitleText": "档案移交预约"
......@@ -26,6 +20,12 @@
}
},
{
"path": "pages/deposit/index",
"style": {
"navigationBarTitleText": "档案存放预约"
}
},
{
"path": "pages/transfer/reservation",
"style": {
"navigationBarTitleText": "档案移交预约"
......
......@@ -13,43 +13,44 @@
/></u-form-item>
</u-form>
<view class="footer">
<u-button @click="submit" size="medium" type="primary">预约</u-button>
<u-button @click="submit" size="medium" type="primary">查询</u-button>
</view>
</view>
</template>
<script setup lang="ts">
import { useGlobalStore } from "@/store/useStore"
import { toast, zalert } from "@/utils/util"
import { zalert } from "@/utils/util"
import { LOGO } from "@/utils/example"
import { depositReservation } from "@/api/deposit"
const globalStore = useGlobalStore()
const show = ref(false)
const uCode = ref()
const form = ref()
const uniA: any = uni
const data = reactive({
formData: {
name: "阿旭",
idCard: "1111",
name: "",
idCard: "",
},
rules: {
Phone: [
name: [
{
required: true,
message: "请输入手机号",
message: "请输入档案人姓名",
trigger: ["change", "blur"],
},
],
idCard: [
{
required: true,
message: "请输入身份证号",
trigger: ["change", "blur"],
},
{
validator: (rule: any, value: any, callback: any) => {
return uniA.$u.test.idCard(value)
},
message: "身份证号不正确",
trigger: ["change", "blur"],
},
// {
// // 自定义验证函数,见上说明
// validator: (rule: any, value: any, callback: any) => {
// return uniA.$u.test.mobile(value)
// },
// message: "手机号码不正确",
// // 触发器可以同时用blur和change
// trigger: ["change", "blur"],
// },
],
},
radioList: [
......@@ -71,7 +72,6 @@ onReady(() => {
const submit = () =>
form.value.validate(async (valid: boolean) => {
if (valid) {
toast("登录成功")
const { data: res } = await depositReservation(data.formData)
zalert(res.msg)
}
......@@ -86,6 +86,10 @@ page {
/* 其他样式设置 */
}
:deep(.uni-page-head-hd) {
display: none;
}
.container {
padding: 30rpx;
position: absolute;
......
差异被折叠。
<template>
<!-- <view style="display: flex; justify-content: space-between; padding: 0 20rpx">
<te @tap="toRefer" :under-line="false">查阅</te>
<u-link @tap="toDeposit" :under-line="false">存放</u-link>
</view> -->
<view class="logo">
<u-image :src="LOGO" width="60%" height="300rpx;" border-radius="15" />
</view>
......@@ -74,7 +78,7 @@
import { useGlobalStore } from "@/store/useStore"
import { toast } from "@/utils/util"
import { LOGO } from "@/utils/example"
import { transferReservation, verification } from "@/api/transfer"
import { verification } from "@/api/transfer"
const globalStore = useGlobalStore()
......@@ -87,13 +91,13 @@ const data = reactive({
NeedReturnFields: ["FID", "FBillNo"],
IsDeleteEntry: "false",
Model: {
FTransferredBy: "阿旭", //移交人姓名
FIDCard: "431124111111111111", //移交人身份证
FPhoneNumber: "18820132611", //移交人手机号
FDatetime: "2002-01-01", //移交预约时间
FUnitName: "Microsoft", //单位名称
FTransferQty: 21, //移交份数
code: "123",
FTransferredBy: "", // 移交人姓名
FIDCard: "", // 移交人身份证
FPhoneNumber: "", // 移交人手机号
FDatetime: "", // 移交预约时间
FUnitName: "", // 单位名称
FTransferQty: "", // 移交份数
code: "",
},
},
rules: {
......@@ -142,13 +146,13 @@ const data = reactive({
trigger: ["change", "blur"],
},
],
code: [
{
required: true,
message: "请输入验证码",
trigger: ["change", "blur"],
},
],
// code: [
// {
// required: true,
// message: "请输入验证码",
// trigger: ["change", "blur"],
// },
// ],
},
tips: "",
codeValue: "",
......@@ -157,7 +161,7 @@ const data = reactive({
watch(
() => data.parmeters.Model.FTransferQty,
(val: number) => {
(val: any) => {
if (Number(val) > 20) disabled.value = true
else disabled.value = false
}
......@@ -169,7 +173,8 @@ watch(
if (newVal && uniA.$u.test.mobile(newVal)) {
data.codeDisabled = false
} else data.codeDisabled = true
}
},
{ immediate: true }
)
const getCode = async () => {
......@@ -202,6 +207,12 @@ const codeChange = (text: string) => {
const start = () => {
console.log("开始计时")
}
const toRefer = () => {
uni.navigateTo({ url: "/pages/refer/index" })
}
const toDeposit = () => {
uni.navigateTo({ url: "/pages/deposit/index" })
}
onReady(() => {
form.value.setRules(data.rules)
......@@ -210,6 +221,9 @@ onReady(() => {
const submit = () => {
form.value.validate(async (valid: boolean) => {
if (valid) {
// if (data.tips == "重新获取") return toast("验证码失效")
// if (data.codeValue !== data.parmeters.Model.code)
// return toast("验证码不正确")
Reflect.deleteProperty(data.parmeters.Model, "code")
globalStore.setTransferData(data.parmeters)
uni.navigateTo({ url: "/pages/transfer/reservation" })
......
......@@ -5,15 +5,25 @@
:right="false"
style="margin: 20rpx 0"
></u-section>
<u-button type="primary" size="mini" style="width: 100%" @tap="uploadFile"
>导入汇总表格</u-button
<u-button
:type="!fileUrl ? 'primary' : 'success'"
size="mini"
style="width: 100%"
@tap="uploadFile"
>{{ !fileUrl ? "导入汇总表格" : "导入汇总表格(已导入)" }}</u-button
>
<u-section
title="第二步:选择预约时间"
:right="false"
style="margin: 50rpx 0 20rpx 0"
></u-section>
<reservationVue ref="reservationRef" :list="list" />
<reservationVue
v-if="flag"
ref="reservationRef"
:list="list"
:disabled="state.disabled"
@change="reservationChange"
/>
<u-section
title="预约备注"
......@@ -27,7 +37,6 @@
height="200"
:placeholder-style="{ background: '#fff' }"
/>
<u-button type="primary" style="margin-top: 50rpx" @tap="onConfirm"
>立即预约</u-button
>
......@@ -37,112 +46,15 @@
<script setup lang="ts">
import { baseUrl } from "@/utils/request"
import { useGlobalStore } from "@/store/useStore"
import { hLoading, sLoading, toast, zconfirm } from "@/utils/util"
import { selectDateTime } from "@/api/transfer"
import reservationVue from "@/components/reservation/index.vue"
import { hLoading, sLoading, toast } from "@/utils/util"
const uniA: any = uni
const globalStore = useGlobalStore()
const list = ref([
{
week: "周一",
date: "08-14",
show: false,
color: "#2979ff",
morning: [
{
time: "09:30-10:30",
num: 1,
bgColor: "",
},
{
time: "10:30-11:30",
num: 1,
bgColor: "",
},
],
afternoon: [
{
time: "15:30-16:30",
num: 1,
bgColor: "",
},
{
time: "16:30-18:30",
num: 1,
bgColor: "",
},
],
},
{
week: "周二",
date: "08-15",
show: false,
color: "",
morning: [
{
time: "09:30-10:30",
num: 10,
},
{
time: "10:30-11:30",
num: 10,
},
],
afternoon: [
{
time: "09:30-10:30",
num: 10,
},
{
time: "10:30-11:30",
num: 10,
},
],
},
{
week: "周三",
date: "08-16",
show: false,
color: "",
morning: [],
afternoon: [],
},
{
week: "周四",
date: "08-17",
show: false,
color: "",
morning: [],
afternoon: [],
},
{
week: "周五",
date: "08-18",
show: false,
color: "",
morning: [],
afternoon: [],
},
{
week: "周六",
date: "08-19",
show: true,
color: "",
morning: [],
afternoon: [],
},
{
week: "周日",
date: "08-20",
show: true,
color: "",
morning: [],
afternoon: [],
},
] as any)
const list = ref([] as any)
const flag = ref(true)
const fileUrl = ref()
const state = reactive({
current: 0,
barFirstTimeMove: true,
......@@ -157,7 +69,10 @@ const state = reactive({
barWidth: 70,
id: uniA.$u.guid(),
isDate: true,
disabled: true,
fid: undefined,
})
const reservationRef = ref()
const uploadFile = () => {
......@@ -165,34 +80,89 @@ const uploadFile = () => {
count: 1,
extension: ["xls", "xlsx"],
success(res: any) {
console.log(res)
if (res.errMsg == "chooseFile:ok") {
fileUrl.value = res.tempFilePaths[0]
state.disabled = false
}
},
})
}
// 选择日期
const reservationChange = (data: any) => {
state.fid = data.FID
}
// 预约
const onConfirm = () => {
sLoading()
if (!state.fid || !fileUrl.value) return toast("请先完成步骤")
zconfirm("确认预约?", (result: boolean) => {
if (result) {
sLoading()
upload(0)
}
})
}
const upload = (type: number) => {
uni.uploadFile({
url:
baseUrl +
"/LQKJ.K3.FileSystem.WebApi.WebApiService.Uploda,LQKJ.K3.FileSystem.WebApi.common.kdsvc",
filePath: fileUrl.value,
formData: { parmeters: JSON.stringify(globalStore.transferData) },
formData: {
parmeters: JSON.stringify(globalStore.transferData),
fid: state.fid,
type,
},
success: (uploadFileRes: any) => {
const res = JSON.parse(uploadFileRes.data)
console.log(res)
if (res.code == 200) toast("预约成功")
else toast(res.msg)
if (res.code === 200) {
flag.value = false
setTimeout(() => {
init()
toast("预约成功")
}, 300)
} else if (res.code === 402) {
zconfirm(res.msg, (e: boolean) => {
if (e) {
upload(1)
}
})
} else toast(res.msg)
hLoading()
},
})
}
onMounted(() => {
reservationRef.value.init()
// 初始化数据
const init = async () => {
let data = {
typeO: "YJYY", // CYYY:查询预约,YJYY:移交预约
}
const { data: res } = await selectDateTime(data)
if (res.code === 200) {
list.value = []
res.data.map((item: any) => {
list.value.push({
week: item.WeekdayName,
date: item.Date,
show: item.FISRESTDAYS === "1" ? true : false,
color: "",
morning: item.data.filter((el: any) => !el.type),
afternoon: item.data.filter((el: any) => el.type),
})
})
flag.value = true
}
}
onMounted(async () => {
init()
setTimeout(() => {
reservationRef.value.list = list.value
reservationRef.value.init()
}, 200)
})
</script>
......
export const useCommonStore = defineStore("common", {
state: () => ({
locationList: [{ name: "武汉家园印象里", key: 1 }],
}),
actions: {},
})
import { useGlobalStore } from "@/store/useStore"
import { hLoading, sLoading, toast } from "./util"
// export const baseUrl = "/k3cloud"
export const baseUrl = "/k3cloud"
// 部署到iis上用的
// export const baseUrl = "https://weixin3.lingqingkeji.com/k3cloud"
export const baseUrl = "/XiBU"
const globalStore = useGlobalStore()
// export const baseUrl = "/XiBU"
// 封装公共申请办法
function request(
......@@ -18,7 +15,6 @@ function request(
return new Promise<any>(function (resolve, reject) {
let header: any
sLoading()
header = { "Content-Type": "application/json" }
url = baseUrl + url
......@@ -30,9 +26,13 @@ function request(
responseType,
success(res: any) {
hLoading()
if (res.data.code == 200 || res.data.code == 400) {
if (
res.data.code === 200 ||
res.data.code === 400 ||
res.data.code === 402
) {
resolve(res)
} else if (res.data.code == 500 || res.data.code === 401) {
} else if (res.data.code === 500 || res.data.code === 401) {
toast(res.data.msg)
reject(res)
} else {
......
{
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"types": ["@dcloudio/types"],
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"types": ["@dcloudio/types"],
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}
......@@ -60,8 +60,12 @@ export default defineConfig({
strictPort: false, // 端口被占用直接退出
https: false, // 默认用http方式
proxy: {
// "/k3cloud": {
// target: "https://weixin.lingqingkeji.com:86/",
// secure: false,
// },
"/k3cloud": {
target: "https://weixin.lingqingkeji.com:86/",
target: "http://192.168.1.168:83/",
secure: false,
},
"/XiBU": {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论