|
|
@ -45,8 +45,8 @@ |
|
|
|
:rules="PackageRules" |
|
|
|
:formAllSchemas="Package.allSchemas" |
|
|
|
:searchTableParams="searchTableParams" |
|
|
|
:apiUpdate="PackageApi.updatePackage" |
|
|
|
:apiCreate="PackageApi.createPackage" |
|
|
|
:apiUpdate="BarbasicApi.updateBarbasic" |
|
|
|
:apiCreate="BarbasicApi.createBarbasic" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
:isBusiness="false" |
|
|
|
/> |
|
|
@ -62,7 +62,7 @@ |
|
|
|
import download from '@/utils/download' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
import { Package,PackageRules } from './manufacturePackage.data' |
|
|
|
import * as PackageApi from '@/api/wms/package' |
|
|
|
import * as BarbasicApi from '@/api/wms/barbasic' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
|
|
|
|
// 制造件标签 |
|
|
@ -76,29 +76,21 @@ const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(Package.allSchemas.tableColumns) |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* PurchasePackage regularParams = procure采购件标签记录页面 |
|
|
|
* ManufacturePackage regularParams = manufacture 制造件标签记录页面 |
|
|
|
* UtensilPackage regularParams = utensil 器具标签记录页面 |
|
|
|
* SupplierPackage regularParams = procure 供应商发货标签记录(用采购标签) |
|
|
|
* PurchasePackage type = PurchaseLabel 采购件标签记录页面 |
|
|
|
* ManufacturePackage type = MakeLabel 制造件标签记录页面 |
|
|
|
* UtensilPackage type = ContainerLabel 器具标签记录页面 |
|
|
|
* SupplierPackage type = PurchaseLabel 供应商发货标签记录(用采购标签) |
|
|
|
*/ |
|
|
|
const regularParams = ref(route.name == 'PurchasePackage'?'procure':route.name == 'ManufacturePackage'?'manufacture':route.name == 'UtensilPackage'?'utensil':route.name == 'SupplierPackage'?'procure':'') |
|
|
|
const type = ref(route.name == 'PurchasePackage'?'PurchaseLabel':route.name == 'ManufacturePackage'?'MakeLabel':route.name == 'UtensilPackage'?'ContainerLabel':route.name == 'SupplierPackage'?'PurchaseLabel':'') |
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查询列表页面参数设置 |
|
|
|
const searchTableParams = ref([ |
|
|
|
//{ |
|
|
|
// formField: 'productItemCode', |
|
|
|
// searchTableTitle: '物料信息', |
|
|
|
// searchTableAllSchemas: Itembasic.allSchemas, |
|
|
|
// searchTablePage: ItembasicApi.getItembasicPage |
|
|
|
//} |
|
|
|
]) |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
@ -111,9 +103,9 @@ const searchTableSuccess = (formField, searchField, val, basicFormRef, type, row |
|
|
|
} |
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: PackageApi.getPackagePage // 分页接口 |
|
|
|
getListApi: BarbasicApi.getBarbasicPage // 分页接口 |
|
|
|
}) |
|
|
|
tableObject.params.regularParams = regularParams.value |
|
|
|
tableObject.params.type = type.value |
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
@ -183,7 +175,7 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} else if (val == 'point') { // 标签打印 |
|
|
|
handlePoint(row.id) |
|
|
|
handlePoint(row.relateNumber) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -205,7 +197,7 @@ const handleDelete = async (id: number) => { |
|
|
|
// 删除的二次确认 |
|
|
|
await message.delConfirm() |
|
|
|
// 发起删除 |
|
|
|
await PackageApi.deletePackage(id) |
|
|
|
await BarbasicApi.deleteBarbasic(id) |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
@ -220,8 +212,8 @@ const handleExport = async () => { |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const data = await PackageApi.exportPackage(setSearchParams) |
|
|
|
download.excel(data, '包装.xlsx') |
|
|
|
const data = await BarbasicApi.exportBarbasic(tableObject.params) |
|
|
|
download.excel(data, '制造件标签.xlsx') |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
exportLoading.value = false |
|
|
@ -229,10 +221,10 @@ const handleExport = async () => { |
|
|
|
} |
|
|
|
|
|
|
|
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/894718245021065216?token=' + getAccessToken()) |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/899811206721347584?token=' + getAccessToken()) |
|
|
|
// 标签打印 |
|
|
|
const handlePoint = async (id) => { |
|
|
|
window.open(src.value+'&id='+id) |
|
|
|
const handlePoint = async (number) => { |
|
|
|
window.open(src.value+'&number='+number) |
|
|
|
} |
|
|
|
|
|
|
|
/** 导入 */ |
|
|
@ -257,7 +249,7 @@ const searchFormClick = (searchData) => { |
|
|
|
tableObject.params = { |
|
|
|
isSearch: true, |
|
|
|
filters: searchData.filters, |
|
|
|
regularParams:regularParams.value |
|
|
|
type:type.value |
|
|
|
} |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|