修改供应商配置物料流程

This commit is contained in:
yangjun 2026-04-01 16:12:45 +08:00
parent 0c03ca821f
commit 1b4e247629
8 changed files with 628 additions and 29 deletions

View File

@ -0,0 +1,164 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="8">
<a-form-item name="materialName">
<template #label><span title="物料名称">物料名称</span></template>
<JInput placeholder="请输入物料名称" v-model:value="queryParam.materialName" allow-clear ></JInput>
</a-form-item>
</a-col>
<a-col :xl="16" :lg="16" :md="16" :sm="24">
<span style="float: right; 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-button type="primary" preIcon="ant-design:calendar-outlined" @click="handlePeizhi" style="margin-left: 8px">配置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 物料配置 -->
<MateriallInfoPeizhiListModal ref="wlpzModal" @success="handleSuccess"></MateriallInfoPeizhiListModal>
</div>
</template>
<script lang="ts" name="bizSuppliers-nuBizSuppliersMaterialInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns3, superQuerySchema } from './NuBizSuppliersMaterialInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizSuppliersMaterialInfo.api';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
import MateriallInfoPeizhiListModal from './MateriallInfoPeizhiListModal.vue'
const formRef = ref();
const wlpzModal = ref();
const queryParam = reactive<any>({});
const suppliersId = ref<string>('');
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '供应商可提供的物料信息',
api: list,
columns: columns3,
canResize:false,
useSearchForm: false,
showActionColumn: false,
immediate: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
params.column = 'id'
params.order = 'desc'
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:8,
xl:8,
xxl:8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 配置
*/
function handlePeizhi(){
const record = {suppliersId:suppliersId.value}
wlpzModal.value.disableSubmit = false;
wlpzModal.value.edit(record);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
function init(record) {
console.log("🚀 ~ init123 ~ record:", record)
queryParam.materialName = null;
suppliersId.value = record.id;
queryParam.suppliersId = record.id;
queryParam.suppliersName = record.suppliersName;
selectedRowKeys.value = []
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,76 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<MateriallInfoCheckList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
</MateriallInfoCheckList>
<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 MateriallInfoCheckList from './MateriallInfoCheckList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('1000');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const upInfoForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function edit(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({
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,227 @@
<template>
<div class="p-2">
<a-spin :spinning="confirmLoading">
<!--查询区域-->
<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="8">
<a-form-item name="materialName">
<template #label><span title="物料名称">物料名称</span></template>
<JInput placeholder="请输入物料名称" v-model:value="queryParam.materialName" allow-clear ></JInput>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item name="categoryId">
<template #label><span title="一级分类">一级分类</span></template>
<j-dict-select-tag v-model:value="queryParam.categoryId"
:dictCode="`nu_config_material_category,category_name,id,del_flag = 0 and iz_enabled = 'Y' order by sort asc`"
placeholder="请选择一级分类" allowClear :ignoreDisabled="true" />
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item name="typeId">
<template #label><span title="二级分类">二级分类</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.typeId"
:dictCode="`nu_config_material_type,type_name,id,del_flag = 0 and iz_enabled = 'Y' and category_id = '${queryParam.categoryId || ''}' `"
placeholder="请选择二级分类" allowClear :ignoreDisabled="true" />
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item name="medicationId">
<template #label><span title="三级分类">三级分类</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.medicationId"
:dictCode="`nu_config_material_medication,medication_name,id,del_flag = 0 and iz_enabled ='Y' and category_id = '${queryParam.categoryId || ''}' and type_id = '${queryParam.typeId || ''}' `"
placeholder="请选择三级分类" allowClear :ignoreDisabled="true" />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<div>
<div><SectionDivider :title="'本次配置的物料信息'" /></div>
<!-- 选中的物料 -->
<a-table :columns="columns2" :data-source="checkDataShource">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<span>
<a @click="handleYichu(record)">移除</a>
</span>
</template>
</template>
</a-table>
</div>
</a-spin>
</div>
</template>
<script lang="ts" name="bizSuppliers-nuBizSuppliersMaterialInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns3, columns2 } from './NuBizSuppliersMaterialInfo.data';
import { getNoSuplist} from './NuBizSuppliersMaterialInfo.api';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { defHttp } from '/@/utils/http/axios';
const emit = defineEmits(['register', 'ok']);
const { createMessage } = useMessage();
const formRef = ref();
const queryParam = reactive<any>({});
const suppliersId = ref<string>('');
const checkDataShource = ref<any>([]);
const confirmLoading = ref<boolean>(false);
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '供应商可提供的物料信息',
api: getNoSuplist,
columns:columns3,
canResize:false,
useSearchForm: false,
immediate: false,
actionColumn: {
width: 80,
fixed: 'right',
},
beforeFetch: async (params) => {
params.column = 'id'
params.order = 'desc'
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:8,
xl:8,
xxl:8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* 选择
*/
function handeXuanze(record) {
//checkDataShource
if (checkDataShource.value.some(item => item.id === record.id)) {
createMessage.error('该物料已选择!');
return;
}
checkDataShource.value.push(record);
}
function handleYichu(record) {
checkDataShource.value = checkDataShource.value.filter(item => item.id !== record.id);
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '选择',
onClick: handeXuanze.bind(null, record),
},
];
}
function init(record) {
confirmLoading.value = false;
checkDataShource.value = [];
suppliersId.value = record.suppliersId;
queryParam.suppliersId = record.suppliersId;
selectedRowKeys.value = []
reload();
}
function submitForm(){
confirmLoading.value = true;
const params = {
suppliersId: suppliersId.value,
addList: checkDataShource.value
}
defHttp.post({ url: '/bizSuppliers/nuBizSuppliersMaterialInfo/saveBacthMaterial', params }).then(res => {
confirmLoading.value = false;
emit('ok');
})
}
defineExpose({
init,
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,80 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<MaterialInfoPeizhiList ref="register2Form" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
</MaterialInfoPeizhiList>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" @click="handleOk" v-if="!disableSubmit" :loading="confirmLoading">确认</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import MaterialInfoPeizhiList from './MateriallInfoPeizhiList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('1000');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const register2Form = ref();
const upInfoForm = ref();
const emit = defineEmits(['register', 'success']);
const confirmLoading = ref<boolean>(false);
/**
* 编辑
* @param record
*/
function edit(record) {
confirmLoading.value = false;
title.value = "物料配置";
visible.value = true;
nextTick(() => {
register2Form.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
confirmLoading.value = true;
register2Form.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
confirmLoading.value = false;
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -36,7 +36,7 @@
<!-- 物料详情 -->
<NuBizSuppliersMateriallInfoModal ref="wlRegisterModal" @success="handleSuccess"></NuBizSuppliersMateriallInfoModal>
<!-- 物料配置 -->
<SuppliersWlTypeModal ref="wlTypeModal" @success="handleSuccess"></SuppliersWlTypeModal>
<MateriallInfoCheckListModal ref="wlTypeModal" @success="handleSuccess"></MateriallInfoCheckListModal>
</div>
</template>
@ -48,7 +48,7 @@
import { syncList, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizSuppliersInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuBizSuppliersMateriallInfoModal from './NuBizSuppliersMateriallInfoModal.vue'
import SuppliersWlTypeModal from './components/SuppliersWlTypeModal.vue'
import MateriallInfoCheckListModal from './MateriallInfoCheckListModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
import { defHttp } from '/@/utils/http/axios';
@ -85,9 +85,9 @@
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys,selectedRows }] = tableContext;
const labelCol = reactive({
xs:24,
sm:6,
xl:6,
xxl:6
sm:8,
xl:8,
xxl:8
});
const wrapperCol = reactive({
xs: 24,
@ -115,7 +115,7 @@
* 合作
*/
async function handleWlType(record) {
wlTypeModal.value.disableSubmit = false;
wlTypeModal.value.disableSubmit = true;
wlTypeModal.value.edit(record);
// var params = { id: record.id }
@ -180,18 +180,17 @@ async function handleWlType(record) {
{
label: '物料配置',
onClick: handleWlType.bind(null, record),
ifShow: !record.izEnabled
},
{
label: '启用',
onClick: handleWlQyty.bind(null, record),
ifShow: record.izEnabled == 'N'
},
{
label: '停用',
onClick: handleWlQyty.bind(null, record),
ifShow: record.izEnabled == 'Y'
},
// {
// label: '',
// onClick: handleWlQyty.bind(null, record),
// ifShow: record.izEnabled == 'N'
// },
// {
// label: '',
// onClick: handleWlQyty.bind(null, record),
// ifShow: record.izEnabled == 'Y'
// },
];
}

View File

@ -5,6 +5,7 @@ const { createConfirm } = useMessage();
enum Api {
list = '/bizSuppliers/nuBizSuppliersMaterialInfo/list',
getNoSuplist = '/invoicing/configMaterialInfo/getNoSuplist',
save='/bizSuppliers/nuBizSuppliersMaterialInfo/add',
edit='/bizSuppliers/nuBizSuppliersMaterialInfo/edit',
deleteOne = '/bizSuppliers/nuBizSuppliersMaterialInfo/delete',
@ -30,6 +31,7 @@ export const getImportUrl = Api.importExcel;
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
export const getNoSuplist = (params) => defHttp.get({ url: Api.getNoSuplist, params });
/**
*

View File

@ -42,6 +42,66 @@ export const columns: BasicColumn[] = [
},
];
export const columns2: BasicColumn[] = [
{
title: '物料名称',
align: "center",
dataIndex: 'materialName',
width: 140
},
{
title: '规格型号',
align: "center",
dataIndex: 'specificationModel',
width: 140
},
{
title: '品牌型号',
align: "center",
dataIndex: 'brandType',
width: 200
},
{
title: '生产厂家',
align: "center",
dataIndex: 'manufacturer',
width: 200
},
{
title: '操作',
align: "center",
dataIndex: 'action',
width: 100
},
];
//列表数据
export const columns3: BasicColumn[] = [
{
title: '物料名称',
align: "center",
dataIndex: 'materialName'
},
{
title: '规格型号',
align: "center",
dataIndex: 'specificationModel',
width: 140
},
{
title: '品牌型号',
align: "center",
dataIndex: 'brandType',
width: 200
},
{
title: '生产厂家',
align: "center",
dataIndex: 'manufacturer',
width: 200
},
];
// 高级查询数据
export const superQuerySchema = {
suppliersId: {title: '供应商',order: 0,view: 'list', type: 'string',dictTable: "nu_biz_suppliers_info", dictCode: 'id', dictText: 'suppliers_name',},

View File

@ -28,7 +28,7 @@
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
<TableAction />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
@ -40,8 +40,8 @@
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuBizSuppliersMaterialInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizSuppliersMaterialInfo.api';
import { columns } from './NuBizSuppliersMaterialInfo.data';
import { list } from './NuBizSuppliersMaterialInfo.api';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
@ -68,15 +68,6 @@
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({