This commit is contained in:
yangzhq68909 2024-10-12 08:53:10 +08:00
parent 767c647d4a
commit 646c801665
5 changed files with 149 additions and 56 deletions

View File

@ -156,16 +156,10 @@ export function userEditApi(config) { // 用户编辑
data: config data: config
}) })
} }
export function qjAddApi(config) { // 请假
return https({
url: '/cxcqxjzg/cxcQxjZg/add',
method: 'post',
data: config
})
}
export function qjQueryByIdApi(config) { // 请假流程 export function qjQueryByIdApi(config) { // 请假流程
return https({ return https({
url: '/cxcqxjzg/cxcQxjZg/queryById', url: '/CxcQxj/cxcQxj/queryById',
method: 'get', method: 'get',
data: config data: config
}) })

21
api/pages.js Normal file
View File

@ -0,0 +1,21 @@
import {
https
} from '@/utils/http.js';
export function qjAddApi(config) { // 发起请假流程申请
return https({
url: '/CxcQxj/cxcQxj/add',
method: 'post',
data: config
})
}
export function queryZwmcAndExaApi(username) { // 根据username获取职位名称和审批领导列表
return https({
url: '/CxcQxj/cxcQxj/queryZwmcByUsername',
method: 'get',
data: {
username
}
})
}

View File

@ -127,7 +127,7 @@
} }
const extActFlowData = (dataId) => { const extActFlowData = (dataId) => {
extActFlowDataApi({ extActFlowDataApi({
flowCode: "dev_cxc_qxj_zg_001", flowCode: "dev_cxc_qxj",
dataId: props.dataId dataId: props.dataId
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {

View File

@ -25,7 +25,6 @@
</view> </view>
<tree-select :dataSource="dataSource" v-model="type" dataValue="name" /> <tree-select :dataSource="dataSource" v-model="type" dataValue="name" />
</view> </view>
<picker mode="date" fields="day" @change="chooseStart" :value="beginTime"> <picker mode="date" fields="day" @change="chooseStart" :value="beginTime">
<view class="f-row aic jcb box"> <view class="f-row aic jcb box">
<view class="title"> <view class="title">
@ -42,7 +41,7 @@
<picker mode="date" fields="day" @change="chooseEnd" :value="endTime"> <picker mode="date" fields="day" @change="chooseEnd" :value="endTime">
<view class="f-row aic jcb box"> <view class="f-row aic jcb box">
<view class="title"> <view class="title">
结束时间 截止时间
</view> </view>
<view class="f-row aic"> <view class="f-row aic">
<view :class="[{'choose':!endTime},{'choosed':endTime}]"> <view :class="[{'choose':!endTime},{'choosed':endTime}]">
@ -52,6 +51,19 @@
</view> </view>
</view> </view>
</picker> </picker>
<picker @change="bindType" :value="typeIndex" :range="typeArr" range-key="realname" v-if="ifShow">
<view class="f-row aic jcb box">
<view class="title">
审批领导
</view>
<view class="f-row aic">
<view :class="[{'choose':typeIndex==null},{'choosed':typeIndex!=null}]">
{{typeIndex!=null?typeArr[typeIndex].realname:'请选择'}}
</view>
<uni-icons type="bottom" color="#333333"></uni-icons>
</view>
</view>
</picker>
<view class="f-row aic jcb input_box"> <view class="f-row aic jcb input_box">
<view class="title"> <view class="title">
请假地点 请假地点
@ -67,27 +79,6 @@
<textarea v-model="reason" placeholder="请输入请假事由" placeholder-style="font-size: 28rpx;color: #999999;" <textarea v-model="reason" placeholder="请输入请假事由" placeholder-style="font-size: 28rpx;color: #999999;"
cols="30" rows="10"></textarea> cols="30" rows="10"></textarea>
</view> </view>
<!-- <view class="progress_box">
<view class="title">
审批流程
</view>
<view class="progress f-row aic">
<view class="f-col aic ">
<image class="avatar" src="" mode=""></image>
<text>发起人</text>
</view>
<image class="line" src="../../static/line.png" mode=""></image>
<view class="f-col aic">
<image class="avatar" src="" mode=""></image>
<text>部门领导</text>
</view>
<image class="line" src="../../static/line.png" mode=""></image>
<view class="f-col aic">
<image class="avatar" src="" mode=""></image>
<text>人事部门</text>
</view>
</view>
</view> -->
<view class="btn f-col aic"> <view class="btn f-col aic">
<view @click="qjAdd"> <view @click="qjAdd">
提交 提交
@ -102,10 +93,13 @@
getCurrentInstance getCurrentInstance
} from 'vue'; } from 'vue';
import { import {
qjAddApi,
startMutilProcessApi, startMutilProcessApi,
getCategoryItemsApi getCategoryItemsApi,
} from '@/api/api.js'; } from '@/api/api.js';
import {
qjAddApi,
queryZwmcAndExaApi
} from '@/api/pages.js';
import { import {
queryDepByCode queryDepByCode
} from '@/api/depart.js' } from '@/api/depart.js'
@ -141,6 +135,13 @@
const chooseEnd = (e) => { const chooseEnd = (e) => {
endTime.value = e.detail.value endTime.value = e.detail.value
} }
/**审批领导*/
const typeArr = ref([])
const typeIndex = ref(null)
/**判断是否显示审批领导字段*/
const ifShow = ref(true)
/**职位层级*/
const zwcj = ref('')
/**请假地点*/ /**请假地点*/
const address = ref('') const address = ref('')
/**请假事由*/ /**请假事由*/
@ -155,17 +156,23 @@
if (!type.value) return proxy.$toast('请选择请假类型') if (!type.value) return proxy.$toast('请选择请假类型')
if (!beginTime.value) return proxy.$toast('请选择开始时间') if (!beginTime.value) return proxy.$toast('请选择开始时间')
if (!endTime.value) return proxy.$toast('请选择结束时间') if (!endTime.value) return proxy.$toast('请选择结束时间')
if (zwcj.value != '单位专家' && zwcj.value != '正职' && zwcj.value != '高级主管') {
if (typeIndex.value == null) { //
return proxy.$toast('请选择审批领导')
}
}
if (!address.value.trim()) return proxy.$toast('请输入请假地点') if (!address.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,
realname: store.userinfo.realname,
phone: phone.value, phone: phone.value,
type: type.value, type: type.value,
begintime: beginTime.value, begintime: beginTime.value,
endtime: endTime.value, endtime: endTime.value,
examineleader: typeArr.value[typeIndex.value].username,
address: address.value, address: address.value,
reason: reason.value reason: reason.value,
zwcj: zwcj.value,
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
startMutilProcess(res.message) startMutilProcess(res.message)
@ -176,9 +183,9 @@
} }
const startMutilProcess = (id) => { const startMutilProcess = (id) => {
startMutilProcessApi({ startMutilProcessApi({
flowCode: "dev_cxc_qxj_zg_001", flowCode: "dev_cxc_qxj",
id, id,
formUrl: "modules/zgqxj/modules/CxcZgqxjBpmModel", formUrl: "modules/qxj/modules/CxcQxjBpmModel",
formUrlMobile: "leaveApplication" //main.jscreateApp() app.component('leaveApplication',index) formUrlMobile: "leaveApplication" //main.jscreateApp() app.component('leaveApplication',index)
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
@ -195,7 +202,6 @@
getCategoryItemsApi('1838487445813645313').then((res) => { // getCategoryItemsApi('1838487445813645313').then((res) => { //
if (res.success) { if (res.success) {
dataSource.value = res.result dataSource.value = res.result
console.log('--', res.result)
} }
}) })
@ -205,6 +211,21 @@
} }
}) })
queryZwmcAndExaApi(store.userinfo.username).then((res) => { //
if (res.success) {
typeArr.value = res.result.list
zwcj.value = res.result.zwmc
if (zwcj.value == '单位专家' || zwcj.value == '正职' || zwcj.value == '高级主管') {
ifShow.value = false;
}
} else {
proxy.$toast(res.message);
}
})
}
const bindType = (e) => {
typeIndex.value = e.detail.value
} }
</script> </script>

View File

@ -6314,16 +6314,9 @@ This will fail in production.`);
data: config data: config
}); });
} }
function qjAddApi(config) {
return https({
url: "/cxcqxjzg/cxcQxjZg/add",
method: "post",
data: config
});
}
function qjQueryByIdApi(config) { function qjQueryByIdApi(config) {
return https({ return https({
url: "/cxcqxjzg/cxcQxjZg/queryById", url: "/CxcQxj/cxcQxj/queryById",
method: "get", method: "get",
data: config data: config
}); });
@ -9889,6 +9882,22 @@ This will fail in production.`);
} }
}; };
const PagesMeetingDetail = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-ee2c785f"], ["__file", "D:/projects/cxc-szcx-uniapp/pages/meeting/detail.vue"]]); const PagesMeetingDetail = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-ee2c785f"], ["__file", "D:/projects/cxc-szcx-uniapp/pages/meeting/detail.vue"]]);
function qjAddApi(config) {
return https({
url: "/CxcQxj/cxcQxj/add",
method: "post",
data: config
});
}
function queryZwmcAndExaApi(username) {
return https({
url: "/CxcQxj/cxcQxj/queryZwmcByUsername",
method: "get",
data: {
username
}
});
}
function queryDepByCode(code) { function queryDepByCode(code) {
return https({ return https({
url: "/sys/sysDepart/queryDepNameByDepCode", url: "/sys/sysDepart/queryDepNameByDepCode",
@ -11401,6 +11410,10 @@ This will fail in production.`);
const chooseEnd = (e2) => { const chooseEnd = (e2) => {
endTime.value = e2.detail.value; endTime.value = e2.detail.value;
}; };
const typeArr = vue.ref([]);
const typeIndex = vue.ref(null);
const ifShow = vue.ref(true);
const zwcj = vue.ref("");
const address = vue.ref(""); const address = vue.ref("");
const reason = vue.ref(""); const reason = vue.ref("");
onLoad(() => { onLoad(() => {
@ -11415,19 +11428,25 @@ This will fail in production.`);
return proxy.$toast("请选择开始时间"); return proxy.$toast("请选择开始时间");
if (!endTime.value) if (!endTime.value)
return proxy.$toast("请选择结束时间"); return proxy.$toast("请选择结束时间");
if (zwcj.value != "单位专家" && zwcj.value != "正职" && zwcj.value != "高级主管") {
if (typeIndex.value == null) {
return proxy.$toast("请选择审批领导");
}
}
if (!address.value.trim()) if (!address.value.trim())
return proxy.$toast("请输入请假地点"); return proxy.$toast("请输入请假地点");
if (!reason.value.trim()) if (!reason.value.trim())
return proxy.$toast("请输入请假事由"); return proxy.$toast("请输入请假事由");
qjAddApi({ qjAddApi({
username: store.userinfo.username, username: store.userinfo.username,
realname: store.userinfo.realname,
phone: phone.value, phone: phone.value,
type: type.value, type: type.value,
begintime: beginTime.value, begintime: beginTime.value,
endtime: endTime.value, endtime: endTime.value,
examineleader: typeArr.value[typeIndex.value].username,
address: address.value, address: address.value,
reason: reason.value reason: reason.value,
zwcj: zwcj.value
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
startMutilProcess(res.message); startMutilProcess(res.message);
@ -11438,9 +11457,9 @@ This will fail in production.`);
}; };
const startMutilProcess = (id) => { const startMutilProcess = (id) => {
startMutilProcessApi({ startMutilProcessApi({
flowCode: "dev_cxc_qxj_zg_001", flowCode: "dev_cxc_qxj",
id, id,
formUrl: "modules/zgqxj/modules/CxcZgqxjBpmModel", formUrl: "modules/qxj/modules/CxcQxjBpmModel",
formUrlMobile: "leaveApplication" formUrlMobile: "leaveApplication"
//对应main.js里全局注册createApp()里的 app.component('leaveApplication',index) //对应main.js里全局注册createApp()里的 app.component('leaveApplication',index)
}).then((res) => { }).then((res) => {
@ -11451,14 +11470,13 @@ This will fail in production.`);
}, 2e3); }, 2e3);
} }
}).catch((err) => { }).catch((err) => {
formatAppLog("log", "at pages/leave/application.vue:191", err); formatAppLog("log", "at pages/leave/application.vue:198", err);
}); });
}; };
const loadData = () => { const loadData = () => {
getCategoryItemsApi("1838487445813645313").then((res) => { getCategoryItemsApi("1838487445813645313").then((res) => {
if (res.success) { if (res.success) {
dataSource.value = res.result; dataSource.value = res.result;
formatAppLog("log", "at pages/leave/application.vue:198", "--", res.result);
} }
}); });
queryDepByCode(store.userinfo.orgCode).then((res) => { queryDepByCode(store.userinfo.orgCode).then((res) => {
@ -11466,6 +11484,20 @@ This will fail in production.`);
depart.value = res.result; depart.value = res.result;
} }
}); });
queryZwmcAndExaApi(store.userinfo.username).then((res) => {
if (res.success) {
typeArr.value = res.result.list;
zwcj.value = res.result.zwmc;
if (zwcj.value == "单位专家" || zwcj.value == "正职" || zwcj.value == "高级主管") {
ifShow.value = false;
}
} else {
proxy.$toast(res.message);
}
});
};
const bindType = (e2) => {
typeIndex.value = e2.detail.value;
}; };
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);
@ -11561,7 +11593,7 @@ This will fail in production.`);
value: endTime.value value: endTime.value
}, [ }, [
vue.createElementVNode("view", { class: "f-row aic jcb box" }, [ vue.createElementVNode("view", { class: "f-row aic jcb box" }, [
vue.createElementVNode("view", { class: "title" }, " 结束时间: "), vue.createElementVNode("view", { class: "title" }, " 截止时间: "),
vue.createElementVNode("view", { class: "f-row aic" }, [ vue.createElementVNode("view", { class: "f-row aic" }, [
vue.createElementVNode( vue.createElementVNode(
"view", "view",
@ -11579,6 +11611,32 @@ This will fail in production.`);
]) ])
]) ])
], 40, ["value"]), ], 40, ["value"]),
ifShow.value ? (vue.openBlock(), vue.createElementBlock("picker", {
key: 0,
onChange: bindType,
value: typeIndex.value,
range: typeArr.value,
"range-key": "realname"
}, [
vue.createElementVNode("view", { class: "f-row aic jcb box" }, [
vue.createElementVNode("view", { class: "title" }, " 审批领导: "),
vue.createElementVNode("view", { class: "f-row aic" }, [
vue.createElementVNode(
"view",
{
class: vue.normalizeClass([{ "choose": typeIndex.value == null }, { "choosed": typeIndex.value != null }])
},
vue.toDisplayString(typeIndex.value != null ? typeArr.value[typeIndex.value].realname : "请选择"),
3
/* TEXT, CLASS */
),
vue.createVNode(_component_uni_icons, {
type: "bottom",
color: "#333333"
})
])
])
], 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(
@ -11615,7 +11673,6 @@ This will fail in production.`);
[vue.vModelText, reason.value] [vue.vModelText, reason.value]
]) ])
]), ]),
vue.createCommentVNode(' <view class="progress_box">\r\n <view class="title">\r\n 审批流程:\r\n </view>\r\n <view class="progress f-row aic">\r\n <view class="f-col aic ">\r\n <image class="avatar" src="" mode=""></image>\r\n <text>发起人</text>\r\n </view>\r\n <image class="line" src="../../static/line.png" mode=""></image>\r\n <view class="f-col aic">\r\n <image class="avatar" src="" mode=""></image>\r\n <text>部门领导</text>\r\n </view>\r\n <image class="line" src="../../static/line.png" mode=""></image>\r\n <view class="f-col aic">\r\n <image class="avatar" src="" mode=""></image>\r\n <text>人事部门</text>\r\n </view>\r\n </view>\r\n </view> '),
vue.createElementVNode("view", { class: "btn f-col aic" }, [ vue.createElementVNode("view", { class: "btn f-col aic" }, [
vue.createElementVNode("view", { onClick: qjAdd }, " 提交 ") vue.createElementVNode("view", { onClick: qjAdd }, " 提交 ")
]) ])
@ -17664,7 +17721,7 @@ ${i3}
}; };
const extActFlowData = (dataId) => { const extActFlowData = (dataId) => {
extActFlowDataApi({ extActFlowDataApi({
flowCode: "dev_cxc_qxj_zg_001", flowCode: "dev_cxc_qxj",
dataId: props.dataId dataId: props.dataId
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {