教师档案调整
This commit is contained in:
parent
7a05e5e544
commit
f60f7c759e
@ -122,7 +122,9 @@ const schema = reactive<FormsSchema[]>([
|
|||||||
field: "qqtime",
|
field: "qqtime",
|
||||||
label: "起聘时间",
|
label: "起聘时间",
|
||||||
component: "BasicDateTimes",
|
component: "BasicDateTimes",
|
||||||
componentProps: {},
|
componentProps: {
|
||||||
|
mode: "year-month",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: "pywjh",
|
field: "pywjh",
|
||||||
|
|||||||
@ -19,27 +19,10 @@ 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 "";
|
||||||
@ -82,15 +65,15 @@ const [register, { getValue, setValue, setSchema }] = useForm({
|
|||||||
label: "籍贯",
|
label: "籍贯",
|
||||||
component: "BasicDataPicker",
|
component: "BasicDataPicker",
|
||||||
componentProps: {
|
componentProps: {
|
||||||
range: cityTreeData.value,
|
api: findDicTreeByPidApi,
|
||||||
rangeKey: "text",
|
param: { pid: 100 },
|
||||||
savaKey: "value",
|
rangeKey: "dictionaryValue",
|
||||||
|
savaKey: "dictionaryCode",
|
||||||
onChange: (e: any) => {
|
onChange: (e: any) => {
|
||||||
const selectedNodes = e.detail.data;
|
jsjg.value = map(e.detail.value, (item) => {
|
||||||
if (selectedNodes && selectedNodes.length > 0) {
|
return item.text;
|
||||||
jsjg.value = selectedNodes.map((node: any) => node.text).join("");
|
}).join("");
|
||||||
}
|
},
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -175,12 +158,12 @@ const [register, { getValue, setValue, setSchema }] = useForm({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: "jsTime",
|
field: "jsTime",
|
||||||
label: "任教开始时间",
|
label: "教龄计算时间",
|
||||||
component: "BasicDateTime",
|
component: "BasicDateTime",
|
||||||
componentProps: {
|
componentProps: {
|
||||||
mode: "year-month",
|
mode: "year-month",
|
||||||
ok: (e: any) => {
|
ok: (e: any) => {
|
||||||
const yearDiff = calculateYearDiff(e);
|
const yearDiff = calculateYearDiff(e.value);
|
||||||
setValue({ jl: yearDiff });
|
setValue({ jl: yearDiff });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user