|
|
@ -41,7 +41,7 @@ |
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm |
|
|
|
ref="basicFormRef" |
|
|
|
@success="getList" |
|
|
|
@success="formsSuccess" |
|
|
|
:rules="PackageRules" |
|
|
|
:formAllSchemas="Package.allSchemas" |
|
|
|
:searchTableParams="searchTableParams" |
|
|
@ -122,6 +122,8 @@ const HeadButttondata = [ |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'add') { // 新增 |
|
|
|
openForm('create') |
|
|
|
} else if (val == 'update') { // 导入 |
|
|
|
openForm('update') |
|
|
|
} else if (val == 'import') { // 导入 |
|
|
|
handleImport() |
|
|
|
} else if (val == 'export') { // 导出 |
|
|
@ -149,18 +151,10 @@ const buttonBaseClick = (val, item) => { |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
// const butttondata = (row) => { |
|
|
|
// return [ |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'wms:package:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:package:delete'}), // 删除 |
|
|
|
// defaultButtons.mainListPointBtn(null), // 标签打印 |
|
|
|
// ] |
|
|
|
// } |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'wms:package:update'}), // 编辑 |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:package:update'}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:package:delete'}), // 删除 |
|
|
|
defaultButtons.mainListPointBtn(null), // 标签打印 |
|
|
|
] |
|
|
@ -179,6 +173,31 @@ const buttonTableClick = async (val, row) => { |
|
|
|
/** 添加/修改操作 */ |
|
|
|
const basicFormRef = ref() |
|
|
|
const openForm =async (type: string, row?: number) => { |
|
|
|
if(type == "update"){ |
|
|
|
Package.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'number') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
if (item.field == 'itemCode') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
if (item.field == 'itemName') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
}else { |
|
|
|
Package.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'number') { |
|
|
|
item.componentProps.disabled = false |
|
|
|
} |
|
|
|
if (item.field == 'itemCode') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
if (item.field == 'itemName') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
@ -221,8 +240,22 @@ const handleExport = async () => { |
|
|
|
|
|
|
|
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
|
|
|
|
|
// form表单提交 |
|
|
|
const formsSuccess = async (formType,data) => { |
|
|
|
if (formType === 'create') { |
|
|
|
await PackageApi.createPackage(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|
await PackageApi.updatePackage(data) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
basicFormRef.value.dialogVisible = false |
|
|
|
getList() |
|
|
|
} |
|
|
|
// 标签打印 |
|
|
|
const handlePoint = async (row) => { |
|
|
|
console.log(row,66666666666); |
|
|
|
|
|
|
|
// 判断是采购还是制造 |
|
|
|
if (row.asnNumber !== null && row.asnNumber !== '') { |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|