123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829 |
- import { BasicColumn, FormSchema } from '/@/components/Table';
- import { requestMagicApi } from '/@/api/magicApi';
- import { getDataOption } from '/@/api/system/dic';
- import { getSubjectGroupInfo } from '/@/services/apis/SubjectGroupController';
- import { getTextbookInfoByissn } from '/@/services/apis/TextbookController';
- import { getMajorSetOption } from '/@/api/userMagic';
- export const type = {
- 0: '菜单',
- 1: '目录',
- };
- export const TableColumns: BasicColumn[] = [
- {
- title: '书号(ISSN)',
- dataIndex: 'issn',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '书名',
- dataIndex: 'bookName',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '出版社',
- dataIndex: 'publishingHouse',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '作者(主编)',
- dataIndex: 'editorInChief',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '学科组',
- dataIndex: 'groupName',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- // {
- // title: '使用学期',
- // dataIndex: 'semesterName',
- // customRender: ({ text }) => {
- // return text ? text : '/';
- // },
- // },
- // {
- // title: '使用班级',
- // dataIndex: 'useClass',
- // customRender: ({ text }) => {
- // return text ? text : '/';
- // },
- // },
- {
- title: '对应课程',
- dataIndex: 'courseName',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '规划教材',
- dataIndex: 'isTextbookPlanCn',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '类型',
- dataIndex: 'textbookTypeCn',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '规格型号',
- dataIndex: 'specificationsModels',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '估价(元)',
- dataIndex: 'appraisalPrice',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '定价(元)',
- dataIndex: 'price',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '折扣(折)',
- dataIndex: 'discount',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '小计(元)',
- dataIndex: 'subtotal',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '库存(本、册)',
- dataIndex: 'stock',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- {
- title: '操作',
- dataIndex: 'action',
- width: 220,
- fixed: 'right',
- slots: { customRender: 'action' },
- },
- ];
- export const formSchema: FormSchema[] = [
- {
- field: 'id',
- component: 'Input',
- label: 'id',
- show: false,
- },
- {
- label: '书号',
- field: 'issn',
- component: 'Input',
- componentProps: ({ formModel, formActionType }) => {
- return {
- onBlur: async (_) => {
- if (!formModel.issn) {
- return false;
- }
- const data = await getTextbookInfoByissn({ issn: formModel.issn });
- data && formActionType.setFieldsValue(Object.keys(data).length ? data : {});
- await formActionType.setFieldsValue({
- classId: data.textbookClassRelationList.map((item) => item.classId),
- });
- },
- };
- },
- required: true,
- colProps: { span: 12 },
- },
- {
- label: '书名',
- field: 'bookName',
- component: 'Input',
- required: true,
- colProps: { span: 12 },
- },
- {
- label: '类型',
- field: 'textbookType',
- component: 'ApiSelect',
- componentProps: {
- api: getDataOption,
- params: { code: 'textbook_type' },
- },
- required: true,
- colProps: { span: 12 },
- },
- {
- label: '出版社名称',
- field: 'publishingHouse',
- component: 'Input',
- required: true,
- colProps: { span: 12 },
- },
- {
- label: '版次',
- field: 'version',
- component: 'Input',
- required: true,
- colProps: { span: 12 },
- },
- {
- label: '作者(主编)',
- field: 'editorInChief',
- component: 'Input',
- required: true,
- colProps: { span: 12 },
- },
- {
- label: '规划教材',
- field: 'isTextbookPlan',
- component: 'ApiSelect',
- componentProps: {
- api: getDataOption,
- params: { code: 'judgment_method_1' },
- },
- required: true,
- colProps: { span: 12 },
- },
- {
- label: '定价(元)',
- field: 'price',
- component: 'InputNumber',
- defaultValue: 0,
- required: true,
- componentProps: ({ formModel }) => {
- return {
- min: 0,
- onChange: (e) => {
- if (e !== 0) {
- formModel.discount = ((formModel.subtotal / e) * 10).toFixed(1);
- } else {
- formModel.discount = 0;
- }
- },
- };
- },
- colProps: { span: 12 },
- },
- {
- label: '估价(元)',
- field: 'appraisalPrice',
- component: 'InputNumber',
- componentProps: {
- min: 0,
- },
- colProps: { span: 12 },
- },
- {
- label: '使用类型',
- field: 'useType',
- component: 'Select',
- required: true,
- componentProps: {
- options: [
- { label: '一学期', value: 1 },
- { label: '二学期', value: 2 },
- { label: '三学期', value: 3 },
- { label: '四学期', value: 4 },
- { label: '五学期', value: 5 },
- { label: '六学期', value: 6 },
- ],
- },
- colProps: { span: 12 },
- },
- {
- field: 'subtotal',
- label: '小计(元)',
- component: 'InputNumber',
- defaultValue: 0,
- required: true,
- colProps: { span: 12 },
- dynamicDisabled: true,
- componentProps: ({ formModel }) => {
- return {
- min: 0,
- onChange: (e) => {
- if (!e) {
- return false;
- }
- if (formModel.price !== 0) {
- formModel.discount = ((e / formModel.price) * 10).toFixed(1);
- } else {
- formModel.discount = 0;
- }
- },
- };
- },
- },
- {
- label: '折扣(折)',
- field: 'discount',
- component: 'InputNumber',
- componentProps: ({ formModel }) => {
- return {
- onChange: (e) => {
- if (e < 1) {
- e = 1;
- }
- if (e > 10) {
- e = 10;
- }
- formModel.subtotal = (((formModel.price || 0) * e) / 10).toFixed(2);
- // if (formModel.price && formModel.subtotal) {
- // formModel.subtotal = (formModel.price * e).toFixed(2);
- // }
- },
- };
- },
- // dynamicDisabled: true,
- colProps: { span: 12 },
- },
- {
- label: '学科组',
- field: 'subjectGroupId',
- component: 'ApiSelect',
- required: true,
- ifShow: ({ values }) => {
- return values.textbookType == 't_textbook';
- },
- componentProps: {
- api: requestMagicApi,
- params: { url: '/educational/subjectGroup/list' },
- },
- colProps: { span: 12 },
- },
- {
- label: '对应课程',
- field: 'courseSubjectId',
- required: true,
- component: 'ApiSelect',
- ifShow: ({ values }) => {
- return values.textbookType == 't_textbook';
- },
- componentProps: ({ formModel }) => {
- return {
- api: async () => {
- if (!formModel.subjectGroupId) {
- return [];
- }
- const data = await getSubjectGroupInfo({ id: formModel.subjectGroupId });
- return data.subjectGroupCourseList.map((item) => {
- return {
- label: item.courseSubjectIdCN,
- value: item.courseSubjectId,
- };
- });
- },
- showSearch: true,
- // 搜索参考
- filterOption: (input, option) => {
- return (
- option?.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
- option?.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
- );
- },
- };
- },
- colProps: { span: 12 },
- },
- // {
- // label: '使用年级',
- // field: 'gradeId',
- // component: 'ApiSelect',
- // componentProps: {
- // api: requestMagicApi,
- // params: { url: '/baseData/grade/option' },
- // },
- // colProps: { span: 12 },
- // },
- // {
- // label: '使用班级',
- // field: 'classId',
- // required: true,
- // component: 'ApiSelect',
- // componentProps: ({ formModel }) => {
- // return {
- // api: requestMagicApi,
- // params: {
- // url: `educational/class/gradeid?grade_id=${formModel.gradeId ? formModel.gradeId : ''}`,
- // },
- // showSearch: true,
- // mode: 'multiple',
- // // 搜索参考
- // filterOption: (input, option) => {
- // return (
- // option?.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
- // option?.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
- // );
- // },
- // };
- // },
- // colProps: { span: 12 },
- // },
- // {
- // label: '使用学期',
- // field: 'baseSemesterId',
- // component: 'ApiSelect',
- // required: true,
- // componentProps: {
- // api: requestMagicApi,
- // params: { url: 'baseData/semester/option' },
- // },
- // colProps: { span: 12 },
- // },
- ];
- export const searchFormSchema: FormSchema[] = [
- {
- label: '教材类型',
- field: 'textbookType',
- component: 'ApiSelect',
- componentProps: {
- getPopupContainer: () => document.body,
- api: getDataOption,
- params: { code: 'textbook_type' },
- },
- colProps: { span: 6 },
- },
- {
- label: '学期',
- field: 'baseSemesterId',
- component: 'ApiSelect',
- componentProps: {
- getPopupContainer: () => document.body,
- api: requestMagicApi,
- params: { url: 'baseData/semester/option' },
- },
- colProps: { span: 6 },
- },
- {
- label: '学科组',
- field: 'subjectGroupId',
- component: 'ApiSelect',
- componentProps: {
- getPopupContainer: () => document.body,
- api: requestMagicApi,
- params: { url: '/educational/subjectGroup/list' },
- },
- colProps: { span: 6 },
- },
- {
- label: '书号',
- field: 'issn',
- component: 'Input',
- colProps: { span: 6 },
- },
- {
- label: '书名',
- field: 'bookName',
- component: 'Input',
- colProps: { span: 6 },
- },
- // {
- // label: '出版社名称',
- // field: 'publishingHouse',
- // component: 'Input',
- // colProps: { span: 6 },
- // },
- {
- field: 'majorSetId',
- label: '专业方向',
- component: 'ApiSelect',
- componentProps: ({}) => {
- return {
- getPopupContainer: () => document.body,
- api: getMajorSetOption,
- };
- },
- colProps: { span: 6 },
- },
- // {
- // label: '作者(主编)',
- // field: 'editorInChief',
- // component: 'Input',
- // colProps: { span: 6 },
- // },
- {
- label: '规划教材',
- field: 'isTextbookPlan',
- component: 'ApiSelect',
- componentProps: {
- getPopupContainer: () => document.body,
- api: getDataOption,
- params: { code: 'judgment_method_1' },
- },
- colProps: { span: 6 },
- },
- {
- label: '对应课程',
- field: 'courseSubjectId',
- component: 'ApiSelect',
- componentProps: ({ formModel }) => {
- return {
- getPopupContainer: () => document.body,
- api: async () => {
- if (!formModel.subjectGroupId) {
- return [];
- }
- const data = await getSubjectGroupInfo({ id: formModel.subjectGroupId });
- return data.subjectGroupCourseList.map((item) => {
- return {
- label: item.courseSubjectIdCN,
- value: item.courseSubjectId,
- };
- });
- },
- showSearch: true,
- // 搜索参考
- filterOption: (input, option) => {
- return (
- option?.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
- option?.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
- );
- },
- };
- },
- colProps: { span: 6 },
- },
- // {
- // label: '使用年级',
- // field: 'gradeId',
- // component: 'ApiSelect',
- // componentProps: {
- // getPopupContainer: () => document.body,
- // api: requestMagicApi,
- // params: { url: '/baseData/grade/option' },
- // },
- // colProps: { span: 6 },
- // },
- // {
- // label: '使用班级',
- // field: 'classId',
- // component: 'ApiSelect',
- // componentProps: ({ formModel }) => {
- // return {
- // getPopupContainer: () => document.body,
- // api: requestMagicApi,
- // params: { url: `educational/class/gradeid?grade_id=${formModel.gradeId}` },
- // showSearch: true,
- // mode: 'multiple',
- // // 搜索参考
- // filterOption: (input, option) => {
- // return (
- // option?.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
- // option?.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
- // );
- // },
- // };
- // },
- // colProps: { span: 6 },
- // },
- ];
- export const pushFormSchema: FormSchema[] = [
- {
- field: 'textbookId',
- component: 'Input',
- label: '教材管理编号',
- show: false,
- },
- {
- field: 'issn',
- label: '书号',
- component: 'Input',
- dynamicDisabled: true,
- colProps: { span: 24 },
- },
- {
- field: 'bookName',
- label: '书名',
- component: 'Input',
- required: true,
- dynamicDisabled: true,
- colProps: { span: 24 },
- },
- {
- field: 'stock',
- label: '库存',
- component: 'Input',
- defaultValue: 0,
- dynamicDisabled: true,
- colProps: { span: 24 },
- },
- {
- field: 'warehouseNumber',
- label: '入库数量',
- component: 'InputNumber',
- componentProps: ({ formModel }) => {
- return {
- min: 0,
- onChange: (e) => {
- if (!e || !formModel.price) {
- formModel.totalPrice = undefined;
- return false;
- }
- formModel.totalPrice = (
- e *
- formModel.price *
- (formModel.discount ? formModel.discount / 10 : 1)
- ).toFixed(2);
- },
- };
- },
- required: true,
- colProps: { span: 24 },
- },
- {
- field: 'source',
- label: '来源',
- component: 'Input',
- required: true,
- colProps: { span: 24 },
- },
- {
- field: 'price',
- label: '单价',
- component: 'InputNumber',
- required: true,
- componentProps: ({ formModel }) => {
- return {
- min: 0,
- onChange: (e) => {
- if (!e || !formModel.warehouseNumber) {
- formModel.totalPrice = undefined;
- return false;
- }
- formModel.totalPrice = (
- e *
- formModel.warehouseNumber *
- (formModel.discount ? formModel.discount / 10 : 1)
- ).toFixed(2);
- },
- };
- },
- colProps: { span: 24 },
- },
- {
- label: '折扣(折)',
- field: 'discount',
- component: 'InputNumber',
- colProps: { span: 24 },
- componentProps: ({ formModel }) => {
- return {
- onChange: (e) => {
- if (e < 1) {
- e = 1;
- }
- if (e > 10) {
- e = 10;
- }
- if (!e || !formModel.warehouseNumber || !formModel.price) {
- formModel.totalPrice = undefined;
- return false;
- }
- formModel.totalPrice = (
- formModel.price *
- formModel.warehouseNumber *
- (e ? e / 10 : 1)
- ).toFixed(2);
- },
- };
- },
- },
- {
- field: 'totalPrice',
- label: '总价(元)',
- component: 'InputNumber',
- componentProps: {
- min: 0,
- },
- required: true,
- colProps: { span: 24 },
- },
- ];
- export const infoEumns = {
- issn: '书号',
- bookName: '书名',
- textbookTypeCn: '类型',
- publishingHouse: '出版社',
- editorInChief: '作者(主编)',
- isTextbookPlanCn: '是否为规划教材',
- price: '定价(元)',
- appraisalPrice: '估价(元)',
- discount: '折扣(折)',
- stock: '库存',
- };
- export const textbookInfoEumns = {
- groupName: '对应学科组',
- courseName: '对应课程',
- useGrade: '使用年级',
- useClass: '使用班级',
- };
- export const SubscriptionsColumns: BasicColumn[] = [
- {
- title: '征订时间',
- dataIndex: 'createDate',
- },
- {
- title: '征订人',
- dataIndex: 'applicantUser',
- },
- {
- title: '书号(ISSN)',
- dataIndex: 'issn',
- },
- {
- title: '书名',
- dataIndex: 'bookName',
- },
- {
- title: '出版社',
- dataIndex: 'publishingHouse',
- },
- {
- title: '作者(主编)',
- dataIndex: 'editorInChief',
- },
- // {
- // title: '学科组',
- // dataIndex: 'subjectGroupIdCN',
- // },
- // {
- // title: '使用年级',
- // dataIndex: 'gradeName',
- // },
- {
- title: '使用班级',
- dataIndex: 'useClass',
- },
- {
- title: '对应课程',
- dataIndex: 'courseName',
- },
- // {
- // title: '规划教材',
- // dataIndex: 'isTextbookPlanCn',
- // },
- // {
- // title: '估价(元)',
- // dataIndex: 'appraisalPrice',
- // },
- {
- title: '学生用书征订数量',
- dataIndex: 'studentSubscriptionNumber',
- },
- {
- title: '教师教材用书征订数量',
- dataIndex: 'teacherSubscriptionNumber',
- },
- {
- title: '教师教参用书征订数量',
- dataIndex: 'teacherReferenceNumber',
- },
- // {
- // title: '有无配套资源',
- // dataIndex: 'isSupportResourcesCn',
- // },
- ];
- export const pushListColumns: BasicColumn[] = [
- {
- title: '入库时间',
- dataIndex: 'warehouseDate',
- },
- {
- title: '入库数量',
- dataIndex: 'warehouseNumber',
- },
- {
- title: '入库人员',
- dataIndex: 'warehouseUser',
- },
- {
- title: '来源',
- dataIndex: 'source',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- ];
- export const popListColumns: BasicColumn[] = [
- {
- title: '出库时间',
- dataIndex: 'issueDate',
- },
- {
- title: '出库数量',
- dataIndex: 'issueNumber',
- },
- {
- title: '出库方式',
- dataIndex: 'issueMode',
- },
- {
- title: '出库人员',
- dataIndex: 'issueUser',
- },
- {
- title: '去处',
- dataIndex: 'remark',
- customRender: ({ text }) => {
- return text ? text : '/';
- },
- },
- ];
- export const receiveColumns: BasicColumn[] = [
- {
- title: '领取时间',
- dataIndex: 'claimDate',
- },
- {
- title: '领取人身份',
- dataIndex: 'claimIdentity',
- },
- {
- title: '班级',
- dataIndex: 'className',
- },
- {
- title: '领取人员',
- dataIndex: 'name',
- },
- {
- title: '学期',
- dataIndex: 'semesterName',
- },
- {
- title: '学号/工号',
- dataIndex: 'userName',
- },
- ];
|