Browse Source

库存余额打印标签实际调用包装信息的打印标签按钮

master_hella_20240701
chenfang 7 months ago
parent
commit
cde2a71905
  1. 5
      src/api/wms/package/index.ts
  2. 2
      src/views/wms/inventoryManage/balance/balance.data.ts
  3. 23
      src/views/wms/inventoryManage/balance/index.vue
  4. 53
      src/views/wms/inventoryManage/package/index.vue

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

@ -105,3 +105,8 @@ export const batchPrintingLable = async (data: any) => {
export const getLabel = async (id: number) => {
return await request.get({ url: `/wms/package/getLabel?id=` + id })
}
// 查询包装列表
export const getbalanceToPage = async (packingNumber: String) => {
return await request.get({ url: `/wms/package/balanceToPage?packingNumber=` + packingNumber})
}

2
src/views/wms/inventoryManage/balance/balance.data.ts

@ -429,7 +429,7 @@ export const Balance = useCrudSchemas(reactive<CrudSchema[]>([
isDetail: false,
isForm: false,
table: {
width: 100,
width: 200,
fixed: 'right'
},
}

23
src/views/wms/inventoryManage/balance/index.vue

@ -59,12 +59,14 @@
<script setup lang="ts">
import download from '@/utils/download'
import * as BalanceApi from '@/api/wms/balance'
import * as PackageApi from '@/api/wms/package'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Balance, BalanceRules } from './balance.data'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import { getAccessToken } from '@/utils/auth'
//
defineOptions({ name: 'Balance' })
@ -142,6 +144,7 @@ const butttondata = [
float:'right',
hasPermi: ''
},
defaultButtons.mainListPointBtn(null), //
// defaultButtons.mainListEditBtn({hasPermi:'wms:balance:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:balance:delete'}), //
]
@ -151,6 +154,8 @@ const buttonTableClick = async (val, row) => {
if (val == 'bqxx') {
let aaa = 'HPQ;V1.0;I'+row.itemCode+';P'+row.packingNumber+';B'+row.batch+';Q'+row.qty+';U'+row.uom
alert(aaa)
}else if (val == 'point') { //
handlePoint(row)
}
// if (val == 'edit') { //
// // const res = await BalanceApi.getItempackaging(row.id)
@ -172,6 +177,24 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue,'transactionBalance')
}
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
//
const handlePoint = async (row) => {
console.log(row.packingNumber,445555555555555);
PackageApi.getBalanceToPackage(row.packingNumber).then(res => {
console.log(res,66666666666);
//
if (res.asnNumber !== null && res.asnNumber !== '') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&id='+res.id)
} else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&id='+res.id)
}
})
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {

53
src/views/wms/inventoryManage/package/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="PackageRules"
:formAllSchemas="Package.allSchemas"
:searchTableParams="searchTableParams"
@ -122,6 +122,8 @@ const HeadButttondata = [
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'update') { //
openForm('update')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
@ -149,18 +151,10 @@ const buttonBaseClick = (val, item) => {
// }
// }
// -
// const butttondata = (row) => {
// return [
// defaultButtons.mainListEditBtn({hasPermi:'wms:package:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:package:delete'}), //
// defaultButtons.mainListPointBtn(null), //
// ]
// }
// -
const butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'wms:package:update'}), //
defaultButtons.mainListEditBtn({hasPermi:'wms:package:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:package:delete'}), //
defaultButtons.mainListPointBtn(null), //
]
@ -179,6 +173,31 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm =async (type: string, row?: number) => {
if(type == "update"){
Package.allSchemas.formSchema.forEach((item) => {
if (item.field == 'number') {
item.componentProps.disabled = true
}
if (item.field == 'itemCode') {
item.componentProps.disabled = true
}
if (item.field == 'itemName') {
item.componentProps.disabled = true
}
})
}else {
Package.allSchemas.formSchema.forEach((item) => {
if (item.field == 'number') {
item.componentProps.disabled = false
}
if (item.field == 'itemCode') {
item.componentProps.disabled = true
}
if (item.field == 'itemName') {
item.componentProps.disabled = true
}
})
}
basicFormRef.value.open(type, row)
}
@ -221,8 +240,22 @@ const handleExport = async () => {
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
// form
const formsSuccess = async (formType,data) => {
if (formType === 'create') {
await PackageApi.createPackage(data)
message.success(t('common.createSuccess'))
} else {
await PackageApi.updatePackage(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
//
const handlePoint = async (row) => {
console.log(row,66666666666);
//
if (row.asnNumber !== null && row.asnNumber !== '') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())

Loading…
Cancel
Save