Browse Source

创建标签 修改根据物料可制造判断采购或制造

master
陈薪名 10 months ago
parent
commit
1a00e4cbe4
  1. 54
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue
  2. 15
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue
  3. 15
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue
  4. 4
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue

54
src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue

@ -131,6 +131,7 @@ const tableColumns = ref(UnplannedreceiptRequestMain.allSchemas.tableColumns)
const detailListTableColumns = UnplannedreceiptRequestDetailLabel.allSchemas const detailListTableColumns = UnplannedreceiptRequestDetailLabel.allSchemas
const isCreateLabel = ref(false) const isCreateLabel = ref(false)
const formLabelRef = ref() const formLabelRef = ref()
const labelType = ref('') //
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: UnplannedreceiptRequestDetailApi.getUnplannedreceiptRequestDetailPage getListApi: UnplannedreceiptRequestDetailApi.getUnplannedreceiptRequestDetailPage
}) })
@ -141,19 +142,56 @@ const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
//
const isItemType = async (itemCode, labelTypeParams) => {
let isType = false
const labelTypeOld = JSON.parse(JSON.stringify(labelType.value))
await ItembasicApi.getItembasicPage({
pageSize: 10,
pageNo: 1,
code: itemCode,
sort: '',
by: 'ASC',
}).then(res => {
if (res.list.length > 0) {
//
if (res.list[0].enableMake == "FALSE") {
labelType.value = 'cg'
if (labelTypeParams == 'cg') {
isType = true
}
} else {
labelType.value = 'zz'
if (labelTypeParams == 'zz') {
isType = true
}
}
if(labelTypeParams == '') isType = true
}
})
//
if (!isType) labelType.value = labelTypeOld
return isType
}
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => { nextTick(async () => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
if(formField == 'toLocationCode'){ if(formField == 'toLocationCode'){
row['toLocationCode'] = val[0]['code'] row['toLocationCode'] = val[0]['code']
} else if(formField == 'itemCode'){
const isType = await isItemType(val[0]['code'], labelType.value)
if(!isType){
message.warning('当前物料可制造与其他数据不一致,请重新选择!')
} else {
row['itemCode'] = val[0]['code']
row['uom'] = val[0]['uom']
}
} else {
row[formField] = val[0][searchField]
} }
if(formField == 'itemCode'){
row['itemCode'] = val[0]['code']
row['uom'] = val[0]['uom']
}
row[formField] = val[0][searchField]
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
@ -323,8 +361,8 @@ const buttonTableClick = async (val, row) => {
by: 'ASC', by: 'ASC',
}).then(res => { }).then(res => {
if (res.list.length > 0) { if (res.list.length > 0) {
// //
if (res.list[0].type == "RAW") { if (res.list[0].enableMake == "FALSE") {
// tableform // tableform
detailListTableColumns.tableFormColumns.map(item => { detailListTableColumns.tableFormColumns.map(item => {
if(item.field == 'productionLineCodePackage') { if(item.field == 'productionLineCodePackage') {

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

@ -125,6 +125,7 @@ const updataTableColumns = (val) => {
// //
const isItemType = async (itemCode, labelTypeParams) => { const isItemType = async (itemCode, labelTypeParams) => {
let isType = false let isType = false
const labelTypeOld = JSON.parse(JSON.stringify(labelType.value))
await ItembasicApi.getItembasicPage({ await ItembasicApi.getItembasicPage({
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
@ -133,8 +134,8 @@ const isItemType = async (itemCode, labelTypeParams) => {
by: 'ASC', by: 'ASC',
}).then(res => { }).then(res => {
if (res.list.length > 0) { if (res.list.length > 0) {
// //
if (res.list[0].type == "RAW") { if (res.list[0].enableMake == "FALSE") {
labelType.value = 'cg' labelType.value = 'cg'
if (labelTypeParams == 'cg') { if (labelTypeParams == 'cg') {
isType = true isType = true
@ -148,6 +149,8 @@ const isItemType = async (itemCode, labelTypeParams) => {
if(labelTypeParams == '') isType = true if(labelTypeParams == '') isType = true
} }
}) })
//
if (!isType) labelType.value = labelTypeOld
return isType return isType
} }
@ -159,7 +162,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
if(formField == 'itemCode') { if(formField == 'itemCode') {
const isType = await isItemType(val[0]['itemCode'], labelType.value) const isType = await isItemType(val[0]['itemCode'], labelType.value)
if(!isType){ if(!isType){
message.warning('当前物料类型与其他数据不一致,请重新选择!') message.warning('当前物料可制造与其他数据不一致,请重新选择!')
} else { } else {
row['itemCode'] = val[0]['itemCode'] row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom'] row['uom'] = val[0]['uom']
@ -194,7 +197,7 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
if(formField == 'itemCode') { if(formField == 'itemCode') {
const isType = await isItemType(val[0]['itemCode'], labelType.value) const isType = await isItemType(val[0]['itemCode'], labelType.value)
if(!isType){ if(!isType){
message.warning('当前物料类型与其他数据不一致,请重新选择!') message.warning('当前物料可制造与其他数据不一致,请重新选择!')
} else { } else {
setV['itemCode'] = val[0]['itemCode'] setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom'] setV['uom'] = val[0]['uom']
@ -363,8 +366,8 @@ const buttonTableClick = async (val, row) => {
by: 'ASC', by: 'ASC',
}).then(res => { }).then(res => {
if (res.list.length > 0) { if (res.list.length > 0) {
// //
if (res.list[0].type == "RAW") { if (res.list[0].enableMake == "FALSE") {
// tableform // tableform
detailListTableColumns.tableFormColumns.map(itemColumns => { detailListTableColumns.tableFormColumns.map(itemColumns => {
if(itemColumns.field == 'productionLineCodePackage') { if(itemColumns.field == 'productionLineCodePackage') {

15
src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue

@ -128,6 +128,7 @@ const updataTableColumns = (val) => {
// //
const isItemType = async (itemCode, labelTypeParams) => { const isItemType = async (itemCode, labelTypeParams) => {
let isType = false let isType = false
const labelTypeOld = JSON.parse(JSON.stringify(labelType.value))
await ItembasicApi.getItembasicPage({ await ItembasicApi.getItembasicPage({
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
@ -136,8 +137,8 @@ const isItemType = async (itemCode, labelTypeParams) => {
by: 'ASC', by: 'ASC',
}).then(res => { }).then(res => {
if (res.list.length > 0) { if (res.list.length > 0) {
// //
if (res.list[0].type == "RAW") { if (res.list[0].enableMake == "FALSE") {
labelType.value = 'cg' labelType.value = 'cg'
if (labelTypeParams == 'cg') { if (labelTypeParams == 'cg') {
isType = true isType = true
@ -151,6 +152,8 @@ const isItemType = async (itemCode, labelTypeParams) => {
if(labelTypeParams == '') isType = true if(labelTypeParams == '') isType = true
} }
}) })
//
if (!isType) labelType.value = labelTypeOld
return isType return isType
} }
@ -162,7 +165,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
if(formField == 'itemCode') { if(formField == 'itemCode') {
const isType = await isItemType(val[0]['itemCode'], labelType.value) const isType = await isItemType(val[0]['itemCode'], labelType.value)
if(!isType){ if(!isType){
message.warning('当前物料类型与其他数据不一致,请重新选择!') message.warning('当前物料可制造与其他数据不一致,请重新选择!')
} else { } else {
row['batch'] = val[0]['batch']==''?formatTime(new Date(), 'yyyyMMdd'):val[0]['batch'] row['batch'] = val[0]['batch']==''?formatTime(new Date(), 'yyyyMMdd'):val[0]['batch']
row['itemCode'] = val[0]['itemCode'] row['itemCode'] = val[0]['itemCode']
@ -200,7 +203,7 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
if(formField == 'itemCode') { if(formField == 'itemCode') {
const isType = await isItemType(val[0]['itemCode'], labelType.value) const isType = await isItemType(val[0]['itemCode'], labelType.value)
if(!isType){ if(!isType){
message.warning('当前物料类型与其他数据不一致,请重新选择!') message.warning('当前物料可制造与其他数据不一致,请重新选择!')
} else { } else {
setV['batch'] = val[0]['batch'] setV['batch'] = val[0]['batch']
setV['itemCode'] = val[0]['itemCode'] setV['itemCode'] = val[0]['itemCode']
@ -370,8 +373,8 @@ const buttonTableClick = async (val, row) => {
by: 'ASC', by: 'ASC',
}).then(res => { }).then(res => {
if (res.list.length > 0) { if (res.list.length > 0) {
// //
if (res.list[0].type == "RAW") { if (res.list[0].enableMake == "FALSE") {
// tableform // tableform
detailListTableColumns.tableFormColumns.map(itemColumns => { detailListTableColumns.tableFormColumns.map(itemColumns => {
if(itemColumns.field == 'productionLineCodePackage') { if(itemColumns.field == 'productionLineCodePackage') {

4
src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue

@ -352,8 +352,8 @@ const buttonTableClick = async (val, row) => {
by: 'ASC', by: 'ASC',
}).then(res => { }).then(res => {
if (res.list.length > 0) { if (res.list.length > 0) {
// //
if (res.list[0].type == "RAW") { if (res.list[0].enableMake == "FALSE") {
// tableform // tableform
detailListTableColumns.tableFormColumns.map(itemColumns => { detailListTableColumns.tableFormColumns.map(itemColumns => {
if(itemColumns.field == 'productionLineCodePackage') { if(itemColumns.field == 'productionLineCodePackage') {

Loading…
Cancel
Save