2023年7月20日 新增调停课

This commit is contained in:
bai 2023-07-20 00:06:30 +08:00
parent 904c9991f5
commit 02a9be5a88
5 changed files with 1222 additions and 0 deletions

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/grab/imports/xxhbtkxx/list',
save='/grab/imports/xxhbtkxx/add',
edit='/grab/imports/xxhbtkxx/edit',
deleteOne = '/grab/imports/xxhbtkxx/delete',
deleteBatch = '/grab/imports/xxhbtkxx/deleteBatch',
importExcel = '/grab/imports/xxhbtkxx/importExcel',
exportXls = '/grab/imports/xxhbtkxx/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,436 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { log } from 'console';
//列表数据
export const columns: BasicColumn[] = [
{
title: '姓名',
align: "center",
dataIndex: 'xm'
},
{
title: '创建人',
align: "center",
dataIndex: 'cjr'
},
{
title: '手机号',
align: "center",
dataIndex: 'sjh'
},
{
title: '调课事由',
align: "center",
dataIndex: 'tksy'
},
// {
// title: 'xyjwmsshyj',
// align: "center",
// dataIndex: 'xyjwmsshyj'
// },
{
title: 'yjxq',
align: "center",
dataIndex: 'yjxq'
},
{
title: '申请人单位',
align: "center",
dataIndex: 'sqrdw'
},
// {
// title: 'bizbh',
// align: "center",
// dataIndex: 'bizbh'
// },
// {
// title: 'jwcsh',
// align: "center",
// dataIndex: 'jwcsh'
// },
// {
// title: 'szxyldshyj',
// align: "center",
// dataIndex: 'szxyldshyj'
// },
// {
// title: 'shxq',
// align: "center",
// dataIndex: 'shxq'
// },
// {
// title: 'lcjgbh',
// align: "center",
// dataIndex: 'lcjgbh'
// },
{
title: '补课计划',
align: "center",
dataIndex: 'bkjh'
},
{
title: '时间戳',
align: "center",
dataIndex: 'timestamps'
},
{
title: '课程名称',
align: "center",
dataIndex: 'kcmc'
},
// {
// title: 'pbh',
// align: "center",
// dataIndex: 'pbh'
// },
{
title: '教材',
align: "center",
dataIndex: 'jc'
},
{
title: '上课日期',
align: "center",
dataIndex: 'skrq'
},
{
title: '课程信息编号',
align: "center",
dataIndex: 'kcxxbh'
},
{
title: '学期',
align: "center",
dataIndex: 'xq'
},
{
title: '教师工号',
align: "center",
dataIndex: 'jsgh'
},
{
title: '编号',
align: "center",
dataIndex: 'bh'
},
{
title: '授课教室',
align: "center",
dataIndex: 'skjs'
},
// {
// title: 'lcbh',
// align: "center",
// dataIndex: 'lcbh'
// },
{
title: '调整事由',
align: "center",
dataIndex: 'tklx',
customRender: ({ text }) => {
if(text == '1'){
return '调整时间';
}else if(text == '2'){
return '调整地点';
}else if(text == '3'){
return '更换教师';
}else if(text == '4'){
return '其他';
}else{
return '';
}
}
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "姓名",
field: 'xm',
component: 'Input',
colProps: {span: 6},
},
{
label: "cjr",
field: 'cjr',
component: 'Input',
colProps: {span: 6},
},
{
label: "sjh",
field: 'sjh',
component: 'Input',
colProps: {span: 6},
},
{
label: "tksy",
field: 'tksy',
component: 'Input',
colProps: {span: 6},
},
{
label: "xyjwmsshyj",
field: 'xyjwmsshyj',
component: 'Input',
colProps: {span: 6},
},
{
label: "yjxq",
field: 'yjxq',
component: 'Input',
colProps: {span: 6},
},
{
label: "sqrdw",
field: 'sqrdw',
component: 'Input',
colProps: {span: 6},
},
{
label: "bizbh",
field: 'bizbh',
component: 'Input',
colProps: {span: 6},
},
{
label: "jwcsh",
field: 'jwcsh',
component: 'Input',
colProps: {span: 6},
},
{
label: "szxyldshyj",
field: 'szxyldshyj',
component: 'Input',
colProps: {span: 6},
},
{
label: "shxq",
field: 'shxq',
component: 'Input',
colProps: {span: 6},
},
{
label: "lcjgbh",
field: 'lcjgbh',
component: 'Input',
colProps: {span: 6},
},
{
label: "bkjh",
field: 'bkjh',
component: 'Input',
colProps: {span: 6},
},
{
label: "时间戳",
field: 'timestamps',
component: 'Input',
colProps: {span: 6},
},
{
label: "课程名称",
field: 'kcmc',
component: 'Input',
colProps: {span: 6},
},
{
label: "pbh",
field: 'pbh',
component: 'Input',
colProps: {span: 6},
},
{
label: "教材",
field: 'jc',
component: 'Input',
colProps: {span: 6},
},
{
label: "上课日期",
field: 'skrq',
component: 'Input',
colProps: {span: 6},
},
{
label: "kcxxbh",
field: 'kcxxbh',
component: 'Input',
colProps: {span: 6},
},
{
label: "学期",
field: 'xq',
component: 'Input',
colProps: {span: 6},
},
{
label: "jsgh",
field: 'jsgh',
component: 'Input',
colProps: {span: 6},
},
{
label: "编号",
field: 'bh',
component: 'Input',
colProps: {span: 6},
},
{
label: "授课教师",
field: 'skjs',
component: 'Input',
colProps: {span: 6},
},
{
label: "lcbh",
field: 'lcbh',
component: 'Input',
colProps: {span: 6},
},
{
label: "1-调整时间2-调整地点3-更换教师4-其他",
field: 'tklx',
component: 'Input',
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '姓名',
field: 'xm',
component: 'Input',
},
{
label: 'cjr',
field: 'cjr',
component: 'Input',
},
{
label: 'sjh',
field: 'sjh',
component: 'Input',
},
{
label: 'tksy',
field: 'tksy',
component: 'Input',
},
{
label: 'xyjwmsshyj',
field: 'xyjwmsshyj',
component: 'Input',
},
{
label: 'yjxq',
field: 'yjxq',
component: 'Input',
},
{
label: 'sqrdw',
field: 'sqrdw',
component: 'Input',
},
{
label: 'bizbh',
field: 'bizbh',
component: 'Input',
},
{
label: 'jwcsh',
field: 'jwcsh',
component: 'Input',
},
{
label: 'szxyldshyj',
field: 'szxyldshyj',
component: 'Input',
},
{
label: 'shxq',
field: 'shxq',
component: 'Input',
},
{
label: 'lcjgbh',
field: 'lcjgbh',
component: 'Input',
},
{
label: 'bkjh',
field: 'bkjh',
component: 'Input',
},
{
label: '时间戳',
field: 'timestamps',
component: 'Input',
},
{
label: '课程名称',
field: 'kcmc',
component: 'Input',
},
{
label: 'pbh',
field: 'pbh',
component: 'Input',
},
{
label: '教材',
field: 'jc',
component: 'Input',
},
{
label: '上课日期',
field: 'skrq',
component: 'Input',
},
{
label: 'kcxxbh',
field: 'kcxxbh',
component: 'Input',
},
{
label: '学期',
field: 'xq',
component: 'Input',
},
{
label: 'jsgh',
field: 'jsgh',
component: 'Input',
},
{
label: '编号',
field: 'bh',
component: 'Input',
},
{
label: '授课教师',
field: 'skjs',
component: 'Input',
},
{
label: 'lcbh',
field: 'lcbh',
component: 'Input',
},
{
label: '1-调整时间2-调整地点3-更换教师4-其他',
field: 'tklx',
component: 'Input',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,363 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="8">
<a-form-item label="姓名">
<j-input placeholder="请输入姓名" v-model:value="queryParam.xm"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="创建人">
<j-input placeholder="请输入创建人" v-model:value="queryParam.cjr"></j-input>
</a-form-item>
</a-col>
<!--<template v-if="toggleSearchStatus">-->
<a-col :lg="8">
<a-form-item label="手机号">
<j-input placeholder="请输入手机号" v-model:value="queryParam.sjh"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="调课事由">
<j-input placeholder="请输入调课事由" v-model:value="queryParam.tksy"></j-input>
</a-form-item>
</a-col>
<!-- <a-col :lg="8">
<a-form-item label="xyjwmsshyj">
<j-input placeholder="请输入xyjwmsshyj" v-model:value="queryParam.xyjwmsshyj"></j-input>
</a-form-item>
</a-col> -->
<a-col :lg="8">
<a-form-item label="yjxq">
<j-input placeholder="请输入yjxq" v-model:value="queryParam.yjxq"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="申请人单位">
<j-input placeholder="请输入申请人单位" v-model:value="queryParam.sqrdw"></j-input>
</a-form-item>
</a-col>
<!-- <a-col :lg="8">
<a-form-item label="bizbh">
<j-input placeholder="请输入bizbh" v-model:value="queryParam.bizbh"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="jwcsh">
<j-input placeholder="请输入jwcsh" v-model:value="queryParam.jwcsh"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="szxyldshyj">
<j-input placeholder="请输入szxyldshyj" v-model:value="queryParam.szxyldshyj"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="shxq">
<j-input placeholder="请输入shxq" v-model:value="queryParam.shxq"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="lcjgbh">
<j-input placeholder="请输入lcjgbh" v-model:value="queryParam.lcjgbh"></j-input>
</a-form-item>
</a-col> -->
<a-col :lg="8">
<a-form-item label="补课计划">
<j-input placeholder="请输入补课计划" v-model:value="queryParam.bkjh"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="时间戳">
<j-input placeholder="请输入时间戳" v-model:value="queryParam.timestamps"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="课程名称">
<j-input placeholder="请输入课程名称" v-model:value="queryParam.kcmc"></j-input>
</a-form-item>
</a-col>
<!-- <a-col :lg="8">
<a-form-item label="pbh">
<j-input placeholder="请输入pbh" v-model:value="queryParam.pbh"></j-input>
</a-form-item>
</a-col> -->
<a-col :lg="8">
<a-form-item label="教材">
<j-input placeholder="请输入教材" v-model:value="queryParam.jc"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="上课日期">
<j-input placeholder="请输入上课日期" v-model:value="queryParam.skrq"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="课程信息编号">
<j-input placeholder="请输入课程信息编号" v-model:value="queryParam.kcxxbh"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="学期">
<j-input placeholder="请输入学期" v-model:value="queryParam.xq"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="教师工号">
<j-input placeholder="请输入教师工号" v-model:value="queryParam.jsgh"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="编号">
<j-input placeholder="请输入编号" v-model:value="queryParam.bh"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="授课教室">
<j-input placeholder="请输入授课教室" v-model:value="queryParam.skjs"></j-input>
</a-form-item>
</a-col>
<!-- <a-col :lg="8">
<a-form-item label="lcbh">
<j-input placeholder="请输入lcbh" v-model:value="queryParam.lcbh"></j-input>
</a-form-item>
</a-col> -->
<a-col :lg="8">
<a-form-item label="调整事由">
<!-- <j-input placeholder="请输入1-调整时间2-调整地点3-更换教师4-其他" v-model:value="queryParam.tklx"></j-input> -->
<j-dict-select-tag
placeholder="请选择调整事由" v-model:value="queryParam.tklx"
:options="[{ value: 1, label: '调整时间'},{ value: 2, label: '调整地点'},{ value: 3, label: '更换教师'},{ value: 4, label: '其他'}]"
/>
</a-form-item>
</a-col>
<!--</template>-->
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<!--<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
</a>-->
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown> -->
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<!--<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>-->
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<XxhbtkxxModal ref="registerModal" @success="handleSuccess"></XxhbtkxxModal>
</div>
</template>
<script lang="ts" name="kc-xxhbtkxx" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './Xxhbtkxx.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Xxhbtkxx.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import XxhbtkxxModal from './components/XxhbtkxxModal.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { JInput } from '/@/components/Form';
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '同步数据表(tkxx)',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
params.column = '',params.order = '';//
return Object.assign(params, queryParam.value);
},
},
exportConfig: {
name: "同步数据表(tkxx)",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
// label: '',
// onClick: handleEdit.bind(null, record),
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
// {
// label: '',
// onClick: handleDetail.bind(null, record),
// },
// {
// label: '',
// popConfirm: {
// title: '',
// confirm: handleDelete.bind(null, record),
// }
// }
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
width: calc(50% - 15px);
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
}
</style>

View File

@ -0,0 +1,276 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="12">
<a-form-item label="姓名" v-bind="validateInfos.xm">
<a-input v-model:value="formData.xm" placeholder="请输入姓名" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="创建人" v-bind="validateInfos.cjr">
<a-input v-model:value="formData.cjr" placeholder="请输入创建人" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="手机号" v-bind="validateInfos.sjh">
<a-input v-model:value="formData.sjh" placeholder="请输入手机号" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="调课事由" v-bind="validateInfos.tksy">
<a-input v-model:value="formData.tksy" placeholder="请输入调课事由" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="12">
<a-form-item label="xyjwmsshyj" v-bind="validateInfos.xyjwmsshyj">
<a-input v-model:value="formData.xyjwmsshyj" placeholder="请输入xyjwmsshyj" :disabled="disabled"></a-input>
</a-form-item>
</a-col> -->
<a-col :span="12">
<a-form-item label="yjxq" v-bind="validateInfos.yjxq">
<a-input v-model:value="formData.yjxq" placeholder="请输入yjxq" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="申请人单位" v-bind="validateInfos.sqrdw">
<a-input v-model:value="formData.sqrdw" placeholder="请输入申请人单位" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="12">
<a-form-item label="bizbh" v-bind="validateInfos.bizbh">
<a-input v-model:value="formData.bizbh" placeholder="请输入bizbh" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="jwcsh" v-bind="validateInfos.jwcsh">
<a-input v-model:value="formData.jwcsh" placeholder="请输入jwcsh" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="szxyldshyj" v-bind="validateInfos.szxyldshyj">
<a-input v-model:value="formData.szxyldshyj" placeholder="请输入szxyldshyj" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="shxq" v-bind="validateInfos.shxq">
<a-input v-model:value="formData.shxq" placeholder="请输入shxq" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="lcjgbh" v-bind="validateInfos.lcjgbh">
<a-input v-model:value="formData.lcjgbh" placeholder="请输入lcjgbh" :disabled="disabled"></a-input>
</a-form-item>
</a-col> -->
<a-col :span="12">
<a-form-item label="补课计划" v-bind="validateInfos.bkjh">
<a-input v-model:value="formData.bkjh" placeholder="请输入补课计划" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="时间戳" v-bind="validateInfos.timestamps">
<a-input v-model:value="formData.timestamps" placeholder="请输入时间戳" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="课程名称" v-bind="validateInfos.kcmc">
<a-input v-model:value="formData.kcmc" placeholder="请输入课程名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="12">
<a-form-item label="pbh" v-bind="validateInfos.pbh">
<a-input v-model:value="formData.pbh" placeholder="请输入pbh" :disabled="disabled"></a-input>
</a-form-item>
</a-col> -->
<a-col :span="12">
<a-form-item label="教材" v-bind="validateInfos.jc">
<a-input v-model:value="formData.jc" placeholder="请输入教材" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="上课日期" v-bind="validateInfos.skrq">
<a-input v-model:value="formData.skrq" placeholder="请输入上课日期" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="课程信息编号" v-bind="validateInfos.kcxxbh">
<a-input v-model:value="formData.kcxxbh" placeholder="请输入课程信息编号" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="学期" v-bind="validateInfos.xq">
<a-input v-model:value="formData.xq" placeholder="请输入学期" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="教师工号" v-bind="validateInfos.jsgh">
<a-input v-model:value="formData.jsgh" placeholder="请输入教师工号" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="编号" v-bind="validateInfos.bh">
<a-input v-model:value="formData.bh" placeholder="请输入编号" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="授课教室" v-bind="validateInfos.skjs">
<a-input v-model:value="formData.skjs" placeholder="请输入授课教室" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="12">
<a-form-item label="lcbh" v-bind="validateInfos.lcbh">
<a-input v-model:value="formData.lcbh" placeholder="请输入lcbh" :disabled="disabled"></a-input>
</a-form-item>
</a-col> -->
<a-col :span="12">
<a-form-item label="调整事由" v-bind="validateInfos.tklx">
<!-- <a-input v-model:value="formData.tklx" placeholder="请输入1-调整时间2-调整地点3-更换教师4-其他" :disabled="disabled"></a-input> -->
<j-dict-select-tag
placeholder="请选择调整事由" v-model:value="formData.tklx" :disabled="disabled"
:options="[{ value: 1, label: '调整时间'},{ value: 2, label: '调整地点'},{ value: 3, label: '更换教师'},{ value: 4, label: '其他'}]"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../Xxhbtkxx.api';
import { Form } from 'ant-design-vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
xm: '',
cjr: '',
sjh: '',
tksy: '',
xyjwmsshyj: '',
yjxq: '',
sqrdw: '',
bizbh: '',
jwcsh: '',
szxyldshyj: '',
shxq: '',
lcjgbh: '',
bkjh: '',
timestamps: '',
kcmc: '',
pbh: '',
jc: '',
skrq: '',
kcxxbh: '',
xq: '',
jsgh: '',
bh: '',
skjs: '',
lcbh: '',
tklx: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
min-height: 500px !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<XxhbtkxxForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></XxhbtkxxForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import XxhbtkxxForm from './XxhbtkxxForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>