Browse Source

YT-1996《供应商地点便次时间配置表》开发

intex_online20250311
张立 1 month ago
parent
commit
65c8a590e1
  1. 4
      src/api/wms/supplierAddrDeliTime/index.ts
  2. 30
      src/views/wms/basicDataManage/supplierManage/supplierAddrDeliTime/index.vue
  3. 102
      src/views/wms/basicDataManage/supplierManage/supplierAddrDeliTime/supplierAddrDeliTimeDetail.data.ts
  4. 4
      src/views/wms/supplierManage/supplierDeliMain/supplierDeliMain.data.ts

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

@ -47,3 +47,7 @@ export const exportSupplierAddrDeliTimeDetail = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/supplier-addr-deli-time-detail/get-import-template' }) return request.download({ url: '/wms/supplier-addr-deli-time-detail/get-import-template' })
} }
// 查询供应商地点
export const getSupplierAddrList = async (supplierCode) => {
return await request.get({ url: `/wms/supplieritem/getAddrBySupplierCode?supplierCode=` + supplierCode })
}

30
src/views/wms/basicDataManage/supplierManage/supplierAddrDeliTime/index.vue

@ -103,7 +103,7 @@ const tableColumns = ref(SupplierAddrDeliTime.allSchemas.tableColumns)
const detailAllSchemas = ref(SupplierAddrDeliTimeDetail.allSchemas) const detailAllSchemas = ref(SupplierAddrDeliTimeDetail.allSchemas)
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(async() => {
if (formField == 'code') { if (formField == 'code') {
let codes = val.filter((item) => let codes = val.filter((item) =>
tableData.value.find((item1) => item1['code'] == item['code']) tableData.value.find((item1) => item1['code'] == item['code'])
@ -135,6 +135,18 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
if (formField == 'supplierCode') { if (formField == 'supplierCode') {
setV['supplierCode'] = val[0].code setV['supplierCode'] = val[0].code
setV['supplierName'] = val[0].name setV['supplierName'] = val[0].name
console.log(SupplierAddrDeliTime.allSchemas.formSchema)
const options = await SupplierAddrDeliTimeDetailApi.getSupplierAddrList(val[0].code)
SupplierAddrDeliTime.allSchemas.formSchema.forEach(item => {
if(item.field == 'supplierAddressShow'){
item.componentProps.options = options.map(item=> {
return {
label: item,
value:item
}
})
}
})
} }
formRef.setValues(setV) formRef.setValues(setV)
}) })
@ -150,6 +162,8 @@ const submitForm = async (formType, submitData) => {
if (data.masterId) { if (data.masterId) {
data.id = data.masterId data.id = data.masterId
} }
data.supplierAddress =data.supplierAddressShow.join(',')
data.yearAndMonth =data.yearAndMonthShow.join(',')
data.subList = tableData.value // data.subList = tableData.value //
data.subList.forEach((item) => { data.subList.forEach((item) => {
item.toWarehouseCode = data.toWarehouseCode item.toWarehouseCode = data.toWarehouseCode
@ -277,13 +291,27 @@ const openForm = async (type: string, row?: any) => {
item.componentProps.isSearchList = false item.componentProps.isSearchList = false
item.componentProps.disabled = true item.componentProps.disabled = true
} }
if (item.field == 'supplierAddressShow') {
item.componentProps.disabled = true
}
if (item.field == 'yearAndMonthShow') {
item.componentProps.disabled = true
}
}) })
row.yearAndMonthShow =row.yearAndMonth.split(',')
row.supplierAddressShow =row.supplierAddress.split(',')
} else { } else {
SupplierAddrDeliTime.allSchemas.formSchema.forEach((item) => { SupplierAddrDeliTime.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') { if (item.field == 'supplierCode') {
item.componentProps.isSearchList = true item.componentProps.isSearchList = true
item.componentProps.disabled = false item.componentProps.disabled = false
} }
if (item.field == 'supplierAddressShow') {
item.componentProps.disabled = false
}
if (item.field == 'yearAndMonthShow') {
item.componentProps.disabled = false
}
}) })
} }
formRef.value.open(type, row) formRef.value.open(type, row)

102
src/views/wms/basicDataManage/supplierManage/supplierAddrDeliTime/supplierAddrDeliTimeDetail.data.ts

@ -15,7 +15,39 @@ export const SupplierAddrDeliTimeDetailRules = reactive({
delayDeli: [required], delayDeli: [required],
}) })
function getMonthArr() {
let dateArr = [];
let year = new Date().getFullYear();
let month = new Date().getMonth();
const n = 12
if (n < month) {
//1.n<month的情况
for (let i = month - n + 1; i <= month; i++) {
let m1 = i < 10 ? "0" + i : i;
dateArr.push({
label: year + '-' + m1,
value: year + '-' + m1
});
}
} else {
//2.n>month的情况
for (let i = (12 - (n - month) + 1); i <= 12; i++) {
let m1 = i < 10 ? "0" + i : i;
dateArr.push({
label: year + '-' + m1,
value: year + '-' + m1
});
}
for (let i = 1; i <= month; i++) {
let m1 = i < 10 ? "0" + i : i;
dateArr.push({
label: (parseFloat(year) + 1) + '-' + m1,
value: (parseFloat(year) + 1) + '-' + m1,
});
}
}
return dateArr;
}
export const SupplierAddrDeliTime = useCrudSchemas(reactive<CrudSchema[]>([ export const SupplierAddrDeliTime = useCrudSchemas(reactive<CrudSchema[]>([
{ {
@ -27,6 +59,7 @@ export const SupplierAddrDeliTime = useCrudSchemas(reactive<CrudSchema[]>([
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
enterSearch: true,
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段 searchField: 'number', // 查询弹窗赋值字段
searchTitle: '供应商', // 查询弹窗标题 searchTitle: '供应商', // 查询弹窗标题
@ -38,7 +71,16 @@ export const SupplierAddrDeliTime = useCrudSchemas(reactive<CrudSchema[]>([
value: "TRUE", value: "TRUE",
isMainValue: false isMainValue: false
} }
] ],
// 失去焦点校验参数
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true,
}]
} }
} }
}, },
@ -54,15 +96,69 @@ export const SupplierAddrDeliTime = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '供应商地点', label: '供应商地点',
field: 'supplierAddress', field: 'supplierAddressShow',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isTable: false,
isDetail: false,
form: {
component: 'Select',
componentProps: {
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
maxCollapseTags: "2",
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
}
},
{
label: '供应商地点',
field: 'supplierAddress',
sort: 'custom',
isTable: true,
isDetail: true,
isForm: false,
},
{
label: '年月',
field: 'yearAndMonthShow',
sort: 'custom',
isTable: false,
isDetail: false,
form: {
component: 'Select',
api: () => getMonthArr(),
componentProps: {
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
maxCollapseTags:"2",
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
}
}, },
{ {
label: '年月', label: '年月',
field: 'yearAndMonth', field: 'yearAndMonth',
sort: 'custom', sort: 'custom',
isTable: true,
isDetail: true,
isForm: false,
isSearch: true, isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
type: 'month',
valueFormat: 'YYYY-MM',
}
},
}, },
{ {
label: '延后便次', label: '延后便次',

4
src/views/wms/supplierManage/supplierDeliMain/supplierDeliMain.data.ts

@ -53,10 +53,10 @@ export const SupplierDeliMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
value: formatDate(new Date(),'YYYYMM'), value: formatDate(new Date(),'YYYY-MM'),
componentProps: { componentProps: {
type: 'month', type: 'month',
valueFormat: 'YYYYMM', valueFormat: 'YYYY-MM',
} }
} }
}, },

Loading…
Cancel
Save