Browse Source

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

intex
zhang_li 24 hours ago
parent
commit
9a0a6f0b2a
  1. 99
      src/views/wms/deliversettlementManage/ftSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts
  2. 48
      src/views/wms/deliversettlementManage/ftSuppliesRecordMain/deliverRecordMain/index.vue
  3. 98
      src/views/wms/deliversettlementManage/tjdtSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts
  4. 48
      src/views/wms/deliversettlementManage/tjdtSuppliesRecordMain/deliverRecordMain/index.vue

99
src/views/wms/deliversettlementManage/ftSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts

@ -17,7 +17,8 @@ export const DeliverRecordMain = useCrudSchemas(
width: 180,
fixed: 'left'
},
isSearch: true
isSearch: true,
isForm: false,
},
{
@ -39,7 +40,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isSearch: true
isSearch: true,
isForm: false,
},
{
label: '客户月台代码',
@ -48,7 +50,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: true
isTable: true,
isForm: false,
},
{
label: '客户订单号',
@ -59,7 +62,7 @@ export const DeliverRecordMain = useCrudSchemas(
},
isSearch: true,
isTable: true,
isForm: true,
isForm: false,
search: {
component: 'Input',
}
@ -71,7 +74,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
{
label: '截止时间',
@ -92,7 +96,8 @@ export const DeliverRecordMain = useCrudSchemas(
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
isForm: false,
},
{
label: '从仓库代码',
@ -101,7 +106,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
{
label: '到仓库代码',
@ -110,7 +116,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
{
label: '创建时间',
@ -141,6 +148,7 @@ export const DeliverRecordMain = useCrudSchemas(
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
},
},
isForm: false,
},
{
label: '创建者',
@ -149,7 +157,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
// {
// label: '代码',
@ -177,69 +186,29 @@ 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,
}
])
)
//表单校验
export const DeliverRecordMainRules = reactive({
requestNumber: [
{ required: true, message: '请选择申请单号', trigger: 'change' }
],
customerCode: [
{ required: true, message: '请选择客户代码', trigger: 'change' }
],
customerDockCode: [
{ required: true, message: '请选择客户月台代码', trigger: 'change' }
],
fromWarehouseCode: [
{ required: true, message: '请选择从仓库代码', trigger: 'change' }
],
fromAreaTypes: [
{ required: true, message: '请选择从库区类型范围', trigger: 'change' }
],
fromAreaCodes: [
{ required: true, message: '请选择从库区代码范围', trigger: 'change' }
],
toWarehouseCode: [
{ required: true, message: '请选择到仓库代码', trigger: 'change' }
],
toAreaTypes: [
{ required: true, message: '请选择到库区类型范围', trigger: 'change' }
],
outTransaction: [
{ required: true, message: '请输入出库事务类型', trigger: 'blur' }
],
inTransaction: [
{ required: true, message: '请输入入库事务类型', trigger: 'blur' }
],
executeTime: [
{ required: true, message: '请输入执行时间', trigger: 'change' }
],
activeDate: [
{ required: true, message: '请输入生效日期', trigger: 'change' }
],
available: [
{ required: true, message: '请输入是否可用', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
interfaceType: [
{ required: true, message: '请选择接口类型', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
{ required: true, message: '请输入发货类型', trigger: 'blur' }
],
})

48
src/views/wms/deliversettlementManage/ftSuppliesRecordMain/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,17 +164,26 @@ 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)
}
//
const { wsCache } = useCache()
@ -267,7 +274,30 @@ 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 () => {
if (routeName.value == 'ToyotaSupplies') {

98
src/views/wms/deliversettlementManage/tjdtSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts

@ -17,7 +17,8 @@ export const DeliverRecordMain = useCrudSchemas(
width: 180,
fixed: 'left'
},
isSearch: true
isSearch: true,
isForm: false,
},
{
@ -39,7 +40,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isSearch: true
isSearch: true,
isForm: false,
},
{
label: '客户月台代码',
@ -48,7 +50,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: true
isTable: true,
isForm: false,
},
{
label: '客户订单号',
@ -59,7 +62,7 @@ export const DeliverRecordMain = useCrudSchemas(
},
isSearch: true,
isTable: true,
isForm: true,
isForm: false,
search: {
component: 'Input',
}
@ -71,7 +74,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
{
label: '截止时间',
@ -92,7 +96,8 @@ export const DeliverRecordMain = useCrudSchemas(
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
isForm: false,
},
{
label: '从仓库代码',
@ -101,7 +106,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
{
label: '到仓库代码',
@ -110,7 +116,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
{
label: '创建时间',
@ -141,6 +148,7 @@ export const DeliverRecordMain = useCrudSchemas(
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
},
},
isForm: false,
},
{
label: '创建者',
@ -149,7 +157,8 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 150
},
isTable: false
isTable: false,
isForm: false,
},
// {
// label: '代码',
@ -177,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,
}
])
)
@ -185,62 +207,8 @@ export const DeliverRecordMain = useCrudSchemas(
//表单校验
export const DeliverRecordMainRules = reactive({
requestNumber: [
{ required: true, message: '请选择申请单号', trigger: 'change' }
],
customerCode: [
{ required: true, message: '请选择客户代码', trigger: 'change' }
],
customerDockCode: [
{ required: true, message: '请选择客户月台代码', trigger: 'change' }
],
fromWarehouseCode: [
{ required: true, message: '请选择从仓库代码', trigger: 'change' }
],
fromAreaTypes: [
{ required: true, message: '请选择从库区类型范围', trigger: 'change' }
],
fromAreaCodes: [
{ required: true, message: '请选择从库区代码范围', trigger: 'change' }
],
toWarehouseCode: [
{ required: true, message: '请选择到仓库代码', trigger: 'change' }
],
toAreaTypes: [
{ required: true, message: '请选择到库区类型范围', trigger: 'change' }
],
outTransaction: [
{ required: true, message: '请输入出库事务类型', trigger: 'blur' }
],
inTransaction: [
{ required: true, message: '请输入入库事务类型', trigger: 'blur' }
],
executeTime: [
{ required: true, message: '请输入执行时间', trigger: 'change' }
],
activeDate: [
{ required: true, message: '请输入生效日期', trigger: 'change' }
],
available: [
{ required: true, message: '请输入是否可用', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
interfaceType: [
{ required: true, message: '请选择接口类型', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
{ required: true, message: '请输入发货类型', trigger: 'blur' }
],
})

48
src/views/wms/deliversettlementManage/tjdtSuppliesRecordMain/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,17 +164,26 @@ 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)
}
//
const { wsCache } = useCache()
@ -267,7 +274,30 @@ 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 () => {
if (routeName.value == 'ToyotaSupplies') {

Loading…
Cancel
Save