修改请假页面

This commit is contained in:
yangzhq68909 2024-11-12 16:16:01 +08:00
parent b2664417e3
commit a252f9b88b
7 changed files with 189 additions and 108 deletions

View File

@ -54,9 +54,15 @@
</view> </view>
<view class="info f-row aic jcb"> <view class="info f-row aic jcb">
<view> <view>
请假地点 出发地
</view> </view>
<text>{{info.address}}</text> <text>{{info.departure}}</text>
</view>
<view class="info f-row aic jcb">
<view>
目的地
</view>
<text>{{info.destination}}</text>
</view> </view>
<view class="info f-row aic jcb"> <view class="info f-row aic jcb">
<view> <view>
@ -64,7 +70,7 @@
</view> </view>
<text>{{info.reason}}</text> <text>{{info.reason}}</text>
</view> </view>
<view class="info f-row aic jcb"> <view class="info f-row aic jcb" v-if="ifShowFj">
<view> <view>
附件 附件
</view> </view>
@ -121,6 +127,7 @@
}, },
}) })
const imageValue = ref([]) const imageValue = ref([])
const ifShowFj = ref(false)
const imageStyles = { const imageStyles = {
width: 64, width: 64,
height: 64, height: 64,
@ -139,8 +146,9 @@
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
info.value = res.result.records[0] info.value = res.result.records[0]
// imageValue // imageValue
if (info.value.path) {
ifShowFj.value = true;
imageValue.value = info.value.path.split(',').map(path => { imageValue.value = info.value.path.split(',').map(path => {
const name = path.split('/').pop(); // const name = path.split('/').pop(); //
const extname = name.split('.').pop(); // const extname = name.split('.').pop(); //
@ -151,6 +159,7 @@
}; };
}); });
} }
}
}) })
} }

View File

@ -66,9 +66,15 @@
</picker> </picker>
<view class="f-row aic jcb input_box"> <view class="f-row aic jcb input_box">
<view class="title"> <view class="title">
请假地点 出发地
</view> </view>
<input v-model="address" placeholder="请输入" nplaceholder-style="font-size: 28rpx;color: #999999;" /> <input v-model="departure" placeholder="请输入" nplaceholder-style="font-size: 28rpx;color: #999999;" />
</view>
<view class="f-row aic jcb input_box">
<view class="title">
目的地
</view>
<input v-model="destination" placeholder="请输入" nplaceholder-style="font-size: 28rpx;color: #999999;" />
</view> </view>
<view class="f-row aic jcb input_box"> <view class="f-row aic jcb input_box">
<view class="title"> <view class="title">
@ -147,8 +153,10 @@
const ifShow = ref(true) const ifShow = ref(true)
/**职位层级*/ /**职位层级*/
const zwcj = ref('') const zwcj = ref('')
/**请假地点*/ /**出发地*/
const address = ref('') const departure = ref('')
/**目的地*/
const destination = ref('')
/**请假事由*/ /**请假事由*/
const reason = ref('') const reason = ref('')
/**附件路径*/ /**附件路径*/
@ -166,6 +174,7 @@
} }
onLoad(() => { onLoad(() => {
loadData() loadData()
getTomorrowDate()
}) })
const select = (e) => { const select = (e) => {
@ -196,7 +205,8 @@
return proxy.$toast('请选择审批领导') return proxy.$toast('请选择审批领导')
} }
} }
if (!address.value.trim()) return proxy.$toast('请输入请假地点') if (!departure.value.trim()) return proxy.$toast('请输入出发地')
if (!destination.value.trim()) return proxy.$toast('请输入目的地')
if (!reason.value.trim()) return proxy.$toast('请输入请假事由') if (!reason.value.trim()) return proxy.$toast('请输入请假事由')
qjAddApi({ qjAddApi({
username: store.userinfo.username, username: store.userinfo.username,
@ -205,7 +215,8 @@
begintime: beginTime.value, begintime: beginTime.value,
endtime: endTime.value, endtime: endTime.value,
examineleader: typeArr.value[typeIndex.value].username, examineleader: typeArr.value[typeIndex.value].username,
address: address.value, departure: departure.value,
destination: destination.value,
reason: reason.value, reason: reason.value,
zwmc: zwcj.value, zwmc: zwcj.value,
path: path.value.toString() path: path.value.toString()
@ -264,6 +275,17 @@
const bindType = (e) => { const bindType = (e) => {
typeIndex.value = e.detail.value typeIndex.value = e.detail.value
} }
const getTomorrowDate = () => {
let today = new Date();
let tomorrow = new Date(today);
tomorrow.setDate(today.getDate() + 1);
// yyyy-mm-dd
let year = tomorrow.getFullYear();
let month = String(tomorrow.getMonth() + 1).padStart(2, '0'); // 01
let day = String(tomorrow.getDate()).padStart(2, '0');
beginTime.value = year + '-' + month + '-' + day;
}
</script> </script>
<style> <style>

View File

@ -3,9 +3,7 @@
<view class="nav"> <view class="nav">
<view class="user f-row aic"> <view class="user f-row aic">
<view class="avatar"> <view class="avatar">
<image @click="toProfile('/pages/useredit/useredit')" <image @click="toProfile('/pages/useredit/useredit')" :src="imgUrl(store.userinfo.avatar)" mode="">
:src="imgUrl(store.userinfo.avatar)"
mode="">
</image> </image>
</view> </view>
<view class="f-row aic jcb right"> <view class="f-row aic jcb right">
@ -75,6 +73,9 @@
</view> </view>
</view> </view>
</view> </view>
<view class="btn" @click="loginout">
退出登录
</view>
</view> </view>
</template> </template>
@ -159,6 +160,24 @@
} }
}) })
} }
const loginout = () => {
uni.showModal({
title: '退出登录',
content: '您确认要退出登录吗?',
success(res) {
if (res.confirm) {
uni.removeStorageSync('token')
uni.removeStorageSync('user')
uni.removeStorageSync('role')
uni.removeStorageSync('logintime')
uni.reLaunch({
url: '/pages/login/login'
})
}
}
})
}
// onShow(() => { // onShow(() => {
// taskList() // taskList()
// }) // })
@ -177,6 +196,15 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.btn {
position: fixed;
left: 50%;
transform: translateX(-50%);
text-align: center;
font-size: 32rpx;
color: #DB4B31;
}
.operate { .operate {
padding: 0 30rpx; padding: 0 30rpx;
transform: translateY(-10rpx); transform: translateY(-10rpx);

View File

@ -31,9 +31,6 @@
<view class="line"> <view class="line">
</view> </view>
<view class="btn" @click="loginout">
退出登录
</view>
</template> </template>
<script setup> <script setup>
@ -111,24 +108,6 @@
realname: '', realname: '',
phone: '' phone: ''
}) })
const loginout = () => {
uni.showModal({
title: '退出登录',
content: '您确认要退出登录吗?',
success(res) {
if (res.confirm) {
uni.removeStorageSync('token')
uni.removeStorageSync('user')
uni.removeStorageSync('role')
uni.removeStorageSync('logintime')
uni.reLaunch({
url: '/pages/login/login'
})
}
}
})
}
onLoad(() => { onLoad(() => {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: "#ffffff", frontColor: "#ffffff",
@ -200,10 +179,4 @@
background: #F8F8F8; background: #F8F8F8;
} }
.btn {
margin-top: 40rpx;
text-align: center;
font-size: 32rpx;
color: #DB4B31;
}
</style> </style>

View File

@ -7523,6 +7523,23 @@ This will fail in production.`);
} }
}); });
}; };
const loginout = () => {
uni.showModal({
title: "退出登录",
content: "您确认要退出登录吗?",
success(res) {
if (res.confirm) {
uni.removeStorageSync("token");
uni.removeStorageSync("user");
uni.removeStorageSync("role");
uni.removeStorageSync("logintime");
uni.reLaunch({
url: "/pages/login/login"
});
}
}
});
};
return (_ctx, _cache) => { return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock( return vue.openBlock(), vue.createElementBlock(
"view", "view",
@ -7708,7 +7725,11 @@ This will fail in production.`);
128 128
/* KEYED_FRAGMENT */ /* KEYED_FRAGMENT */
)) ))
]) ]),
vue.createElementVNode("view", {
class: "btn",
onClick: loginout
}, " 退出登录 ")
], ],
2 2
/* CLASS */ /* CLASS */
@ -15580,7 +15601,8 @@ ${i3}
const typeIndex = vue.ref(null); const typeIndex = vue.ref(null);
const ifShow = vue.ref(true); const ifShow = vue.ref(true);
const zwcj = vue.ref(""); const zwcj = vue.ref("");
const address = vue.ref(""); const departure = vue.ref("");
const destination = vue.ref("");
const reason = vue.ref(""); const reason = vue.ref("");
const path = vue.ref([]); const path = vue.ref([]);
const baseUrl2 = "https://36.112.48.190/jeecg-boot/sys/common/upload/"; const baseUrl2 = "https://36.112.48.190/jeecg-boot/sys/common/upload/";
@ -15596,6 +15618,7 @@ ${i3}
}; };
onLoad(() => { onLoad(() => {
loadData(); loadData();
getTomorrowDate();
}); });
const select = (e2) => { const select = (e2) => {
e2.tempFilePaths; e2.tempFilePaths;
@ -15628,8 +15651,10 @@ ${i3}
return proxy.$toast("请选择审批领导"); return proxy.$toast("请选择审批领导");
} }
} }
if (!address.value.trim()) if (!departure.value.trim())
return proxy.$toast("请输入请假地点"); return proxy.$toast("请输入出发地");
if (!destination.value.trim())
return proxy.$toast("请输入目的地");
if (!reason.value.trim()) if (!reason.value.trim())
return proxy.$toast("请输入请假事由"); return proxy.$toast("请输入请假事由");
qjAddApi({ qjAddApi({
@ -15639,7 +15664,8 @@ ${i3}
begintime: beginTime.value, begintime: beginTime.value,
endtime: endTime.value, endtime: endTime.value,
examineleader: typeArr.value[typeIndex.value].username, examineleader: typeArr.value[typeIndex.value].username,
address: address.value, departure: departure.value,
destination: destination.value,
reason: reason.value, reason: reason.value,
zwmc: zwcj.value, zwmc: zwcj.value,
path: path.value.toString() path: path.value.toString()
@ -15666,7 +15692,7 @@ ${i3}
}, 2e3); }, 2e3);
} }
}).catch((err) => { }).catch((err) => {
formatAppLog("log", "at pages/leave/application.vue:235", err); formatAppLog("log", "at pages/leave/application.vue:246", err);
}); });
}; };
const loadData = () => { const loadData = () => {
@ -15695,6 +15721,15 @@ ${i3}
const bindType = (e2) => { const bindType = (e2) => {
typeIndex.value = e2.detail.value; typeIndex.value = e2.detail.value;
}; };
const getTomorrowDate = () => {
let today = /* @__PURE__ */ new Date();
let tomorrow = new Date(today);
tomorrow.setDate(today.getDate() + 1);
let year = tomorrow.getFullYear();
let month = String(tomorrow.getMonth() + 1).padStart(2, "0");
let day = String(tomorrow.getDate()).padStart(2, "0");
beginTime.value = year + "-" + month + "-" + day;
};
return (_ctx, _cache) => { return (_ctx, _cache) => {
const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$1); const _component_uni_icons = resolveEasycom(vue.resolveDynamicComponent("uni-icons"), __easycom_1$1);
const _component_uni_file_picker = resolveEasycom(vue.resolveDynamicComponent("uni-file-picker"), __easycom_0$2); const _component_uni_file_picker = resolveEasycom(vue.resolveDynamicComponent("uni-file-picker"), __easycom_0$2);
@ -15835,11 +15870,11 @@ ${i3}
]) ])
], 40, ["value", "range"])) : vue.createCommentVNode("v-if", true), ], 40, ["value", "range"])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("view", { class: "f-row aic jcb input_box" }, [ vue.createElementVNode("view", { class: "f-row aic jcb input_box" }, [
vue.createElementVNode("view", { class: "title" }, " 请假地点 "), vue.createElementVNode("view", { class: "title" }, " 出发地 "),
vue.withDirectives(vue.createElementVNode( vue.withDirectives(vue.createElementVNode(
"input", "input",
{ {
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => address.value = $event), "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => departure.value = $event),
placeholder: "请输入", placeholder: "请输入",
"nplaceholder-style": "font-size: 28rpx;color: #999999;" "nplaceholder-style": "font-size: 28rpx;color: #999999;"
}, },
@ -15847,7 +15882,23 @@ ${i3}
512 512
/* NEED_PATCH */ /* NEED_PATCH */
), [ ), [
[vue.vModelText, address.value] [vue.vModelText, departure.value]
])
]),
vue.createElementVNode("view", { class: "f-row aic jcb input_box" }, [
vue.createElementVNode("view", { class: "title" }, " 目的地: "),
vue.withDirectives(vue.createElementVNode(
"input",
{
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => destination.value = $event),
placeholder: "请输入",
"nplaceholder-style": "font-size: 28rpx;color: #999999;"
},
null,
512
/* NEED_PATCH */
), [
[vue.vModelText, destination.value]
]) ])
]), ]),
vue.createElementVNode("view", { class: "f-row aic jcb input_box" }, [ vue.createElementVNode("view", { class: "f-row aic jcb input_box" }, [
@ -15855,7 +15906,7 @@ ${i3}
vue.withDirectives(vue.createElementVNode( vue.withDirectives(vue.createElementVNode(
"input", "input",
{ {
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => reason.value = $event), "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => reason.value = $event),
placeholder: "请输入", placeholder: "请输入",
"placeholder-style": "font-size: 28rpx;color: #999999;" "placeholder-style": "font-size: 28rpx;color: #999999;"
}, },
@ -16025,11 +16076,11 @@ ${i3}
}); });
} }
}).catch((err) => { }).catch((err) => {
formatAppLog("log", "at pages/useredit/useredit.vue:97", err); formatAppLog("log", "at pages/useredit/useredit.vue:94", err);
}); });
}, },
fail(err) { fail(err) {
formatAppLog("log", "at pages/useredit/useredit.vue:101", "图片上传出错", err); formatAppLog("log", "at pages/useredit/useredit.vue:98", "图片上传出错", err);
} }
}); });
} }
@ -16040,23 +16091,6 @@ ${i3}
realname: "", realname: "",
phone: "" phone: ""
}); });
const loginout = () => {
uni.showModal({
title: "退出登录",
content: "您确认要退出登录吗?",
success(res) {
if (res.confirm) {
uni.removeStorageSync("token");
uni.removeStorageSync("user");
uni.removeStorageSync("role");
uni.removeStorageSync("logintime");
uni.reLaunch({
url: "/pages/login/login"
});
}
}
});
};
onLoad(() => { onLoad(() => {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: "#ffffff", frontColor: "#ffffff",
@ -16169,11 +16203,7 @@ ${i3}
2 2
/* CLASS */ /* CLASS */
), ),
vue.createElementVNode("view", { class: "line" }), vue.createElementVNode("view", { class: "line" })
vue.createElementVNode("view", {
class: "btn",
onClick: loginout
}, " 退出登录 ")
], ],
64 64
/* STABLE_FRAGMENT */ /* STABLE_FRAGMENT */
@ -18768,6 +18798,7 @@ ${i3}
setup(__props) { setup(__props) {
const props = __props; const props = __props;
const imageValue = vue.ref([]); const imageValue = vue.ref([]);
const ifShowFj = vue.ref(false);
const imageStyles = { const imageStyles = {
width: 64, width: 64,
height: 64, height: 64,
@ -18785,6 +18816,8 @@ ${i3}
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
info.value = res.result.records[0]; info.value = res.result.records[0];
if (info.value.path) {
ifShowFj.value = true;
imageValue.value = info.value.path.split(",").map((path) => { imageValue.value = info.value.path.split(",").map((path) => {
const name = path.split("/").pop(); const name = path.split("/").pop();
const extname = name.split(".").pop(); const extname = name.split(".").pop();
@ -18795,6 +18828,7 @@ ${i3}
}; };
}); });
} }
}
}); });
}; };
const extActFlowData = () => { const extActFlowData = () => {
@ -18911,11 +18945,21 @@ ${i3}
) )
]), ]),
vue.createElementVNode("view", { class: "info f-row aic jcb" }, [ vue.createElementVNode("view", { class: "info f-row aic jcb" }, [
vue.createElementVNode("view", null, " 请假地点 "), vue.createElementVNode("view", null, " 出发地 "),
vue.createElementVNode( vue.createElementVNode(
"text", "text",
null, null,
vue.toDisplayString(info.value.address), vue.toDisplayString(info.value.departure),
1
/* TEXT */
)
]),
vue.createElementVNode("view", { class: "info f-row aic jcb" }, [
vue.createElementVNode("view", null, " 目的地: "),
vue.createElementVNode(
"text",
null,
vue.toDisplayString(info.value.destination),
1 1
/* TEXT */ /* TEXT */
) )
@ -18930,14 +18974,17 @@ ${i3}
/* TEXT */ /* TEXT */
) )
]), ]),
vue.createElementVNode("view", { class: "info f-row aic jcb" }, [ ifShowFj.value ? (vue.openBlock(), vue.createElementBlock("view", {
key: 0,
class: "info f-row aic jcb"
}, [
vue.createElementVNode("view", null, " 附件: "), vue.createElementVNode("view", null, " 附件: "),
vue.createVNode(_component_uni_file_picker, { vue.createVNode(_component_uni_file_picker, {
modelValue: imageValue.value, modelValue: imageValue.value,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => imageValue.value = $event), "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => imageValue.value = $event),
"image-styles": imageStyles "image-styles": imageStyles
}, null, 8, ["modelValue"]) }, null, 8, ["modelValue"])
]) ])) : vue.createCommentVNode("v-if", true)
]) ])
]), ]),
vue.createElementVNode("view", { class: "f-col aic" }, [ vue.createElementVNode("view", { class: "f-col aic" }, [

View File

@ -23,6 +23,14 @@
/* 垂直间距 */ /* 垂直间距 */
/* 透明度 */ /* 透明度 */
/* 文章场景相关 */ /* 文章场景相关 */
.btn[data-v-2086c871] {
position: fixed;
left: 50%;
transform: translateX(-50%);
text-align: center;
font-size: 1rem;
color: #DB4B31;
}
.operate[data-v-2086c871] { .operate[data-v-2086c871] {
padding: 0 0.9375rem; padding: 0 0.9375rem;
transform: translateY(-0.3125rem); transform: translateY(-0.3125rem);

View File

@ -605,9 +605,3 @@ uni-button[data-v-503dd57f]::after {
height: 0.3125rem; height: 0.3125rem;
background: #F8F8F8; background: #F8F8F8;
} }
.btn[data-v-503dd57f] {
margin-top: 1.25rem;
text-align: center;
font-size: 1rem;
color: #DB4B31;
}