|
|
@ -59,7 +59,15 @@ |
|
|
|
@submitForm="submitForm" |
|
|
|
@formFormDateChange="formFormDateChange" |
|
|
|
@onEnter="onEnter" |
|
|
|
/> |
|
|
|
> |
|
|
|
<template v-slot="{row}"> |
|
|
|
<el-date-picker v-bind:modelValue="row['expireTime']?addDay(row['produceDate'],row['expireTime']):dayjs('2099-12-31').valueOf()" |
|
|
|
:clearable="true" |
|
|
|
style="width: 100%" |
|
|
|
:disabled="true" |
|
|
|
placeholder="选择日期"/> |
|
|
|
</template> |
|
|
|
</BasicForm> |
|
|
|
<!-- 详情 --> |
|
|
|
<Detail |
|
|
|
ref="detailRef" |
|
|
@ -118,10 +126,15 @@ |
|
|
|
:isShowReduceButton="false" |
|
|
|
:isShowFooterButtton="false" |
|
|
|
/> |
|
|
|
<!-- 标签打印 --> |
|
|
|
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
|
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import { addDay } from '@/utils/formatTime' |
|
|
|
import download from '@/utils/download' |
|
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
|
import { |
|
|
@ -130,11 +143,13 @@ import { |
|
|
|
PurchasereceiptRequestDetail, |
|
|
|
PurchasereceiptRequestDetailRules, |
|
|
|
PurchasereceiptRequestDetailLabel, |
|
|
|
PurchasereceiptRequestDetailPackingNumber, |
|
|
|
|
|
|
|
PurchasereceiptRequestDetailPackingNumber |
|
|
|
} from './purchasereceiptRequestMain.data' |
|
|
|
import { |
|
|
|
SupplierdeliverRequestPackage |
|
|
|
} from '../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
|
import { PurchaseDetail } from '../../supplierdeliver/purchaseMain/purchaseMain.data' |
|
|
|
|
|
|
|
import * as PackageApi from '@/api/wms/package' |
|
|
|
import * as PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequestMain' |
|
|
|
import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
@ -142,6 +157,7 @@ import { formatDate } from '@/utils/formatTime' |
|
|
|
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' |
|
|
|
import * as ItembasicApi from '@/api/wms/itembasic' |
|
|
|
|
|
|
|
// 采购收货申请 |
|
|
|
defineOptions({ name: 'PurchasereceiptRequestMain' }) |
|
|
@ -400,10 +416,65 @@ const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
|
|
|
|
// 标签打印 |
|
|
|
const searchTableRef = ref() |
|
|
|
const labelPrint = async (row) => { |
|
|
|
window.open(src.value + '&asn_number=' + row.asnNumber) |
|
|
|
} |
|
|
|
console.log("------------",row); |
|
|
|
tableObject.loading = true |
|
|
|
const subTableDFata = await PackageApi.getLabel(row.masterId) |
|
|
|
tableObject.loading = false |
|
|
|
const tableObject1 = { |
|
|
|
// 当前页 |
|
|
|
currentPage: 1, |
|
|
|
// 导出加载中 |
|
|
|
exportLoading: false, |
|
|
|
// 加载中 |
|
|
|
loading: false, |
|
|
|
// 页数 |
|
|
|
pageSize: subTableDFata.length, |
|
|
|
params:null, |
|
|
|
// 排序 |
|
|
|
sort: { |
|
|
|
order: '', // 排序规则 |
|
|
|
prop: '' // 排序字段 |
|
|
|
}, |
|
|
|
// 总条数 |
|
|
|
total: subTableDFata.length, |
|
|
|
// 表格数据 |
|
|
|
tableList: subTableDFata, |
|
|
|
currentRow:null |
|
|
|
} |
|
|
|
console.log("标签打印",subTableDFata,tableObject1,SupplierdeliverRequestPackage.allSchemas) |
|
|
|
|
|
|
|
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns |
|
|
|
|
|
|
|
tableColumns.forEach((item) => { |
|
|
|
item.width = item.table?.width || 150 |
|
|
|
}) |
|
|
|
searchTableRef.value.openData("标签信息",tableObject1,{tableColumns},true) |
|
|
|
|
|
|
|
// window.open(src.value + '&asn_number=' + row.asnNumber) |
|
|
|
} |
|
|
|
// 批量打印---采购收货申请 |
|
|
|
const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => { |
|
|
|
console.log('批量打印',val) |
|
|
|
// let rows:any = [] |
|
|
|
// val.forEach(item=>{ |
|
|
|
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)] |
|
|
|
// }) |
|
|
|
if(val.length == 0){ |
|
|
|
message.warning("请先选择要打印的数据!") |
|
|
|
return |
|
|
|
} |
|
|
|
// window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(',')) |
|
|
|
|
|
|
|
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => { |
|
|
|
console.log(res) |
|
|
|
window.open(src.value + '&asn_number=' + res) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
message.error('创建标签失败') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const getSearchTableData = async (number,isEnter=false)=>{ |
|
|
|
const {tableObject ,tableMethods} = useTable({ |
|
|
@ -418,12 +489,20 @@ const getSearchTableData = async (number,isEnter=false)=>{ |
|
|
|
item.width = item.table?.width || 150 |
|
|
|
}) |
|
|
|
tableData.value = [] |
|
|
|
const itemCodes = [] |
|
|
|
tableObject.tableList.forEach(row=>{ |
|
|
|
itemCodes.push(row['itemCode']) |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) |
|
|
|
newRow['poLine'] = row['lineNumber'] |
|
|
|
newRow['itemCode'] = row['itemCode'] |
|
|
|
newRow['uom'] = row['uom'] |
|
|
|
newRow['poNumber'] =row['number'] |
|
|
|
newRow['supplierCode'] =row['supplierCode'] |
|
|
|
//生产日期 到货日期 默认当天 |
|
|
|
newRow['produceDate'] = dayjs().valueOf() |
|
|
|
newRow['arriveDate'] = dayjs().valueOf() |
|
|
|
//批次 |
|
|
|
newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD'); |
|
|
|
newRow['defaultToLocationCode'] =row['defaultLocation'] |
|
|
|
tableData.value.push(newRow) |
|
|
|
if(isEnter){ |
|
|
@ -435,6 +514,15 @@ const getSearchTableData = async (number,isEnter=false)=>{ |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
//有效期 |
|
|
|
ItembasicApi.getItembasicPage({ |
|
|
|
code:itemCodes.join(',') |
|
|
|
}).then((res)=>{ |
|
|
|
res.list.forEach((item,index)=>{ |
|
|
|
const findItem = tableData.value.find(item1=>item1['itemCode']==item['code']) |
|
|
|
findItem['expireTime'] = item['expireTime'] |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
/** 添加/修改操作 */ |
|
|
|
const formRef = ref() |
|
|
@ -607,6 +695,9 @@ const onEnter = async (field,value)=>{ |
|
|
|
} |
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
tableData.value.forEach((row, index) => { |
|
|
|
row['expireDate'] = row['expireTime']?addDay(row['produceDate'],row['expireTime']).valueOf():dayjs('2099-12-31').valueOf() |
|
|
|
}) |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|