Commit 5ee600ec by 宋春膨

fix(ckgl/cgdh): 修复采购到货页面配置和交互功能

- 移除输入框maxlength限制并添加预置字段配置
- 将查询参数字段名从ddhid更改为dhdid并更新相关SQL查询
- 清空批量报检事件配置并隐藏新增按钮
- 添加表格行选择功能和选中状态管理
- 移除删除按钮和相关删除逻辑
- 调整操作列宽度并优化双击行事件处理
- 同步按钮配置更新并移除未使用的导入依赖
parent 43413681
...@@ -622,7 +622,6 @@ export const formProps: FormProps = { ...@@ -622,7 +622,6 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
placeholder: '请输入id', placeholder: '请输入id',
maxlength: null,
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
...@@ -640,6 +639,7 @@ export const formProps: FormProps = { ...@@ -640,6 +639,7 @@ export const formProps: FormProps = {
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'id',
}, },
}, },
{ {
...@@ -1011,10 +1011,17 @@ export const formProps: FormProps = { ...@@ -1011,10 +1011,17 @@ export const formProps: FormProps = {
title: 'Query Params', title: 'Query Params',
tableInfo: [ tableInfo: [
{ {
name: 'ddhid', name: 'dhdid',
value: '{"bindField":"id","fieldKey":"139048460226487596074dfbbaedba0c"}', value: '{"bindField":"id","fieldKey":"139048460226487596074dfbbaedba0c"}',
description: null,
required: true, required: true,
dataType: 'String',
type: null,
defaultValue: '0', defaultValue: '0',
validateType: null,
error: null,
expression: null,
children: null,
bindType: 'data', bindType: 'data',
}, },
], ],
...@@ -1023,7 +1030,7 @@ export const formProps: FormProps = { ...@@ -1023,7 +1030,7 @@ export const formProps: FormProps = {
{ key: '3', title: 'Body' }, { key: '3', title: 'Body' },
], ],
script: script:
'var sql="select * from mes_warehouse_arrived_info where id = #{ddhid}";\r\nreturn db.select(sql);', 'var sql="select * from mes_warehouse_arrived_info where dhdid = #{dhdid}";\r\nreturn db.select(sql);',
}, },
itemId: '', itemId: '',
dicOptions: [], dicOptions: [],
...@@ -1045,15 +1052,7 @@ export const formProps: FormProps = { ...@@ -1045,15 +1052,7 @@ export const formProps: FormProps = {
label: '批量报检', label: '批量报检',
icon: 'ant-design:alert-outlined', icon: 'ant-design:alert-outlined',
style: 'primary', style: 'primary',
event: [ event: [],
{
operateType: 2,
operateConfig: {
apiConfig: { path: '' },
js: "if(formActionType.selectedRowsData\n\t&&Array.isArray(formActionType.selectedRowsData)\n\t&&formActionType.selectedRowsData.length>0){\n\tlet item = formActionType.selectedRowsData;\n\tfor(let i=0; i<item.length; i++){\n formActionType.httpRequest({\n requestType: 'put',\n requestUrl: '/magic-api//updateSfzj',\n params: {\n id: item[i].id\n },\n errorMessageMode: 'message'\n })\n }\n}",
},
},
],
type: 1, type: 1,
}, },
], ],
...@@ -1062,7 +1061,7 @@ export const formProps: FormProps = { ...@@ -1062,7 +1061,7 @@ export const formProps: FormProps = {
isDeleteSelected: false, isDeleteSelected: false,
isListView: false, isListView: false,
viewList: [], viewList: [],
isShowAdd: true, isShowAdd: false,
isShowDelete: false, isShowDelete: false,
hasCheckedCol: true, hasCheckedCol: true,
events: {}, events: {},
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<template #resizeRight> <template #resizeRight>
<BasicTable @register="registerTable" isMenuTable ref="tableRef" <BasicTable @register="registerTable" isMenuTable ref="tableRef" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }"
> >
...@@ -60,11 +60,9 @@ ...@@ -60,11 +60,9 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed,provide,Ref, createVNode, import { ref, computed,provide,Ref,
} from 'vue'; } from 'vue';
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
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 { ResizePageWrapper } from '/@/components/Page'; import { ResizePageWrapper } from '/@/components/Page';
...@@ -131,9 +129,9 @@ ...@@ -131,9 +129,9 @@
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]); const actionButtons = ref<string[]>(["view","edit"]);
const buttonConfigs = computed(()=>{ const buttonConfigs = computed(()=>{
const list = [{"buttonId":"2009445983314264064","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2009445983314264065","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2009445983314264066","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2009445983314264067","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}] const list = [{"buttonId":"2009445983314264064","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2009445983314264066","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2009478676487966720","name":"同步","code":"get","icon":"ant-design:arrow-down-outlined","isDefault":false,"isUse":true,"setting":[],"showType":"top","buttonType":"primary"}]
return filterButtonAuth(list); return filterButtonAuth(list);
}) })
...@@ -145,7 +143,7 @@ ...@@ -145,7 +143,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,add : handleAdd,edit : handleEdit,delete : handleDelete,} const btnEvent = {view : handleView,edit : handleEdit,}
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
...@@ -157,6 +155,8 @@ ...@@ -157,6 +155,8 @@
const selectedKeys = ref<string[]>([]);
const selectedRowsData = ref<any[]>([]);
...@@ -189,6 +189,8 @@ ...@@ -189,6 +189,8 @@
selectedKeys.value = [];
selectedRowsData.value = [];
}, },
useSearchForm: true, useSearchForm: true,
...@@ -198,7 +200,7 @@ ...@@ -198,7 +200,7 @@
striped: false, striped: false,
actionColumn: { actionColumn: {
width: 195, width: 130,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
slots: { customRender: 'action' }, slots: { customRender: 'action' },
...@@ -221,13 +223,6 @@ ...@@ -221,13 +223,6 @@
} }
function handleAdd() {
openModal(true, { isUpdate: false, });
}
async function handleEdit(record: Recordable) { async function handleEdit(record: Recordable) {
let field = 'id'; let field = 'id';
...@@ -256,39 +251,29 @@ ...@@ -256,39 +251,29 @@
function handleDelete(record: Recordable) {
deleteList([record.id]);
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认删除?',
okText: '确认',
cancelText: '取消',
onOk() {
deleteMesWarehouseArrived(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!'),
});
});
},
onCancel() {},
});
}
function onSelectChange(selectedRowKeys: [], selectedRows) {
selectedKeys.value = selectedRowKeys;
selectedRowsData.value = selectedRows;
}
function customRow(record: Recordable) { function customRow(record: Recordable) {
return { return {
onClick: () => {
let selectedRowKeys = [...selectedKeys.value];
if (selectedRowKeys.indexOf(record.id) >= 0) {
let index = selectedRowKeys.indexOf(record.id);
selectedRowKeys.splice(index, 1);
} else {
selectedRowKeys.push(record.id);
}
selectedKeys.value = selectedRowKeys;
},
ondblclick: () => { ondblclick: () => {
if (record.isCanEdit && hasPermission("cgdh:edit")) { if (record.isCanEdit && hasPermission("cgdh:edit")) {
handleEdit(record); handleEdit(record);
...@@ -300,6 +285,8 @@ ...@@ -300,6 +285,8 @@
function handleSuccess() { function handleSuccess() {
selectedKeys.value = [];
selectedRowsData.value = [];
reload(); reload();
} }
...@@ -382,4 +369,4 @@ ...@@ -382,4 +369,4 @@
</style> </style>
\ No newline at end of file
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