Compare commits

...

2 Commits

23 changed files with 1431 additions and 102 deletions

View File

@ -6,12 +6,12 @@ import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '货品名称',
title: '物料名称',
align: "center",
dataIndex: 'materialName'
},
{
title: '货品编码',
title: '物料编码',
align: "center",
dataIndex: 'materialNo',
width:'100px'
@ -34,7 +34,7 @@ export const columns: BasicColumn[] = [
width:'100px'
},
{
title: '货品单位',
title: '物料单位',
align: "center",
dataIndex: 'materialUnits',
width:'100px'
@ -88,12 +88,12 @@ export const superQuerySchema = {
categoryId: {title: '一级分类',order: 0,view: 'radio', type: 'string',dictTable: "nu_config_material_category", dictCode: 'id', dictText: 'category_name',},
typeId: {title: '二级分类',order: 1,view: 'radio', type: 'string',dictTable: "nu_config_material_type", dictCode: 'id', dictText: 'type_name',},
medicationId: {title: '三级分类',order: 2,view: 'radio', type: 'string',dictTable: "nu_config_material_medication", dictCode: 'id', dictText: 'medication_name',},
materialName: {title: '货品名称',order: 3,view: 'text', type: 'string',},
materialNo: {title: '货品编码',order: 4,view: 'text', type: 'string',},
materialName: {title: '物料名称',order: 3,view: 'text', type: 'string',},
materialNo: {title: '物料编码',order: 4,view: 'text', type: 'string',},
specificationModel: {title: '规格型号',order: 5,view: 'text', type: 'string',},
salesUnitPrice: {title: '销售单价',order: 6,view: 'number', type: 'number',},
referenceUnitPrice: {title: '参考单价',order: 7,view: 'number', type: 'number',},
materialUnits: {title: '货品单位',order: 8,view: 'text', type: 'string',},
materialUnits: {title: '物料单位',order: 8,view: 'text', type: 'string',},
multiUnitSwitch: {title: '多单位开关',order: 9,view: 'switch', type: 'string',},
oneUnit: {title: '父级单位',order: 10,view: 'text', type: 'string',},
oneUnitProportion: {title: '父级单位兑换比例',order: 11,view: 'number', type: 'number',},

View File

@ -7,14 +7,14 @@
<a-row :gutter="24">
<a-col :lg="5">
<a-form-item name="materialName">
<template #label><span title="货品名称">货品名称</span></template>
<j-input placeholder="请输入货品名称" v-model:value="queryParam.materialName" allow-clear></j-input>
<template #label><span title="物料名称">物料名称</span></template>
<j-input placeholder="请输入物料名称" v-model:value="queryParam.materialName" allow-clear></j-input>
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="materialNo">
<template #label><span title="货品编码">货品编码</span></template>
<j-input placeholder="请输入货品编码" v-model:value="queryParam.materialNo" allow-clear></j-input>
<template #label><span title="物料编码">物料编码</span></template>
<j-input placeholder="请输入物料编码" v-model:value="queryParam.materialNo" allow-clear></j-input>
</a-form-item>
</a-col>
<a-col :lg="5">

View File

@ -20,13 +20,13 @@
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="货品名称" v-bind="validateInfos.materialName" id="ConfigMaterialInfoForm-materialName" name="materialName">
<a-input v-model:value="formData.materialName" placeholder="请输入货品名称" maxlength="20" allow-clear ></a-input>
<a-form-item label="物料名称" v-bind="validateInfos.materialName" id="ConfigMaterialInfoForm-materialName" name="materialName">
<a-input v-model:value="formData.materialName" placeholder="请输入物料名称" maxlength="20" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="货品编码" v-bind="validateInfos.materialNo" id="ConfigMaterialInfoForm-materialNo" name="materialNo">
<a-input v-model:value="formData.materialNo" placeholder="请输入货品编码" maxlength="20" allow-clear ></a-input>
<a-form-item label="物料编码" v-bind="validateInfos.materialNo" id="ConfigMaterialInfoForm-materialNo" name="materialNo">
<a-input v-model:value="formData.materialNo" placeholder="请输入物料编码" maxlength="20" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
@ -86,7 +86,7 @@
</a-col>
<a-col :span="8">
<a-form-item label="三级单位" v-bind="validateInfos.materialUnits" id="ConfigMaterialInfoForm-materialUnits" name="materialUnits">
<a-input v-model:value="formData.materialUnits" placeholder="请输入货品单位" maxlength="10" allow-clear ></a-input>
<a-input v-model:value="formData.materialUnits" placeholder="请输入物料单位" maxlength="10" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8" >
@ -188,10 +188,10 @@
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
materialName: [{ required: true, message: '请输入货品名称!'},],
materialName: [{ required: true, message: '请输入物料名称!'},],
salesUnitPrice: [{ required: true, message: '请输入销售单价!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
referenceUnitPrice: [{ required: true, message: '请输入参考单价!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
materialUnits: [{ required: true, message: '请输入货品单位!'}],
materialUnits: [{ required: true, message: '请输入物料单位!'}],
suppliers: [{ required: true, message: '请选择供应商!'},],
upperLimit: [{ required: false, message: '请输入物料上限!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
lowerLimit: [{ required: false, message: '请输入物料下限!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],

View File

@ -5,8 +5,8 @@
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="ConfigMaterialInfoForm">
<a-row>
<a-col :span="24">
<a-form-item label="货品名称" v-bind="validateInfos.materialName" id="ConfigMaterialInfoForm-materialName" name="materialName">
<a-input v-model:value="formData.materialName" placeholder="请输入货品名称" maxlength="20" allow-clear disabled ></a-input>
<a-form-item label="物料名称" v-bind="validateInfos.materialName" id="ConfigMaterialInfoForm-materialName" name="materialName">
<a-input v-model:value="formData.materialName" placeholder="请输入物料名称" maxlength="20" allow-clear disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="24" >

View File

@ -34,10 +34,10 @@
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<BasicTable @register="registerTable">
<!--插槽: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: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">
@ -52,7 +52,7 @@
<a-button v-auth="'cgd:nu_invoicing_cgd_main:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</a-dropdown> -->
</template>
<!--操作栏-->
<template #action="{ record }">

View File

@ -12,13 +12,13 @@ export const columns: BasicColumn[] = [
width:'140px'
},
{
title: '货品名称',
title: '物料名称',
align: "center",
dataIndex: 'materialName',
width:'180px'
},
{
title: '货品编码',
title: '物料编码',
align: "center",
dataIndex: 'materialNo',
width:'100px'
@ -84,12 +84,12 @@ export const superQuerySchema = {
categoryId: {title: '一级分类',order: 0,view: 'radio', type: 'string',dictTable: "nu_config_material_category", dictCode: 'id', dictText: 'category_name',},
typeId: {title: '二级分类',order: 1,view: 'radio', type: 'string',dictTable: "nu_config_material_type", dictCode: 'id', dictText: 'type_name',},
medicationId: {title: '三级分类',order: 2,view: 'radio', type: 'string',dictTable: "nu_config_material_medication", dictCode: 'id', dictText: 'medication_name',},
materialName: {title: '货品名称',order: 3,view: 'text', type: 'string',},
materialNo: {title: '货品编码',order: 4,view: 'text', type: 'string',},
materialName: {title: '物料名称',order: 3,view: 'text', type: 'string',},
materialNo: {title: '物料编码',order: 4,view: 'text', type: 'string',},
specificationModel: {title: '规格型号',order: 5,view: 'text', type: 'string',},
salesUnitPrice: {title: '销售单价',order: 6,view: 'number', type: 'number',},
referenceUnitPrice: {title: '参考单价',order: 7,view: 'number', type: 'number',},
materialUnits: {title: '货品单位',order: 8,view: 'text', type: 'string',},
materialUnits: {title: '物料单位',order: 8,view: 'text', type: 'string',},
multiUnitSwitch: {title: '多单位开关',order: 9,view: 'switch', type: 'string',},
oneUnit: {title: '父级单位',order: 10,view: 'text', type: 'string',},
oneUnitProportion: {title: '父级单位兑换比例',order: 11,view: 'number', type: 'number',},
@ -109,21 +109,21 @@ export const superQuerySchema = {
//列表数据
export const columnsQgcList: BasicColumn[] = [
{
title: '货品名称',
title: '物料名称',
align: "center",
dataIndex: 'wlName'
},
{
title: '货品编码',
title: '物料编码',
align: "center",
dataIndex: 'wlMaterialNo',
width:'100px'
width:'140px'
},
{
title: '请购数量',
align: "center",
dataIndex: 'purchaseQuantity',
width:'100px'
width:'140px'
},
{
title: '规格型号',
@ -131,11 +131,17 @@ export const columnsQgcList: BasicColumn[] = [
dataIndex: 'wlSpecificationModel'
},
{
title: '货品单位',
title: '物料单位',
align: "center",
dataIndex: 'wlUnits',
width:'100px'
},
{
title: '库存数量',
align: "center",
dataIndex: 'kcsl',
width:'100px'
},
{
title: '上限',
align: "center",
@ -152,6 +158,6 @@ export const columnsQgcList: BasicColumn[] = [
title: '供应商',
align: "center",
dataIndex: 'suppliersName',
width:'200px'
width:'280px'
},
];

View File

@ -5,27 +5,9 @@
<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="materialName">
<template #label><span title="货品名称">货品名称</span></template>
<j-input placeholder="请输入货品名称" v-model:value="queryParam.materialName" allow-clear ></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="materialNo">
<template #label><span title="货品编码">货品编码</span></template>
<j-input placeholder="请输入货品编码" v-model:value="queryParam.materialNo" allow-clear ></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="pinyin">
<template #label><span title="拼音检索">拼音检索</span></template>
<j-input placeholder="请输入拼音" v-model:value="queryParam.pinyin" allow-clear ></j-input>
</a-form-item>
</a-col>
<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 name="wlParamInfo">
<template #label><span title="物料信息">物料信息</span></template>
<a-input placeholder="请输入物料信息" v-model:value="queryParam.wlParamInfo" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
@ -61,7 +43,7 @@
<!-- 表单区域 -->
<QgdInfoModal ref="registerModal" @success="handleSuccess"></QgdInfoModal>
<a-drawer title="请购车" width="60vw" :open="qgcOpen" @close="onQgcClose">
<a-drawer title="请购车" width="80vw" :open="qgcOpen" @close="onQgcClose" bodyStyle="padding: 14px;">
<template #footer>
<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>
@ -93,7 +75,7 @@ import type { CollapseProps } from 'ant-design-vue';
const formRef = ref();
const qgcModal = ref();
const queryParam = reactive<any>({});
const queryParam = reactive<any>({izEnabled:'0'});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const qgcOpen = ref(false)//

View File

@ -1,33 +1,15 @@
<template>
<div class="p-2">
<div>
<!--查询区域-->
<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="materialName">
<template #label><span title="货品名称">货品名称</span></template>
<j-input placeholder="请输入货品名称" v-model:value="queryParam.materialName" allow-clear ></j-input>
<a-form-item name="wlParamInfo">
<template #label><span title="物料信息">物料信息</span></template>
<a-input placeholder="请输入物料信息" v-model:value="queryParam.wlParamInfo" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="materialNo">
<template #label><span title="货品编码">货品编码</span></template>
<j-input placeholder="请输入货品编码" v-model:value="queryParam.materialNo" allow-clear ></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="pinyin">
<template #label><span title="拼音检索">拼音检索</span></template>
<j-input placeholder="请输入拼音" v-model:value="queryParam.pinyin" allow-clear ></j-input>
</a-form-item>
</a-col>
<!-- <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 :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
@ -49,8 +31,13 @@
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
<template v-if="column.dataIndex === 'purchaseQuantity'">
<!-- <a-input :value="text" placeholder="请输入请购数量" min="1" max="999" @change="(value) => handleInputChange(record, 'purchaseQuantity', value)"/> -->
<a-input-number :value="text" placeholder="请输入请购数量" min="1" max="999" @change="(value) => handleInputChange(record, 'purchaseQuantity', value)" />
</template>
</template>
</BasicTable>
</div>
</template>
@ -65,6 +52,7 @@
import { JInput } from '/@/components/Form';
import { DownOutlined } from '@ant-design/icons-vue';
import { defHttp } from '/@/utils/http/axios';
import QgdInfoModal from '/@/views/invoicing/jxc/components/QgdInfoModal.vue'
const formRef = ref();
@ -104,15 +92,20 @@ import { defHttp } from '/@/utils/http/axios';
sm: 16,
});
/**
* 请购事件
*/
function handleAddQg(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
//
const handleInputChange = (record, field, value) => {
console.log("🚀 ~ handleInputChange ~ record, field, value:", record, field, value)
//
if(parseInt(value) > parseInt(record.wlUpperLimit) - parseInt(record.kcsl)){
record[field] = parseInt(record.wlUpperLimit) - parseInt(record.kcsl);
}else{
record[field] = value;
}
defHttp.post({url:'/invoicing/qgdInfo/editQgdInfo',params:record}).then(res=>{
})
};
/**
* 删除事件
*/
@ -131,10 +124,6 @@ import { defHttp } from '/@/utils/http/axios';
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleAddQg.bind(null, record),
},
{
label: '删除',
onClick: handleDelete.bind(null, record),

View File

@ -125,10 +125,10 @@
const validatorRules = reactive({
categoryId: [{ required: true, message: '请选择一级分类!'},],
typeId: [{ required: true, message: '请选择二级分类!'},],
materialName: [{ required: true, message: '请输入货品名称!'},],
materialName: [{ required: true, message: '请输入物料名称!'},],
salesUnitPrice: [{ required: true, message: '请输入销售单价!'},],
referenceUnitPrice: [{ required: true, message: '请输入参考单价!'},],
materialUnits: [{ required: true, message: '请输入货品单位!'},],
materialUnits: [{ required: true, message: '请输入物料单位!'},],
suppliers: [{ required: true, message: '请选择供应商!'},],
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });

View File

@ -11,6 +11,7 @@ enum Api {
deleteBatch = '/invoicing/blWarehouseMaterialInfo/deleteBatch',
importExcel = '/invoicing/blWarehouseMaterialInfo/importExcel',
exportXls = '/invoicing/blWarehouseMaterialInfo/exportXls',
getConfiguredList = '/invoicing/configMaterialInfo/getConfiguredList',
}
/**
@ -29,6 +30,11 @@ export const getImportUrl = Api.importExcel;
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
*/
export const getConfiguredList = (params) => defHttp.get({ url: Api.getConfiguredList, params });
/**
*

View File

@ -51,6 +51,88 @@ export const columns: BasicColumn[] = [
},
];
export const columns2: BasicColumn[] = [
{
title: '物料',
align: "center",
dataIndex: 'materialName'
},
{
title: '物料编码',
align: "center",
dataIndex: 'materialNo'
},
{
title: '规格型号',
align: "center",
dataIndex: 'specificationModel'
},
{
title: '一级分类',
align: "center",
dataIndex: 'categoryId_dictText'
},
{
title: '二级分类',
align: "center",
dataIndex: 'typeId_dictText'
},
{
title: '三级分类',
align: "center",
dataIndex: 'medicationId_dictText'
},
{
title: '物料上限',
align: "center",
dataIndex: 'upperLimit',
},
{
title: '物料下限',
align: "center",
dataIndex: 'lowerLimit',
},
{
title: '操作',
align: "center",
dataIndex: 'action',
},
];
export const columns3: BasicColumn[] = [
{
title: '物料',
align: "center",
dataIndex: 'materialName'
},
{
title: '物料编码',
align: "center",
dataIndex: 'materialNo'
},
{
title: '规格型号',
align: "center",
dataIndex: 'specificationModel'
},
{
title: '一级分类',
align: "center",
dataIndex: 'categoryId_dictText'
},
{
title: '二级分类',
align: "center",
dataIndex: 'typeId_dictText'
},
{
title: '三级分类',
align: "center",
dataIndex: 'medicationId_dictText'
},
];
// 高级查询数据
export const superQuerySchema = {
nuId: {title: '库房',order: 0,view: 'list', type: 'string',dictTable: "nu_base_info", dictCode: 'nu_id', dictText: 'nu_name',},

View File

@ -7,13 +7,13 @@
<a-col :lg="6">
<a-form-item name="nuId">
<template #label><span title="库房">库房</span></template>
<j-dict-select-tag type='list' placeholder="请选择是否启用" v-model:value="queryParam.nuId" dictCode="nu_base_info,nu_name,nu_id,area_flag = '3'" allow-clear />
<j-dict-select-tag type='list' placeholder="请选择库房" v-model:value="queryParam.nuId" dictCode="nu_base_info,nu_name,nu_id,area_flag = '3'" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="wlId">
<template #label><span title="物料">物料</span></template>
<j-input placeholder="请填写物料" v-model:value="queryParam.wlName" allow-clear></j-input>
<a-form-item name="wlParamInfo">
<template #label><span title="物料信息">物料信息</span></template>
<a-input placeholder="请填写物料信息" v-model:value="queryParam.wlParamInfo" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
@ -42,6 +42,9 @@
</BasicTable>
<!-- 表单区域 -->
<BlWarehouseMaterialInfoModal ref="registerModal" @success="handleSuccess"></BlWarehouseMaterialInfoModal>
<BlWarehouseMaterialInfoAddModal ref="registerAddModal" @success="handleSuccess"></BlWarehouseMaterialInfoAddModal>
<!-- 出入库详情 -->
<NuWarehouseMaterialCrkInfoListModal ref="registerCrkModal" @success="handleSuccess"></NuWarehouseMaterialCrkInfoListModal>
</div>
</template>
@ -53,6 +56,8 @@
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BlWarehouseMaterialInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import BlWarehouseMaterialInfoModal from './components/BlWarehouseMaterialInfoModal.vue'
import BlWarehouseMaterialInfoAddModal from './components/BlWarehouseMaterialInfoAddModal.vue'
import NuWarehouseMaterialCrkInfoListModal from '/@/views/invoicing/warehouseMaterialInfo/NuWarehouseMaterialCrkInfoListModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
@ -63,6 +68,8 @@ import { defHttp } from '/@/utils/http/axios';
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerAddModal = ref();
const registerCrkModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
@ -119,8 +126,8 @@ import { defHttp } from '/@/utils/http/axios';
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
registerAddModal.value.disableSubmit = false;
registerAddModal.value.add();
}
/**
@ -138,6 +145,11 @@ import { defHttp } from '/@/utils/http/axios';
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
//
function handleCrkjl(record: Recordable) {
registerCrkModal.value.disableSubmit = true;
registerCrkModal.value.init(record);
}
/**
* 删除事件
@ -186,6 +198,10 @@ import { defHttp } from '/@/utils/http/axios';
auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit',
ifShow: record.izEnabled == '0'
},
{
label: '记录',
onClick: handleCrkjl.bind(null, record,'1'),
},
];
}
function handleQyty(record,izEnabled) {

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/nuWarehouseMaterialCrkInfo/list',
save='/cgd/nuWarehouseMaterialCrkInfo/add',
edit='/cgd/nuWarehouseMaterialCrkInfo/edit',
deleteOne = '/cgd/nuWarehouseMaterialCrkInfo/delete',
deleteBatch = '/cgd/nuWarehouseMaterialCrkInfo/deleteBatch',
importExcel = '/cgd/nuWarehouseMaterialCrkInfo/importExcel',
exportXls = '/cgd/nuWarehouseMaterialCrkInfo/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,63 @@
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: 'cgdId_dictText'
},
{
title: '库房',
align: "center",
dataIndex: 'nuId_dictText'
},
{
title: '物料',
align: "center",
dataIndex: 'wlId_dictText'
},
{
title: '操作前库存量',
align: "center",
dataIndex: 'czqkcl'
},
{
title: '出入库数量',
align: "center",
dataIndex: 'crkNum'
},
{
title: '当前库存量',
align: "center",
dataIndex: 'dqkcl'
},
{
title: '出入库类型',
align: "center",
dataIndex: 'crkType_dictText'
},
{
title: '备注',
align: "center",
dataIndex: 'content'
},
{
title: '操作时间',
align: "center",
dataIndex: 'createTime'
},
];
// 高级查询数据
export const superQuerySchema = {
cgdId: {title: '采购单',order: 0,view: 'list', type: 'string',dictTable: "nu_invoicing_cgd_main", dictCode: 'id', dictText: 'cgd_no',},
nuId: {title: '库房',order: 1,view: 'list', type: 'string',dictTable: "nu_base_info", dictCode: 'id', dictText: 'nu_name',},
wlId: {title: '物料',order: 2,view: 'list', type: 'string',dictTable: "nu_config_material_info", dictCode: 'id', dictText: 'material_name',},
crkNum: {title: '出入库数量',order: 3,view: 'text', type: 'string',},
crkType: {title: '出入库类型 1入库',order: 4,view: 'list', type: 'string',dictCode: 'crk_type',},
content: {title: '备注',order: 5,view: 'text', type: 'string',},
};

View File

@ -0,0 +1,227 @@
<template>
<div >
<!--查询区域-->
<!-- <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">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<NuWarehouseMaterialCrkInfoModal ref="registerModal" @success="handleSuccess"></NuWarehouseMaterialCrkInfoModal>
</div>
</template>
<script lang="ts" name="cgd-nuWarehouseMaterialCrkInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuWarehouseMaterialCrkInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuWarehouseMaterialCrkInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuWarehouseMaterialCrkInfoModal from './components/NuWarehouseMaterialCrkInfoModal.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: '库房物料出入库信息',
api: list,
columns,
canResize:false,
useSearchForm: false,
immediate: false,
showActionColumn: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "库房物料出入库信息",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
//
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_warehouse_material_crk_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_warehouse_material_crk_info:delete'
}
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
function init(record) {
queryParam.nuId = record.nuId;
queryParam.wlId = record.wlId;
reload();
}
defineExpose({
init,
});
</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,71 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<NuWarehouseMaterialCrkInfoList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuWarehouseMaterialCrkInfoList>
<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 NuWarehouseMaterialCrkInfoList from './NuWarehouseMaterialCrkInfoList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('80%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function init(record) {
title.value = '出入库详情' ;
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
init,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,204 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="BlWarehouseMaterialInfoForm">
<a-row>
<a-col :span="8">
<a-form-item label="库房" v-bind="validateInfos.nuId" id="BlWarehouseMaterialInfoForm-nuId" name="nuId" >
<j-dict-select-tag v-model:value="formData.nuId" dictCode="nu_base_info,nu_name,nu_id,area_flag = '3' and status != '5'" placeholder="请选择库房" :disabled="formData.id != ''" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-button @click="handleCheckWuliao">选择物料</a-button>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="物料" v-bind="validateInfos.wlId" id="BlWarehouseMaterialInfoForm-wlId" name="wlId" >
<j-select-multiple type="list_multi" v-model:value="formData.wlId" dictCode="nu_config_material_info,material_name,id,iz_enabled = '0' and del_flag = '0'" placeholder="请选择物料" :disabled="formData.id != ''" :triggerChange="false"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料上限" v-bind="validateInfos.upperLimit" id="BlWarehouseMaterialInfoForm-upperLimit" name="upperLimit">
<a-input v-model:value="formData.upperLimit" placeholder="请输入物料上限" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料下限" v-bind="validateInfos.lowerLimit" id="BlWarehouseMaterialInfoForm-lowerLimit" name="lowerLimit">
<a-input v-model:value="formData.lowerLimit" placeholder="请输入物料下限" ></a-input>
</a-form-item>
</a-col> -->
</a-row>
</a-form>
</template>
</JFormContainer>
<a-table
:columns="columns2"
:row-key="id"
:data-source="dataSource"
:pagination="false"
>
<template #bodyCell="{ column, text ,record }">
<template v-if="column.dataIndex === 'upperLimit'">
<a-input-number :value="text" placeholder="物料上限" min="0" max="999" @change="(value) => handleInputChange(record, 'arrivalPrice', value)" />
</template>
<template v-if="column.dataIndex === 'lowerLimit'">
<a-input-number :value="text" placeholder="物料上限" min="0" max="999" @change="(value) => handleInputChange(record, 'arrivalPrice', value)" />
</template>
<template v-if="column.dataIndex === 'action'">
<a @click="deleteWlxx(record)">删除</a>
</template>
</template>
</a-table>
<CheckWuliaoModal ref="checkWuliaoModal" @success="handleSuccess"/>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../BlWarehouseMaterialInfo.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import { columns2 } from '../BlWarehouseMaterialInfo.data';
import CheckWuliaoModal from './CheckWuliaoModal.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({})},
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const checkWuliaoModal = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const dataSource = ref([]);
const formData = reactive<Record<string, any>>({
id: '',
nuId: '',
wlId: '',
upperLimit: '',
lowerLimit: '',
});
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({
nuId: [{ required: true, message: '请选择库房!' },],
// wlId: [{ required: true, message: '!' },],
// upperLimit: [{ required: true, message: '!' },],
// lowerLimit: [{ required: true, message: '!' },],
});
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 handleInputChange = (record, field, value) => {
//
record[field] = value;
};
function handleCheckWuliao(){
var nuId = formData.nuId;
if(!nuId){
createMessage.warning('请选择库房!');
return;
}
var data = dataSource.value;
checkWuliaoModal.value.disableSubmit = false;
checkWuliaoModal.value.edit(data);
}
//
function handleSuccess(record){
for(let item of record){
dataSource.value.push(item)
}
}
//
function deleteWlxx(record){
var index = dataSource.value.indexOf(record);
if (index !== -1) {
dataSource.value.splice(index, 1);
}
}
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
dataSource.value = [];
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
var list = dataSource.value;
if(list.length == 0){
createMessage.warning('请选择物料!');
return;
}
var list2 = [];
for(let item of list){
var insParams = {}
insParams.nuId = formData.nuId;
insParams.wlId = item.id;
insParams.upperLimit = item.upperLimit;
insParams.lowerLimit = item.lowerLimit;
insParams.kcsl = '0';
list2.push(insParams);
}
defHttp.post({url:'/invoicing/blWarehouseMaterialInfo/addBatch',params:list2}).then(res=>{
console.log("🚀 ~ submitForm ~ res:", res)
emit('ok');
})
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,82 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<BlWarehouseMaterialInfoAddForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></BlWarehouseMaterialInfoAddForm>
<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 BlWarehouseMaterialInfoAddForm from './BlWarehouseMaterialInfoAddForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('80%');
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

@ -6,12 +6,12 @@
<a-row>
<a-col :span="24">
<a-form-item label="库房" v-bind="validateInfos.nuId" id="BlWarehouseMaterialInfoForm-nuId" name="nuId" >
<j-dict-select-tag v-model:value="formData.nuId" dictCode="nu_base_info,nu_name,nu_id,area_flag = '3' and status != '5'" placeholder="请选择库房" :disabled="formData.id != ''" />
<a-input v-model:value="formData.nuId_dictText" :disabled="formData.id != ''" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料" v-bind="validateInfos.wlId" id="BlWarehouseMaterialInfoForm-wlId" name="wlId" >
<j-select-multiple type="list_multi" v-model:value="formData.wlId" dictCode="nu_config_material_info,material_name,id,iz_enabled = '0' and del_flag = '0'" placeholder="请选择物料" :disabled="formData.id != ''" :triggerChange="false"/>
<a-input v-model:value="formData.wlId_dictText" :disabled="formData.id != ''" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
@ -55,6 +55,8 @@
wlId: '',
upperLimit: '',
lowerLimit: '',
wlId_dictText:'',
nuId_dictText:'',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
@ -62,8 +64,6 @@
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
nuId: [{ required: true, message: '请选择库房!' },],
wlId: [{ required: true, message: '请选择物料!' },],
upperLimit: [{ required: true, message: '请输入物料上限!' },],
lowerLimit: [{ required: true, message: '请输入物料下限!' },],
});

View File

@ -0,0 +1,187 @@
<template>
<div>
<!--查询区域-->
<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="paramWlxx">
<template #label><span title="物料信息">物料信息</span></template>
<a-input placeholder="请填写物料信息" v-model:value="queryParam.paramWlxx" allow-clear></a-input>
</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>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
</template>
<script lang="ts" name="materialInfo-nuConfigMaterialInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns3 } from '../BlWarehouseMaterialInfo.data';
import { getConfiguredList } from '../BlWarehouseMaterialInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import { defHttp } from '/@/utils/http/axios';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
const emit = defineEmits(['register', 'ok']);
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'nu_config_material_info',
api: getConfiguredList,
columns: columns3,
canResize:false,
useSearchForm: false,
immediate: false,
showActionColumn: false,
showTableSetting: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
async function edit(record) {
console.log("🚀 ~ edit ~ record:", record)
selectedRowKeys.value = [];
selectedRows.value = [];
var checkId = "";
for(let item of record){
checkId += item.id + ",";
}
if(checkId.length > 0){
checkId = checkId.substring(0,checkId.length - 1);
}
queryParam.checkId = checkId;
reload();
}
function submitForm() {
emit('ok',selectedRows.value);
}
defineExpose({
edit,
submitForm,
});
</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,83 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<CheckWuliaoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></CheckWuliaoForm>
<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 CheckWuliaoForm from './CheckWuliaoForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('80%');
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 = '选择物料';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(record) {
console.log("🚀 11111~ submitCallback ~ record:", record)
handleCancel();
emit('success',record);
}
/**
* 取消按钮回调事件
*/
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,176 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuWarehouseMaterialCrkInfoForm">
<a-row>
<a-col :span="24">
<a-form-item label="采购单" v-bind="validateInfos.cgdId" id="NuWarehouseMaterialCrkInfoForm-cgdId" name="cgdId">
<j-dict-select-tag v-model:value="formData.cgdId" dictCode="nu_invoicing_cgd_main,cgd_no,id" placeholder="请选择采购单" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="库房" v-bind="validateInfos.nuId" id="NuWarehouseMaterialCrkInfoForm-nuId" name="nuId">
<j-dict-select-tag v-model:value="formData.nuId" dictCode="nu_base_info,nu_name,id" placeholder="请选择库房" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料" v-bind="validateInfos.wlId" id="NuWarehouseMaterialCrkInfoForm-wlId" name="wlId">
<j-dict-select-tag v-model:value="formData.wlId" dictCode="nu_config_material_info,material_name,id" placeholder="请选择物料" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="出入库数量" v-bind="validateInfos.crkNum" id="NuWarehouseMaterialCrkInfoForm-crkNum" name="crkNum">
<a-input v-model:value="formData.crkNum" placeholder="请输入出入库数量" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="出入库类型 1入库" v-bind="validateInfos.crkType" id="NuWarehouseMaterialCrkInfoForm-crkType" name="crkType">
<j-dict-select-tag v-model:value="formData.crkType" dictCode="crk_type" placeholder="请选择出入库类型 1入库" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="备注" v-bind="validateInfos.content" id="NuWarehouseMaterialCrkInfoForm-content" name="content">
<a-input v-model:value="formData.content" 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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuWarehouseMaterialCrkInfo.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: '',
cgdId: '',
nuId: '',
wlId: '',
crkNum: '',
crkType: '',
content: '',
});
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,83 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<NuWarehouseMaterialCrkInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuWarehouseMaterialCrkInfoForm>
<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 NuWarehouseMaterialCrkInfoForm from './NuWarehouseMaterialCrkInfoForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('80%');
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>