Browse Source

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

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

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

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

Loading…
Cancel
Save