Browse Source

YT-1078生产退料申请创建标签页面不应该同时显示“标签生产线代码”和“标签供应商代码”字段

intex
zhang_li 1 week ago
parent
commit
8fb48c2b4d
  1. 40
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

40
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

@ -83,7 +83,7 @@
ref="formLabelRef" ref="formLabelRef"
@success="getList" @success="getList"
:tableAllSchemas="detailListTableColumns" :tableAllSchemas="detailListTableColumns"
:tableFormRules="ProductionreturnRequestDetailLabelRules" :tableFormRules="detailListTableColumnsRules"
:tableData="detatableData.tableList" :tableData="detatableData.tableList"
:isBusiness="true" :isBusiness="true"
:isShowButton="false" :isShowButton="false"
@ -118,6 +118,7 @@ import * as LocationApi from '@/api/wms/location'
import * as SupplieritemApi from '@/api/wms/supplieritem' import * as SupplieritemApi from '@/api/wms/supplieritem'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem' import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
import { cloneDeep } from 'lodash-es'
// 退 // 退
defineOptions({ name: 'ProductionreturnRequestMain' }) defineOptions({ name: 'ProductionreturnRequestMain' })
@ -130,7 +131,8 @@ routeName.value = route.name
const tableColumns = ref([...ProductionreturnRequestMain.allSchemas.tableColumns,...ProductionreturnRequestDetail.allSchemas.tableMainColumns]) const tableColumns = ref([...ProductionreturnRequestMain.allSchemas.tableColumns,...ProductionreturnRequestDetail.allSchemas.tableMainColumns])
// //
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas const detailListTableColumns =cloneDeep(ProductionreturnRequestDetailLabel.allSchemas)
const detailListTableColumnsRules =cloneDeep(ProductionreturnRequestDetailLabel)
const isCreateLabel = ref(false) const isCreateLabel = ref(false)
const formLabelRef = ref() const formLabelRef = ref()
const labelType = ref('') // const labelType = ref('') //
@ -558,15 +560,13 @@ const buttonTableClick = async (val, row) => {
}).then(res => { }).then(res => {
if (res.list.length > 0) { if (res.list.length > 0) {
// //
detailListTableColumnsRules.value = cloneDeep(ProductionreturnRequestDetailLabelRules)
if (res.list[0].enableBuy == "TRUE") { if (res.list[0].enableBuy == "TRUE") {
detailListTableColumns.tableFormColumns = ProductionreturnRequestDetailLabel.allSchemas.tableFormColumns.filter(item=>item.field != 'productionLineCodePackage')
delete detailListTableColumnsRules.value.productionLineCodePackage
// tableform // tableform
detailListTableColumns.tableFormColumns.map(itemColumns => { detailListTableColumns.tableFormColumns.map(itemColumns => {
// tableform
if(itemColumns.field == 'supplierItemCode') { if(itemColumns.field == 'supplierItemCode') {
itemColumns.tableForm.isInpuFocusShow = true
itemColumns.tableForm.disabled = false
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = true
formLabelRef.value.formLoading = true
SupplieritemApi.getSupplieritemPage({ SupplieritemApi.getSupplieritemPage({
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
@ -579,27 +579,14 @@ const buttonTableClick = async (val, row) => {
}) })
} }
}) })
} else {
// tableform
detailListTableColumns.tableFormColumns.map(itemColumns => {
if(itemColumns.field == 'supplierItemCode') {
itemColumns.tableForm.isInpuFocusShow = false
itemColumns.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = false
}
})
} }
// //
if (res.list[0].enableMake == "TRUE") { if (res.list[0].enableMake == "TRUE") {
// tableform // tableform
detailListTableColumns.tableFormColumns = ProductionreturnRequestDetailLabel.allSchemas.tableFormColumns.filter(item=>item.field != 'supplierItemCode')
delete detailListTableColumnsRules.value.supplierItemCode
detailListTableColumns.tableFormColumns.map(itemColumns => { detailListTableColumns.tableFormColumns.map(itemColumns => {
if(itemColumns.field == 'productionLineCodePackage') { if(itemColumns.field == 'productionLineCodePackage') {
item.productionLineCodePackage = item.productionLineCode
itemColumns.tableForm.isInpuFocusShow = true
itemColumns.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = true
formLabelRef.value.formLoading = true
ProductionlineitemApi.getProductionlineitemPage({ ProductionlineitemApi.getProductionlineitemPage({
pageNo: 1, pageNo: 1,
code: item.itemCode, code: item.itemCode,
@ -611,15 +598,6 @@ const buttonTableClick = async (val, row) => {
}) })
} }
}) })
} else {
// tableform
detailListTableColumns.tableFormColumns.map(itemColumns => {
if(itemColumns.field == 'productionLineCodePackage') {
itemColumns.tableForm.isInpuFocusShow = false
itemColumns.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = false
}
})
} }
} else { } else {
message.warning('没有查询到物料代码:【' + item.itemCode + '】') message.warning('没有查询到物料代码:【' + item.itemCode + '】')

Loading…
Cancel
Save