Commit 8fd6c4de by 张珈源

feat(cgdh): 添加采购到货单质检状态和相关字段

- 在CgdhModel模型中新增zsl(总数量)、zt(质检状态)、bz(备注)字段
- 配置文件中添加总数量、质检状态、备注三个表格列的显示配置
- 表单配置中添加质检状态选择组件及其相关属性设置
- 工作流权限配置中增加质检状态字段的权限控制
- 更新操作按钮配置,添加生成入库单功能按钮
- 调整表格操作列宽度以适应更多按钮显示
- 移除批量报检按钮的事件绑定逻辑
- 优化表单组件中的sendMessageForAllIframe函数格式
parent fdc0cd85
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesWarehouseArrivedPage, deleteMesWarehouseArrived} from '/@/api/ckgl/cgdh'; import { getMesWarehouseArrivedPage, deleteMesWarehouseArrived} from '/@/api/ckgl/cgdh';
import { getToken } from '/@/utils/auth';
import { ResizePageWrapper } from '/@/components/Page'; import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
...@@ -72,7 +73,7 @@ ...@@ -72,7 +73,7 @@
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue'; import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { executeListStyle, getValue } from '/@/hooks/web/useListStyle';//列表样式配置 import { executeListStyle, getValue } from '/@/hooks/web/useListStyle';//列表样式配置
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useUserStore } from '/@/store/modules/user';
...@@ -143,7 +144,7 @@ ...@@ -143,7 +144,7 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
}); });
const btnEvent = {view : handleView,edit : handleEdit,} const btnEvent = {view : handleView,edit : handleEdit,create: handleCreate,}
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
...@@ -309,6 +310,45 @@ ...@@ -309,6 +310,45 @@
openModal(true, info); openModal(true, info);
} }
async function handleCreate(record: Recordable) {
try {
// 获取token\
const store = useUserStore();
let token = store.token
// 调用后端接口
const response = await fetch('http://localhost:8053/ckgl/cgrk', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + token, // 添加token到请求头
},
body: JSON.stringify(record), // 将当前行数据作为参数传递
});
if (response.ok) {
const result = await response.json();
notification.success({
message: '操作成功',
description: '生成入库单成功',
});
// 刷新表格数据
reload();
} else {
const error = await response.json();
notification.error({
message: '操作失败',
description: error.message || '生成入库单失败',
});
}
} catch (error) {
notification.error({
message: '操作失败',
description: '网络错误,请稍后重试',
});
}
}
...@@ -326,25 +366,46 @@ ...@@ -326,25 +366,46 @@
let actionsList: ActionItem[] = []; let actionsList: ActionItem[] = [];
actionButtonConfig.value?.map((button) => { actionButtonConfig.value?.map((button) => {
if (!record?.workflowData?.processId) { // 检查是否应该显示当前按钮
record.isCanEdit = true; let shouldShowButton = true;
actionsList.push({
...button, // 控制create按钮的显示/隐藏
if (button.code === 'create') {
auth: `cgdh:${button.code}`, // 质检状态为"草稿"或"已质检"时隐藏
label: button?.name, if (record.zt === '草稿' || record.zt === '已质检') {
color: button.code === 'delete' ? 'error' : undefined, shouldShowButton = false;
onClick: btnEvent[button.code]?.bind(null, record), }
}); // 质检状态为"质检合格"或"质检不合格"时显示
} else { else if (record.zt === '质检合格' || record.zt === '质检不合格') {
if (!['edit', 'delete'].includes(button.code)) { shouldShowButton = true;
}
// 其他状态默认隐藏
else {
shouldShowButton = false;
}
}
// 如果按钮应该显示,则继续处理
if (shouldShowButton) {
if (!record?.workflowData?.processId) {
record.isCanEdit = true;
actionsList.push({ actionsList.push({
...button,
auth: `cgdh:${button.code}`, auth: `cgdh:${button.code}`,
label: button?.name, label: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code]?.bind(null, record), onClick: btnEvent[button.code]?.bind(null, record),
}); });
} } else {
if (!['edit', 'delete'].includes(button.code)) {
actionsList.push({
auth: `cgdh:${button.code}`,
label: button?.name,
onClick: btnEvent[button.code]?.bind(null, record),
});
}
}
} }
}); });
return actionsList; return actionsList;
......
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