Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

hella_online_20241107
zhaoxuebing 3 weeks ago
parent
commit
c7b4755c26
  1. 7
      src/api/wms/supplierApbalanceMain/index.ts
  2. 102
      src/views/wms/supplierManage/supplierApbalance/supplierApbalanceMain/index.vue
  3. 18
      src/views/wms/supplierManage/supplierApbalance/supplierApbalanceMain/supplierApbalanceMain.data.ts
  4. 2
      src/views/wms/supplierManage/supplierApbalanceCalendar/index.vue

7
src/api/wms/supplierApbalanceMain/index.ts

@ -70,3 +70,10 @@ export const exportSupplierApbalanceMain = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/wms/supplier-apbalance-main/get-import-template' })
}
// 查询年月日
export const getMonthDay = async () => {
return await request.get({ url: `/wms/supplier-apbalance-calendar/getMonthDay`})
}

102
src/views/wms/supplierManage/supplierApbalance/supplierApbalanceMain/index.vue

@ -1,7 +1,23 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SupplierApbalanceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search ref="searchRef" :schema="SupplierApbalanceMain.allSchemas.searchSchema" @search="searchClick" @reset="resetClick" >
<template #year>
<el-select v-model="year" placeholder="请选择年" @change="(value)=>selectChange(value,'year')">
<el-option v-for="dict in yearList" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</template>
<template #month>
<el-select v-model="month" placeholder="请选择月" @change="(value)=>selectChange(value,'month')">
<el-option v-for="dict in monthList" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</template>
<template #day>
<el-select v-model="day" placeholder="请选择日" @change="(value)=>selectChange(value,'day')">
<el-option v-for="dict in dayList" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</template>
</Search>
</ContentWrap>
<!-- 列表头部 -->
@ -92,6 +108,7 @@ import Detail from '@/components/Detail/src/Detail.vue'
import * as BasicSpotCheckOptionApi from "@/api/eam/basicSpotCheckOption";
import TableFormAdjustment from '@/components/TableFormAdjustment/src/TableFormAdjustment.vue'
import AdjustmentDialog from '@/components/TableFormAdjustment/src/AdjustmentDialog.vue'
import dayjs from 'dayjs'
import {getJmreportBaseUrl} from "@/utils/systemParam";
import {getAccessToken} from "@/utils/auth";
@ -296,8 +313,91 @@ const searchFormClick = (searchData) => {
getList() //
}
const year = ref('')
const month = ref('')
const day = ref('')
//
const yearList = ref([])
const getDefaultYear = ()=>{
yearList.value = []
let current = new Date().getFullYear()
for(let i=-10;i<=10;i++){
yearList.value.push({
label:current+i,
value:current+i
})
}
}
//
const daysInMonths = ref([])
const monthList = ref([])
const getMonthDay = async ()=>{
getDefaultYear()
monthList.value = []
let res = await SupplierApbalanceMainApi.getMonthDay()
console.log('获取年月日',res)
if(res){
daysInMonths.value = res
res.forEach(item => {
monthList.value.push({
label:item['beginMonth'],
value:item['beginMonth'],
})
});
console.log('monthList',monthList.value)
}
}
const searchRef = ref()
//
const dayList = ref([])
const selectChange = (value,field)=>{
searchRef.value.setFormValues({
[field]:value,
})
if(field=='month'){
//
dayList.value = []
//
let dayObj = daysInMonths.value.find(item=>item['beginMonth']==month.value)
if(dayObj){
for(let i= Number(dayObj['beginDay']);i<=Number(dayObj['endDay']);i++){
dayList.value.push({
label:i,
value:i
})
}
}
if(dayList.value.length>0){
day.value = dayList.value[0]['value']
}
}
}
const resetClick = async (data)=>{
year.value = ''
month.value = ''
day.value = ''
searchClick(data)
}
const searchClick = async (data)=>{
if((data['year']||data['month']||data['day'])&&(!data['year']||!data['month']||!data['day'])){
message.error('请选择年月日')
return
}
if(data['month'].length==1){
data['month'] = '0'+data['month']
}
if((''+data['day']).length==1){
data['day'] = '0' + data['day']
}
data['searchTime'] = `${data['year']}-${data['month']}-${data['day']}`
setSearchParams(data)
}
/** 初始化 **/
onMounted(async () => {
getMonthDay()
getList()
importTemplateData.templateUrl = await SupplierApbalanceMainApi.importTemplate()
})

18
src/views/wms/supplierManage/supplierApbalance/supplierApbalanceMain/supplierApbalanceMain.data.ts

@ -39,6 +39,24 @@ export const SupplierApbalanceMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
},
{
label: '年',
field: 'year',
sort: 'custom',
isSearch: true,
},
{
label: '月',
field: 'month',
sort: 'custom',
isSearch: true,
},
{
label: '日',
field: 'day',
sort: 'custom',
isSearch: true,
},
// {
// label: '账户类型',
// field: 'ttGltype',

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

@ -162,6 +162,8 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
beginDay.value = row['beginDay']
endDay.value = row['endDay']
basicFormRef.value.open(type, row)
}

Loading…
Cancel
Save