|
@ -1,7 +1,7 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="[...InventorymoveRecordMain.allSchemas.searchSchema,...InventorymoveRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search :schema="[...InventorymoveRecordMainNew.allSchemas.searchSchema,...InventorymoveRecordDetailNew.allSchemas.searchSchema]" @search="setSearchParams({'business_type':'Move'})" @reset="setSearchParams({'business_type':'Move'})" /> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
@ -11,8 +11,8 @@ |
|
|
:routeName="routeName" |
|
|
:routeName="routeName" |
|
|
@updataTableColumns="updataTableColumns" |
|
|
@updataTableColumns="updataTableColumns" |
|
|
@searchFormClick="searchFormClick" |
|
|
@searchFormClick="searchFormClick" |
|
|
:allSchemas="InventorymoveRecordMain.allSchemas" |
|
|
:allSchemas="InventorymoveRecordMainNew.allSchemas" |
|
|
:detailAllSchemas="InventorymoveRecordDetail.allSchemas" |
|
|
:detailAllSchemas="InventorymoveRecordDetailNew.allSchemas" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
@ -66,11 +66,13 @@ |
|
|
<Detail |
|
|
<Detail |
|
|
ref="detailRef" |
|
|
ref="detailRef" |
|
|
:isBasic="false" |
|
|
:isBasic="false" |
|
|
:allSchemas="InventorymoveRecordMain.allSchemas" |
|
|
:allSchemas="InventorymoveRecordMainNew.allSchemas" |
|
|
:detailAllSchemas="InventorymoveRecordDetail.allSchemas" |
|
|
:detailAllSchemas="InventorymoveRecordDetailNew.allSchemas" |
|
|
:detailAllSchemasRules="InventorymoveRecordDetailRules" |
|
|
:detailAllSchemasRules="InventorymoveRecordDetailNewRules" |
|
|
:apiPage="InventorymoveRecordDetailApi.getInventorymoveRecordDetailPage" |
|
|
:apiPage="InventorymoveRecordDetailApi.getInventorymoveRecordDetailPage" |
|
|
/> |
|
|
/> |
|
|
|
|
|
<!-- 标签打印 --> |
|
|
|
|
|
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" /> |
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/inventorymove-record-main/importMove" :importTemplateData="importTemplateData" |
|
|
<ImportForm ref="importFormRef" url="/wms/inventorymove-record-main/importMove" :importTemplateData="importTemplateData" |
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :fromInventoryStatus= "fromInventoryStatus" :toInventoryStatus="toInventoryStatus" /> |
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :fromInventoryStatus= "fromInventoryStatus" :toInventoryStatus="toInventoryStatus" /> |
|
@ -78,15 +80,23 @@ |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { InventorymoveRecordMain,InventorymoveRecordMainRules,InventorymoveRecordDetail,InventorymoveRecordDetailRules } from './inventorymoveRecordMain.data' |
|
|
import { InventorymoveRecordMainNew,InventorymoveRecordDetailNew,InventorymoveRecordDetailNewRules } from './inventorymoveRecordMainNew.data' |
|
|
import { InventorymoveRequestMain,InventorymoveRequestMainRules,InventorymoveRequestDetail,InventorymoveRequestDetailRules } from './inventorymoveRecordRequestMain.data' |
|
|
import { InventorymoveRequestMain,InventorymoveRequestMainRules,InventorymoveRequestDetail,InventorymoveRequestDetailRules } from './inventorymoveRecordRequestMain.data' |
|
|
|
|
|
import { |
|
|
|
|
|
SupplierdeliverRequestPackage |
|
|
|
|
|
} from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
|
|
|
|
|
|
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
|
|
|
|
|
|
|
|
import * as PackageApi from '@/api/wms/package' |
|
|
|
|
|
import { getJmreportBaseUrl } from '@/utils/systemParam' |
|
|
import * as InventorymoveRequestMainApi from '@/api/wms/inventorymoveRequestMain' |
|
|
import * as InventorymoveRequestMainApi from '@/api/wms/inventorymoveRequestMain' |
|
|
import * as InventorymoveRecordMainApi from '@/api/wms/inventorymoveRecordMain' |
|
|
import * as InventorymoveRecordMainApi from '@/api/wms/inventorymoveRecordMain' |
|
|
import * as InventorymoveRecordDetailApi from '@/api/wms/inventorymoveRecordDetail' |
|
|
import * as InventorymoveRecordDetailApi from '@/api/wms/inventorymoveRecordDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
// 库存转移记录主 |
|
|
// 库存转移记录主 |
|
|
defineOptions({ name: 'InventorymoveRecordMain' }) |
|
|
defineOptions({ name: 'InventorymoveRecordMainNew' }) |
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
@ -95,7 +105,7 @@ const importFileName = ref() |
|
|
const route = useRoute() // 路由信息 |
|
|
const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref([...InventorymoveRecordMain.allSchemas.tableColumns,...InventorymoveRecordDetail.allSchemas.tableMainColumns]) |
|
|
const tableColumns = ref([...InventorymoveRecordMainNew.allSchemas.tableColumns,...InventorymoveRecordDetailNew.allSchemas.tableMainColumns]) |
|
|
|
|
|
|
|
|
console.log(99 , routeName.value) |
|
|
console.log(99 , routeName.value) |
|
|
const fromInventoryStatus = ref() |
|
|
const fromInventoryStatus = ref() |
|
@ -107,6 +117,7 @@ const updataTableColumns = (val) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
|
|
defaultParams:{'business_type':'Move'}, |
|
|
getListApi: InventorymoveRecordDetailApi.getInventorymoveRecordDetailPage // 分页接口 |
|
|
getListApi: InventorymoveRecordDetailApi.getInventorymoveRecordDetailPage // 分页接口 |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
@ -165,17 +176,77 @@ const openForm =async (type: string, row?: number) => { |
|
|
formRef.value.open(type, row) |
|
|
formRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = (row,$index) => { |
|
|
const butttondata = (row,$index) => { |
|
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|
|
if(findIndex>-1&&findIndex<$index){ |
|
|
if(findIndex>-1&&findIndex<$index){ |
|
|
return [] |
|
|
return [] |
|
|
} |
|
|
} |
|
|
return [] |
|
|
return [ |
|
|
|
|
|
defaultButtons.mainListPointBtn(null), // 标签打印 |
|
|
|
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
|
|
if (val == 'point') { // 标签打印 |
|
|
|
|
|
labelPrint(row) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
const BASE_URL = getJmreportBaseUrl() |
|
|
|
|
|
// 标签打印 |
|
|
|
|
|
const searchTableRef = ref() |
|
|
|
|
|
const labelType = ref('') // 标签类别 采购还是制造等 |
|
|
|
|
|
const labelPrint = async (row) => { |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
//获取类型 |
|
|
|
|
|
let resType = await PackageApi.getPackagePage({ |
|
|
|
|
|
requestNumber: row.number |
|
|
|
|
|
}) |
|
|
|
|
|
if(resType.list.length > 0){ |
|
|
|
|
|
if (resType.list[0].productionLineCode != null) { |
|
|
|
|
|
labelType.value = 'zz' |
|
|
|
|
|
} else { |
|
|
|
|
|
labelType.value = 'cg' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
const defaultParams = {'moduleName':'productreceipt_predict','tableName':'record_productreceipt_main','recordNumber':row.number} |
|
|
|
|
|
const {tableObject:tableObjectPrint ,tableMethods} = useTable({ |
|
|
|
|
|
defaultParams, |
|
|
|
|
|
getListApi: PackageApi.getLabelDetailPage // 分页接口 |
|
|
|
|
|
}) |
|
|
|
|
|
// 获得表格的各种操作 |
|
|
|
|
|
const { getList:getListPrint } = tableMethods |
|
|
|
|
|
getListPrint() |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns |
|
|
|
|
|
tableColumns.forEach((item) => { |
|
|
|
|
|
item.width = item.table?.width || 150 |
|
|
|
|
|
}) |
|
|
|
|
|
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true) |
|
|
|
|
|
} |
|
|
|
|
|
// 批量打印--预生产收货 |
|
|
|
|
|
const searchTableSuccessLabel = async (formField, searchField, val, formRef, type, row) => { |
|
|
|
|
|
console.log('批量打印',val) |
|
|
|
|
|
|
|
|
|
|
|
if(val.length == 0){ |
|
|
|
|
|
message.warning("请先选择要打印的数据!") |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
if (labelType.value == 'cg') { |
|
|
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
|
|
window.open(src.value+'&asn_number='+res) |
|
|
|
|
|
} else { |
|
|
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) |
|
|
|
|
|
window.open(src.value+'&asn_number='+res) |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
message.error('创建标签失败') |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
// 获取部门 用于详情 部门回显 |
|
|
// 获取部门 用于详情 部门回显 |
|
|
const { wsCache } = useCache() |
|
|
const { wsCache } = useCache() |
|
@ -208,7 +279,7 @@ const handleExport = async () => { |
|
|
* tableForm方法 |
|
|
* tableForm方法 |
|
|
*/ |
|
|
*/ |
|
|
const tableFormKeys = {} |
|
|
const tableFormKeys = {} |
|
|
InventorymoveRecordDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
InventorymoveRecordDetailNew.allSchemas.tableFormColumns.forEach(item => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
@ -241,6 +312,8 @@ const submitForm = async (formType, submitData) => { |
|
|
item.toBatch = item.fromBatch |
|
|
item.toBatch = item.fromBatch |
|
|
item.fromLocationCode = data.fromLocationCode |
|
|
item.fromLocationCode = data.fromLocationCode |
|
|
item.toLocationCode = data.toLocationCode |
|
|
item.toLocationCode = data.toLocationCode |
|
|
|
|
|
item.toInventoryStatus = data.toInventoryStatus |
|
|
|
|
|
|
|
|
if(item.qty == 0){ |
|
|
if(item.qty == 0){ |
|
|
message.error(`到数量不能为0!`) |
|
|
message.error(`到数量不能为0!`) |
|
|
flag.value = true |
|
|
flag.value = true |
|
@ -276,6 +349,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
val.forEach(item=>{ |
|
|
val.forEach(item=>{ |
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
newRow['fromPackingNumber'] = item['packingNumber'] |
|
|
newRow['fromPackingNumber'] = item['packingNumber'] |
|
|
|
|
|
newRow['toPackingNumber'] = item['packingNumber'] |
|
|
newRow['fromContainerNumber'] = item['containerNumber'] |
|
|
newRow['fromContainerNumber'] = item['containerNumber'] |
|
|
newRow['itemCode'] = item['itemCode'] |
|
|
newRow['itemCode'] = item['itemCode'] |
|
|
newRow['fromBatch'] = item['batch'] |
|
|
newRow['fromBatch'] = item['batch'] |
|
@ -283,10 +357,19 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
newRow['origin_fromLocationCode'] = item['locationCode'] |
|
|
newRow['origin_fromLocationCode'] = item['locationCode'] |
|
|
newRow['uom'] = item['uom'] |
|
|
newRow['uom'] = item['uom'] |
|
|
newRow['qty'] = item['qty'] |
|
|
newRow['qty'] = item['qty'] |
|
|
|
|
|
if(item['packingNumber']&&item['packingNumber'].length>0){ |
|
|
newRow['packUnit'] = item['packUnit'] |
|
|
newRow['packUnit'] = item['packUnit'] |
|
|
newRow['packQty'] = item['packQty'] |
|
|
newRow['packQty'] = item['packQty'] |
|
|
|
|
|
}else{ |
|
|
|
|
|
newRow['packUnit'] = '' |
|
|
|
|
|
newRow['packQty'] = '' |
|
|
|
|
|
} |
|
|
tableData.value.push(newRow) |
|
|
tableData.value.push(newRow) |
|
|
}) |
|
|
}) |
|
|
|
|
|
}else if(formField == 'packUnit'){ |
|
|
|
|
|
//包装规格 |
|
|
|
|
|
row['packUnit'] = val[0]['packUnit'] |
|
|
|
|
|
row['packQty'] = val[0]['packQty'] |
|
|
} else { |
|
|
} else { |
|
|
row[formField] = val[0][searchField] |
|
|
row[formField] = val[0][searchField] |
|
|
} |
|
|
} |
|
@ -325,7 +408,11 @@ const importSuccess = () => { |
|
|
const searchFormClick = (searchData) => { |
|
|
const searchFormClick = (searchData) => { |
|
|
tableObject.params = { |
|
|
tableObject.params = { |
|
|
isSearch: true, |
|
|
isSearch: true, |
|
|
filters: searchData.filters |
|
|
filters: [...searchData.filters,{ |
|
|
|
|
|
action: "==", |
|
|
|
|
|
column: "business_type", |
|
|
|
|
|
value: "Move" |
|
|
|
|
|
}] |
|
|
} |
|
|
} |
|
|
getList() // 刷新当前列表 |
|
|
getList() // 刷新当前列表 |
|
|
} |
|
|
} |
|
|