Browse Source

询证函日期管理

hella_online_20241107
yufei_wang 3 weeks ago
parent
commit
b50e0ced10
  1. 36
      src/views/wms/supplierManage/supplierApbalanceCalendar/index.vue
  2. 29
      src/views/wms/supplierManage/supplierApbalanceCalendar/supplierApbalanceCalendar.data.ts

36
src/views/wms/supplierManage/supplierApbalanceCalendar/index.vue

@ -47,8 +47,20 @@
:apiUpdate="SupplierApbalanceCalendarApi.updateSupplierApbalanceCalendar"
:apiCreate="SupplierApbalanceCalendarApi.createSupplierApbalanceCalendar"
@searchTableSuccess="searchTableSuccess"
@onChange="onChange"
:isBusiness="false"
/>
>
<template #beginDay>
<el-select v-model="beginDay" placeholder="请选择开始日期" @change="(value)=>selectChange(value,'beginDay')">
<el-option v-for="dict in daysInMonths" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</template>
<template #endDay>
<el-select v-model="endDay" placeholder="请选择结束日期" @change="(value)=>selectChange(value,'endDay')">
<el-option v-for="dict in daysInMonths" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</template>
</BasicForm>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="SupplierApbalanceCalendar.allSchemas" />
@ -65,6 +77,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import dayjs from 'dayjs'
defineOptions({ name: 'SupplierApbalanceCalendar' })
@ -235,6 +248,27 @@ const searchFormClick = (searchData) => {
getList() //
}
const beginDay = ref('')
const endDay = ref('')
const selectChange = (value,field)=>{
basicFormRef.value.formRef.formModel[field] = value
}
const daysInMonths = ref([])
const onChange = (field, value, formRef)=>{
if(field=='month'){
let days = []
for (let i=1;i<=dayjs(`${value}-01`).daysInMonth();i++){
days.push({
value:i,
label:i
})
}
basicFormRef.value.formRef.formModel['beginDay'] = ''
basicFormRef.value.formRef.formModel['endDay'] = ''
daysInMonths.value = days
}
}
/** 初始化 **/
onMounted(async () => {
getList()

29
src/views/wms/supplierManage/supplierApbalanceCalendar/supplierApbalanceCalendar.data.ts

@ -10,6 +10,14 @@ export const SupplierApbalanceCalendarRules = reactive({
concurrencyStamp: [required],
})
let months = []
for(let i=0;i<12;i++){
months.push({
value: i+1,
label: i+1,
})
}
export const SupplierApbalanceCalendar = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: 'id',
@ -18,20 +26,27 @@ export const SupplierApbalanceCalendar = useCrudSchemas(reactive<CrudSchema[]>([
// isForm: false,
// },
{
label: '开始月份',
field: 'beginMonth',
label: '月份',
field: 'month',
sort: 'custom',
form: {
component: 'Select',
componentProps: {
options: months,
placeholder: '请选择月份',
}
},
},
{
label: '开始日期',
field: 'beginDay',
sort: 'custom',
},
{
label: '结束月份',
field: 'endMonth',
sort: 'custom',
},
// {
// label: '结束月份',
// field: 'endMonth',
// sort: 'custom',
// },
{
label: '结束日期',
field: 'endDay',

Loading…
Cancel
Save