|
|
@ -113,6 +113,8 @@ |
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/productreceipt-request-main/import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :extend="'predict'"/> |
|
|
|
<!-- 标签打印 --> |
|
|
|
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@ -121,6 +123,10 @@ import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
|
import { ProductreceiptRequestMain,ProductreceiptRequestMainRules,ProductreceiptRequestDetail, |
|
|
|
ProductreceiptRequestDetailRules, BackflushDetailRequest, |
|
|
|
ProductreceiptRequestLabel,ProductreceiptRequestLabelRules } from './productreceiptRequestMain.data' |
|
|
|
import { |
|
|
|
SupplierdeliverRequestPackage |
|
|
|
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts' |
|
|
|
// } from '../../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
|
import * as ProductreceiptRequestMainApi from '@/api/wms/productreceiptRequestMain' |
|
|
|
import * as ProductreceiptRequestDetailApi from '@/api/wms/productreceiptRequestDetail' |
|
|
|
import * as BackflushRequestDetailbApi from '@/api/wms/backflushRequestDetailb' |
|
|
@ -657,18 +663,86 @@ const handlePoint = async (row) => { |
|
|
|
}) |
|
|
|
// 判断是采购还是制造 |
|
|
|
if (isCreateLabel.value) { |
|
|
|
labelPrint(row) |
|
|
|
// if (labelType.value == 'cg') { |
|
|
|
// const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
// window.open(src.value+'&request_number='+row.number) |
|
|
|
// labelPrint(row) |
|
|
|
// } else { |
|
|
|
// const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) |
|
|
|
// window.open(src.value+'&request_number='+row.number) |
|
|
|
// labelPrint(row) |
|
|
|
// } |
|
|
|
} else { |
|
|
|
message.warning('请先创建标签') |
|
|
|
} |
|
|
|
} |
|
|
|
const searchTableRef = ref() |
|
|
|
// |
|
|
|
const labelPrint = async (row) => { |
|
|
|
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) |
|
|
|
if (labelType.value == 'cg') { |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
window.open(src.value+'&request_number='+row.number) |
|
|
|
window.open(src.value+'&request_number='+res) |
|
|
|
} else { |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) |
|
|
|
window.open(src.value+'&request_number='+row.number) |
|
|
|
} |
|
|
|
} else { |
|
|
|
message.warning('请先创建标签') |
|
|
|
window.open(src.value+'&request_number='+res) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
message.error('创建标签失败') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|