|
|
@ -90,12 +90,15 @@ |
|
|
|
<ImportForm ref="importFormRef" url="/wms/productionreturn-request-main/hold-import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
|
|
|
|
|
|
<!-- 标签打印 --> |
|
|
|
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules } from '../productionreturnRequestMain/productionreturnRequestMain.data' |
|
|
|
import { ProductionreturnRequestDetail,ProductionreturnRequestDetailRules, ProductionreturnRequestDetailNoLabel, ProductionreturnRequestDetailNoLabelRules } from './productionreturnRequestMainNo.data' |
|
|
|
import { ProductionreturnRequestDetail,ProductionreturnRequestDetailRules, ProductionreturnRequestDetailNoLabel, ProductionreturnRequestDetailNoLabelRules,SupplierdeliverRequestPackage } from './productionreturnRequestMainNo.data' |
|
|
|
|
|
|
|
import * as ProductionreturnRequestMainNoApi from '@/api/wms/productionreturnRequestMainNo' |
|
|
|
import * as ProductionreturnRequestDetailNoApi from '@/api/wms/productionreturnRequestDetailNo' |
|
|
@ -473,7 +476,8 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.masterId) |
|
|
|
} else if (val == 'point') { // 标签打印 |
|
|
|
handlePoint(row) |
|
|
|
// handlePoint(row) |
|
|
|
labelPrint(row) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -607,7 +611,42 @@ const submitFormLabel = async (formType, data) => { |
|
|
|
|
|
|
|
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
|
// 标签打印 |
|
|
|
const handlePoint = async (row) => { |
|
|
|
// const handlePoint = async (row) => { |
|
|
|
// // 查询是否已创建过标签 |
|
|
|
// await PackageApi.getPackagePage({ |
|
|
|
// requestNumber: row.number |
|
|
|
// }).then((res) => { |
|
|
|
// if(res.list.length > 0) { |
|
|
|
// isCreateLabel.value = true |
|
|
|
// if (res.list[0].productionLineCode != null) { |
|
|
|
// labelType.value = 'zz' |
|
|
|
// } else { |
|
|
|
// labelType.value = 'cg' |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// isCreateLabel.value = false |
|
|
|
// } |
|
|
|
// }).catch(err => { |
|
|
|
// isCreateLabel.value = false |
|
|
|
// console.log(err) |
|
|
|
// }) |
|
|
|
// // 判断是采购还是制造 |
|
|
|
// if (isCreateLabel.value) { |
|
|
|
// if (labelType.value == 'cg') { |
|
|
|
// const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) |
|
|
|
// window.open(src.value+'&asn_number='+row.number) |
|
|
|
// } else { |
|
|
|
// const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
// window.open(src.value+'&asn_number='+row.number) |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// message.warning('请先创建标签') |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
const searchTableRef = ref() |
|
|
|
const labelPrint = async (row) => { |
|
|
|
tableObject.loading = true |
|
|
|
// 查询是否已创建过标签 |
|
|
|
await PackageApi.getPackagePage({ |
|
|
|
requestNumber: row.number |
|
|
@ -624,22 +663,60 @@ const handlePoint = async (row) => { |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
isCreateLabel.value = false |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
// 判断是采购还是制造 |
|
|
|
if (isCreateLabel.value) { |
|
|
|
if (labelType.value == 'cg') { |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) |
|
|
|
window.open(src.value+'&asn_number='+row.number) |
|
|
|
} else { |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
window.open(src.value+'&asn_number='+row.number) |
|
|
|
} |
|
|
|
const defaultParams = {'moduleName':'productreceipt_predict','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) |
|
|
|
} else { |
|
|
|
tableObject.loading = false |
|
|
|
message.warning('请先创建标签') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 批量打印--生产退料 |
|
|
|
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+'&asn_number='+res) |
|
|
|
} else { |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
window.open(src.value+'&asn_number='+res) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
message.error('创建标签失败') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/** 导入 */ |
|
|
|
const importFormRef = ref() |
|
|
|
const handleImport = () => { |
|
|
|