Browse Source

标签打印

master_hella_20240701
yufei0306 7 months ago
parent
commit
c04e66441f
  1. 88
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue
  2. 90
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue
  3. 4
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

88
src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue

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

90
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue

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

4
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -807,11 +807,11 @@ const labelPrint = async (row) => {
tableColumns.forEach((item) => { tableColumns.forEach((item) => {
item.width = item.table?.width || 150 item.width = item.table?.width || 150
}) })
searchTableRef.value.openData("采购收货记录单号",tableObject1,{tableColumns},true) searchTableRef.value.openData("标签信息",tableObject1,{tableColumns},true)
// window.open(src.value + '&asn_number=' + row.asnNumber) // window.open(src.value + '&asn_number=' + row.asnNumber)
} }
// // --
const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => { const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => {
console.log('批量打印',val) console.log('批量打印',val)
// let rows:any = [] // let rows:any = []

Loading…
Cancel
Save