Browse Source

YT-1295维修备件领用申请明细中不应该有新增,编辑,删除按钮

intex_online20241228
张立 2 months ago
parent
commit
7afaad5061
  1. 123
      src/views/wms/inventoryManage/balance/index.vue

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

@ -82,8 +82,8 @@
<BasicForm
ref="labelPointFormRef"
@success="getList"
:tableAllSchemas="SupplierdeliverRequestPackage.allSchemas"
:tableFormRules="SupplierdeliverRequestPackageRules"
:tableAllSchemas="detailListTableColumns"
:tableFormRules="detailListTableColumnsRules"
:tableData="detatableData1"
:isBusiness="true"
:isShowButton="false"
@ -106,10 +106,11 @@
<script setup lang="ts">
import dayjs from 'dayjs'
import download from '@/utils/download'
import { cloneDeep } from 'lodash-es'
import * as BalanceApi from '@/api/wms/balance'
import * as PackageApi from '@/api/wms/package'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Balance, TransactionTab, BalanceRules } from './balance.data'
import { Balance, TransactionTab, BalanceRules,BalancePackage,BalancePackageRules } 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'
@ -118,10 +119,14 @@ import { getAccessToken } from '@/utils/auth'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import * as ItembasicApi from '@/api/wms/itembasic'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
import {
SupplierdeliverRequestPackage,
SupplierdeliverRequestPackageRules
} from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data'
console.log(222,SupplierdeliverRequestPackage)
const { loadStart, loadDone } = usePageLoading()
//
@ -137,6 +142,8 @@ const tableColumns = ref(Balance.allSchemas.tableColumns)
const tabsExtend = ref(false)
const apiPage = ref()
const tableObjectExtend = ref()
const detailListTableColumns =cloneDeep(BalancePackage.allSchemas)
const detailListTableColumnsRules =cloneDeep(BalancePackageRules)
//
const updataTableColumns = (val) => {
@ -348,28 +355,86 @@ const handlePoint = async (row) => {
}
const searchTableRef = ref()
const enableBuyOrenableMake = ref()//
const getLabelDetailPage = async (row, useToPackingNumber) => {
////
let defaultParams = {
moduleName: 'move',
recordNumber: '',
itemCode: row.itemCode,
packQty: row.packQty,
batch: row.batch
}
const { tableObject: tableObjectPrint, tableMethods } = useTable({
defaultParams,
getListApi: PackageApi.getLabelDetailPage //
})
//
const { getList: getListPrint } = tableMethods
await getListPrint()
tableObject.loading = false
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
// let defaultParams = {
// moduleName: 'move',
// recordNumber: '',
// itemCode: row.itemCode,
// packQty: row.packQty,
// batch: row.batch
// }
// const { tableObject: tableObjectPrint, tableMethods } = useTable({
// defaultParams,
// getListApi: PackageApi.getLabelDetailPage //
// })
// //
// const { getList: getListPrint } = tableMethods
// await getListPrint()
// tableObject.loading = false
// const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
// tableColumns.forEach((item) => {
// item.width = item.table?.width || 150
// })
// detatableData1.value = tableObjectPrint.tableList
await ItembasicApi.getItembasicPage({
pageSize: 10,
pageNo: 1,
code: row.itemCode,
sort: '',
by: 'ASC',
}).then(res => {
if (res.list.length > 0) {
//
detailListTableColumnsRules.value = cloneDeep(detailListTableColumnsRules)
enableBuyOrenableMake.value = res.list[0].enableBuy == "TRUE" ? 'enableBuy' : res.list[0].enableMake == "TRUE" ? 'enableMake' :''
if (res.list[0].enableBuy == "TRUE") {
detailListTableColumns.tableFormColumns = BalancePackage.allSchemas.tableFormColumns.filter(item=>item.field != 'productionLineCodePackage')
delete detailListTableColumnsRules.value.productionLineCodePackage
// tableform
detailListTableColumns.tableFormColumns.map(itemColumns => {
if(itemColumns.field == 'supplierItemCode') {
SupplieritemApi.getSupplieritemPage({
pageSize: 10,
pageNo: 1,
itemCode: row.itemCode,
sort: '',
by: 'ASC',
}).then(response => {
row.supplierItemCode = response.list[0].supplierCode
})
}
})
}
//
if (res.list[0].enableMake == "TRUE") {
// tableform
detailListTableColumns.tableFormColumns = BalancePackage.allSchemas.tableFormColumns.filter(item=>item.field != 'supplierItemCode')
delete detailListTableColumnsRules.value.supplierItemCode
detailListTableColumns.tableFormColumns.map(itemColumns => {
if(itemColumns.field == 'productionLineCodePackage') {
ProductionlineitemApi.getProductionlineitemPage({
pageNo: 1,
itemCode: row.itemCode,
sort: '',
by: 'ASC',
}).then(response => {
row.supplierItemCode = response.list[0].supplierCode
})
}
})
}
} else {
message.warning('没有查询到物料代码:【' + row.itemCode + '】')
return
}
})
detatableData1.value = tableObjectPrint.tableList
detatableData1.value=[]//,
detatableData1.value.push(row)
detatableData1.value.forEach(item => {
item.printQty =row.qty
if (!item.batch) {
@ -504,10 +569,13 @@ const pointLabel = async () => {
// })
const obj = {
itemCode:detatableData1.value[0].itemCode,
packingNumber:detatableData1.value[0].number,
batch:detatableData1.value[0].batch,
printQty:detatableData1.value[0].printQty,
packUnit:detatableData1.value[0].packUnit,
packQty:detatableData1.value[0].packQty,
uom:detatableData1.value[0].uom,
productionLineCodePackage:detatableData1.value[0].productionLineCodePackage,
supplierItemCode:detatableData1.value[0].supplierItemCode,
}
// const isHave = detatableData1.value.find(item => parseFloat(item.printQty) <= 0)
if(!parseFloat(obj.printQty) ){
@ -515,8 +583,13 @@ const pointLabel = async () => {
return;
}
await PackageApi.batchPrintingBalanceLableForCreate(obj).then(res => {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
let src =ref('')
if (enableBuyOrenableMake.value == 'enableBuy') {
src.value = BASE_URL + '/jmreport/view/1016234988731322368?token=' + getAccessToken()+'&id='+res//
} else if(enableBuyOrenableMake.value == 'enableMake') {
src.value = BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()+'&asn_number='+res//
}
window.open(src.value)
}).catch(err => {
console.log(err)
message.error('创建标签失败')

Loading…
Cancel
Save