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

更新

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