|
@@ -0,0 +1,151 @@
|
|
|
+<script setup lang="ts">
|
|
|
+ import { useModalInner } from '/@/components/Modal';
|
|
|
+ import BasicModal from '/@/components/Modal/src/BasicModal.vue';
|
|
|
+ import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
|
|
+ import { useTable } from '/@/components/Table';
|
|
|
+ import { computed, reactive } from 'vue';
|
|
|
+ import { getTextbookWarehouseRecordDetailPage } from '/@/services/apis/TextbookWarehouseRecordDetailController';
|
|
|
+ import { getDataOption } from '/@/api/system/dic';
|
|
|
+
|
|
|
+ defineEmits(['register']);
|
|
|
+ const searchInfo = reactive<Recordable>({});
|
|
|
+ const state = reactive({
|
|
|
+ type: 1,
|
|
|
+ });
|
|
|
+
|
|
|
+ const getTitle = computed(() => (state.type === 1 ? '入库记录' : '退书记录'));
|
|
|
+ const searchFormSchema = computed(() =>
|
|
|
+ state.type === 1
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ label: '入库类型',
|
|
|
+ field: 'warehouseMode',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ api: getDataOption,
|
|
|
+ params: { code: 'warehouse_mode' },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '入库时间',
|
|
|
+ field: '[startCreateDate,endCreateDate]',
|
|
|
+ component: 'RangePicker',
|
|
|
+ colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ placeholder: ['开始时间', '结束时间'],
|
|
|
+ format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
+ showTime: { format: 'HH:mm:ss' },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ : [
|
|
|
+ {
|
|
|
+ label: '退书人',
|
|
|
+ field: 'createUserIdCn',
|
|
|
+ component: 'Input',
|
|
|
+ colProps: { span: 8 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '入库时间',
|
|
|
+ field: '[startCreateDate,endCreateDate]',
|
|
|
+ component: 'RangePicker',
|
|
|
+ colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ placeholder: ['开始时间', '结束时间'],
|
|
|
+ format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
+ showTime: { format: 'HH:mm:ss' },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ );
|
|
|
+
|
|
|
+ const [tableReg, { reload, setColumns, getForm }] = useTable({
|
|
|
+ title: '',
|
|
|
+ api: getTextbookWarehouseRecordDetailPage,
|
|
|
+ pagination: true,
|
|
|
+ immediate: false,
|
|
|
+ showTableSetting: true,
|
|
|
+ bordered: true,
|
|
|
+ resizeHeightOffset: 50,
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ title: '入库方式',
|
|
|
+ dataIndex: 'warehouseModeCn',
|
|
|
+ align: 'left',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ formConfig: {
|
|
|
+ labelWidth: 100,
|
|
|
+ schemas: searchFormSchema,
|
|
|
+ },
|
|
|
+ useSearchForm: true,
|
|
|
+ });
|
|
|
+
|
|
|
+ const [register] = useModalInner((data) => {
|
|
|
+ searchInfo.textbookWarehouseRecordId = data.baseData.id;
|
|
|
+ searchInfo.warehouseModeInt = state.type === 1 ? 2 : 1;
|
|
|
+ state.type = data.type;
|
|
|
+ getForm().resetFields();
|
|
|
+ if (state.type === 1) {
|
|
|
+ setColumns([
|
|
|
+ {
|
|
|
+ title: '入库数量',
|
|
|
+ dataIndex: 'warehouseNumber',
|
|
|
+ align: 'left',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '入库时间',
|
|
|
+ dataIndex: 'createDate',
|
|
|
+ align: 'left',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '入库人员',
|
|
|
+ dataIndex: 'createUserIdCn',
|
|
|
+ align: 'left',
|
|
|
+ },
|
|
|
+ ]);
|
|
|
+ } else {
|
|
|
+ setColumns([
|
|
|
+ {
|
|
|
+ title: '退书人',
|
|
|
+ dataIndex: 'createUserIdCn',
|
|
|
+ align: 'left',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '退书数量',
|
|
|
+ dataIndex: 'warehouseNumber',
|
|
|
+ align: 'left',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '入库时间',
|
|
|
+ dataIndex: 'createDate',
|
|
|
+ align: 'left',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '入库人员',
|
|
|
+ dataIndex: 'createUserIdCn',
|
|
|
+ align: 'left',
|
|
|
+ },
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ reload();
|
|
|
+ });
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <BasicModal
|
|
|
+ :title="getTitle"
|
|
|
+ v-bind="$attrs"
|
|
|
+ default-fullscreen
|
|
|
+ @register="register"
|
|
|
+ :footer="null"
|
|
|
+ >
|
|
|
+ <BasicTable @register="tableReg" :search-info="searchInfo" />
|
|
|
+ </BasicModal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style scoped lang="less"></style>
|