From 3690b237ddde034f29e30f552062d3d4dc7964a6 Mon Sep 17 00:00:00 2001
From: wangyufei <2267742828@qq.com>
Date: Sat, 10 Aug 2024 11:13:33 +0800
Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A0=87=E7=AD=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../inventorymoveRecordMainNew/index.vue | 72 ++++++++++++++++++-
.../inventorymoveRecordMain.data.ts | 10 +++
2 files changed, 81 insertions(+), 1 deletion(-)
diff --git a/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue b/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue
index 8c7802185..7a08ce4d9 100644
--- a/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue
+++ b/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue
@@ -71,6 +71,8 @@
:detailAllSchemasRules="InventorymoveRecordDetailRules"
:apiPage="InventorymoveRecordDetailApi.getInventorymoveRecordDetailPage"
/>
+
+
@@ -80,6 +82,14 @@
import download from '@/utils/download'
import { InventorymoveRecordMain,InventorymoveRecordMainRules,InventorymoveRecordDetail,InventorymoveRecordDetailRules } from './inventorymoveRecordMain.data'
import { InventorymoveRequestMain,InventorymoveRequestMainRules,InventorymoveRequestDetail,InventorymoveRequestDetailRules } from './inventorymoveRecordRequestMain.data'
+import {
+ SupplierdeliverRequestPackage
+} from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data'
+
+import { getAccessToken } from '@/utils/auth'
+
+import * as PackageApi from '@/api/wms/package'
+import { getJmreportBaseUrl } from '@/utils/systemParam'
import * as InventorymoveRequestMainApi from '@/api/wms/inventorymoveRequestMain'
import * as InventorymoveRecordMainApi from '@/api/wms/inventorymoveRecordMain'
import * as InventorymoveRecordDetailApi from '@/api/wms/inventorymoveRecordDetail'
@@ -165,17 +175,77 @@ const openForm =async (type: string, row?: number) => {
formRef.value.open(type, row)
}
+// 列表-操作按钮
// 列表-操作按钮
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
- return []
+ return [
+ defaultButtons.mainListPointBtn(null), // 标签打印
+ ]
}
// 列表-操作按钮事件
const buttonTableClick = async (val, row) => {
+ if (val == 'point') { // 标签打印
+ labelPrint(row)
+ }
+}
+const BASE_URL = getJmreportBaseUrl()
+// 标签打印
+const searchTableRef = ref()
+const labelType = ref('') // 标签类别 采购还是制造等
+const labelPrint = async (row) => {
+ tableObject.loading = true
+ //获取类型
+ let resType = await PackageApi.getPackagePage({
+ requestNumber: row.number
+ })
+ if(resType.list.length > 0){
+ if (resType.list[0].productionLineCode != null) {
+ labelType.value = 'zz'
+ } else {
+ labelType.value = 'cg'
+ }
+ }
+ const defaultParams = {'moduleName':'productreceipt_predict','tableName':'record_productreceipt_main','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 searchTableSuccessLabel = async (formField, searchField, val, formRef, type, row) => {
+ console.log('批量打印',val)
+
+ if(val.length == 0){
+ message.warning("请先选择要打印的数据!")
+ return
+ }
+ 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('创建标签失败')
+ })
}
// 获取部门 用于详情 部门回显
const { wsCache } = useCache()
diff --git a/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordMain.data.ts b/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordMain.data.ts
index a89421081..3fb619aec 100644
--- a/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordMain.data.ts
+++ b/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordMain.data.ts
@@ -338,6 +338,16 @@ export const InventorymoveRecordMain = useCrudSchemas(reactive([
// }
// }
// },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 120,
+ fixed: 'right'
+ },
+ }
]))
//表单校验