Browse Source

HL-5465预生产和装配报工申请中修改物料选择方法

hella_online_20240821
zhang_li 3 months ago
parent
commit
cae2a034c1
  1. 735
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue
  2. 203
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts
  3. 61
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue
  4. 42
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/productreceiptAssembleRequestMain.data.ts

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

File diff suppressed because it is too large

203
src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts

@ -1,6 +1,6 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
@ -26,7 +26,7 @@ import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/prod
import * as BomApi from '@/api/wms/bom'
import { Bom } from '@/views/wms/basicDataManage/itemManage/bom/bom.data'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data'
import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data'
@ -36,21 +36,21 @@ const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'ProductReceiptRequest'
pageSize: 10,
pageNo: 1,
code: 'ProductReceiptRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData = data?.list[0] || {}
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
import { TableColumn } from '@/types/table'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept]
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
import { TableColumn } from '@/types/table'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray: any = [userDept]
/**
* @returns {Array}
@ -74,7 +74,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
dictClass: 'string',
isSearch: true,
isTable: true,
isForm:false,
isForm: false,
sort: 'custom',
table: {
width: 150
@ -95,7 +95,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
},
isSearch: true,
isForm: false,
isTable:true,
isTable: true,
},
{
label: '车间代码',
@ -151,7 +151,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'workshopCode',
value: 'workshopCode',
message: '请填写车间代码!',
@ -172,12 +172,12 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'workshopCode',
value: 'workshopCode',
message: '请填写车间代码!',
isMainValue: true
}],
}],
verificationParams: [{
key: 'code',
action: '==',
@ -266,7 +266,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
isTable:false,
isTable: false,
isForm: false
},
{
@ -276,7 +276,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
isTable:false,
isTable: false,
isForm: false,
},
{
@ -288,7 +288,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
isTable:false,
isTable: false,
isForm: false,
},
{
@ -340,7 +340,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
@ -382,7 +382,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
@ -417,7 +417,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm:false,
isForm: false,
table: {
width: 150
},
@ -452,7 +452,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
@ -477,7 +477,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm:false,
isForm: false,
sort: 'custom',
table: {
width: 150
@ -498,7 +498,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm:false,
isForm: false,
sort: 'custom',
table: {
width: 150
@ -519,7 +519,7 @@ export const ProductreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm:false,
isForm: false,
sort: 'custom',
table: {
width: 150
@ -596,7 +596,7 @@ export const ProductreceiptRequestMainRules = reactive({
directCreateRecord: [
{ required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' }
],
remark: [
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})
@ -613,7 +613,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150
},
isTableForm: false,
tableForm:{
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
@ -624,7 +624,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'workshopCode',
value: 'workshopCode',
message: '请填写车间代码!',
@ -644,7 +644,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'workshopCode',
value: 'workshopCode',
message: '请填写车间代码!',
@ -660,27 +660,26 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
table: {
width: 150
},
tableForm:{
multiple: true,
disabled:true,
// isInpuFocusShow: true,
tableForm: {
enterSearch: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择工位代码',
searchField: 'code',
searchTitle: '工位信息',
searchAllSchemas: Workstation.allSchemas,
searchPage: WorkstationApi.getWorkstationPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'productionLineCode',
value: 'productionLineCode',
message: '请填写生产线代码!',
isMainValue: true
}],
verificationPage: WorkstationApi.getWorkstationByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
}],
isRepeat: true,//tableForm下方输入框是否可以重复添加该条数据
verificationParams: [{
key: 'code',
action: '==',
@ -693,8 +692,8 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
isSearchList: true,
enterSearch: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择工位代码',
searchField: 'code',
searchTitle: '工位信息',
@ -704,12 +703,12 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'productionLineCode',
value: 'productionLineCode',
message: '请填写生产线代码!',
isMainValue: true
}],
}],
verificationParams: [{
key: 'code',
action: '==',
@ -741,6 +740,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
value: 'TRUE',
isMainValue: false
}],
isRepeat: true,//tableForm下方输入框是否可以重复添加该条数据
verificationParams: [{
key: 'code',
action: '==',
@ -783,8 +783,8 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
table: {
width: 150
},
hiddenInMain:true,
isTable:false,
hiddenInMain: true,
isTable: false,
isTableForm: false,
isForm: false
},
@ -807,7 +807,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
dictClass: 'string',
isTable: false,
sort: 'custom',
hiddenInMain:true,
hiddenInMain: true,
table: {
width: 150
},
@ -819,7 +819,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'woNumber',
sort: 'custom',
isTable: false,
hiddenInMain:true,
hiddenInMain: true,
table: {
width: 150
},
@ -831,7 +831,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'woLine',
sort: 'custom',
isTable: false,
hiddenInMain:true,
hiddenInMain: true,
table: {
width: 150
},
@ -843,7 +843,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'packQty',
sort: 'custom',
isTable: false,
hiddenInMain:true,
hiddenInMain: true,
table: {
width: 150
},
@ -864,7 +864,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
// dictClass: 'string',
isTable: false,
sort: 'custom',
hiddenInMain:true,
hiddenInMain: true,
table: {
width: 150
},
@ -876,7 +876,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'toOwnerCode',
sort: 'custom',
isTable: false,
hiddenInMain:true,
hiddenInMain: true,
table: {
width: 150
},
@ -888,7 +888,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'number',
sort: 'custom',
isTable: false,
hiddenInMain:true,
hiddenInMain: true,
table: {
width: 180
},
@ -903,13 +903,15 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
label: '物料代码',
field: 'itemCode',
sort: 'custom',
sortTableDefault:1003,
sortTableDefault: 1003,
table: {
width: 150
},
tableForm:{
tableForm: {
// enterSearch:true,
isInpuFocusShow: true,
disabled: true,
multiple: true,
isInpuFocusShow: false,
searchListPlaceholder: '请选择物料代码',
searchField: 'itemCode',
searchTitle: '生产线物料关系信息',
@ -919,12 +921,15 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'productionLineCode',
value: 'productionLineCode',
message: '请填写生产线代码!',
isMainValue: true
}],
}],
verificationPage: ProductionlineitemApi.getProductionLineCodelistByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
verificationParams: [{
key: 'itemCode',
action: '==',
@ -948,12 +953,12 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'productionLineCode',
value: 'productionLineCode',
message: '请填写生产线代码!',
isMainValue: true
}],
}],
verificationParams: [{
key: 'itemCode',
action: '==',
@ -972,7 +977,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
table: {
width: 150
},
sortTableDefault:1004,
sortTableDefault: 1004,
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择Bom版本', // 输入框占位文本
@ -981,11 +986,11 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productItemCode',
value:'itemCode',
key: 'productItemCode',
value: 'itemCode',
message: '请填写物料代码!',
isMainValue: true
},{
}, {
key: 'available',
value: 'TRUE',
isMainValue: false
@ -1001,11 +1006,11 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productItemCode',
value:'itemCode',
key: 'productItemCode',
value: 'itemCode',
message: '请填写物料代码!',
isMainValue: true
},{
}, {
key: 'available',
value: 'TRUE',
isMainValue: false
@ -1017,7 +1022,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
label: '批次',
field: 'batch',
sort: 'custom',
sortTableDefault:1006,
sortTableDefault: 1006,
table: {
width: 150
},
@ -1026,7 +1031,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
label: '物料名称',
field: 'itemName',
sort: 'custom',
sortTableDefault:1005,
sortTableDefault: 1005,
table: {
width: 150
},
@ -1036,7 +1041,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
{
label: '物料描述1',
field: 'itemDesc1',
hiddenInMain:true,
hiddenInMain: true,
isTable: false,
sort: 'custom',
table: {
@ -1048,7 +1053,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
{
label: '物料描述2',
field: 'itemDesc2',
hiddenInMain:true,
hiddenInMain: true,
isTable: false,
sort: 'custom',
table: {
@ -1060,7 +1065,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
{
label: '项目代码',
field: 'projectCode',
hiddenInMain:true,
hiddenInMain: true,
isTable: false,
sort: 'custom',
table: {
@ -1073,7 +1078,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
label: '数量',
field: 'qty',
sort: 'custom',
sortTableDefault:1006,
sortTableDefault: 1006,
table: {
width: 150
},
@ -1095,7 +1100,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
sortTableDefault:1007,
sortTableDefault: 1007,
isTable: true,
sort: 'custom',
table: {
@ -1114,7 +1119,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
detail: {
dateFormat: 'YYYY-MM-DD'
},
sortTableDefault:1008,
sortTableDefault: 1008,
sort: 'custom',
table: {
width: 180
@ -1126,7 +1131,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
style: { width: '100%' },
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
@ -1136,7 +1141,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
{
label: '过期日期',
field: 'expireDate',
hiddenInMain:true,
hiddenInMain: true,
isTable: false,
formatter: dateFormatter2,
detail: {
@ -1150,14 +1155,14 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
// type: 'FormDate',
// valueFormat: 'x',
// },
tableForm:{
tableForm: {
type: 'slot',
disabled: true
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
style: { width: '100%' },
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
@ -1172,13 +1177,13 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
table: {
width: 150
},
hiddenInMain:true,
hiddenInMain: true,
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
sortTableDefault:1009,
sortTableDefault: 1009,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
@ -1189,7 +1194,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
@ -1202,7 +1207,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
label: '创建者',
field: 'creator',
sort: 'custom',
sortTableDefault:1010,
sortTableDefault: 1010,
table: {
width: 150
},
@ -1213,7 +1218,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
label: '最后更新时间',
field: 'updateTime',
isTable: false,
hiddenInMain:true,
hiddenInMain: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -1225,7 +1230,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
@ -1238,7 +1243,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
label: '最后更新者',
field: 'updater',
sort: 'custom',
hiddenInMain:true,
hiddenInMain: true,
isTable: false,
table: {
width: 150
@ -1248,15 +1253,15 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
},
{
label: '操作',
hiddenInMain:true,
hiddenInMain: true,
field: 'action',
isDetail: false,
isForm: false ,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm:false,
isTableForm: false,
}
]))
@ -1287,7 +1292,7 @@ export const ProductreceiptRequestDetailRules = reactive({
productionLineCode: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
],
remark: [
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})
@ -1641,7 +1646,7 @@ export const ProductreceiptRequestLabel = useCrudSchemas(reactive<CrudSchema[]>(
table: {
width: 150
},
tableForm:{
tableForm: {
disabled: true
// isInpuFocusShow: true,
// searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
@ -1663,14 +1668,14 @@ export const ProductreceiptRequestLabel = useCrudSchemas(reactive<CrudSchema[]>(
table: {
width: 150
},
tableForm:{
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'supplierCode', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法
searchCondition:[{
searchCondition: [{
key: 'itemCode',
value: 'itemCode',
message: '请填写物料代码!',
@ -1914,7 +1919,7 @@ export const ProductreceiptRequestLabel = useCrudSchemas(reactive<CrudSchema[]>(
}
},
tableForm: {
enterSearch:true,
enterSearch: true,
disabled: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
@ -1983,7 +1988,7 @@ export const ProductreceiptRequestLabel = useCrudSchemas(reactive<CrudSchema[]>(
}
},
tableForm: {
enterSearch:true,
enterSearch: true,
disabled: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
@ -2014,7 +2019,7 @@ export const ProductreceiptRequestLabel = useCrudSchemas(reactive<CrudSchema[]>(
},
form: {
componentProps: {
disabled:true
disabled: true
}
},
tableForm: {

61
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue

@ -43,7 +43,7 @@
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="workStationCode"
fieldTableColumn="itemCode"
@success="getList"
:rules="ProductreceiptRequestMainRules"
:formAllSchemas="ProductreceiptRequestMain.allSchemas"
@ -212,38 +212,14 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
row['packUnit'] = val[0]['packUnit']
row['packQty'] = val[0]['packQty']
row[formField] = val[0][searchField]
}else if (formField == 'itemCode') {
} else if (formField == 'itemCode') {
if(tableData.value.find(item1=>item1['itemCode'] == val[0]['itemCode'])){
message.warning(`物料${val[0]['itemCode']}已经存在`)
return
}
row['uom'] = val[0]['uom']
row['produceDate'] = dayjs().valueOf()
row[formField] = val[0][searchField]
// BOM
const param1 = {
productItemCode: val[0]['itemCode'],
available: 'TRUE',
pageSize: 20,
pageNo: 1,
sort: '',
by: 'ASC',
}
BomApi.getBomPage(param1).then(res => {
console.log(res)
if(res?.list?.length>0){
row['bomVersion'] = res.list[0].version
}
})
}else if (formField == 'workStationCode') {
//
val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow[formField] = item[searchField]
newRow.batch = formatTime(new Date(), 'yyyyMMdd')
tableData.value.push(newRow)
})
}else{
const index1 = 0
setTableFormsValues(val, index1)
} else{
row[formField] = val[0][searchField]
}
} else {
@ -261,6 +237,33 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
})
}
const setTableFormsValues = async (val, index1) => {
if (index1 <= val.length - 1) {
const newRow = JSON.parse(JSON.stringify({ ...tableFormKeys, ...val[index1] }))
newRow['itemCode'] = val[index1]['itemCode']
newRow['uom'] = val[0]['uom']
newRow['produceDate'] = dayjs().valueOf()
const param1 = {
productItemCode: val[0]['itemCode'],
available: 'TRUE',
pageSize: 20,
pageNo: 1,
sort: '',
by: 'ASC'
}
await BomApi.getBomPage(param1).then((res) => {
console.log(res)
if (res?.list?.length > 0) {
newRow['bomVersion'] = res.list[0].version
}
})
tableData.value.push(newRow)
console.log(tableData.value)
index1++
setTableFormsValues(val, index1)
}
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {

42
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/productreceiptAssembleRequestMain.data.ts

@ -670,27 +670,26 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
table: {
width: 150
},
tableForm:{
multiple: true,
disabled:true,
// isInpuFocusShow: true,
tableForm: {
enterSearch: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择工位代码',
searchField: 'code',
searchTitle: '工位信息',
searchAllSchemas: Workstation.allSchemas,
searchPage: WorkstationApi.getWorkstationPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'productionLineCode',
value: 'productionLineCode',
message: '请填写生产线代码!',
isMainValue: true
}],
verificationPage: WorkstationApi.getWorkstationByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
}],
isRepeat: true,//tableForm下方输入框是否可以重复添加该条数据
verificationParams: [{
key: 'code',
action: '==',
@ -703,7 +702,8 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
enterSearch: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择工位代码',
searchField: 'code',
searchTitle: '工位信息',
@ -713,7 +713,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'productionLineCode',
value: 'productionLineCode',
message: '请填写生产线代码!',
@ -750,6 +750,7 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
value: 'TRUE',
isMainValue: false
}],
isRepeat: true,//tableForm下方输入框是否可以重复添加该条数据
verificationParams: [{
key: 'code',
action: '==',
@ -760,9 +761,9 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
}], // 失去焦点校验参数
},
form: {
enterSearch: true,
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true,
searchListPlaceholder: '请选择工序代码',
searchField: 'code',
@ -912,13 +913,15 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
label: '物料代码',
field: 'itemCode',
sort: 'custom',
sortTableDefault: 1003,
table: {
width: 150
},
sortTableDefault:1003,
tableForm:{
tableForm: {
// enterSearch:true,
isInpuFocusShow: true,
disabled: true,
multiple: true,
isInpuFocusShow: false,
searchListPlaceholder: '请选择物料代码',
searchField: 'itemCode',
searchTitle: '生产线物料关系信息',
@ -928,12 +931,15 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'productionLineCode',
value: 'productionLineCode',
message: '请填写生产线代码!',
isMainValue: true
}],
}],
verificationPage: ProductionlineitemApi.getProductionLineCodelistByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
verificationParams: [{
key: 'itemCode',
action: '==',
@ -957,12 +963,12 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
key: 'available',
value: 'TRUE',
isMainValue: false
},{
}, {
key: 'productionLineCode',
value: 'productionLineCode',
message: '请填写生产线代码!',
isMainValue: true
}],
}],
verificationParams: [{
key: 'itemCode',
action: '==',

Loading…
Cancel
Save