Commit 9ca545ae by 张珈源

feat(ckgl/cgdh): 添加采购组织字段并调整表单配置

- 在CgdhModel模型中新增cgzz字段替换原有的p4字段
- 在表格配置中添加采购组织列的显示和排序功能
- 在表单配置中添加采购组织输入框组件
- 调整工作流权限配置中的字段映射关系
- 恢复总数量字段的表单配置
- 移除未使用的getToken导入
- 修复代码中的语法错误和格式问题
parent 8fd6c4de
...@@ -31,6 +31,8 @@ export interface MesWarehouseArrivedPageModel { ...@@ -31,6 +31,8 @@ export interface MesWarehouseArrivedPageModel {
kczz: string; kczz: string;
cgzz: string;
zsl: string; zsl: string;
zt: string; zt: string;
...@@ -68,7 +70,7 @@ export interface MesWarehouseArrivedModel { ...@@ -68,7 +70,7 @@ export interface MesWarehouseArrivedModel {
zt: string; zt: string;
p4: string; cgzz: string;
p5: string; p5: string;
......
...@@ -117,6 +117,19 @@ export const columns: BasicColumn[] = [ ...@@ -117,6 +117,19 @@ export const columns: BasicColumn[] = [
{ {
resizable: true, resizable: true,
dataIndex: 'cgzz',
title: '采购组织',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'zsl', dataIndex: 'zsl',
title: '总数量', title: '总数量',
componentType: 'number', componentType: 'number',
...@@ -497,28 +510,36 @@ export const formProps: FormProps = { ...@@ -497,28 +510,36 @@ export const formProps: FormProps = {
span: 8, span: 8,
list: [ list: [
{ {
key: '94f59d97b377411fb1097853bd9479b0', key: '8b55245dd1cb473193b7302da6ec35be',
field: 'fj', field: 'cgzz',
label: '上传附件', label: '采购组织',
type: 'upload', type: 'input',
component: 'Upload', component: 'Input',
colProps: { span: 24 }, colProps: { span: 24 },
defaultValue: '',
componentProps: { componentProps: {
api: uploadApi, width: '100%',
span: 7, span: 7,
defaultValue: '', defaultValue: '',
accept: '', placeholder: '请输入采购组织',
maxNumber: 5, prefix: '',
maxSize: 5, suffix: '',
showLabel: true, addonBefore: '',
multiple: false, addonAfter: '',
disabled: false, disabled: false,
allowClear: false,
showLabel: true,
required: false, required: false,
isShow: true, rules: [],
events: {}, events: {},
listType: 'text', listStyle: '',
sourceType: 'album,camera', isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
}, },
}, },
], ],
...@@ -527,29 +548,28 @@ export const formProps: FormProps = { ...@@ -527,29 +548,28 @@ export const formProps: FormProps = {
span: 8, span: 8,
list: [ list: [
{ {
key: '4ca80a2d3a8244bc8d3380b6b0457c25', key: '94f59d97b377411fb1097853bd9479b0',
field: 'zsl', field: 'fj',
label: '总数量', label: '上传附件',
type: 'number', type: 'upload',
component: 'InputNumber', component: 'Upload',
colProps: { span: 24 }, colProps: { span: 24 },
defaultValue: 0,
componentProps: { componentProps: {
width: '100%', api: uploadApi,
span: 7, span: 7,
defaultValue: 0, defaultValue: '',
min: 0, accept: '',
step: 1, maxNumber: 5,
disabled: false, maxSize: 5,
showLabel: true, showLabel: true,
controls: true, multiple: false,
disabled: false,
required: false, required: false,
subTotal: false, isShow: true,
isShow: false,
rules: [],
events: {}, events: {},
listType: 'text',
sourceType: 'album,camera',
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
}, },
}, },
], ],
...@@ -649,7 +669,6 @@ export const formProps: FormProps = { ...@@ -649,7 +669,6 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '2012042307269611522' }, params: { itemId: '2012042307269611522' },
labelField: 'name', labelField: 'name',
...@@ -671,6 +690,37 @@ export const formProps: FormProps = { ...@@ -671,6 +690,37 @@ export const formProps: FormProps = {
}, },
], ],
}, },
{
span: 8,
list: [
{
key: '4ca80a2d3a8244bc8d3380b6b0457c25',
field: 'zsl',
label: '总数量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
defaultValue: 0,
min: 0,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: false,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
], ],
componentProps: { componentProps: {
gutter: 16, gutter: 16,
......
...@@ -125,12 +125,12 @@ export const permissionList = [ ...@@ -125,12 +125,12 @@ export const permissionList = [
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '上传附件', fieldName: '采购组织',
fieldId: 'fj', fieldId: 'cgzz',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'upload', type: 'input',
key: '94f59d97b377411fb1097853bd9479b0', key: '8b55245dd1cb473193b7302da6ec35be',
children: [], children: [],
options: {}, options: {},
defaultValue: '', defaultValue: '',
...@@ -142,15 +142,15 @@ export const permissionList = [ ...@@ -142,15 +142,15 @@ export const permissionList = [
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '总数量', fieldName: '上传附件',
fieldId: 'zsl', fieldId: 'fj',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'number', type: 'upload',
key: '4ca80a2d3a8244bc8d3380b6b0457c25', key: '94f59d97b377411fb1097853bd9479b0',
children: [], children: [],
options: {}, options: {},
defaultValue: 0, defaultValue: '',
}, },
{ {
required: false, required: false,
...@@ -203,6 +203,23 @@ export const permissionList = [ ...@@ -203,6 +203,23 @@ export const permissionList = [
options: {}, options: {},
}, },
{ {
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '总数量',
fieldId: 'zsl',
isSubTable: false,
showChildren: true,
type: 'number',
key: '4ca80a2d3a8244bc8d3380b6b0457c25',
children: [],
options: {},
defaultValue: 0,
},
{
required: true, required: true,
view: true, view: true,
edit: true, edit: true,
......
...@@ -65,12 +65,11 @@ ...@@ -65,12 +65,11 @@
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';
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
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'; import { useUserStore } from '/@/store/modules/user';
...@@ -78,6 +77,7 @@ ...@@ -78,6 +77,7 @@
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
const buttonConfigs = computed(()=>{ const buttonConfigs = computed(()=>{
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"},{"buttonId":"2012037219988561920","name":"生成入库单","code":"create","icon":"ant-design:download-outlined","isDefault":false,"isUse":true,"setting":[],"showType":"inline","buttonType":"primary"}] 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"},{"buttonId":"2012037219988561920","name":"生成入库单","code":"create","icon":"ant-design:download-outlined","isDefault":false,"isUse":true,"setting":[],"showType":"inline","buttonType":"primary"}]
return filterButtonAuth(list); return filterButtonAuth(list);
}); })
const tableButtonConfig = computed(() => { const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code)); return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
...@@ -144,7 +144,7 @@ ...@@ -144,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,create: handleCreate,} const btnEvent = {view : handleView,edit : handleEdit,create : handleCreate}
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
...@@ -311,12 +311,13 @@ ...@@ -311,12 +311,13 @@
openModal(true, info); openModal(true, info);
} }
async function handleCreate(record: Recordable) { async function handleCreate(record: Recordable) {
try { try {
// 获取token\ // 获取token\
const store = useUserStore(); const store = useUserStore();
let token = store.token let token = store.token
// 调用后端接口 // 调用后端接口
const response = await fetch('http://localhost:8053/ckgl/cgrk', { const response = await fetch('http://localhost:8053/ckgl/cgrk', {
method: 'POST', method: 'POST',
...@@ -350,9 +351,6 @@ ...@@ -350,9 +351,6 @@
} }
} }
function getLessActions(record: Recordable) { function getLessActions(record: Recordable) {
let list = getActions(record); let list = getActions(record);
return list.slice(0, listSpliceNum.value); return list.slice(0, listSpliceNum.value);
...@@ -363,12 +361,12 @@ ...@@ -363,12 +361,12 @@
} }
function getActions(record: Recordable):ActionItem[] { function getActions(record: Recordable):ActionItem[] {
record.isCanEdit = false; record.isCanEdit = false;
let actionsList: ActionItem[] = []; let actionsList: ActionItem[] = [];
actionButtonConfig.value?.map((button) => { actionButtonConfig.value?.map((button) => {
// 检查是否应该显示当前按钮 // 检查是否应该显示当前按钮
let shouldShowButton = true; let shouldShowButton = true;
// 控制create按钮的显示/隐藏 // 控制create按钮的显示/隐藏
if (button.code === 'create') { if (button.code === 'create') {
// 质检状态为"草稿"或"已质检"时隐藏 // 质检状态为"草稿"或"已质检"时隐藏
...@@ -384,14 +382,14 @@ ...@@ -384,14 +382,14 @@
shouldShowButton = false; shouldShowButton = false;
} }
} }
// 如果按钮应该显示,则继续处理 // 如果按钮应该显示,则继续处理
if (shouldShowButton) { if (shouldShowButton) {
if (!record?.workflowData?.processId) { if (!record?.workflowData?.processId) {
record.isCanEdit = true; record.isCanEdit = true;
actionsList.push({ actionsList.push({
...button, ...button,
auth: `cgdh:${button.code}`, auth: `cgdh:${button.code}`,
label: button?.name, label: button?.name,
color: button.code === 'delete' ? 'error' : undefined, color: button.code === 'delete' ? 'error' : undefined,
...@@ -404,7 +402,7 @@ ...@@ -404,7 +402,7 @@
label: button?.name, label: button?.name,
onClick: btnEvent[button.code]?.bind(null, record), onClick: btnEvent[button.code]?.bind(null, record),
}); });
} }
} }
} }
}); });
......
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