Commit 721945d1 by 史雅文

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

parents 2e07ad3f 8fd849e8
...@@ -17,6 +17,8 @@ export interface MesWarehousePromaterialPageParams extends BasicPageParams { ...@@ -17,6 +17,8 @@ export interface MesWarehousePromaterialPageParams extends BasicPageParams {
export interface MesWarehousePromaterialPageModel { export interface MesWarehousePromaterialPageModel {
id: string; id: string;
djbh: string;
djrq: string; djrq: string;
lldw: string; lldw: string;
...@@ -27,8 +29,6 @@ export interface MesWarehousePromaterialPageModel { ...@@ -27,8 +29,6 @@ export interface MesWarehousePromaterialPageModel {
kgy: string; kgy: string;
djbh: string;
bz: string; bz: string;
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
@register="registerModal" @register="registerModal"
title="生成领料单" title="生成领料单"
width="700px" width="700px"
:confirmLoading="loading"
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
> >
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { h } from 'vue'; import { h } from 'vue';
import { InputNumber } from 'ant-design-vue'; import { InputNumber } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
const { Message } = useMessage(); const { Message } = useMessage();
const [registerModal, { openModal, closeModal }] = useModal(); const [registerModal, { openModal, closeModal }] = useModal();
const { createMessage } = useMessage(); const { createMessage } = useMessage();
...@@ -32,6 +34,9 @@ ...@@ -32,6 +34,9 @@
/* 表格数据 */ /* 表格数据 */
const tableData = ref<any[]>([]); const tableData = ref<any[]>([]);
/* 加载状态 */
const loading = ref(false);
/* 表格列定义 */ /* 表格列定义 */
const columns: BasicColumn[] = [ const columns: BasicColumn[] = [
...@@ -61,15 +66,48 @@ ...@@ -61,15 +66,48 @@
} }
/* 确认 - 回传所有行(含改后的数量) */ /* 确认 - 回传所有行(含改后的数量) */
function handleOk() { async function handleOk() {
// 防止重复提交
if (loading.value) return;
// 简单校验:数量不能全 0 // 简单校验:数量不能全 0
const allZero = tableData.value.every((r) => r.blsl === 0); const allZero = tableData.value.every((r) => r.blsl === 0);
if (allZero) { if (allZero) {
createMessage.warning('请至少输入一行领料数量'); // ✅ 用 createMessage createMessage.warning('请至少输入一行领料数量'); // ✅ 用 createMessage
return; 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() { function handleCancel() {
......
...@@ -13,19 +13,40 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -13,19 +13,40 @@ export const searchFormSchema: FormSchema[] = [
field: 'lldw', field: 'lldw',
label: '领料单位', label: '领料单位',
defaultValue: undefined, defaultValue: undefined,
component: 'Input', component: 'Dept',
componentProps: {
placeholder: '请选择',
getPopupContainer: () => document.body,
},
}, },
{ {
field: 'llr', field: 'llr',
label: '领料人', label: '领料人',
defaultValue: undefined, defaultValue: undefined,
component: 'Input', component: 'User',
componentProps: {
suffix: 'ant-design:setting-outlined',
placeholder: '请选择',
},
}, },
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
resizable: true, resizable: true,
dataIndex: 'djbh',
title: '单据编号',
componentType: 'auto-code',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'djrq', dataIndex: 'djrq',
title: '单据日期', title: '单据日期',
componentType: 'date', componentType: 'date',
...@@ -41,26 +62,26 @@ export const columns: BasicColumn[] = [ ...@@ -41,26 +62,26 @@ export const columns: BasicColumn[] = [
resizable: true, resizable: true,
dataIndex: 'lldw', dataIndex: 'lldw',
title: '领料单位', title: '领料单位',
componentType: 'input', componentType: 'organization',
fixed: false, fixed: false,
sorter: true, sorter: true,
styleConfig: undefined, styleConfig: undefined,
listStyle: '', listStyle: undefined,
}, },
{ {
resizable: true, resizable: true,
dataIndex: 'llr', dataIndex: 'llr',
title: '领料人', title: '领料人',
componentType: 'input', componentType: 'user',
fixed: false, fixed: false,
sorter: true, sorter: true,
styleConfig: undefined, styleConfig: undefined,
listStyle: '', listStyle: undefined,
}, },
{ {
...@@ -91,19 +112,6 @@ export const columns: BasicColumn[] = [ ...@@ -91,19 +112,6 @@ export const columns: BasicColumn[] = [
{ {
resizable: true, resizable: true,
dataIndex: 'djbh',
title: '单据编号',
componentType: 'auto-code',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'bz', dataIndex: 'bz',
title: '备注', title: '备注',
componentType: 'input', componentType: 'input',
...@@ -258,34 +266,23 @@ export const formProps: FormProps = { ...@@ -258,34 +266,23 @@ export const formProps: FormProps = {
span: 8, span: 8,
list: [ list: [
{ {
key: '2e1a848d54b144d994cb147279cc1b96', key: '70dd6f50e807416eafb7ca0ea7fdc401',
field: 'lldw', field: 'lldw',
label: '领料单位', label: '领料单位',
type: 'input', type: 'organization',
component: 'Input', component: 'Dept',
colProps: { span: 24 }, colProps: { span: 24 },
defaultValue: '',
componentProps: { componentProps: {
width: '100%',
span: 7, span: 7,
defaultValue: '', width: '100%',
placeholder: '请输入领料单位', orgzType: 0,
prefix: '', placeholder: '请选择领料单位',
suffix: '', isShowAllName: false,
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true, showLabel: true,
disabled: false,
required: false, required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true, isShow: true,
scan: false, events: {},
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' }, style: { width: '100%' },
}, },
...@@ -296,34 +293,27 @@ export const formProps: FormProps = { ...@@ -296,34 +293,27 @@ export const formProps: FormProps = {
span: 8, span: 8,
list: [ list: [
{ {
key: '602d674a8361431fa689d42f72bf4662', key: '2e8683cce6cd40dea3d890b3d421a588',
field: 'llr', field: 'llr',
label: '领料人', label: '领料人',
type: 'input', type: 'user',
component: 'Input', component: 'User',
colProps: { span: 24 }, colProps: { span: 24 },
defaultValue: '', defaultValue: '',
componentProps: { componentProps: {
width: '100%',
span: 7, span: 7,
width: '100%',
defaultValue: '', defaultValue: '',
placeholder: '请输入领料人', placeholder: '请选择领料人',
userType: 0,
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true, showLabel: true,
disabled: false,
required: false, required: false,
rules: [], multiple: true,
events: {},
listStyle: '',
isSave: false,
isShow: true, isShow: true,
scan: false, events: {},
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' }, style: { width: '100%' },
}, },
......
...@@ -43,11 +43,10 @@ export const permissionList = [ ...@@ -43,11 +43,10 @@ export const permissionList = [
fieldId: 'lldw', fieldId: 'lldw',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'organization',
key: '2e1a848d54b144d994cb147279cc1b96', key: '70dd6f50e807416eafb7ca0ea7fdc401',
children: [], children: [],
options: {}, options: {},
defaultValue: '',
}, },
{ {
required: false, required: false,
...@@ -60,8 +59,8 @@ export const permissionList = [ ...@@ -60,8 +59,8 @@ export const permissionList = [
fieldId: 'llr', fieldId: 'llr',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'user',
key: '602d674a8361431fa689d42f72bf4662', key: '2e8683cce6cd40dea3d890b3d421a588',
children: [], children: [],
options: {}, options: {},
defaultValue: '', defaultValue: '',
......
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]); const actionButtons = ref<string[]>(["view","edit","delete"]);
const buttonConfigs = computed(()=>{ 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); return filterButtonAuth(list);
}) })
......
...@@ -132,13 +132,13 @@ export const columns: BasicColumn[] = [ ...@@ -132,13 +132,13 @@ export const columns: BasicColumn[] = [
resizable: true, resizable: true,
dataIndex: 'djbh', dataIndex: 'djbh',
title: '单据编号', title: '单据编号',
componentType: 'input', componentType: 'auto-code',
fixed: false, fixed: false,
sorter: true, sorter: true,
styleConfig: undefined, styleConfig: undefined,
listStyle: '', listStyle: undefined,
}, },
{ {
...@@ -601,34 +601,24 @@ export const formProps: FormProps = { ...@@ -601,34 +601,24 @@ export const formProps: FormProps = {
span: 6, span: 6,
list: [ list: [
{ {
key: '7b5da9c087bc41d5ba2efa9034582b0c', key: '160979df6a214cb590fa0b8f20bcd98c',
field: 'djbh', field: 'djbh',
label: '单据编号', label: '单据编号',
type: 'input', type: 'auto-code',
component: 'Input', component: 'AutoCodeRule',
colProps: { span: 24 }, colProps: { span: 24 },
defaultValue: '',
componentProps: { componentProps: {
width: '100%', width: '100%',
span: 8, span: 7,
defaultValue: '',
placeholder: '请输入单据编号', placeholder: '请输入单据编号',
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true, showLabel: true,
autoCodeRule: 'XSCK',
required: false, required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true, isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' }, style: { width: '100%' },
}, },
......
...@@ -136,19 +136,18 @@ export const permissionList = [ ...@@ -136,19 +136,18 @@ export const permissionList = [
{ {
required: false, required: false,
view: true, view: true,
edit: true, edit: false,
disabled: false, disabled: true,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '单据编号', fieldName: '单据编号',
fieldId: 'djbh', fieldId: 'djbh',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'auto-code',
key: '7b5da9c087bc41d5ba2efa9034582b0c', key: '160979df6a214cb590fa0b8f20bcd98c',
children: [], children: [],
options: {}, options: {},
defaultValue: '',
}, },
{ {
required: false, 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