Browse Source

发货申请的新增

master_hella_20240701
yufei0306 7 months ago
parent
commit
77fc48e36b
  1. 4
      src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts
  2. 107
      src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue

4
src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts

@ -81,7 +81,7 @@ export const DeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
disabled: true, enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户代码', // 输入框占位文本 searchListPlaceholder: '请选择客户代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
@ -148,6 +148,7 @@ export const DeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择发货计划单号', // 输入框占位文本 searchListPlaceholder: '请选择发货计划单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段 searchField: 'number', // 查询弹窗赋值字段
@ -691,6 +692,7 @@ export const DeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
tableForm:{ tableForm:{
multiple:true,
isInpuFocusShow: true, // 开启查询弹窗 isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', searchListPlaceholder: '请选择物料代码',
searchField: 'itemCode', searchField: 'itemCode',

107
src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue

@ -43,6 +43,8 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm
ref="formRef" ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
@success="getList" @success="getList"
:rules="DeliverRequestMainRules" :rules="DeliverRequestMainRules"
:formAllSchemas="DeliverRequestMain.allSchemas" :formAllSchemas="DeliverRequestMain.allSchemas"
@ -119,8 +121,17 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
nextTick(() => { nextTick(() => {
if (type == 'tableForm') { if (type == 'tableForm') {
if(formField == 'itemCode') { if(formField == 'itemCode') {
row['itemCode'] = val[0]['itemCode'] const tableFormKeys = {}
row['uom'] = val[0]['customerUom'] DeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
console.log('tableData.value',tableData.value)
val.forEach(item=>{
if(tableData.value.find(item1=>item1['id'] == item['id'])) return
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['uom'] = item['customerUom']
tableData.value.push(newRow)
})
}else{ }else{
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
} }
@ -129,54 +140,54 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if(formField == 'deliverPlanNumber') { if(formField == 'deliverPlanNumber') {
setV['deliverPlanNumber'] = val[0]['number'] setV['deliverPlanNumber'] = val[0]['number']
if(setV['deliverPlanNumber'] != null){ // if(setV['deliverPlanNumber'] != null){
isShowButton.value = false // isShowButton.value = false
} // }
setV['customerCode'] = val[0]['customerCode'] setV['customerCode'] = val[0]['customerCode']
// getBomDisassemble // getBomDisassemble
DeliverPlanDetailApi.selectDetailByMasterID(val[0]['id']) // DeliverPlanDetailApi.selectDetailByMasterID(val[0]['id'])
.then(res => { // .then(res => {
res.forEach(item => { // res.forEach(item => {
item.qty = item.planQty // item.qty = item.planQty
}) // })
if (res) tableData.value = res // if (res) tableData.value = res
// tableform // // tableform
DeliverRequestDetail.allSchemas.tableFormColumns.map(item => { // DeliverRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'itemCode') { // if(item.field == 'itemCode') {
item.isInpuFocusShow = false // item.isInpuFocusShow = false
item.tableForm.isInpuFocusShow = false // item.tableForm.isInpuFocusShow = false
item.tableForm.disabled = true // item.tableForm.disabled = true
} // }
if(item.field == 'uom') { // if(item.field == 'uom') {
item.tableForm.disabled = true // item.tableForm.disabled = true
} // }
}) // })
// tableform // // tableform
if(formField == 'customerCode'){ // if(formField == 'customerCode'){
console.log(1111,val); // console.log(1111,val);
customerCode.value = val[0]['code'] // customerCode.value = val[0]['code']
console.log(11112,customerCode.value); // console.log(11112,customerCode.value);
} // }
DeliverRequestMain.allSchemas.tableFormColumns.map(item => { // DeliverRequestMain.allSchemas.tableFormColumns.map(item => {
if(item.field == 'customerDockCode') { // if(item.field == 'customerDockCode') {
item.tableForm.searchCondition = [ // item.tableForm.searchCondition = [
{ // {
key: 'customerCode', // key: 'customerCode',
value: customerCode.value , // value: customerCode.value ,
isMainValue: true // isMainValue: true
}] // }]
item.form.componentProps.searchCondition = [ // item.form.componentProps.searchCondition = [
{ // {
key: 'customerCode', // key: 'customerCode',
value: customerCode.value , // value: customerCode.value ,
isMainValue: true // isMainValue: true
}]} // }]}
else { // else {
delete item.tableForm.searchCondition // delete item.tableForm.searchCondition
delete item.form.componentProps.searchCondition // delete item.form.componentProps.searchCondition
} // }
}) // })
}) // })
if(formField == 'itemCode'){ if(formField == 'itemCode'){
console.log( val[0]); console.log( val[0]);
row['uom'] = val[0]['customerUom'] row['uom'] = val[0]['customerUom']

Loading…
Cancel
Save