|
|
@ -113,6 +113,8 @@ |
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/productreceipt-request-main/import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
|
|
<!-- 标签打印 --> |
|
|
|
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@ -129,6 +131,9 @@ import * as ItembasicApi from '@/api/wms/itembasic' |
|
|
|
import * as PackageApi from '@/api/wms/package' |
|
|
|
import { formatTime } from '@/utils/index' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
import { |
|
|
|
SupplierdeliverRequestPackage |
|
|
|
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts' |
|
|
|
|
|
|
|
// 制品收货申请 |
|
|
|
defineOptions({ name: 'ProductreceiptRequestMain' }) |
|
|
@ -636,6 +641,7 @@ const detailValidate = (data) => { |
|
|
|
} |
|
|
|
|
|
|
|
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
|
|
|
|
|
// 标签打印 |
|
|
|
const handlePoint = async (row) => { |
|
|
|
// 查询是否已创建过标签 |
|
|
@ -658,18 +664,61 @@ const handlePoint = async (row) => { |
|
|
|
}) |
|
|
|
// 判断是采购还是制造 |
|
|
|
if (isCreateLabel.value) { |
|
|
|
if (labelType.value == 'cg') { |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
window.open(src.value+'&request_number='+row.number) |
|
|
|
} 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) => { |
|
|
|
tableObject.loading = true |
|
|
|
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) |
|
|
|
} |
|
|
|
|
|
|
|
// 批量打印--预生产收货 |
|
|
|
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/922734157577715712?token=' + getAccessToken()) |
|
|
|
window.open(src.value+'&asn_number='+res) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
message.error('创建标签失败') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|