Browse Source

YT-1186发货记录,可编辑的只有 “发货类型” 字段,其余皆不可修改,如图(需求)

intex
zhang_li 2 days ago
parent
commit
a2e9db2a40
  1. 4
      src/api/wms/deliverRecordDetail/index.ts
  2. 45
      src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts
  3. 47
      src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/index.vue

4
src/api/wms/deliverRecordDetail/index.ts

@ -68,6 +68,10 @@ export const createDeliverRecordDetail = async (data: DeliverRecordDetailVO) =>
export const updateDeliverRecordDetail = async (data: DeliverRecordDetailVO) => {
return await request.put({ url: `/wms/deliver-record-detail/update`, data })
}
// 修改所有子表发货记录
export const updateDeliverRecordDetailAll = async (data) => {
return await request.put({ url: `/wms/deliver-record-detail/updateByMasterId`, data })
}
// 删除发货记录子
export const deleteDeliverRecordDetail = async (id: number) => {

45
src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts

@ -18,9 +18,9 @@ export const DeliverRecordMain = useCrudSchemas(
width: 180,
fixed: 'left'
},
isSearch: true
isSearch: true,
isForm:false,
},
{
label: '发货类型',
field: 'businessType',
@ -40,7 +40,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isSearch: true
isSearch: true,
isForm: false,
},
{
label: '客户月台代码',
@ -49,7 +50,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: true
isTable: true,
isForm: false,
},
{
label: '客户订单号',
@ -60,10 +62,10 @@ export const DeliverRecordMain = useCrudSchemas(
},
isSearch: true,
isTable: true,
isForm: true,
search: {
component: 'Input',
}
},
isForm: false,
},
{
label: '车牌号',
@ -72,7 +74,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
{
label: '截止时间',
@ -93,7 +96,8 @@ export const DeliverRecordMain = useCrudSchemas(
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
isForm: false,
},
{
label: '从仓库代码',
@ -102,7 +106,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
{
label: '到仓库代码',
@ -111,7 +116,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
{
label: '创建时间',
@ -125,6 +131,7 @@ export const DeliverRecordMain = useCrudSchemas(
width: 180
},
isTable: false,
isForm:false,
form: {
component: 'DatePicker',
componentProps: {
@ -150,7 +157,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
// {
// label: '代码',
@ -178,7 +186,20 @@ export const DeliverRecordMain = useCrudSchemas(
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
isForm: false,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
hiddenInMain: true,
isTableForm: false,
}
])
)

47
src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/index.vue

@ -38,13 +38,11 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
ref="basicFormRef"
:rules="DeliverRecordMainRules"
:formAllSchemas="DeliverRecordMain.allSchemas"
:tableAllSchemas="DeliverRecordDetail.allSchemas"
:tableFormRules="DeliverRecordDetailRules"
:isBusiness="true"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
@ -166,15 +164,25 @@ const butttondata = (row,$index) => {
if(findIndex>-1&&findIndex<$index){
return []
}else{
return [defaultButtons.mainListDocumentPrintBtn(null),] //
return [
// defaultButtons.mainListDocumentPrintBtn(null), //
defaultButtons.mainListEditBtn(null), //
]
}
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'documentPrint') { //
handlePoint(row)
if (val == 'edit') { //
openForm('update', row)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const tableData = ref([])
const openForm = (type: string, row?: any) => {
tableData.value = []
basicFormRef.value.open(type, row)
}
//
@ -267,6 +275,31 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
formRef.setValues(setV)
}
}
//
const submitForm = async (formType, submitData) => {
let data = {...submitData}
if(data.masterId){
data.id = data.masterId
}
try {
if (formType === 'create') {
await DeliverRecordMainApi.createDeliverRecordMain(data)
message.success(t('common.createSuccess'))
getList()
} else {
await DeliverRecordMainApi.updateDeliverRecordMain(data)
await DeliverRecordDetailApi.updateDeliverRecordDetailAll(data)
message.success(t('common.updateSuccess'))
basicFormRef.value.dialogVisible = false
buttonBaseClick('refresh',null)
}
} finally {
basicFormRef.value.formLoading = false
}
}
/** 初始化 **/
onMounted(async () => {

Loading…
Cancel
Save