修改请购逻辑

This commit is contained in:
yangjun 2025-10-09 14:53:16 +08:00
parent 7a52d9a149
commit 50a2ab8eb5
16 changed files with 2002 additions and 5 deletions

View File

@ -113,6 +113,13 @@ function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 护理流程
*/
function handleHllc(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.hllcView(record);
}
/**
@ -130,6 +137,10 @@ function getTableAction(record) {
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '护理流程',
onClick: handleHllc.bind(null, record),
}
];
}

View File

@ -0,0 +1,405 @@
<template>
<div class="hllcClass" @contextmenu.prevent>
<a-row>
<a-col :span="12" style="padding-top: 14px;">
{{customerInfo.name}} - 护理流程展示
</a-col>
<a-col :span="12" style="text-align: right;">
<!-- <a-button type="primary" @click="handleFanhui">返回</a-button> -->
<!-- <a-button type="primary" @click="getData(customerInfo)">加载</a-button> -->
</a-col>
<a-col :span="24" style="margin-top:14px;">
<a-table
:columns="columns"
:data-source="dataSource"
bordered
size="small"
:pagination="false"
:rowClassName="setRowClassName"
:customRow="handleCustomRow"
@contextmenu.prevent
>
<template #bodyCell="{ column, record, text }">
<template v-if="column.key !== 'minute'">
<a-tooltip :title="text" placement="topLeft">
<span class="cell-text">{{ text }}</span>
</a-tooltip>
</template>
</template>
</a-table>
</a-col>
<!-- <a-col :span="24" style="text-align: center;">
<a-button type="primary" @click="handleSaveBach">保存</a-button>
</a-col> -->
</a-row>
<!-- 右键菜单 -->
<div
v-if="contextMenu.visible"
:style="{
position: 'fixed',
left: `${contextMenu.x}px`,
top: `${contextMenu.y}px`,
zIndex: 1000,
boxShadow: '0 2px 8px rgba(0,0,0,0.15)'
}"
class="context-menu"
>
<a-menu @click="handleMenuClick" style="padding: 14px;">
<a-menu-item key="add">新增数据</a-menu-item>
<a-menu-item key="edit" :disabled="!contextMenu.record?.[contextMenu.columnKey]">编辑数据</a-menu-item>
<a-menu-item key="delete" :disabled="!contextMenu.record?.[contextMenu.columnKey]">删除数据</a-menu-item>
</a-menu>
</div>
<!-- 数据操作模态框 -->
<a-modal
v-model:visible="modalVisible"
:title="modalTitle"
@ok="handleModalOk"
@cancel="handleModalCancel"
>
<a-form :model="formState" layout="vertical" style="padding:14px;">
<a-form-item label="数据内容">
<a-input v-model:value="formState.content" />
</a-form-item>
<a-form-item label="备注">
<a-textarea v-model:value="formState.remark" />
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose,computed } from 'vue';
import { message } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
const emit = defineEmits(['register', 'success']);
const customerInfo = ref<any>({});
//
const contextMenu = reactive({
visible: false,
x: 0,
y: 0,
record: null as DataRow | null,
columnKey: '',
rowIndex: -1
});
//
const modalVisible = ref(false);
const modalAction = ref<'add' | 'edit' | 'delete'>('add');
const modalTitle = computed(() => {
return {
add: '新增数据',
edit: '编辑数据',
delete: '确认删除'
}[modalAction.value];
});
const formState = reactive({
content: '',
remark: ''
});
// 24
const columns = [
{
title: '',
dataIndex: 'minute',
key: 'minute',
width: '50px',
fixed: 'left',
align: 'center',
}
];
//
for (let hour = 0; hour < 24; hour++) {
columns.push({
title: `${hour.toString().padStart(2, '0')}`,
dataIndex: `hour_${hour}`,
key: `hour_${hour}`,
width: 60,
align: 'center',
fixed: '',
customCell: (record: DataRow, rowIndex: number) => {
return {
onClick: () => handleCellClick(record, `hour_${hour}`, rowIndex, 'left'),
onContextmenu: (event: MouseEvent) => {
showContextMenu(event, record, `hour_${hour}`, rowIndex);
}
};
}
});
}
// 5
interface DataRow {
key: number;
minute: string;
remark?: string;
[key: `hour_${number}`]: string;
}
const dataSource = ref<DataRow[]>([]);
//
const initDataSource = () => {
const newData: DataRow[] = [];
for (let minute = 0; minute < 60; minute += 5) {
let row: DataRow = {
key: minute,
minute: `${minute.toString().padStart(2, '0')}`
} as DataRow;
for (let hour = 0; hour < 24; hour++) {
row[`hour_${hour}`] = '';
}
newData.push(row);
}
dataSource.value = newData;
};
//
function setRowClassName(record: DataRow, index: number) {
return index % 2 === 0 ? 'even-row' : 'odd-row';
}
//
initDataSource();
//
const handleCustomRow = (record: DataRow, index: number) => {
return {
onClick: () => handleRowClick(record, index),
onContextmenu: (event: MouseEvent) => {
event.preventDefault();
}
};
};
//
const showContextMenu = (event: MouseEvent, record: DataRow, columnKey: string, rowIndex: number) => {
// event.preventDefault();
// contextMenu.visible = true;
// contextMenu.x = event.clientX;
// contextMenu.y = event.clientY;
// contextMenu.record = record;
// contextMenu.columnKey = columnKey;
// contextMenu.rowIndex = rowIndex;
// //
// const closeMenu = (e: MouseEvent) => {
// if (!(e.target as HTMLElement).closest('.context-menu')) {
// contextMenu.visible = false;
// document.removeEventListener('click', closeMenu);
// }
// };
// document.addEventListener('click', closeMenu);
};
//
const handleMenuClick = ({ key }: { key: string }) => {
const { record, columnKey } = contextMenu;
switch (key) {
case 'add':
modalAction.value = 'add';
formState.content = '';
formState.remark = '';
modalVisible.value = true;
break;
case 'edit':
if (record && columnKey) {
modalAction.value = 'edit';
formState.content = record[columnKey];
formState.remark = record.remark || '';
modalVisible.value = true;
}
break;
case 'delete':
modalAction.value = 'delete';
if (record && columnKey) {
formState.content = record[columnKey];
formState.remark = record.remark || '';
}
modalVisible.value = true;
break;
}
contextMenu.visible = false;
};
//
const handleModalOk = () => {
const { record, columnKey, rowIndex } = contextMenu;
if (!record || !columnKey || rowIndex === -1) return;
switch (modalAction.value) {
case 'add':
case 'edit':
if (!formState.content) {
message.warning('请输入数据内容');
return;
}
dataSource.value[rowIndex][columnKey] = formState.content;
dataSource.value[rowIndex].remark = formState.remark;
message.success(`数据${modalAction.value === 'add' ? '添加' : '更新'}成功`);
break;
case 'delete':
dataSource.value[rowIndex][columnKey] = '';
message.success('数据已删除');
break;
}
modalVisible.value = false;
};
//
const handleModalCancel = () => {
modalVisible.value = false;
};
//
function handleRowClick(record: DataRow, index: number) {
//
}
//
function handleCellClick(record: DataRow, columnKey: string, rowIndex: number, buttonType: 'left' | 'right') {
//
}
function handleFanhui() {
emit('success');
}
function getData(record: any) {
defHttp.get({
url: "/nuIpadApi/nuBizNuCustomerServer/getNclist",
params: { nuId: record.nuId, customerId: record.id }
}).then((data) => {
console.log("获取到的数据:", data);
//
initDataSource();
//
if (Array.isArray(data)) {
data.forEach((hourData) => {
const hour = parseInt(hourData.positioning);
//
if (hourData.children && hourData.children.length > 0) {
hourData.children.forEach((item) => {
//
const [startHour, startMinute] = item.startTime.split(':').map(Number);
const rowIndex = Math.floor(startMinute / 5); // 5
//
if (rowIndex >= 0 && rowIndex < dataSource.value.length) {
//
const content = [
item.directiveName,
item.typeName,
item.categoryName,
item.tagName,
item.cycleType,
item.startTime,
item.endTime,
].filter(Boolean).join(' / ');
//
dataSource.value[rowIndex][`hour_${hour}`] = content;
}
});
}
});
}
});
}
function handleSaveBach(){
console.log("🚀 ~ handleSaveBach ~ dataSource:", dataSource)
}
function init(record: any) {
customerInfo.value = record;
console.log("初始化数据:", record);
getData(record)
}
defineExpose({
init
});
</script>
<style lang="less" scoped>
.hllcClass {
background: white;
width: 100%;
height: calc(100vh - 90px);
padding: 14px;
border-radius: 8px;
position: relative;
}
/* 斑马纹样式 */
:deep(.ant-table) {
.even-row {
background-color: #fafafa;
}
.odd-row {
background-color: #ffffff;
}
/* 单元格悬停效果 */
.ant-table-tbody > tr > td {
&:hover {
background-color: #e6f7ff !important;
cursor: pointer;
}
}
/* 有数据的单元格样式 */
.has-data {
background-color: #f6ffed;
}
}
/* 右键菜单样式 */
.context-menu {
background: white;
border-radius: 4px;
overflow: hidden;
.ant-menu {
border-right: none;
}
.ant-menu-item {
margin: 0;
padding: 5px 12px;
}
}
.cell-text {
// display: inline-block;
// max-width: 50px;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* 限制文本为2行 */
overflow: hidden;
text-overflow: ellipsis;
}
</style>

View File

@ -29,6 +29,15 @@
<GuaUpInfoForm v-if="upInfoVisible" ref="upInfoForm" @ok="handleUpInfoCancel" :formBpm="false">
</GuaUpInfoForm>
</a-drawer>
<!-- 护理流程展示 -->
<a-drawer :title="title" width="100vw" :visible="hllcVisible" :closable="true" :footer-style="{ textAlign: 'right' }"
@close="handlehllcCancel">
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handlehllcCancel">关闭</a-button>
</template>
<ElderHllc v-if="hllcVisible" ref="hllcForm" @ok="handlehllcCancel" :formBpm="false">
</ElderHllc>
</a-drawer>
</template>
<script lang="ts" setup>
@ -37,6 +46,7 @@ import ElderInfoForm from './ElderInfoForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
import GuaUpInfoForm from '/@/views/elder/elderinfo/components/GuaUpInfoForm.vue'
import ElderUpInfoForm from '/@/views/elder/elderinfo/components/ElderUpInfoForm.vue'
import ElderHllc from '/@/views/elder/elderinfo/components/ElderHllc.vue'
const title = ref<string>('');
const width = ref<number>(800);
@ -45,6 +55,8 @@ const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const upInfoForm = ref();
const upInfoVisible = ref<boolean>(false);
const hllcVisible = ref<boolean>(false);
const hllcForm = ref();
const elderUpInfoForm = ref();
const elderUpInfoVisible = ref<boolean>(false);
const emit = defineEmits(['register', 'success']);
@ -121,6 +133,25 @@ function handleUpInfoCancel() {
upInfoVisible.value = false
emit('success');
}
/**
* 护理流程展示
* @param record
*/
function handlehllcCancel() {
hllcVisible.value = false
}
/**
* 监护人信息变更审核
* @param record
*/
function hllcView(record) {
title.value = '护理流程';
hllcVisible.value = true;
nextTick(() => {
hllcForm.value.init(record);
});
}
/**
* 长者审核
@ -156,6 +187,7 @@ defineExpose({
disableSubmit,
upInfoEdit,
upElderInfoEdit,
hllcView,
});
</script>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/cgd/nuInvoicingCgdInfo/list',
save='/cgd/nuInvoicingCgdInfo/add',
edit='/cgd/nuInvoicingCgdInfo/edit',
deleteOne = '/cgd/nuInvoicingCgdInfo/delete',
deleteBatch = '/cgd/nuInvoicingCgdInfo/deleteBatch',
importExcel = '/cgd/nuInvoicingCgdInfo/importExcel',
exportXls = '/cgd/nuInvoicingCgdInfo/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,108 @@
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: '请购单id',
// align: "center",
// dataIndex: 'mainId'
// },
// {
// title: '采购单id',
// align: "center",
// dataIndex: 'cgdId'
// },
{
title: '物料编码',
align: "center",
dataIndex: 'wlMaterialNo'
},
{
title: '物料名称',
align: "center",
dataIndex: 'wlName'
},
{
title: '采购单位',
align: "center",
dataIndex: 'wlUnits'
},
{
title: '规格型号',
align: "center",
dataIndex: 'wlSpecificationModel'
},
{
title: '上限',
align: "center",
dataIndex: 'wlUpperLimit'
},
{
title: '下限',
align: "center",
dataIndex: 'wlLowerLimit'
},
{
title: '供应商名称',
align: "center",
dataIndex: 'suppliersName'
},
{
title: '请购数量',
align: "center",
dataIndex: 'purchaseQuantity'
},
// {
// title: '银行',
// align: "center",
// dataIndex: 'brand'
// },
{
title: '库房',
align: "center",
dataIndex: 'nuId'
},
// {
// title: '入库数量',
// align: "center",
// dataIndex: 'rksl'
// },
// {
// title: '未入库数量',
// align: "center",
// dataIndex: 'wrksl'
// },
// {
// title: '采购单价',
// align: "center",
// dataIndex: 'procurementPrice'
// },
// {
// title: '到货单间',
// align: "center",
// dataIndex: 'arrivalPrice'
// },
];
// 高级查询数据
export const superQuerySchema = {
mainId: {title: '请购单id',order: 0,view: 'text', type: 'string',},
cgdId: {title: '采购单id',order: 1,view: 'text', type: 'string',},
wlMaterialNo: {title: '物料编码',order: 2,view: 'text', type: 'string',},
wlName: {title: '物料名称',order: 3,view: 'text', type: 'string',},
wlUnits: {title: '采购单位',order: 4,view: 'text', type: 'string',},
wlSpecificationModel: {title: '规格型号',order: 5,view: 'text', type: 'string',},
wlUpperLimit: {title: '上限',order: 6,view: 'text', type: 'string',},
wlLowerLimit: {title: '下限',order: 7,view: 'text', type: 'string',},
suppliersName: {title: '供应商名称',order: 8,view: 'text', type: 'string',},
purchaseQuantity: {title: '请购数量',order: 9,view: 'number', type: 'number',},
brand: {title: '银行',order: 10,view: 'text', type: 'string',},
nuId: {title: '库房',order: 11,view: 'text', type: 'string',},
rksl: {title: '入库数量',order: 12,view: 'text', type: 'string',},
wrksl: {title: '未入库数量',order: 13,view: 'text', type: 'string',},
procurementPrice: {title: '采购单价',order: 14,view: 'text', type: 'string',},
arrivalPrice: {title: '到货单间',order: 15,view: 'text', type: 'string',},
};

View File

@ -0,0 +1,235 @@
<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-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'cgd:nu_invoicing_cgd_info:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'cgd:nu_invoicing_cgd_info:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'cgd:nu_invoicing_cgd_info:importExcel'" 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 v-auth="'cgd:nu_invoicing_cgd_info:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<NuInvoicingCgdInfoModal ref="registerModal" @success="handleSuccess"></NuInvoicingCgdInfoModal>
</div>
</template>
<script lang="ts" name="cgd-nuInvoicingCgdInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuInvoicingCgdInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuInvoicingCgdInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuInvoicingCgdInfoModal from './components/NuInvoicingCgdInfoModal.vue'
import { useUserStore } from '/@/store/modules/user';
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: 'nu_invoicing_cgd_info',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "nu_invoicing_cgd_info",
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,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
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),
auth: 'cgd:nu_invoicing_cgd_info:edit'
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'cgd:nu_invoicing_cgd_info:delete'
}
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
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: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,78 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/cgd/nuInvoicingCgdMain/list',
save='/cgd/nuInvoicingCgdMain/add',
edit='/cgd/nuInvoicingCgdMain/edit',
deleteOne = '/cgd/nuInvoicingCgdMain/delete',
deleteBatch = '/cgd/nuInvoicingCgdMain/deleteBatch',
importExcel = '/cgd/nuInvoicingCgdMain/importExcel',
exportXls = '/cgd/nuInvoicingCgdMain/exportXls',
auditInfo='/cgd/nuInvoicingCgdMain/auditInfo',
}
/**
* 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 });
}
// 审核
export const auditInfo = (params, isUpdate) => {
let url = Api.auditInfo;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,87 @@
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: 'cgdNo'
},
{
title: '供应商',
align: "center",
dataIndex: 'gysId_dictText'
},
{
title: '请购时间',
align: "center",
dataIndex: 'qgDate',
customRender:({text}) =>{
text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
return text;
},
},
{
title: '请购人',
align: "center",
dataIndex: 'qgBy'
},
{
title: '供应商联系人',
align: "center",
dataIndex: 'gysLxr'
},
{
title: '供应商联系电话',
align: "center",
dataIndex: 'gysLxrdh'
},
{
title: '付款方式',
align: "center",
dataIndex: 'gysFkfs'
},
{
title: '状态',
align: "center",
dataIndex: 'status_dictText'
},
{
title: '采购单类型',
align: "center",
dataIndex: 'cgdType_dictText'
},
{
title: '审核人',
align: "center",
dataIndex: 'reviewedBy'
},
{
title: '审核时间',
align: "center",
dataIndex: 'reviewedTime'
},
];
// 高级查询数据
export const superQuerySchema = {
qgdId: {title: '请购单id',order: 0,view: 'text', type: 'string',},
cgdNo: {title: '采购单单号',order: 1,view: 'text', type: 'string',},
gysId: {title: '供应商id',order: 2,view: 'text', type: 'string',},
qgDate: {title: '请购时间',order: 3,view: 'date', type: 'string',},
qgBy: {title: '请购人',order: 4,view: 'text', type: 'string',},
gysLxr: {title: '供应商联系人',order: 5,view: 'text', type: 'string',},
gysLxrdh: {title: '供应商联系电话',order: 6,view: 'text', type: 'string',},
gysFkfs: {title: '付款方式',order: 7,view: 'text', type: 'string',},
status: {title: '状态',order: 8,view: 'text', type: 'string',},
cgdType: {title: '采购单类型',order: 9,view: 'text', type: 'string',},
sxdPath: {title: '随行单',order: 10,view: 'image', type: 'string',},
xzdPath: {title: '销账单',order: 11,view: 'image', type: 'string',},
jzdPath: {title: '结账单',order: 12,view: 'image', type: 'string',},
reviewedBy: {title: '审核人',order: 13,view: 'text', type: 'string',},
reviewedTime: {title: '审核时间',order: 14,view: 'datetime', type: 'string',},
content: {title: '审核备注',order: 15,view: 'text', type: 'string',},
};

View File

@ -0,0 +1,270 @@
<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="qgdId">
<template #label><span title="请购单单号">请购单单号</span></template>
<j-input placeholder="请输入请购单单号" v-model:value="queryParam.qgdNo" allow-clear ></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="cgdNo">
<template #label><span title="采购单单号">采购单单号</span></template>
<j-input placeholder="请输入采购单单号" v-model:value="queryParam.cgdNo" allow-clear ></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="qgDate">
<template #label><span title="请购时间">请购时间</span></template>
<a-date-picker valueFormat="YYYY-MM-DD" placeholder="请选择请购时间" v-model:value="queryParam.qgDate" allow-clear />
</a-form-item>
</a-col>
<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-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'cgd:nu_invoicing_cgd_main:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'cgd:nu_invoicing_cgd_main:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'cgd:nu_invoicing_cgd_main:importExcel'" 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 v-auth="'cgd:nu_invoicing_cgd_main:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<NuInvoicingCgdMainModal ref="registerModal" @success="handleSuccess"></NuInvoicingCgdMainModal>
</div>
</template>
<script lang="ts" name="cgd-nuInvoicingCgdMain" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuInvoicingCgdMain.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuInvoicingCgdMain.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuInvoicingCgdMainModal from './components/NuInvoicingCgdMainModal.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 { JInput } from '/@/components/Form';
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: 'nu_invoicing_cgd_main',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "nu_invoicing_cgd_main",
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:6
});
const wrapperCol = reactive({
xs: 24,
sm: 18,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
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),
auth: 'cgd:nu_invoicing_cgd_main:edit',
ifShow: record.status == '0'
},
{
label: '入库',
onClick: handleEdit.bind(null, record),
auth: 'cgd:nu_invoicing_cgd_main:edit',
ifShow: record.status == '1'
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'cgd:nu_invoicing_cgd_main:delete'
}
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
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: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,235 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuInvoicingCgdInfoForm">
<a-row>
<a-col :span="24">
<a-form-item label="请购单id" v-bind="validateInfos.mainId" id="NuInvoicingCgdInfoForm-mainId" name="mainId">
<a-input v-model:value="formData.mainId" placeholder="请输入请购单id" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="采购单id" v-bind="validateInfos.cgdId" id="NuInvoicingCgdInfoForm-cgdId" name="cgdId">
<a-input v-model:value="formData.cgdId" placeholder="请输入采购单id" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料编码" v-bind="validateInfos.wlMaterialNo" id="NuInvoicingCgdInfoForm-wlMaterialNo" name="wlMaterialNo">
<a-input v-model:value="formData.wlMaterialNo" placeholder="请输入物料编码" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料名称" v-bind="validateInfos.wlName" id="NuInvoicingCgdInfoForm-wlName" name="wlName">
<a-input v-model:value="formData.wlName" placeholder="请输入物料名称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="采购单位" v-bind="validateInfos.wlUnits" id="NuInvoicingCgdInfoForm-wlUnits" name="wlUnits">
<a-input v-model:value="formData.wlUnits" placeholder="请输入采购单位" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="规格型号" v-bind="validateInfos.wlSpecificationModel" id="NuInvoicingCgdInfoForm-wlSpecificationModel" name="wlSpecificationModel">
<a-input v-model:value="formData.wlSpecificationModel" placeholder="请输入规格型号" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="上限" v-bind="validateInfos.wlUpperLimit" id="NuInvoicingCgdInfoForm-wlUpperLimit" name="wlUpperLimit">
<a-input v-model:value="formData.wlUpperLimit" placeholder="请输入上限" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="下限" v-bind="validateInfos.wlLowerLimit" id="NuInvoicingCgdInfoForm-wlLowerLimit" name="wlLowerLimit">
<a-input v-model:value="formData.wlLowerLimit" placeholder="请输入下限" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="供应商名称" v-bind="validateInfos.suppliersName" id="NuInvoicingCgdInfoForm-suppliersName" name="suppliersName">
<a-input v-model:value="formData.suppliersName" placeholder="请输入供应商名称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="请购数量" v-bind="validateInfos.purchaseQuantity" id="NuInvoicingCgdInfoForm-purchaseQuantity" name="purchaseQuantity">
<a-input-number v-model:value="formData.purchaseQuantity" placeholder="请输入请购数量" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="银行" v-bind="validateInfos.brand" id="NuInvoicingCgdInfoForm-brand" name="brand">
<a-input v-model:value="formData.brand" placeholder="请输入银行" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="库房" v-bind="validateInfos.nuId" id="NuInvoicingCgdInfoForm-nuId" name="nuId">
<a-input v-model:value="formData.nuId" placeholder="请输入库房" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="入库数量" v-bind="validateInfos.rksl" id="NuInvoicingCgdInfoForm-rksl" name="rksl">
<a-input v-model:value="formData.rksl" placeholder="请输入入库数量" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="未入库数量" v-bind="validateInfos.wrksl" id="NuInvoicingCgdInfoForm-wrksl" name="wrksl">
<a-input v-model:value="formData.wrksl" placeholder="请输入未入库数量" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="采购单价" v-bind="validateInfos.procurementPrice" id="NuInvoicingCgdInfoForm-procurementPrice" name="procurementPrice">
<a-input v-model:value="formData.procurementPrice" placeholder="请输入采购单价" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="到货单间" v-bind="validateInfos.arrivalPrice" id="NuInvoicingCgdInfoForm-arrivalPrice" name="arrivalPrice">
<a-input v-model:value="formData.arrivalPrice" placeholder="请输入到货单间" allow-clear ></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</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 '../NuInvoicingCgdInfo.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.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: '',
mainId: '',
cgdId: '',
wlMaterialNo: '',
wlName: '',
wlUnits: '',
wlSpecificationModel: '',
wlUpperLimit: '',
wlLowerLimit: '',
suppliersName: '',
purchaseQuantity: undefined,
brand: '',
nuId: '',
rksl: '',
wrksl: '',
procurementPrice: '',
arrivalPrice: '',
});
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(() => {
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: 14px;
}
</style>

View File

@ -0,0 +1,77 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<NuInvoicingCgdInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuInvoicingCgdInfoForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuInvoicingCgdInfoForm from './NuInvoicingCgdInfoForm.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>

View File

@ -0,0 +1,287 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuInvoicingCgdMainForm">
<a-row>
<a-col :span="8">
<a-form-item label="采购单单号" v-bind="validateInfos.cgdNo" id="NuInvoicingCgdMainForm-cgdNo" name="cgdNo">
<span>{{formData.cgdNo}}</span>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="请购时间" v-bind="validateInfos.qgDate" id="NuInvoicingCgdMainForm-qgDate" name="qgDate">
<span>{{formData.qgDate}}</span>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="请购人" v-bind="validateInfos.qgBy" id="NuInvoicingCgdMainForm-qgBy" name="qgBy">
<span>{{formData.qgBy}}</span>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="供应商" v-bind="validateInfos.gysId" id="NuInvoicingCgdMainForm-gysId" name="gysId">
<span>{{formData.gysId_dictText}}</span>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="供应商联系人" v-bind="validateInfos.gysLxr" id="NuInvoicingCgdMainForm-gysLxr" name="gysLxr">
<span>{{formData.gysLxr}}</span>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="供应商联系电话" v-bind="validateInfos.gysLxrdh" id="NuInvoicingCgdMainForm-gysLxrdh" name="gysLxrdh">
<span>{{formData.gysLxrdh}}</span>
</a-form-item>
</a-col>
<!-- <a-col :span="8">
<a-form-item label="采购单类型" v-bind="validateInfos.cgdType" id="NuInvoicingCgdMainForm-cgdType" name="cgdType">
<span>{{formData.cgdType_dictText}}</span>
</a-form-item>
</a-col> -->
<!-- <a-col :span="8">
<a-form-item label="随行单" v-bind="validateInfos.sxdPath" id="NuInvoicingCgdMainForm-sxdPath" name="sxdPath">
<j-image-upload :fileMax="0" v-model:value="formData.sxdPath" ></j-image-upload>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="销账单" v-bind="validateInfos.xzdPath" id="NuInvoicingCgdMainForm-xzdPath" name="xzdPath">
<j-image-upload :fileMax="0" v-model:value="formData.xzdPath" ></j-image-upload>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="结账单" v-bind="validateInfos.jzdPath" id="NuInvoicingCgdMainForm-jzdPath" name="jzdPath">
<j-image-upload :fileMax="0" v-model:value="formData.jzdPath" ></j-image-upload>
</a-form-item>
</a-col> -->
<a-col :span="8">
<a-form-item label="审核状态" v-bind="validateInfos.status" id="NuInvoicingCgdMainForm-status" name="status">
<a-select v-model:value="formData.status" :disabled="disabled" placeholder="请选择审核状态">
<a-select-option value="">请选择</a-select-option>
<a-select-option value="1">审核通过</a-select-option>
<a-select-option value="3">作废</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="付款方式" v-bind="validateInfos.gysFkfs" id="NuInvoicingCgdMainForm-gysFkfs" name="gysFkfs">
<j-dict-select-tag type="list" v-model:value="formData.gysFkfs"
dictCode="gys_fkfs"
placeholder="请选择付款方式" allow-clear />
</a-form-item>
</a-col>
<a-col :span="8">
</a-col>
<a-col :span="8">
<a-form-item label="审核人" v-bind="validateInfos.reviewedBy" id="NuInvoicingCgdMainForm-reviewedBy" name="reviewedBy">
<a-input v-model:value="formData.reviewedBy" placeholder="请输入审核人" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="审核时间" v-bind="validateInfos.reviewedTime" id="NuInvoicingCgdMainForm-reviewedTime" name="reviewedTime">
<a-date-picker placeholder="请选择审核时间" v-model:value="formData.reviewedTime" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24" >
<a-form-item label="审核备注" v-bind="validateInfos.content" id="NuInvoicingCgdMainForm-content" name="content" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
<a-input v-model:value="formData.content" placeholder="请输入审核备注" allow-clear ></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
<a-table
:columns="columns"
:row-key="id"
:data-source="dataSource"
:pagination="false"
:loading="loading"
@change="handleTableChange"
>
<template #bodyCell="{ column, text }">
</template>
</a-table>
</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 JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
import { getValueType } from '/@/utils';
import { auditInfo } from '../NuInvoicingCgdMain.api';
import { columns } from '../NuInvoicingCgdInfo.data';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { useUserStore } from '/@/store/modules/user';
import dayjs from 'dayjs';
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 dataSource = ref([]);
const userStore = useUserStore();
const formData = reactive<Record<string, any>>({
id: '',
qgdId: '',
cgdNo: '',
gysId: '',
qgDate: '',
qgBy: '',
gysLxr: '',
gysLxrdh: '',
gysFkfs: '',
status: '',
cgdType: '',
sxdPath: '',
xzdPath: '',
jzdPath: '',
reviewedBy: '',
reviewedTime: '',
content: '',
gysId_dictText:'',
status_dictText:'',
cgdType_dictText:'',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 9 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 15 } });
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 19 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
status: [{ required: true, message: '请选择审核状态', trigger: 'blur' }],
gysFkfs: [{ required: true, message: '请选择付款方式', trigger: 'blur' }],
reviewedBy: [{ required: true, message: '请填写审核人', trigger: 'blur' }],
reviewedTime: [{ required: true, message: '请填写审核时间', trigger: 'blur' }],
});
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(() => {
resetFields();
const tmpData = {};
const tempDate = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
console.log("🚀 ~ edit ~ tempDate:", tempDate)
record.reviewedTime = tempDate;
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
})
tmpData.status = null;
var userInfo = userStore.getUserInfo;
tmpData.reviewedBy = userInfo.realname;
//
Object.assign(formData, tmpData);
getCgdInfoList();
});
}
function getCgdInfoList() {
defHttp.get({ url: '/cgd/nuInvoicingCgdInfo/list', params: { cgdId: formData.id,pageSize:-1 } }).then((res) => {
console.log("🚀 ~ getCgdInfoList ~ res:", res)
dataSource.value = res.records;
});
}
/**
* 提交数据
*/
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(',');
}
}
}
console.log("🚀 ~ submitForm ~ model.status:", model.status)
if(model.status == '3'){
model.cgdType = '9'
}
console.log("🚀 ~ submitForm ~ model:", model)
await auditInfo(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: 14px;
}
</style>

View File

@ -0,0 +1,83 @@
<template>
<a-drawer :title="title" :width="`70vw`" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<NuInvoicingCgdMainForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuInvoicingCgdMainForm>
<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 NuInvoicingCgdMainForm from './NuInvoicingCgdMainForm.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>

View File

@ -11,6 +11,7 @@ enum Api {
deleteBatch = '/invoicing/configMaterialInfo/deleteBatch',
addList='/invoicing/qgdInfo/addList',
queryListByUser='/invoicing/qgdInfo/queryListByUser',
addCgdByUser='/invoicing/qgdInfo/addCgdByUser',
}
@ -24,6 +25,7 @@ export const list = (params) => defHttp.get({ url: Api.list, params });
* @param params
*/
export const queryListByUser = (params) => defHttp.get({ url: Api.queryListByUser, params });
export const addCgdByUser = (params) => defHttp.post({ url: Api.addCgdByUser, params });
/**
*

View File

@ -66,7 +66,7 @@
<a-button type="primary" @click="onQgcCaigou" style="float: right;margin-left:10px;">提交采购</a-button>
<a-button type="primary" @click="onQgcClose" style="float: right;">关闭</a-button>
</template>
<QgcList v-if="qgcOpen"></QgcList>
<QgcList v-if="qgcOpen" ref="qgcModal" @success="onQgcClose"></QgcList>
</a-drawer>
</div>
</template>
@ -92,6 +92,7 @@ import type { CollapseProps } from 'ant-design-vue';
const formRef = ref();
const qgcModal = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
@ -152,7 +153,9 @@ function onQgcClose() {
}
function onQgcCaigou() {
qgcOpen.value = false
// qgcOpen.value = false
qgcModal.value.submitForm();
}
/**

View File

@ -22,12 +22,12 @@
<j-input placeholder="请输入拼音" v-model:value="queryParam.pinyin" allow-clear ></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<!-- <a-col :lg="6">
<a-form-item name="izEnabled">
<template #label><span title="是否启用">是否启用</span></template>
<j-dict-select-tag type='list' placeholder="请选择是否启用" v-model:value="queryParam.izEnabled" dictCode="iz_enabled" allow-clear />
</a-form-item>
</a-col>
</a-col> -->
<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">
@ -59,7 +59,7 @@
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columnsQgcList } from '../JxcInfo.data';
import { list, deleteOne, batchDelete, queryListByUser} from '../JxcInfo.api';
import { list, deleteOne, batchDelete, queryListByUser,addCgdByUser} from '../JxcInfo.api';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import { JInput } from '/@/components/Form';
@ -73,6 +73,7 @@ import { defHttp } from '/@/utils/http/axios';
const registerModal = ref();
const qgcOpen = ref(false)//
const count = ref<number>(5);
const emit = defineEmits(['register', 'success']);
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
@ -160,6 +161,17 @@ import { defHttp } from '/@/utils/http/axios';
reload();
}
async function submitForm(){
await addCgdByUser(null);
emit("success");
}
defineExpose({
submitForm,
});
</script>