|
@@ -0,0 +1,154 @@
|
|
|
+
|
|
|
+<template>
|
|
|
+ <flow-form :data="formData" @submit="submitNextActivity">
|
|
|
+ <card title="基础信息" style="height: auto">
|
|
|
+ <van-form required="true">
|
|
|
+ <van-cell-group inset>
|
|
|
+ <van-field
|
|
|
+ v-model="formData.userNickname"
|
|
|
+ name="申请人"
|
|
|
+ label="申请人"
|
|
|
+ placeholder="申请人"
|
|
|
+ readonly
|
|
|
+ :rules="[{ required: true, message: '未获取申请人' }]"
|
|
|
+ />
|
|
|
+ <van-field
|
|
|
+ v-model="formData.deptName"
|
|
|
+ name="所在部门"
|
|
|
+ label="所在部门"
|
|
|
+ placeholder="所在部门"
|
|
|
+ readonly
|
|
|
+ :rules="[{ required: true, message: '未获取所在部门' }]"
|
|
|
+ />
|
|
|
+ </van-cell-group>
|
|
|
+ </van-form>
|
|
|
+ </card>
|
|
|
+ <card title="详情信息">
|
|
|
+ <template #default>
|
|
|
+ <div v-for="(item,index) in formData.detail" :key="index">
|
|
|
+ <van-swipe-cell>
|
|
|
+ <card-cell>
|
|
|
+ <van-cell title="岗位" :value="item.post"/>
|
|
|
+ <van-cell title="需求人数" :value="item.requireNum"/>
|
|
|
+ <van-cell title="任职要求" :value="item.jobRequest"/>
|
|
|
+ <van-cell title="岗位职责" :value="item.postDuty"/>
|
|
|
+ <van-cell title="所属类别" :value="item.type"/>
|
|
|
+ <van-cell title="已招人数" :value="item.recruitNum"/>
|
|
|
+ <van-cell title="落实情况" :value="item.remark"/>
|
|
|
+ </card-cell>
|
|
|
+ <template #right>
|
|
|
+ <van-button square type="primary" text="编辑" @click="detailView(index,item)" />
|
|
|
+ <van-button square type="danger" text="删除" @click="detailDelte(index)" />
|
|
|
+ </template>
|
|
|
+ </van-swipe-cell>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </card>
|
|
|
+ </flow-form>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import { useRoute } from 'vue-router';
|
|
|
+import { FlowDTO, getNextActivity } from '@/service/flow';
|
|
|
+import reqest from "@/utils/request";
|
|
|
+import DateTimeRange from '@/components/dateTimeRange.vue';
|
|
|
+import FlowForm from '@/components/flowForm.vue';
|
|
|
+import Card from '@/components/card.vue';
|
|
|
+import CardCell from '@/components/cardCell.vue';
|
|
|
+
|
|
|
+const popupShow = ref<boolean>(false)
|
|
|
+const route = useRoute();
|
|
|
+interface FormDataType {
|
|
|
+ instanceId: undefined,
|
|
|
+ id: undefined,
|
|
|
+ userNickname: undefined,
|
|
|
+ deptName: undefined,
|
|
|
+ detail: {
|
|
|
+ text: string
|
|
|
+ }[]
|
|
|
+}
|
|
|
+const formData = ref<FormDataType>({
|
|
|
+ instanceId: undefined,
|
|
|
+ id: undefined,
|
|
|
+ userNickname: undefined,
|
|
|
+ deptName: undefined,
|
|
|
+ detail: []
|
|
|
+})
|
|
|
+const detailData = ref({
|
|
|
+ post: '',
|
|
|
+ requireNum: '',
|
|
|
+ jobRequest: '',
|
|
|
+ postDuty: '',
|
|
|
+ type: '',
|
|
|
+ recruitNum: '',
|
|
|
+ remark: ''
|
|
|
+})
|
|
|
+const leaveTypePiker = ref(['11']);
|
|
|
+const showPicker = ref(false);
|
|
|
+const columns = [
|
|
|
+ { text: '事假', value: '11' },
|
|
|
+ { text: '病假', value: '12' },
|
|
|
+ { text: '婚假', value: '13' },
|
|
|
+ { text: '产假', value: '14' },
|
|
|
+ { text: '陪产假', value: '15' },
|
|
|
+ { text: '工伤', value: '16' },
|
|
|
+ { text: '年假', value: '17' },
|
|
|
+ { text: '调休', value: '18' },
|
|
|
+ { text: '其他', value: '20' },
|
|
|
+];
|
|
|
+const { activityInstanceId, participantId,flowInstanceId } = route.query as {
|
|
|
+ activityInstanceId: string;
|
|
|
+ participantId: string;
|
|
|
+ flowInstanceId: string;
|
|
|
+};
|
|
|
+const activityData: FlowDTO = {
|
|
|
+ activityInstanceId,
|
|
|
+ participantId,
|
|
|
+ flowOpinion: ''
|
|
|
+}
|
|
|
+const submitNextActivity = async () => {
|
|
|
+ console.log(formData)
|
|
|
+ //更新表单业务数据
|
|
|
+ const result = await reqest.post("/business/recruit/update",formData.value)
|
|
|
+ if(result.code ===200||result.code ===0){
|
|
|
+ //工作流转件
|
|
|
+ activityData.activityInstanceId='018f23b914660a07729e8f224db60203'
|
|
|
+ activityData.participantId='018f23b9148b0a07729e8f224db60205'
|
|
|
+ activityData.flowOpinion='{"id":"018f23b914970a07729e8f224db60206","opinionContent":"同意","opinionTime":"2024-04-28"}'
|
|
|
+ const result = await getNextActivity(jsonToFormData(activityData))
|
|
|
+ // getNextActivity(activityData).then(result => {
|
|
|
+ // console.log(result)
|
|
|
+ // }).catch((err) => {
|
|
|
+ // console.error(err)
|
|
|
+ // })
|
|
|
+ }
|
|
|
+}
|
|
|
+const jsonToFormData = (json: any): FormData | null => {
|
|
|
+ const keys: string[] = Object.keys(json)
|
|
|
+ if (keys.length > 0) {
|
|
|
+ const formData = new FormData();
|
|
|
+ keys.forEach((key) => {
|
|
|
+ formData.append(key, (json[key] instanceof Object) ? JSON.stringify(json[key]) : json[key]);
|
|
|
+ });
|
|
|
+ return formData;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+}
|
|
|
+
|
|
|
+/** 初始化表单数据 */
|
|
|
+const initFormData= async () => {
|
|
|
+ const result = await reqest.get(`/business/recruit/mobileAdd?flowInstanceId=${flowInstanceId}`)
|
|
|
+ formData.value = result.data
|
|
|
+ console.log(formData.value)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/** 初始化 */
|
|
|
+onMounted(() => {
|
|
|
+ initFormData()
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import "./index.scss";
|
|
|
+</style>
|