进销存-请领单

This commit is contained in:
1378012178@qq.com 2025-12-01 10:23:02 +08:00
parent b814734a04
commit 02f092c272
8 changed files with 1062 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 = '/qld/nuInvoicingQldMain/list',
save='/qld/nuInvoicingQldMain/add',
edit='/qld/nuInvoicingQldMain/edit',
deleteOne = '/qld/nuInvoicingQldMain/delete',
deleteBatch = '/qld/nuInvoicingQldMain/deleteBatch',
importExcel = '/qld/nuInvoicingQldMain/importExcel',
exportXls = '/qld/nuInvoicingQldMain/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,112 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '请领单单号',
align: 'center',
dataIndex: 'qldNo',
},
{
title: 'NUID',
align: 'center',
dataIndex: 'nuId_dictText',
},
{
title: '长者姓名',
align: 'center',
dataIndex: 'elderId_dictText',
},
{
title: '请领状态',
align: 'center',
dataIndex: 'status_dictText',
},
{
title: '提交人',
align: 'center',
dataIndex: 'tjBy_dictText',
},
{
title: '提交时间',
align: 'center',
dataIndex: 'tjTime',
},
// {
// title: '作废人',
// align: "center",
// dataIndex: 'zfBy_dictText'
// },
// {
// title: '作废时间',
// align: "center",
// dataIndex: 'zfTime'
// },
// {
// title: '回退人',
// align: "center",
// dataIndex: 'htBy_dictText'
// },
// {
// title: '回退时间',
// align: "center",
// dataIndex: 'htTime'
// },
// {
// title: '出库人',
// align: "center",
// dataIndex: 'ckBy_dictText'
// },
// {
// title: '出库时间',
// align: "center",
// dataIndex: 'ckTime'
// },
{
title: '收货人',
align: 'center',
dataIndex: 'shBy_dictText',
},
{
title: '收货时间',
align: 'center',
dataIndex: 'shTime',
},
];
// 高级查询数据
export const superQuerySchema = {
qldNo: { title: '请领单单号', order: 0, view: 'text', type: 'string' },
status: { title: '请领状态', order: 1, view: 'list', type: 'string', dictCode: 'qld_status' },
tjBy: { title: '提交人', order: 2, view: 'sel_search', type: 'string', dictTable: 'sys_user', dictCode: 'id', dictText: 'realname' },
tjTime: { title: '提交时间', order: 3, view: 'datetime', type: 'string' },
zfBy: { title: '作废人', order: 4, view: 'sel_search', type: 'string', dictTable: 'sys_user', dictCode: 'id', dictText: 'realname' },
zfTime: { title: '作废时间', order: 5, view: 'datetime', type: 'string' },
htBy: { title: '回退人', order: 6, view: 'sel_search', type: 'string', dictTable: 'sys_user', dictCode: 'id', dictText: 'realname' },
htTime: { title: '回退时间', order: 7, view: 'datetime', type: 'string' },
ckBy: { title: '出库人', order: 8, view: 'sel_search', type: 'string', dictTable: 'sys_user', dictCode: 'id', dictText: 'realname' },
ckTime: { title: '出库时间', order: 9, view: 'datetime', type: 'string' },
shBy: { title: '收货人', order: 10, view: 'sel_search', type: 'string', dictTable: 'sys_user', dictCode: 'id', dictText: 'realname' },
shTime: { title: '收货时间', order: 11, view: 'datetime', type: 'string' },
nuId: {
title: 'nuid nu_base_info.nu_id',
order: 12,
view: 'sel_search',
type: 'string',
dictTable: 'nu_base_info',
dictCode: 'nu_id',
dictText: 'nu_name',
},
elderId: {
title: '长者id nu_biz_elder_info.id',
order: 13,
view: 'sel_search',
type: 'string',
dictTable: 'nu_biz_elder_info',
dictCode: 'id',
dictText: 'name',
},
};

View File

@ -0,0 +1,312 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="qldNo">
<template #label><span title="请领单号">请领单号</span></template>
<JInput v-model:value="queryParam.qldNo" placeholder="请输入单号" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="status">
<template #label><span title="请领状态">请领状态</span></template>
<j-dict-select-tag type='list' v-model:value="queryParam.status" dictCode="qld_status"
placeholder="请选择请领状态" allow-clear />
</a-form-item>
</a-col>
<!-- <template v-if="toggleSearchStatus">
<a-col :lg="6">
<a-form-item name="tjBy">
<template #label><span title="提交人">提交人</span></template>
<j-search-select placeholder="请选择提交人" v-model:value="queryParam.tjBy" dict="sys_user,realname,id" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="tjTime">
<template #label><span title="提交时间">提交时间</span></template>
<a-range-picker showTime value-format="YYYY-MM-DD HH:mm:ss" v-model:value="queryParam.tjTime" class="query-group-cust"/>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="zfBy">
<template #label><span title="作废人">作废人</span></template>
<j-search-select placeholder="请选择作废人" v-model:value="queryParam.zfBy" dict="sys_user,realname,id" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="zfTime">
<template #label><span title="作废时间">作废时间</span></template>
<a-range-picker showTime value-format="YYYY-MM-DD HH:mm:ss" v-model:value="queryParam.zfTime" class="query-group-cust"/>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="htBy">
<template #label><span title="回退人">回退人</span></template>
<j-search-select placeholder="请选择回退人" v-model:value="queryParam.htBy" dict="sys_user,realname,id" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="htTime">
<template #label><span title="回退时间">回退时间</span></template>
<a-range-picker showTime value-format="YYYY-MM-DD HH:mm:ss" v-model:value="queryParam.htTime" class="query-group-cust"/>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="ckBy">
<template #label><span title="出库人">出库人</span></template>
<j-search-select placeholder="请选择出库人" v-model:value="queryParam.ckBy" dict="sys_user,realname,id" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="ckTime">
<template #label><span title="出库时间">出库时间</span></template>
<a-range-picker showTime value-format="YYYY-MM-DD HH:mm:ss" v-model:value="queryParam.ckTime" class="query-group-cust"/>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="shBy">
<template #label><span title="收货人">收货人</span></template>
<j-search-select placeholder="请选择收货人" v-model:value="queryParam.shBy" dict="sys_user,realname,id" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="shTime">
<template #label><span title="收货时间">收货时间</span></template>
<a-range-picker showTime value-format="YYYY-MM-DD HH:mm:ss" v-model:value="queryParam.shTime" class="query-group-cust"/>
</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" >
<!--插槽:table标题-->
<template #tableTitle>
<!-- <a-button type="primary" v-auth="'qld:nu_invoicing_qld_main:add'" @click="handleAdd"
preIcon="ant-design:plus-outlined"> 新增</a-button> -->
<!-- <a-button type="primary" v-auth="'qld:nu_invoicing_qld_main:exportXls'" preIcon="ant-design:export-outlined"
@click="onExportXls"> 导出</a-button> -->
<!-- <j-upload-button type="primary" v-auth="'qld:nu_invoicing_qld_main:importExcel'"
preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> -->
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<NuInvoicingQldMainModal ref="registerModal" @success="handleSuccess"></NuInvoicingQldMainModal>
</div>
</template>
<script lang="ts" name="qld-nuInvoicingQldMain" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuInvoicingQldMain.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuInvoicingQldMain.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuInvoicingQldMainModal from './components/NuInvoicingQldMainModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
import { cloneDeep } from "lodash-es";
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '进销存-请领单-主表',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
let rangerQuery = await setRangeQuery();
return Object.assign(params, rangerQuery);
},
},
exportConfig: {
name: "进销存-请领单-主表",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 新增事件
*/
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: handleDetail.bind(null, record),
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
let rangeField = 'tjTime,zfTime,htTime,ckTime,shTime,'
/**
* 设置范围查询条件
*/
async function setRangeQuery() {
let queryParamClone = cloneDeep(queryParam);
if (rangeField) {
let fieldsValue = rangeField.split(',');
fieldsValue.forEach(item => {
if (queryParamClone[item]) {
let range = queryParamClone[item];
queryParamClone[item + '_begin'] = range[0];
queryParamClone[item + '_end'] = range[1];
delete queryParamClone[item];
} else {
queryParamClone[item + '_begin'] = '';
queryParamClone[item + '_end'] = '';
}
})
}
return queryParamClone;
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 14px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 14px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/qld/nuInvoicingQldInfo/list',
save='/qld/nuInvoicingQldInfo/add',
edit='/qld/nuInvoicingQldInfo/edit',
deleteOne = '/qld/nuInvoicingQldInfo/delete',
deleteBatch = '/qld/nuInvoicingQldInfo/deleteBatch',
importExcel = '/qld/nuInvoicingQldInfo/importExcel',
exportXls = '/qld/nuInvoicingQldInfo/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,49 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '库房',
align: 'center',
dataIndex: 'kfName',
},
{
title: '物料',
align: 'center',
dataIndex: 'meterialInfo.materialName',
format(text, record, index) {
return record.meterialInfo.materialName;
},
},
{
title: '规格型号',
align: 'center',
dataIndex: 'meterialInfo.specificationModel',
format(text, record, index) {
return record.meterialInfo.specificationModel;
},
},
{
title: '请领数量',
align: 'center',
dataIndex: 'qlNum',
},
{
title: '单位',
align: 'center',
dataIndex: 'meterialInfo.materialUnits',
format(text, record, index) {
return record.meterialInfo.materialUnits;
},
},
];
// 高级查询数据
export const superQuerySchema = {
kfIf: { title: '库房id nu_warehouse_material_info.nu_id', order: 0, view: 'text', type: 'string' },
wlId: { title: '物料id nu_config_material_info.id', order: 1, view: 'text', type: 'string' },
qlNum: { title: '请领数量', order: 2, view: 'number', type: 'number' },
};

View File

@ -0,0 +1,105 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<span style="font-size: 15px;font-weight: bold;">请领物料</span>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
</template>
<script lang="ts" name="qld-nuInvoicingQldInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuInvoicingQldInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuInvoicingQldInfo.api';
import { useUserStore } from '/@/store/modules/user';
const formRef = ref();
const queryParam = reactive<any>({});
const qldNo = ref()
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '进销存-请领单-请领信息表',
api: list,
columns,
canResize: false,
useSearchForm: false,
showActionColumn: false,
showIndexColumn: true,
showTableSetting: false,
immediate: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
queryParam.qldNo = qldNo.value
queryParam.pageSize = -1
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
function init(qldNo_) {
qldNo.value = qldNo_
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 14px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 14px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,257 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="true">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="NuInvoicingQldMainForm">
<a-row class="card-class">
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
<SectionDivider :title="'基本信息'" />
</a-col>
<a-col :span="12">
<a-form-item label="请领单单号" v-bind="validateInfos.qldNo" id="NuInvoicingQldMainForm-qldNo" name="qldNo">
<a-input v-model:value="formData.qldNo"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="请领状态" v-bind="validateInfos.status" id="NuInvoicingQldMainForm-status" name="status">
<j-dict-select-tag v-model:value="formData.status" dictCode="qld_status" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="NUID" v-bind="validateInfos.nuId" id="NuInvoicingQldMainForm-nuId" name="nuId">
<j-search-select v-model:value="formData.nuId" dict="nu_base_info,nu_name,nu_id" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="长者姓名" v-bind="validateInfos.elderId" id="NuInvoicingQldMainForm-elderId"
name="elderId">
<j-search-select v-model:value="formData.elderId" dict="nu_biz_elder_info,name,id" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="提交人" v-bind="validateInfos.tjBy" id="NuInvoicingQldMainForm-tjBy" name="tjBy">
<j-search-select v-model:value="formData.tjBy" dict="sys_user,realname,id" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="提交时间" v-bind="validateInfos.tjTime" id="NuInvoicingQldMainForm-tjTime" name="tjTime">
<a-date-picker v-model:value="formData.tjTime" showTime value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="作废人" v-bind="validateInfos.zfBy" id="NuInvoicingQldMainForm-zfBy" name="zfBy">
<j-search-select v-model:value="formData.zfBy" dict="sys_user,realname,id" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="作废时间" v-bind="validateInfos.zfTime" id="NuInvoicingQldMainForm-zfTime" name="zfTime">
<a-date-picker v-model:value="formData.zfTime" showTime value-format="YYYY-MM-DD HH:mm:ss"
placeholder="" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="回退人" v-bind="validateInfos.htBy" id="NuInvoicingQldMainForm-htBy" name="htBy">
<j-search-select v-model:value="formData.htBy" dict="sys_user,realname,id" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="回退时间" v-bind="validateInfos.htTime" id="NuInvoicingQldMainForm-htTime" name="htTime">
<a-date-picker v-model:value="formData.htTime" showTime value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="出库人" v-bind="validateInfos.ckBy" id="NuInvoicingQldMainForm-ckBy" name="ckBy">
<j-search-select v-model:value="formData.ckBy" dict="sys_user,realname,id" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="出库时间" v-bind="validateInfos.ckTime" id="NuInvoicingQldMainForm-ckTime" name="ckTime">
<a-date-picker v-model:value="formData.ckTime" showTime value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="收货人" v-bind="validateInfos.shBy" id="NuInvoicingQldMainForm-shBy" name="shBy">
<j-search-select v-model:value="formData.shBy" dict="sys_user,realname,id" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="收货时间" v-bind="validateInfos.shTime" id="NuInvoicingQldMainForm-shTime" name="shTime">
<a-date-picker v-model:value="formData.shTime" showTime value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
<div>
<NuInvoicingQldInfoList ref="listRef"></NuInvoicingQldInfoList>
</div>
</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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuInvoicingQldMain.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import NuInvoicingQldInfoList from './NuInvoicingQldInfoList.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 listRef = ref()
const formData = reactive<Record<string, any>>({
id: '',
qldNo: '',
status: '',
tjBy: '',
tjTime: '',
zfBy: '',
zfTime: '',
htBy: '',
htTime: '',
ckBy: '',
ckTime: '',
shBy: '',
shTime: '',
nuId: '',
elderId: '',
});
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 = reactive({
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
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(() => {
listRef.value.init(record.qldNo)
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if (record.hasOwnProperty(key)) {
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
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 {
padding: 0px;
}
.card-class {
padding-top: 24px;
padding-bottom: 24px;
padding-left: 14px;
padding-right: 14px;
// background-color: rgba(255, 255, 255, 0.9);
background-color: #fcfdff;
border-radius: 10px;
// box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 12px;
margin-bottom: 14px;
}
</style>

View File

@ -0,0 +1,83 @@
<template>
<a-drawer :title="title" width="80vw" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<NuInvoicingQldMainForm v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
:formBpm="false"></NuInvoicingQldMainForm>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuInvoicingQldMainForm from './NuInvoicingQldMainForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.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 lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>