Browse Source

发料申请新增页面的修改

hella_online_20240829
wangyufei 5 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 <BasicForm
ref="formRef" ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
@success="getList" @success="getList"
:rules="IssueRequestMainRules" :rules="IssueRequestMainRules"
:formAllSchemas="IssueRequestMain.allSchemas" :formAllSchemas="IssueRequestMain.allSchemas"
@ -57,6 +59,7 @@
@tableSelectionDelete="tableSelectionDelete" @tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@onEnter="onEnter"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -104,14 +107,39 @@ const updataTableColumns = (val) => {
tableColumns.value = 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 ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(async() => { nextTick(async() => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
if (formField == 'itemCode') { if (formField == 'itemCode') {
row['itemCode'] = val[0]['code'] val.forEach(item=>{
row['uom'] = val[0]['uom'] 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 { } else {
row[formField] = val[0][searchField] 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: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
enterSearch:true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
@ -161,6 +162,7 @@ export const IssueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
enterSearch:true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择工位代码', // 输入框占位文本 searchListPlaceholder: '请选择工位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
@ -766,6 +768,7 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
sortSearchDefault:2, sortSearchDefault:2,
sortTableDefault:3, sortTableDefault:3,
tableForm:{ tableForm:{
multiple: true,
enterSearch:true, enterSearch:true,
isInpuFocusShow: true, isInpuFocusShow: true,
isSearchList: 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: '计量单位', label: '计量单位',
@ -991,27 +1014,7 @@ export const IssueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm: false, isTableForm: false,
isForm: 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: '从货主代码', label: '从货主代码',
field: 'fromOwnerCode', field: 'fromOwnerCode',

Loading…
Cancel
Save