Compare commits
2 Commits
b56ea7f007
...
1c21c5b85d
| Author | SHA1 | Date |
|---|---|---|
|
|
1c21c5b85d | |
|
|
6833e570a7 |
|
|
@ -6,12 +6,12 @@ import { getWeekMonthQuarterYear } from '/@/utils';
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
title: '货品名称',
|
title: '物料名称',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'materialName'
|
dataIndex: 'materialName'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '货品编码',
|
title: '物料编码',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'materialNo',
|
dataIndex: 'materialNo',
|
||||||
width:'100px'
|
width:'100px'
|
||||||
|
|
@ -34,7 +34,7 @@ export const columns: BasicColumn[] = [
|
||||||
width:'100px'
|
width:'100px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '货品单位',
|
title: '物料单位',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'materialUnits',
|
dataIndex: 'materialUnits',
|
||||||
width:'100px'
|
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',},
|
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',},
|
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',},
|
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',},
|
materialName: {title: '物料名称',order: 3,view: 'text', type: 'string',},
|
||||||
materialNo: {title: '货品编码',order: 4,view: 'text', type: 'string',},
|
materialNo: {title: '物料编码',order: 4,view: 'text', type: 'string',},
|
||||||
specificationModel: {title: '规格型号',order: 5,view: 'text', type: 'string',},
|
specificationModel: {title: '规格型号',order: 5,view: 'text', type: 'string',},
|
||||||
salesUnitPrice: {title: '销售单价',order: 6,view: 'number', type: 'number',},
|
salesUnitPrice: {title: '销售单价',order: 6,view: 'number', type: 'number',},
|
||||||
referenceUnitPrice: {title: '参考单价',order: 7,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',},
|
multiUnitSwitch: {title: '多单位开关',order: 9,view: 'switch', type: 'string',},
|
||||||
oneUnit: {title: '父级单位',order: 10,view: 'text', type: 'string',},
|
oneUnit: {title: '父级单位',order: 10,view: 'text', type: 'string',},
|
||||||
oneUnitProportion: {title: '父级单位兑换比例',order: 11,view: 'number', type: 'number',},
|
oneUnitProportion: {title: '父级单位兑换比例',order: 11,view: 'number', type: 'number',},
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :lg="5">
|
<a-col :lg="5">
|
||||||
<a-form-item name="materialName">
|
<a-form-item name="materialName">
|
||||||
<template #label><span title="货品名称">货品名称</span></template>
|
<template #label><span title="物料名称">物料名称</span></template>
|
||||||
<j-input placeholder="请输入货品名称" v-model:value="queryParam.materialName" allow-clear></j-input>
|
<j-input placeholder="请输入物料名称" v-model:value="queryParam.materialName" allow-clear></j-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="5">
|
<a-col :lg="5">
|
||||||
<a-form-item name="materialNo">
|
<a-form-item name="materialNo">
|
||||||
<template #label><span title="货品编码">货品编码</span></template>
|
<template #label><span title="物料编码">物料编码</span></template>
|
||||||
<j-input placeholder="请输入货品编码" v-model:value="queryParam.materialNo" allow-clear></j-input>
|
<j-input placeholder="请输入物料编码" v-model:value="queryParam.materialNo" allow-clear></j-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="5">
|
<a-col :lg="5">
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,13 @@
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="货品名称" v-bind="validateInfos.materialName" id="ConfigMaterialInfoForm-materialName" name="materialName">
|
<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-input v-model:value="formData.materialName" placeholder="请输入物料名称" maxlength="20" allow-clear ></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="货品编码" v-bind="validateInfos.materialNo" id="ConfigMaterialInfoForm-materialNo" name="materialNo">
|
<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-input v-model:value="formData.materialNo" placeholder="请输入物料编码" maxlength="20" allow-clear ></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="三级单位" v-bind="validateInfos.materialUnits" id="ConfigMaterialInfoForm-materialUnits" name="materialUnits">
|
<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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8" >
|
<a-col :span="8" >
|
||||||
|
|
@ -188,10 +188,10 @@
|
||||||
const confirmLoading = ref<boolean>(false);
|
const confirmLoading = ref<boolean>(false);
|
||||||
//表单验证
|
//表单验证
|
||||||
const validatorRules = reactive({
|
const validatorRules = reactive({
|
||||||
materialName: [{ required: true, message: '请输入货品名称!'},],
|
materialName: [{ required: true, message: '请输入物料名称!'},],
|
||||||
salesUnitPrice: [{ required: true, message: '请输入销售单价!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
|
salesUnitPrice: [{ required: true, message: '请输入销售单价!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
|
||||||
referenceUnitPrice: [{ 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: '请选择供应商!'},],
|
suppliers: [{ required: true, message: '请选择供应商!'},],
|
||||||
upperLimit: [{ required: false, message: '请输入物料上限!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
|
upperLimit: [{ required: false, message: '请输入物料上限!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
|
||||||
lowerLimit: [{ required: false, message: '请输入物料下限!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
|
lowerLimit: [{ required: false, message: '请输入物料下限!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="ConfigMaterialInfoForm">
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="ConfigMaterialInfoForm">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="货品名称" v-bind="validateInfos.materialName" id="ConfigMaterialInfoForm-materialName" name="materialName">
|
<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-input v-model:value="formData.materialName" placeholder="请输入物料名称" maxlength="20" allow-clear disabled ></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" >
|
<a-col :span="24" >
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,10 @@
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<!--引用表格-->
|
<!--引用表格-->
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
<BasicTable @register="registerTable">
|
||||||
<!--插槽:table标题-->
|
<!--插槽:table标题-->
|
||||||
<template #tableTitle>
|
<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>
|
<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>
|
<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">
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
<a-button v-auth="'cgd:nu_invoicing_cgd_main:deleteBatch'">批量操作
|
<a-button v-auth="'cgd:nu_invoicing_cgd_main:deleteBatch'">批量操作
|
||||||
<Icon icon="mdi:chevron-down"></Icon>
|
<Icon icon="mdi:chevron-down"></Icon>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-dropdown>
|
</a-dropdown> -->
|
||||||
</template>
|
</template>
|
||||||
<!--操作栏-->
|
<!--操作栏-->
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@ export const columns: BasicColumn[] = [
|
||||||
width:'140px'
|
width:'140px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '货品名称',
|
title: '物料名称',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'materialName',
|
dataIndex: 'materialName',
|
||||||
width:'180px'
|
width:'180px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '货品编码',
|
title: '物料编码',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'materialNo',
|
dataIndex: 'materialNo',
|
||||||
width:'100px'
|
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',},
|
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',},
|
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',},
|
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',},
|
materialName: {title: '物料名称',order: 3,view: 'text', type: 'string',},
|
||||||
materialNo: {title: '货品编码',order: 4,view: 'text', type: 'string',},
|
materialNo: {title: '物料编码',order: 4,view: 'text', type: 'string',},
|
||||||
specificationModel: {title: '规格型号',order: 5,view: 'text', type: 'string',},
|
specificationModel: {title: '规格型号',order: 5,view: 'text', type: 'string',},
|
||||||
salesUnitPrice: {title: '销售单价',order: 6,view: 'number', type: 'number',},
|
salesUnitPrice: {title: '销售单价',order: 6,view: 'number', type: 'number',},
|
||||||
referenceUnitPrice: {title: '参考单价',order: 7,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',},
|
multiUnitSwitch: {title: '多单位开关',order: 9,view: 'switch', type: 'string',},
|
||||||
oneUnit: {title: '父级单位',order: 10,view: 'text', type: 'string',},
|
oneUnit: {title: '父级单位',order: 10,view: 'text', type: 'string',},
|
||||||
oneUnitProportion: {title: '父级单位兑换比例',order: 11,view: 'number', type: 'number',},
|
oneUnitProportion: {title: '父级单位兑换比例',order: 11,view: 'number', type: 'number',},
|
||||||
|
|
@ -109,21 +109,21 @@ export const superQuerySchema = {
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columnsQgcList: BasicColumn[] = [
|
export const columnsQgcList: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
title: '货品名称',
|
title: '物料名称',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'wlName'
|
dataIndex: 'wlName'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '货品编码',
|
title: '物料编码',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'wlMaterialNo',
|
dataIndex: 'wlMaterialNo',
|
||||||
width:'100px'
|
width:'140px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '请购数量',
|
title: '请购数量',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'purchaseQuantity',
|
dataIndex: 'purchaseQuantity',
|
||||||
width:'100px'
|
width:'140px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '规格型号',
|
title: '规格型号',
|
||||||
|
|
@ -131,11 +131,17 @@ export const columnsQgcList: BasicColumn[] = [
|
||||||
dataIndex: 'wlSpecificationModel'
|
dataIndex: 'wlSpecificationModel'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '货品单位',
|
title: '物料单位',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'wlUnits',
|
dataIndex: 'wlUnits',
|
||||||
width:'100px'
|
width:'100px'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '库存数量',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'kcsl',
|
||||||
|
width:'100px'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '上限',
|
title: '上限',
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|
@ -152,6 +158,6 @@ export const columnsQgcList: BasicColumn[] = [
|
||||||
title: '供应商',
|
title: '供应商',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'suppliersName',
|
dataIndex: 'suppliersName',
|
||||||
width:'200px'
|
width:'280px'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -5,27 +5,9 @@
|
||||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="materialName">
|
<a-form-item name="wlParamInfo">
|
||||||
<template #label><span title="货品名称">货品名称</span></template>
|
<template #label><span title="物料信息">物料信息</span></template>
|
||||||
<j-input placeholder="请输入货品名称" v-model:value="queryParam.materialName" allow-clear ></j-input>
|
<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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
|
@ -61,7 +43,7 @@
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<QgdInfoModal ref="registerModal" @success="handleSuccess"></QgdInfoModal>
|
<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>
|
<template #footer>
|
||||||
<a-button type="primary" @click="onQgcCaigou" style="float: right;margin-left:10px;">提交采购</a-button>
|
<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>
|
<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 formRef = ref();
|
||||||
const qgcModal = ref();
|
const qgcModal = ref();
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({izEnabled:'0'});
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
const qgcOpen = ref(false)//请购车抽屉
|
const qgcOpen = ref(false)//请购车抽屉
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div>
|
||||||
<!--查询区域-->
|
<!--查询区域-->
|
||||||
<div class="jeecg-basic-table-form-container">
|
<div class="jeecg-basic-table-form-container">
|
||||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="materialName">
|
<a-form-item name="wlParamInfo">
|
||||||
<template #label><span title="货品名称">货品名称</span></template>
|
<template #label><span title="物料信息">物料信息</span></template>
|
||||||
<j-input placeholder="请输入货品名称" v-model:value="queryParam.materialName" allow-clear ></j-input>
|
<a-input placeholder="请输入物料信息" v-model:value="queryParam.wlParamInfo" allow-clear ></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</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">
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
|
|
@ -49,8 +31,13 @@
|
||||||
<TableAction :actions="getTableAction(record)" />
|
<TableAction :actions="getTableAction(record)" />
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
<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>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -65,6 +52,7 @@
|
||||||
import { JInput } from '/@/components/Form';
|
import { JInput } from '/@/components/Form';
|
||||||
import { DownOutlined } from '@ant-design/icons-vue';
|
import { DownOutlined } from '@ant-design/icons-vue';
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import QgdInfoModal from '/@/views/invoicing/jxc/components/QgdInfoModal.vue'
|
||||||
|
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
|
@ -104,15 +92,20 @@ import { defHttp } from '/@/utils/http/axios';
|
||||||
sm: 16,
|
sm: 16,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//修改物料上限下限
|
||||||
/**
|
const handleInputChange = (record, field, value) => {
|
||||||
* 请购事件
|
console.log("🚀 ~ handleInputChange ~ record, field, value:", record, field, value)
|
||||||
*/
|
// 更新当前行的数据
|
||||||
function handleAddQg(record: Recordable) {
|
if(parseInt(value) > parseInt(record.wlUpperLimit) - parseInt(record.kcsl)){
|
||||||
registerModal.value.disableSubmit = false;
|
record[field] = parseInt(record.wlUpperLimit) - parseInt(record.kcsl);
|
||||||
registerModal.value.edit(record);
|
}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) {
|
function getTableAction(record) {
|
||||||
return [
|
return [
|
||||||
{
|
|
||||||
label: '编辑',
|
|
||||||
onClick: handleAddQg.bind(null, record),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
onClick: handleDelete.bind(null, record),
|
onClick: handleDelete.bind(null, record),
|
||||||
|
|
|
||||||
|
|
@ -125,10 +125,10 @@
|
||||||
const validatorRules = reactive({
|
const validatorRules = reactive({
|
||||||
categoryId: [{ required: true, message: '请选择一级分类!'},],
|
categoryId: [{ required: true, message: '请选择一级分类!'},],
|
||||||
typeId: [{ required: true, message: '请选择二级分类!'},],
|
typeId: [{ required: true, message: '请选择二级分类!'},],
|
||||||
materialName: [{ required: true, message: '请输入货品名称!'},],
|
materialName: [{ required: true, message: '请输入物料名称!'},],
|
||||||
salesUnitPrice: [{ required: true, message: '请输入销售单价!'},],
|
salesUnitPrice: [{ required: true, message: '请输入销售单价!'},],
|
||||||
referenceUnitPrice: [{ required: true, message: '请输入参考单价!'},],
|
referenceUnitPrice: [{ required: true, message: '请输入参考单价!'},],
|
||||||
materialUnits: [{ required: true, message: '请输入货品单位!'},],
|
materialUnits: [{ required: true, message: '请输入物料单位!'},],
|
||||||
suppliers: [{ required: true, message: '请选择供应商!'},],
|
suppliers: [{ required: true, message: '请选择供应商!'},],
|
||||||
});
|
});
|
||||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ enum Api {
|
||||||
deleteBatch = '/invoicing/blWarehouseMaterialInfo/deleteBatch',
|
deleteBatch = '/invoicing/blWarehouseMaterialInfo/deleteBatch',
|
||||||
importExcel = '/invoicing/blWarehouseMaterialInfo/importExcel',
|
importExcel = '/invoicing/blWarehouseMaterialInfo/importExcel',
|
||||||
exportXls = '/invoicing/blWarehouseMaterialInfo/exportXls',
|
exportXls = '/invoicing/blWarehouseMaterialInfo/exportXls',
|
||||||
|
getConfiguredList = '/invoicing/configMaterialInfo/getConfiguredList',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -29,6 +30,11 @@ export const getImportUrl = Api.importExcel;
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||||
|
/**
|
||||||
|
* 获取配置列表接口
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getConfiguredList = (params) => defHttp.get({ url: Api.getConfiguredList, params });
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除单个
|
* 删除单个
|
||||||
|
|
|
||||||
|
|
@ -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 = {
|
export const superQuerySchema = {
|
||||||
nuId: {title: '库房',order: 0,view: 'list', type: 'string',dictTable: "nu_base_info", dictCode: 'nu_id', dictText: 'nu_name',},
|
nuId: {title: '库房',order: 0,view: 'list', type: 'string',dictTable: "nu_base_info", dictCode: 'nu_id', dictText: 'nu_name',},
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,13 @@
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="nuId">
|
<a-form-item name="nuId">
|
||||||
<template #label><span title="库房">库房</span></template>
|
<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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="wlId">
|
<a-form-item name="wlParamInfo">
|
||||||
<template #label><span title="物料">物料</span></template>
|
<template #label><span title="物料信息">物料信息</span></template>
|
||||||
<j-input placeholder="请填写物料" v-model:value="queryParam.wlName" allow-clear></j-input>
|
<a-input placeholder="请填写物料信息" v-model:value="queryParam.wlParamInfo" allow-clear></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
|
@ -42,6 +42,9 @@
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<BlWarehouseMaterialInfoModal ref="registerModal" @success="handleSuccess"></BlWarehouseMaterialInfoModal>
|
<BlWarehouseMaterialInfoModal ref="registerModal" @success="handleSuccess"></BlWarehouseMaterialInfoModal>
|
||||||
|
<BlWarehouseMaterialInfoAddModal ref="registerAddModal" @success="handleSuccess"></BlWarehouseMaterialInfoAddModal>
|
||||||
|
<!-- 出入库详情 -->
|
||||||
|
<NuWarehouseMaterialCrkInfoListModal ref="registerCrkModal" @success="handleSuccess"></NuWarehouseMaterialCrkInfoListModal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -53,6 +56,8 @@
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BlWarehouseMaterialInfo.api';
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BlWarehouseMaterialInfo.api';
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
import BlWarehouseMaterialInfoModal from './components/BlWarehouseMaterialInfoModal.vue'
|
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 { useUserStore } from '/@/store/modules/user';
|
||||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.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 queryParam = reactive<any>({});
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
|
const registerAddModal = ref();
|
||||||
|
const registerCrkModal = ref();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
//注册table数据
|
//注册table数据
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
|
|
@ -119,8 +126,8 @@ import { defHttp } from '/@/utils/http/axios';
|
||||||
* 新增事件
|
* 新增事件
|
||||||
*/
|
*/
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
registerModal.value.disableSubmit = false;
|
registerAddModal.value.disableSubmit = false;
|
||||||
registerModal.value.add();
|
registerAddModal.value.add();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -138,6 +145,11 @@ import { defHttp } from '/@/utils/http/axios';
|
||||||
registerModal.value.disableSubmit = true;
|
registerModal.value.disableSubmit = true;
|
||||||
registerModal.value.edit(record);
|
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',
|
auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit',
|
||||||
ifShow: record.izEnabled == '0'
|
ifShow: record.izEnabled == '0'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '记录',
|
||||||
|
onClick: handleCrkjl.bind(null, record,'1'),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
function handleQyty(record,izEnabled) {
|
function handleQyty(record,izEnabled) {
|
||||||
|
|
|
||||||
|
|
@ -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 });
|
||||||
|
}
|
||||||
|
|
@ -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',},
|
||||||
|
};
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -6,12 +6,12 @@
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="库房" v-bind="validateInfos.nuId" id="BlWarehouseMaterialInfoForm-nuId" name="nuId" >
|
<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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="物料" v-bind="validateInfos.wlId" id="BlWarehouseMaterialInfoForm-wlId" name="wlId" >
|
<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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
|
|
@ -55,6 +55,8 @@
|
||||||
wlId: '',
|
wlId: '',
|
||||||
upperLimit: '',
|
upperLimit: '',
|
||||||
lowerLimit: '',
|
lowerLimit: '',
|
||||||
|
wlId_dictText:'',
|
||||||
|
nuId_dictText:'',
|
||||||
});
|
});
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
|
|
@ -62,8 +64,6 @@
|
||||||
const confirmLoading = ref<boolean>(false);
|
const confirmLoading = ref<boolean>(false);
|
||||||
//表单验证
|
//表单验证
|
||||||
const validatorRules = reactive({
|
const validatorRules = reactive({
|
||||||
nuId: [{ required: true, message: '请选择库房!' },],
|
|
||||||
wlId: [{ required: true, message: '请选择物料!' },],
|
|
||||||
upperLimit: [{ required: true, message: '请输入物料上限!' },],
|
upperLimit: [{ required: true, message: '请输入物料上限!' },],
|
||||||
lowerLimit: [{ required: true, message: '请输入物料下限!' },],
|
lowerLimit: [{ required: true, message: '请输入物料下限!' },],
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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>
|
||||||
Loading…
Reference in New Issue