Commit 721945d1 by 史雅文

来料、过程、成品入库和发货质检单中弹窗内质检明细与质检方案关联

parents 2e07ad3f 8fd849e8
......@@ -17,6 +17,8 @@ export interface MesWarehousePromaterialPageParams extends BasicPageParams {
export interface MesWarehousePromaterialPageModel {
id: string;
djbh: string;
djrq: string;
lldw: string;
......@@ -27,8 +29,6 @@ export interface MesWarehousePromaterialPageModel {
kgy: string;
djbh: string;
bz: string;
}
......
......@@ -4,6 +4,7 @@
@register="registerModal"
title="生成领料单"
width="700px"
:confirmLoading="loading"
@ok="handleOk"
@cancel="handleCancel"
>
......@@ -25,6 +26,7 @@
import { useMessage } from '/@/hooks/web/useMessage';
import { h } from 'vue';
import { InputNumber } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
const { Message } = useMessage();
const [registerModal, { openModal, closeModal }] = useModal();
const { createMessage } = useMessage();
......@@ -32,6 +34,9 @@
/* 表格数据 */
const tableData = ref<any[]>([]);
/* 加载状态 */
const loading = ref(false);
/* 表格列定义 */
const columns: BasicColumn[] = [
......@@ -61,15 +66,48 @@
}
/* 确认 - 回传所有行(含改后的数量) */
function handleOk() {
async function handleOk() {
// 防止重复提交
if (loading.value) return;
// 简单校验:数量不能全 0
const allZero = tableData.value.every((r) => r.blsl === 0);
if (allZero) {
createMessage.warning('请至少输入一行领料数量'); // ✅ 用 createMessage
return;
}
emit('success', tableData.value); // 回传完整数组
closeModal();
// 构建请求参数
const requestData = tableData.value.map(item => ({
wlbm: item.wlbh, // 物料编码
wlmc: item.wlmc, // 物料名称
sl: item.blsl || 0 // 领料数量
}));
loading.value = true;
try {
// 调用后端接口
const response = await defHttp.post(
{
url: '/ckgl/scll',
data: requestData,
},
{
errorMessageMode: 'message',
}
);
// 接口调用成功
createMessage.success('领料单生成成功');
emit('success', tableData.value); // 回传完整数组
closeModal();
} catch (error) {
// 接口调用失败
createMessage.error('领料单生成失败,请重试');
console.error('接口调用失败:', error);
} finally {
loading.value = false;
}
}
function handleCancel() {
......
......@@ -13,19 +13,40 @@ export const searchFormSchema: FormSchema[] = [
field: 'lldw',
label: '领料单位',
defaultValue: undefined,
component: 'Input',
component: 'Dept',
componentProps: {
placeholder: '请选择',
getPopupContainer: () => document.body,
},
},
{
field: 'llr',
label: '领料人',
defaultValue: undefined,
component: 'Input',
component: 'User',
componentProps: {
suffix: 'ant-design:setting-outlined',
placeholder: '请选择',
},
},
];
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'djbh',
title: '单据编号',
componentType: 'auto-code',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'djrq',
title: '单据日期',
componentType: 'date',
......@@ -41,26 +62,26 @@ export const columns: BasicColumn[] = [
resizable: true,
dataIndex: 'lldw',
title: '领料单位',
componentType: 'input',
componentType: 'organization',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'llr',
title: '领料人',
componentType: 'input',
componentType: 'user',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
{
......@@ -91,19 +112,6 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'djbh',
title: '单据编号',
componentType: 'auto-code',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'bz',
title: '备注',
componentType: 'input',
......@@ -258,34 +266,23 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: '2e1a848d54b144d994cb147279cc1b96',
key: '70dd6f50e807416eafb7ca0ea7fdc401',
field: 'lldw',
label: '领料单位',
type: 'input',
component: 'Input',
type: 'organization',
component: 'Dept',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入领料单位',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
width: '100%',
orgzType: 0,
placeholder: '请选择领料单位',
isShowAllName: false,
showLabel: true,
disabled: false,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
......@@ -296,34 +293,27 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: '602d674a8361431fa689d42f72bf4662',
key: '2e8683cce6cd40dea3d890b3d421a588',
field: 'llr',
label: '领料人',
type: 'input',
component: 'Input',
type: 'user',
component: 'User',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
width: '100%',
defaultValue: '',
placeholder: '请输入领料人',
placeholder: '请选择领料人',
userType: 0,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
disabled: false,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
multiple: true,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
......
......@@ -43,11 +43,10 @@ export const permissionList = [
fieldId: 'lldw',
isSubTable: false,
showChildren: true,
type: 'input',
key: '2e1a848d54b144d994cb147279cc1b96',
type: 'organization',
key: '70dd6f50e807416eafb7ca0ea7fdc401',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -60,8 +59,8 @@ export const permissionList = [
fieldId: 'llr',
isSubTable: false,
showChildren: true,
type: 'input',
key: '602d674a8361431fa689d42f72bf4662',
type: 'user',
key: '2e8683cce6cd40dea3d890b3d421a588',
children: [],
options: {},
defaultValue: '',
......
......@@ -134,7 +134,7 @@
//展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]);
const buttonConfigs = computed(()=>{
const list = [{"buttonId":"2010557152968171520","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2010557152972365824","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"name":"打印","code":"print","icon":"ant-design:printer-outlined","isDefault":true,"isUse":true},{"buttonId":"2010557152972365825","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
const list = [{"buttonId":"2010557152968171520","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2010557152972365824","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2013779484670955520","name":"打印","code":"print","icon":"ant-design:printer-outlined","isDefault":true,"isUse":true},{"buttonId":"2010557152972365825","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
return filterButtonAuth(list);
})
......
......@@ -132,13 +132,13 @@ export const columns: BasicColumn[] = [
resizable: true,
dataIndex: 'djbh',
title: '单据编号',
componentType: 'input',
componentType: 'auto-code',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
{
......@@ -601,34 +601,24 @@ export const formProps: FormProps = {
span: 6,
list: [
{
key: '7b5da9c087bc41d5ba2efa9034582b0c',
key: '160979df6a214cb590fa0b8f20bcd98c',
field: 'djbh',
label: '单据编号',
type: 'input',
component: 'Input',
type: 'auto-code',
component: 'AutoCodeRule',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 8,
defaultValue: '',
span: 7,
placeholder: '请输入单据编号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
autoCodeRule: 'XSCK',
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
......
......@@ -136,19 +136,18 @@ export const permissionList = [
{
required: false,
view: true,
edit: true,
disabled: false,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '单据编号',
fieldId: 'djbh',
isSubTable: false,
showChildren: true,
type: 'input',
key: '7b5da9c087bc41d5ba2efa9034582b0c',
type: 'auto-code',
key: '160979df6a214cb590fa0b8f20bcd98c',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment