Browse Source

发料申请新增页面的修改

hella_online_20240829
wangyufei 2 months ago
parent
commit
ac5f51510d
  1. 32
      src/views/wms/issueManage/issue/issueRequestMain/index.vue
  2. 47
      src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts

32
src/views/wms/issueManage/issue/issueRequestMain/index.vue

@ -42,6 +42,8 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
@success="getList"
:rules="IssueRequestMainRules"
:formAllSchemas="IssueRequestMain.allSchemas"
@ -57,6 +59,7 @@
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@onEnter="onEnter"
/>
<!-- 详情 -->
@ -104,14 +107,39 @@ const updataTableColumns = (val) => {
tableColumns.value = val
}
const onEnter = async (field,value) => {
if (field == 'productionLineCode') {
//线
let res = await WorkstationApi.getWorkstationPage({
productionLineCode:value,
pageSize: 20,
pageNo: 1
})
if(res&&res.list&&res.list.length>0){
const setV = {}
setV['workStationCode'] = res.list[0].code
formRef.value.formRef.setValues(setV)
}
}
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(async() => {
if (type == 'tableForm') {
//
if (formField == 'itemCode') {
row['itemCode'] = val[0]['code']
row['uom'] = val[0]['uom']
val.forEach(item=>{
let tableForm = JSON.parse(JSON.stringify(tableFormKeys))
if (tableData.value.length > 0) {
tableForm.productionLineCode = tableData.value[0].productionLineCode
tableForm.workStationCode = tableData.value[0].workStationCode
}
if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])) return
const newRow = JSON.parse(JSON.stringify({...tableForm,...item}))
newRow['itemCode'] = item['code']
newRow['uom'] = item['uom']
tableData.value.push(newRow)
})
} else {
row[formField] = val[0][searchField]
}

47
src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts

@ -112,6 +112,7 @@ export const IssueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -161,6 +162,7 @@ export const IssueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择工位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -766,6 +768,7 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
sortSearchDefault:2,
sortTableDefault:3,
tableForm:{
multiple: true,
enterSearch:true,
isInpuFocusShow: true,
isSearchList: true, // 开启查询弹窗
@ -809,7 +812,27 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
hiddenInMain:true,
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
}
}
},
{
label: '计量单位',
@ -991,27 +1014,7 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: false,
isForm: false
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
hiddenInMain:true,
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
}
}
},
{
label: '从货主代码',
field: 'fromOwnerCode',

Loading…
Cancel
Save