教师档案调整
This commit is contained in:
parent
1d1d8c795c
commit
7a05e5e544
14797
src/api/base/ChinaCitys.json
Normal file
14797
src/api/base/ChinaCitys.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,25 +5,25 @@
|
|||||||
<template v-for="(item, index) in education.xl" :key="index">
|
<template v-for="(item, index) in education.xl" :key="index">
|
||||||
<view class="po-re mb-15">
|
<view class="po-re mb-15">
|
||||||
<BasicForm
|
<BasicForm
|
||||||
:index="index"
|
:index="index"
|
||||||
v-model="item.value"
|
v-model="item.value"
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:key="`form-${index}-${forceUpdateKey}`"
|
:key="`form-${index}-${forceUpdateKey}`"
|
||||||
:formsProps="{ labelWidth: 100 }"
|
:formsProps="{ labelWidth: 100 }"
|
||||||
/>
|
/>
|
||||||
<view
|
<view
|
||||||
@click="deleteMemberFamily(index, item.value)"
|
@click="deleteMemberFamily(index, item.value)"
|
||||||
class="delete-icon"
|
class="delete-icon"
|
||||||
>
|
>
|
||||||
<BasicIcon type="clear" size="30" />
|
<BasicIcon type="clear" size="30"/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="flex-row items-center justify-center pb-10 pt-5"
|
class="flex-row items-center justify-center pb-10 pt-5"
|
||||||
style="border: 1px solid #e8e8e8"
|
style="border: 1px solid #e8e8e8"
|
||||||
@click="addEducation"
|
@click="addEducation"
|
||||||
>
|
>
|
||||||
<uni-icons type="plus" size="16" color="#447ADE"></uni-icons>
|
<uni-icons type="plus" size="16" color="#447ADE"></uni-icons>
|
||||||
<view class="ml-5 cor-447ADE">新增</view>
|
<view class="ml-5 cor-447ADE">新增</view>
|
||||||
@ -32,22 +32,22 @@
|
|||||||
<template #bottom>
|
<template #bottom>
|
||||||
<view class="flex-row items-center pb-10 pt-5">
|
<view class="flex-row items-center pb-10 pt-5">
|
||||||
<u-button
|
<u-button
|
||||||
text="测试计算"
|
text="测试计算"
|
||||||
class="ml-15 mr-7"
|
class="ml-15 mr-7"
|
||||||
:plain="true"
|
:plain="true"
|
||||||
@click="calculateAllPositionYears"
|
@click="calculateAllPositionYears"
|
||||||
/>
|
/>
|
||||||
<u-button
|
<u-button
|
||||||
text="上一步"
|
text="上一步"
|
||||||
class="ml-15 mr-7"
|
class="ml-15 mr-7"
|
||||||
:plain="true"
|
:plain="true"
|
||||||
@click="navigateBack"
|
@click="navigateBack"
|
||||||
/>
|
/>
|
||||||
<u-button
|
<u-button
|
||||||
text="下一步"
|
text="下一步"
|
||||||
class="mr-15 mr-7"
|
class="mr-15 mr-7"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="submit"
|
@click="submit"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -55,10 +55,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { dicApi } from "@/api/system/dic";
|
import {dicApi} from "@/api/system/dic";
|
||||||
import { useDataStore } from "@/store/modules/data";
|
import {useDataStore} from "@/store/modules/data";
|
||||||
import { navigateBack, navigateTo } from "@/utils/uniapp";
|
import {navigateBack, navigateTo} from "@/utils/uniapp";
|
||||||
import { cloneDeep, map } from "lodash";
|
import {cloneDeep, map} from "lodash";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
// 计算任岗年限
|
// 计算任岗年限
|
||||||
@ -67,7 +67,7 @@ const calculatePositionYears = (startDate: string, endDate?: string) => {
|
|||||||
const start = dayjs(startDate);
|
const start = dayjs(startDate);
|
||||||
const end = endDate ? dayjs(endDate) : dayjs();
|
const end = endDate ? dayjs(endDate) : dayjs();
|
||||||
const years = end.diff(start, "year");
|
const years = end.diff(start, "year");
|
||||||
console.log("计算任岗年限:", { startDate, endDate, years });
|
console.log("计算任岗年限:", {startDate, endDate, years});
|
||||||
// 确保0值也能显示,转换为字符串
|
// 确保0值也能显示,转换为字符串
|
||||||
return years.toString();
|
return years.toString();
|
||||||
};
|
};
|
||||||
@ -77,7 +77,7 @@ const forceUpdateKey = ref(0);
|
|||||||
|
|
||||||
// 更新指定项的任岗年限
|
// 更新指定项的任岗年限
|
||||||
const updatePositionYears = (itemValue: any) => {
|
const updatePositionYears = (itemValue: any) => {
|
||||||
const { gwrztime, gwpyjssj } = itemValue;
|
const {gwrztime, gwpyjssj} = itemValue;
|
||||||
if (gwrztime) {
|
if (gwrztime) {
|
||||||
const years = calculatePositionYears(gwrztime, gwpyjssj);
|
const years = calculatePositionYears(gwrztime, gwpyjssj);
|
||||||
itemValue.gwrznx = years;
|
itemValue.gwrznx = years;
|
||||||
@ -85,24 +85,24 @@ const updatePositionYears = (itemValue: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const schema = reactive<FormsSchema[]>([
|
const schema = reactive<FormsSchema[]>([
|
||||||
// {
|
|
||||||
// field: "xj",
|
|
||||||
// label: "薪级",
|
|
||||||
// component: "BasicPicker",
|
|
||||||
// componentProps: {
|
|
||||||
// api: dicApi,
|
|
||||||
// param: { pid: 434953981 },
|
|
||||||
// rangeKey: "dictionaryValue",
|
|
||||||
// savaKey: "dictionaryCode",
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
field: "gwjbId",
|
field: "gwjbId",
|
||||||
label: "岗位类别",
|
label: "岗位类别",
|
||||||
component: "BasicPicker",
|
component: "BasicPicker",
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: dicApi,
|
api: dicApi,
|
||||||
param: { pid: 260783972 },
|
param: {pid: 260783972},
|
||||||
|
rangeKey: "dictionaryValue",
|
||||||
|
savaKey: "dictionaryCode",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "xj",
|
||||||
|
label: "岗位级别",
|
||||||
|
component: "BasicPicker",
|
||||||
|
componentProps: {
|
||||||
|
api: dicApi,
|
||||||
|
param: {pid: 434953981},
|
||||||
rangeKey: "dictionaryValue",
|
rangeKey: "dictionaryValue",
|
||||||
savaKey: "dictionaryCode",
|
savaKey: "dictionaryCode",
|
||||||
},
|
},
|
||||||
@ -188,7 +188,7 @@ const schema = reactive<FormsSchema[]>([
|
|||||||
// savaKey: "key",
|
// savaKey: "key",
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
{
|
/*{
|
||||||
field: "dzzw",
|
field: "dzzw",
|
||||||
label: "职务",
|
label: "职务",
|
||||||
component: "BasicPicker",
|
component: "BasicPicker",
|
||||||
@ -198,17 +198,17 @@ const schema = reactive<FormsSchema[]>([
|
|||||||
rangeKey: "dictionaryValue",
|
rangeKey: "dictionaryValue",
|
||||||
savaKey: "dictionaryCode",
|
savaKey: "dictionaryCode",
|
||||||
},
|
},
|
||||||
},
|
},*/
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const education = reactive<any>({
|
const education = reactive<any>({
|
||||||
xl: [{ value: {} }],
|
xl: [{value: {}}],
|
||||||
});
|
});
|
||||||
|
|
||||||
const { getFile, setFile } = useDataStore();
|
const {getFile, setFile} = useDataStore();
|
||||||
if (getFile.rgqkList && getFile.rgqkList.length > 0) {
|
if (getFile.rgqkList && getFile.rgqkList.length > 0) {
|
||||||
education.xl = map(getFile.rgqkList, (item) => {
|
education.xl = map(getFile.rgqkList, (item) => {
|
||||||
return { value: item };
|
return {value: item};
|
||||||
});
|
});
|
||||||
|
|
||||||
// 回显数据后,重新计算所有任岗年限
|
// 回显数据后,重新计算所有任岗年限
|
||||||
@ -216,8 +216,8 @@ if (getFile.rgqkList && getFile.rgqkList.length > 0) {
|
|||||||
education.xl.forEach((item: any, index: number) => {
|
education.xl.forEach((item: any, index: number) => {
|
||||||
if (item.value.gwrztime) {
|
if (item.value.gwrztime) {
|
||||||
const years = calculatePositionYears(
|
const years = calculatePositionYears(
|
||||||
item.value.gwrztime,
|
item.value.gwrztime,
|
||||||
item.value.gwpyjssj
|
item.value.gwpyjssj
|
||||||
);
|
);
|
||||||
item.value.gwrznx = years;
|
item.value.gwrznx = years;
|
||||||
console.log(`回显数据-表单项${index}计算结果:`, {
|
console.log(`回显数据-表单项${index}计算结果:`, {
|
||||||
@ -241,8 +241,8 @@ const calculateAllPositionYears = () => {
|
|||||||
education.xl.forEach((item: any, index: number) => {
|
education.xl.forEach((item: any, index: number) => {
|
||||||
if (item.value.gwrztime) {
|
if (item.value.gwrztime) {
|
||||||
const years = calculatePositionYears(
|
const years = calculatePositionYears(
|
||||||
item.value.gwrztime,
|
item.value.gwrztime,
|
||||||
item.value.gwpyjssj
|
item.value.gwpyjssj
|
||||||
);
|
);
|
||||||
item.value.gwrznx = years;
|
item.value.gwrznx = years;
|
||||||
console.log(`表单项${index}计算结果:`, {
|
console.log(`表单项${index}计算结果:`, {
|
||||||
@ -260,7 +260,7 @@ const calculateAllPositionYears = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function addEducation() {
|
function addEducation() {
|
||||||
education.xl.push({ value: {} });
|
education.xl.push({value: {}});
|
||||||
// 强制重新渲染
|
// 强制重新渲染
|
||||||
forceUpdateKey.value++;
|
forceUpdateKey.value++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,10 +19,27 @@ import { dicApi, findDicTreeByPidApi } from "@/api/system/dic";
|
|||||||
import { useDataStore } from "@/store/modules/data";
|
import { useDataStore } from "@/store/modules/data";
|
||||||
import { map } from "lodash";
|
import { map } from "lodash";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
import chinaCitys from "@/api/base/ChinaCitys.json";
|
||||||
|
|
||||||
const { getFile, setFile } = useDataStore();
|
const { getFile, setFile } = useDataStore();
|
||||||
const jsjg = ref("");
|
const jsjg = ref("");
|
||||||
|
|
||||||
|
// 转换省市区数据为树形结构
|
||||||
|
const cityTreeData = computed(() => {
|
||||||
|
return chinaCitys.map(province => ({
|
||||||
|
text: province.province,
|
||||||
|
value: province.code,
|
||||||
|
children: province.citys.map(city => ({
|
||||||
|
text: city.city,
|
||||||
|
value: city.code,
|
||||||
|
children: city.areas.map(area => ({
|
||||||
|
text: area.area,
|
||||||
|
value: area.code
|
||||||
|
}))
|
||||||
|
}))
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
// 计算日期与当前日期相差的年数
|
// 计算日期与当前日期相差的年数
|
||||||
const calculateYearDiff = (startDate: string) => {
|
const calculateYearDiff = (startDate: string) => {
|
||||||
if (!startDate) return "";
|
if (!startDate) return "";
|
||||||
@ -41,9 +58,7 @@ const [register, { getValue, setValue, setSchema }] = useForm({
|
|||||||
field: "jsdah",
|
field: "jsdah",
|
||||||
label: "档案号",
|
label: "档案号",
|
||||||
component: "BasicInput",
|
component: "BasicInput",
|
||||||
componentProps: {
|
componentProps: {},
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: "jsxm",
|
field: "jsxm",
|
||||||
@ -67,15 +82,15 @@ const [register, { getValue, setValue, setSchema }] = useForm({
|
|||||||
label: "籍贯",
|
label: "籍贯",
|
||||||
component: "BasicDataPicker",
|
component: "BasicDataPicker",
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: findDicTreeByPidApi,
|
range: cityTreeData.value,
|
||||||
param: { pid: 3701 },
|
rangeKey: "text",
|
||||||
rangeKey: "dictionaryValue",
|
savaKey: "value",
|
||||||
savaKey: "dictionaryCode",
|
|
||||||
onChange: (e: any) => {
|
onChange: (e: any) => {
|
||||||
jsjg.value = map(e.detail.value, (item) => {
|
const selectedNodes = e.detail.data;
|
||||||
return item.text;
|
if (selectedNodes && selectedNodes.length > 0) {
|
||||||
}).join("");
|
jsjg.value = selectedNodes.map((node: any) => node.text).join("");
|
||||||
},
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -251,7 +266,7 @@ const [register, { getValue, setValue, setSchema }] = useForm({
|
|||||||
component: "BasicInput",
|
component: "BasicInput",
|
||||||
componentProps: {},
|
componentProps: {},
|
||||||
},
|
},
|
||||||
{
|
/*{
|
||||||
field: "gwjbId",
|
field: "gwjbId",
|
||||||
label: "岗位级别",
|
label: "岗位级别",
|
||||||
component: "BasicPicker",
|
component: "BasicPicker",
|
||||||
@ -272,7 +287,7 @@ const [register, { getValue, setValue, setSchema }] = useForm({
|
|||||||
rangeKey: "dictionaryValue",
|
rangeKey: "dictionaryValue",
|
||||||
savaKey: "dictionaryCode",
|
savaKey: "dictionaryCode",
|
||||||
},
|
},
|
||||||
},
|
},*/
|
||||||
{
|
{
|
||||||
field: "sbkh",
|
field: "sbkh",
|
||||||
label: "社保卡号",
|
label: "社保卡号",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user