Browse Source

打印标签,包装信息列表,没有id

master_hella_20240701
yufei0306 7 months ago
parent
commit
1761823904
  1. 5
      src/api/wms/package/index.ts
  2. 66
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  3. 51
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

5
src/api/wms/package/index.ts

@ -100,3 +100,8 @@ export const createPackageLabel = async (data: PackageVO) => {
export const batchPrintingLable = async (data: any) => {
return await request.post({ url: `/wms/package/batchPrintingLable`, data })
}
// 打印标签获取包装列表
export const getLabel = async (id: number) => {
return await request.get({ url: `/wms/package/getLabel?id=` + id })
}

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

@ -20,8 +20,8 @@
/>
<!-- 列表 -->
<ContentWrap>
<Table
<ContentWrap >
<Table v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -147,6 +147,10 @@
</template>
</BasicForm>
<!-- 标签打印 -->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" />
</template>
<script setup lang="ts">
@ -159,7 +163,8 @@ import {
SupplierdeliverRequestMainRules,
SupplierdeliverRequestDetail,
SupplierdeliverRequestDetailRules,
SupplierdeliverRequestDetailLabel
SupplierdeliverRequestDetailLabel,
SupplierdeliverRequestPackage
} from './supplierdeliverRequestMain.data'
import {   SupplierdeliverInspectionDetail} from '../supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
@ -168,6 +173,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail'
import * as ItembasicApi from '@/api/wms/itembasic'
import * as SupplierdeliverInspectionDetailApi from '@/api/wms/supplierdeliverInspectionDetail'
import * as PackageApi from '@/api/wms/package'
import { PurchasePlanDetail } from '../purchasePlanMain/purchasePlanMain.data'
import { addDay } from '@/utils/formatTime'
@ -752,8 +758,60 @@ 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)
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) => {
let rows:any = []
val.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.id)]
})
if(rows.length == 0){
message.warning("请先选择要打印的数据!")
return
}
await PackageApi.batchPrintingLable(rows.join(',')).then(res => {
console.log(res)
window.open(src.value + '&asn_number=' + res)
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
}
const print = async () => {

51
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

@ -1663,3 +1663,54 @@ export const UploadQualityReport = useCrudSchemas(reactive<CrudSchema[]>([
},
},
]))
export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2'
},
table: {
width: 150,
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150,
},
},
]))
Loading…
Cancel
Save