添加供应商采购流程
This commit is contained in:
parent
fe35dd2c9d
commit
1496238884
|
|
@ -0,0 +1,93 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/cgd/nuInvoicingCgdInfo/list',
|
||||
listAndJh = '/cgd/nuInvoicingCgdInfo/listAndJh',
|
||||
save = '/cgd/nuInvoicingCgdInfo/add',
|
||||
edit = '/cgd/nuInvoicingCgdInfo/edit',
|
||||
deleteOne = '/cgd/nuInvoicingCgdInfo/delete',
|
||||
deleteBatch = '/cgd/nuInvoicingCgdInfo/deleteBatch',
|
||||
importExcel = '/cgd/nuInvoicingCgdInfo/importExcel',
|
||||
exportXls = '/cgd/nuInvoicingCgdInfo/exportXls',
|
||||
sxd = '/cgd/nuInvoicingCgdSxd/list',
|
||||
calcTotalPrice = '/cgd/nuInvoicingCgdInfo/calcTotalPrice',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const listAndJh = (params) => defHttp.get({ url: Api.listAndJh, params });
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @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 });
|
||||
};
|
||||
|
||||
/**
|
||||
* 随行单
|
||||
* @param params
|
||||
*/
|
||||
export const sxdList = (params) => defHttp.get({ url: Api.sxd, params });
|
||||
|
||||
/**
|
||||
* 已完结采购单+拣货 总价
|
||||
* @param params
|
||||
*/
|
||||
export const calcTotalPrice = (params) => defHttp.get({ url: Api.calcTotalPrice, params });
|
||||
|
|
@ -0,0 +1,274 @@
|
|||
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 rkcolumns: BasicColumn[] = [
|
||||
{
|
||||
title: '物料编码',
|
||||
align: "center",
|
||||
dataIndex: 'wlMaterialNo',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '物料名称',
|
||||
align: "center",
|
||||
dataIndex: 'wlName'
|
||||
},
|
||||
{
|
||||
title: '规格型号',
|
||||
align: "center",
|
||||
dataIndex: 'wlSpecificationModel'
|
||||
},
|
||||
{
|
||||
title: '品牌型号',
|
||||
align: "center",
|
||||
dataIndex: 'brandType'
|
||||
},
|
||||
{
|
||||
title: '生产厂家',
|
||||
align: "center",
|
||||
dataIndex: 'manufacturer'
|
||||
},
|
||||
{
|
||||
title: '采购单位',
|
||||
align: "center",
|
||||
dataIndex: 'wlUnits',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '采购价格',
|
||||
align: "center",
|
||||
dataIndex: 'procurementPrice',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '销售价格',
|
||||
align: "center",
|
||||
dataIndex: 'arrivalPrice',
|
||||
width: 100,
|
||||
// 设置表头为红色
|
||||
customHeaderCell: () => ({
|
||||
style: {
|
||||
color: '#f5222d', // 红色字体
|
||||
fontWeight: 600, // 加粗
|
||||
backgroundColor: '#f5f5f5' // 可选:背景色
|
||||
}
|
||||
}),
|
||||
customRender: ({ text }) => {
|
||||
return {
|
||||
children: text,
|
||||
props: {
|
||||
style: { color: '#f5222d' } // 红色
|
||||
}
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '采购数量',
|
||||
align: "center",
|
||||
dataIndex: 'purchaseQuantity',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: "center",
|
||||
dataIndex: 'action',
|
||||
width: 80
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
//列表数据
|
||||
export const rkcolumnsDetail: BasicColumn[] = [
|
||||
{
|
||||
title: '物料编码',
|
||||
align: "center",
|
||||
dataIndex: 'wlMaterialNo',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '物料名称',
|
||||
align: "center",
|
||||
dataIndex: 'wlName'
|
||||
},
|
||||
{
|
||||
title: '规格型号',
|
||||
align: "center",
|
||||
dataIndex: 'wlSpecificationModel'
|
||||
},
|
||||
{
|
||||
title: '品牌型号',
|
||||
align: "center",
|
||||
dataIndex: 'brandType'
|
||||
},
|
||||
{
|
||||
title: '生产厂家',
|
||||
align: "center",
|
||||
dataIndex: 'manufacturer'
|
||||
},
|
||||
{
|
||||
title: '采购单位',
|
||||
align: "center",
|
||||
dataIndex: 'wlUnits',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '采购价格',
|
||||
align: "center",
|
||||
dataIndex: 'procurementPrice',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '销售价格',
|
||||
align: "center",
|
||||
dataIndex: 'arrivalPrice',
|
||||
width: 100,
|
||||
// 设置表头为红色
|
||||
customHeaderCell: () => ({
|
||||
style: {
|
||||
color: '#f5222d', // 红色字体
|
||||
fontWeight: 600, // 加粗
|
||||
backgroundColor: '#f5f5f5' // 可选:背景色
|
||||
}
|
||||
}),
|
||||
customRender: ({ text }) => {
|
||||
return {
|
||||
children: text,
|
||||
props: {
|
||||
style: { color: '#f5222d' } // 红色
|
||||
}
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '采购数量',
|
||||
align: "center",
|
||||
dataIndex: 'purchaseQuantity',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '入库数量',
|
||||
align: "center",
|
||||
dataIndex: 'rksl',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '挂账数量',
|
||||
align: "center",
|
||||
dataIndex: 'wrksl',
|
||||
width: 110
|
||||
},
|
||||
{
|
||||
title: '销账数量',
|
||||
align: "center",
|
||||
dataIndex: 'xzsl',
|
||||
width: 90
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
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',},
|
||||
};
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/cgd/nuInvoicingCgdMain/list',
|
||||
calcList = '/cgd/nuInvoicingCgdMain/calcList',
|
||||
save='/cgd/nuInvoicingCgdMain/add',
|
||||
edit='/cgd/nuInvoicingCgdMain/edit',
|
||||
editArrivalPrice='/cgd/nuInvoicingCgdMain/editArrivalPrice',
|
||||
deleteOne = '/cgd/nuInvoicingCgdMain/delete',
|
||||
deleteBatch = '/cgd/nuInvoicingCgdMain/deleteBatch',
|
||||
importExcel = '/cgd/nuInvoicingCgdMain/importExcel',
|
||||
exportXls = '/cgd/nuInvoicingCgdMain/exportXls',
|
||||
auditInfo='/cgd/nuInvoicingCgdMain/auditInfo',
|
||||
rukuInfo='/cgd/nuInvoicingCgdMain/rukuInfo',
|
||||
queryCgdList='/api/suppliers/queryCgdList',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出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
|
||||
*/
|
||||
export const calcList = (params) => defHttp.get({ url: Api.calcList, params });
|
||||
export const queryCgdList = (params) => defHttp.get({ url: Api.queryCgdList, 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 });
|
||||
}
|
||||
// 采购单入库
|
||||
export const rukuInfo = (params, isUpdate) => {
|
||||
let url = Api.rukuInfo;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
||||
export const editArrivalPrice = (params, isUpdate) => {
|
||||
let url = Api.editArrivalPrice;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
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',
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
title: '机构名称',
|
||||
align: "center",
|
||||
dataIndex: 'departName'
|
||||
},
|
||||
{
|
||||
title: '采购日期',
|
||||
align: "center",
|
||||
dataIndex: 'qgDate',
|
||||
customRender:({text}) =>{
|
||||
text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
|
||||
return text;
|
||||
},
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '采购人',
|
||||
align: "center",
|
||||
dataIndex: 'qgBy',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
align: "center",
|
||||
dataIndex: 'qgTel',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '采购金额',
|
||||
align: "center",
|
||||
dataIndex: 'totalPrice',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '订单状态',
|
||||
align: "center",
|
||||
dataIndex: 'status_dictText',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '挂账状态',
|
||||
align: "center",
|
||||
dataIndex: 'izGuazhang',
|
||||
width: 90,
|
||||
customRender:({text}) =>{
|
||||
return text=='N' ? "否" : "是";
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '是否确认',
|
||||
align: "center",
|
||||
dataIndex: 'izGysConfirmed',
|
||||
width: 90,
|
||||
customRender:({text}) =>{
|
||||
return text=='N' ? "否" : "是";
|
||||
}
|
||||
},
|
||||
// {
|
||||
// title: '采购单类型',
|
||||
// align: "center",
|
||||
// dataIndex: 'cgdType_dictText',
|
||||
// width: 120
|
||||
// },
|
||||
// {
|
||||
// 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',},
|
||||
};
|
||||
|
|
@ -0,0 +1,202 @@
|
|||
<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">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
</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>
|
||||
<!-- 入库单 -->
|
||||
<NuInvoicingCgdRkdModal ref="rkdModal" @success="handleSuccess"></NuInvoicingCgdRkdModal>
|
||||
<!-- 详情 -->
|
||||
<NuInvoicingCgdDetailModal ref="detailModal" @success="handleSuccess"></NuInvoicingCgdDetailModal>
|
||||
</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 { queryCgdList } from './NuInvoicingCgdMain.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import NuInvoicingCgdMainModal from './components/NuInvoicingCgdMainModal.vue'
|
||||
import NuInvoicingCgdRkdModal from './components/NuInvoicingCgdRkdModal.vue'
|
||||
import NuInvoicingCgdDetailModal from './components/NuInvoicingCgdDetailModal.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 rkdModal = ref();
|
||||
const detailModal = ref();
|
||||
const gwcModal = ref();
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'nu_invoicing_cgd_main',
|
||||
api: queryCgdList,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
});
|
||||
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,
|
||||
});
|
||||
|
||||
/**
|
||||
* 入库单
|
||||
*/
|
||||
function handleRkd(record: Recordable) {
|
||||
rkdModal.value.disableSubmit = false;
|
||||
rkdModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
detailModal.value.disableSubmit = true;
|
||||
detailModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
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: handleRkd.bind(null, record),
|
||||
ifShow: record.izGysConfirmed == 'N'
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
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>
|
||||
|
|
@ -0,0 +1,259 @@
|
|||
<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.gysName" id="NuInvoicingCgdMainForm-gysName" name="gysName">
|
||||
<span>{{formData.gysName}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="机构地址" v-bind="validateInfos.comRegisterAddress" id="NuInvoicingCgdMainForm-comRegisterAddress" name="comRegisterAddress">
|
||||
<span>{{formData.comRegisterAddress}}</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.qgTel" id="NuInvoicingCgdMainForm-qgTel" name="qgTel">
|
||||
<span>{{formData.qgTel}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
<a-table
|
||||
:columns="rkcolumnsDetail"
|
||||
row-key="id"
|
||||
:data-source="dataSource"
|
||||
:pagination="false"
|
||||
>
|
||||
<template #bodyCell="{ column, text ,record }">
|
||||
</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 { rukuInfo } from '../NuInvoicingCgdMain.api';
|
||||
import { rkcolumnsDetail } 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: '',
|
||||
gysName:'',
|
||||
qgTel:'',
|
||||
departName:'',
|
||||
comRegisterAddress:'',
|
||||
status_dictText:'',
|
||||
cgdType_dictText:'',
|
||||
gysFkfs_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({
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
const handleInputChange = (record, field, value) => {
|
||||
// 更新当前行的数据
|
||||
record[field] = value;
|
||||
|
||||
var b = record.purchaseQuantity - value;
|
||||
if(b<0){
|
||||
record.wrksl = 0;
|
||||
record.rksl = record.purchaseQuantity;
|
||||
return;
|
||||
}
|
||||
record.wrksl = b;
|
||||
// 如果是修改了 rksl,则 wrksl 会自动更新,因为它是计算属性
|
||||
// 如果需要强制更新视图,可以使用以下方法:
|
||||
|
||||
// 方法1:使用 Vue 的强制更新(不推荐常规使用)
|
||||
// this.$forceUpdate();
|
||||
|
||||
// 方法2:更好的方式是更新整个 dataSource(推荐)
|
||||
const index = dataSource.value.findIndex(item => item.id === record.id);
|
||||
if (index !== -1) {
|
||||
dataSource.value[index] = { ...record };
|
||||
dataSource.value = [...dataSource.value]; // 创建新数组触发响应式更新
|
||||
}
|
||||
};
|
||||
const handleRkslChange = (record, field, value) => {
|
||||
// 更新当前行的数据
|
||||
record[field] = value;
|
||||
|
||||
// // 方法2:更好的方式是更新整个 dataSource(推荐)
|
||||
// const index = dataSource.value.findIndex(item => item.id === record.id);
|
||||
// if (index !== -1) {
|
||||
// dataSource.value[index] = { ...record };
|
||||
// dataSource.value = [...dataSource.value]; // 创建新数组触发响应式更新
|
||||
// }
|
||||
};
|
||||
// 表单禁用
|
||||
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);
|
||||
|
||||
getCgdInfoList();
|
||||
});
|
||||
}
|
||||
|
||||
function getCgdInfoList() {
|
||||
defHttp.get({ url: '/api/suppliers/queryCgdInfoList', params: { cgdId: formData.id,pageSize:-1 } }).then((res) => {
|
||||
console.log("🚀 ~ queryCgdInfoList ~ 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)
|
||||
model.cgdInfoList = dataSource.value;
|
||||
await rukuInfo(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>
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<template>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<NuInvoicingCgdDetailForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuInvoicingCgdDetailForm>
|
||||
<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 NuInvoicingCgdDetailForm from './NuInvoicingCgdDetailForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<string>('90%');
|
||||
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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,197 @@
|
|||
<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.wlName" id="NuInvoicingCgdMainForm-wlName" name="wlName">
|
||||
<span>{{formData.wlName}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="物料编码" v-bind="validateInfos.wlMaterialNo" id="NuInvoicingCgdMainForm-wlMaterialNo" name="wlMaterialNo">
|
||||
<span>{{formData.wlMaterialNo}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="规格型号" v-bind="validateInfos.wlSpecificationModel" id="NuInvoicingCgdMainForm-wlSpecificationModel" name="wlSpecificationModel">
|
||||
<span>{{formData.wlSpecificationModel}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="品牌型号" v-bind="validateInfos.brandType" id="NuInvoicingCgdMainForm-brandType" name="brandType">
|
||||
<span>{{formData.brandType}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="生产厂家" v-bind="validateInfos.manufacturer" id="NuInvoicingCgdMainForm-manufacturer" name="manufacturer">
|
||||
<span>{{formData.manufacturer}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="采购数量" v-bind="validateInfos.purchaseQuantity" id="NuInvoicingCgdMainForm-purchaseQuantity" name="purchaseQuantity">
|
||||
<span>{{formData.purchaseQuantity}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="采购价格" v-bind="validateInfos.procurementPrice" id="NuInvoicingCgdMainForm-procurementPrice" name="procurementPrice">
|
||||
<span>{{formData.procurementPrice}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="销售价格" v-bind="validateInfos.arrivalPrice" id="NuInvoicingCgdMainForm-arrivalPrice" name="arrivalPrice">
|
||||
<a-input-number v-model:value="formData.arrivalPrice" max="9999.99"></a-input-number>
|
||||
</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 JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { editArrivalPrice } from '../NuInvoicingCgdMain.api';
|
||||
import { rkcolumns } 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: '',
|
||||
nuId:'',
|
||||
cgdId:'',
|
||||
wlId:'',
|
||||
wlName:'',
|
||||
wlMaterialNo:'',
|
||||
wlSpecificationModel:'',
|
||||
wlUnits:'',
|
||||
procurementPrice:undefined,
|
||||
purchaseQuantity:undefined,
|
||||
manufacturer:'',
|
||||
brandType:'',
|
||||
arrivalPrice: undefined,
|
||||
wrksl: undefined,
|
||||
xzsl: undefined,
|
||||
rksl: '',
|
||||
jhId:'',
|
||||
jhNum:'',
|
||||
jhType: 0,
|
||||
yrksl: 0,
|
||||
|
||||
});
|
||||
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({
|
||||
});
|
||||
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 handleChange(value){
|
||||
var rksl = value;
|
||||
var purchaseQuantity = formData.purchaseQuantity;
|
||||
var xzsl = formData.xzsl;
|
||||
var wrksl = parseInt(purchaseQuantity) - parseInt(rksl) - parseInt(xzsl);
|
||||
if(wrksl<0){
|
||||
wrksl = 0;
|
||||
rksl = purchaseQuantity - xzsl;
|
||||
}
|
||||
formData.rksl = rksl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
console.log("🚀 ~ edit ~ record:", record)
|
||||
var purchaseQuantity = record.purchaseQuantity;
|
||||
record.yrksl = record.rksl;
|
||||
var xzsl = record.xzsl;
|
||||
var rksl = record.wrksl == 0 ? purchaseQuantity - xzsl : record.wrksl;
|
||||
record.rksl = rksl;
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
var params = {id:formData.id, arrivalPrice:formData.arrivalPrice};
|
||||
defHttp.post({
|
||||
url:'/api/suppliers/editArrivalPrice',
|
||||
params
|
||||
}).then((res) => {
|
||||
console.log("🚀 ~ submitForm ~ res:", res)
|
||||
emit('ok');
|
||||
// if (res.status == '1') {
|
||||
// createMessage.success("操作成功");
|
||||
// emit('ok');
|
||||
// } else {
|
||||
// createMessage.error(res.message);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<template>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<NuInvoicingCgdJhForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuInvoicingCgdJhForm>
|
||||
<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 NuInvoicingCgdJhForm from './NuInvoicingCgdJhForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<string>('90%');
|
||||
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() {
|
||||
console.log("🚀 ~ submitCallback ~ 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>
|
||||
|
|
@ -0,0 +1,309 @@
|
|||
<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, record }">
|
||||
|
||||
<template v-if="column.dataIndex === 'purchaseQuantity'">
|
||||
<a-input-number :value="text" placeholder="采购数量" min="0" max="999" @change="(value) => handleQgslChange(record, 'purchaseQuantity', value)" />
|
||||
</template>
|
||||
</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;
|
||||
});
|
||||
|
||||
|
||||
const handleQgslChange = (record, field, value) => {
|
||||
// 更新当前行的数据
|
||||
record[field] = value;
|
||||
if(!value){
|
||||
record[field] = 0;
|
||||
}
|
||||
if(parseInt(record.wlUpperLimit) < value){
|
||||
record[field] = record.wlUpperLimit;
|
||||
}
|
||||
|
||||
// 方法2:更好的方式是更新整个 dataSource(推荐)
|
||||
const index = dataSource.value.findIndex(item => item.id === record.id);
|
||||
if (index !== -1) {
|
||||
dataSource.value[index] = { ...record };
|
||||
dataSource.value = [...dataSource.value]; // 创建新数组触发响应式更新
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
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'
|
||||
}
|
||||
model.cgdInfoList = dataSource.value;
|
||||
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>
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<template>
|
||||
|
||||
<a-drawer :title="title" :width="width" 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<string>('90%');
|
||||
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>
|
||||
|
|
@ -0,0 +1,224 @@
|
|||
<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.gysName" id="NuInvoicingCgdMainForm-gysName" name="gysName">
|
||||
<span>{{formData.gysName}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="机构地址" v-bind="validateInfos.comRegisterAddress" id="NuInvoicingCgdMainForm-comRegisterAddress" name="comRegisterAddress">
|
||||
<span>{{formData.comRegisterAddress}}</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.qgTel" id="NuInvoicingCgdMainForm-qgTel" name="qgTel">
|
||||
<span>{{formData.qgTel}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <a-col :span="8">
|
||||
<a-form-item label="供应商" v-bind="validateInfos.gysName" id="NuInvoicingCgdMainForm-gysName" name="gysName">
|
||||
<span>{{formData.gysName}}</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="24">
|
||||
<a-form-item label="随行单" v-bind="validateInfos.sxdPath" id="NuInvoicingCgdMainForm-sxdPath" name="sxdPath" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
|
||||
<j-image-upload :fileMax="0" v-model:value="formData.sxdPath" ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
<a-table
|
||||
:columns="rkcolumns"
|
||||
row-key="id"
|
||||
:data-source="dataSource"
|
||||
:pagination="false"
|
||||
>
|
||||
<!-- :loading="loading"
|
||||
@change="handleTableChange" -->
|
||||
<template #bodyCell="{ column, text ,record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<a @click="handleJianhuo(record)" >改价</a>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
<NuInvoicingCgdJhModal ref="jhModal" @success="handleJhOk"></NuInvoicingCgdJhModal>
|
||||
</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 { rukuInfo } from '../NuInvoicingCgdMain.api';
|
||||
import { rkcolumns } 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 NuInvoicingCgdJhModal from '/@/views/invoicing/cgd/components/NuInvoicingCgdJhModal.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 jhModal = 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: '',
|
||||
gysName:'',
|
||||
qgTel:'',
|
||||
departName:'',
|
||||
comRegisterAddress:'',
|
||||
status_dictText:'',
|
||||
cgdType_dictText:'',
|
||||
gysFkfs_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({
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
|
||||
function handleJhOk(){
|
||||
getCgdInfoList();
|
||||
}
|
||||
function handleJianhuo(record){
|
||||
console.log("🚀 ~ handleJianhuo ~ record:", record)
|
||||
jhModal.value.disableSubmit = false;
|
||||
jhModal.value.edit(record);
|
||||
}
|
||||
// 表单禁用
|
||||
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) {
|
||||
console.log("🚀 ~ edit ~ record:", record)
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
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() {
|
||||
let model = formData;
|
||||
defHttp.post({ url: '/api/suppliers/cgdQueren', params: model }).then((res) => {
|
||||
emit('ok');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
<template>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<NuInvoicingCgdRkdForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuInvoicingCgdRkdForm>
|
||||
<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 NuInvoicingCgdRkdForm from './NuInvoicingCgdRkdForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<string>('90%');
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
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() {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认单据',
|
||||
content: '是否确认单据,确认后不可修改',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
registerForm.value.submitForm();
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
emit('success');
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
Loading…
Reference in New Issue