pcsn 时间add
This commit is contained in:
@@ -123,9 +123,10 @@ export const checkBucket = (code, option, bill) => post('api/pda/st/in/checkBuck
|
|||||||
option: option
|
option: option
|
||||||
})
|
})
|
||||||
// 1.3获取单据信息
|
// 1.3获取单据信息
|
||||||
export const getBillDtl = (page, size) => post('api/pda/st/in/getBillDtl', {
|
export const getBillDtl = (page, size, pcsn) => post('api/pda/st/in/getBillDtl', {
|
||||||
page: page,
|
page: page,
|
||||||
size: size
|
size: size,
|
||||||
|
pcsn: pcsn
|
||||||
})
|
})
|
||||||
// 1.4 确认组盘
|
// 1.4 确认组盘
|
||||||
export const confirmVehicle = (option, vehicle, rows, point, bill, level) => post('api/pda/st/in/confirmVehicle', {
|
export const confirmVehicle = (option, vehicle, rows, point, bill, level) => post('api/pda/st/in/confirmVehicle', {
|
||||||
@@ -185,11 +186,13 @@ export const askVehicle = (row, point) => post('api/pda/st/in/askVehicle', {
|
|||||||
point: point
|
point: point
|
||||||
})
|
})
|
||||||
// 1.6获取软废单据信息
|
// 1.6获取软废单据信息
|
||||||
export const getRecBillDtl = (page, size, mater, code) => post('api/pda/st/in/getRecBillDtl', {
|
export const getRecBillDtl = (page, size, mater, code, startTime, endTime) => post('api/pda/st/in/getRecBillDtl', {
|
||||||
page: page,
|
page: page,
|
||||||
size: size,
|
size: size,
|
||||||
material_search: mater,
|
material_search: mater,
|
||||||
bill_code: code
|
bill_code: code,
|
||||||
|
startTime: startTime,
|
||||||
|
endTime: endTime
|
||||||
})
|
})
|
||||||
// 1.9 获取软废等级下拉框(进页面查询)
|
// 1.9 获取软废等级下拉框(进页面查询)
|
||||||
export const inIetIvtLevel = () => post('api/pda/st/in/getIvtLevel', {})
|
export const inIetIvtLevel = () => post('api/pda/st/in/getIvtLevel', {})
|
||||||
|
|||||||
@@ -2,6 +2,14 @@
|
|||||||
<section>
|
<section>
|
||||||
<nav-bar :inner="true" title="查找关联单据"></nav-bar>
|
<nav-bar :inner="true" title="查找关联单据"></nav-bar>
|
||||||
<section class="content mgt196 mgb70" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="0" infinite-scroll-immediate-check="false">
|
<section class="content mgt196 mgb70" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="0" infinite-scroll-immediate-check="false">
|
||||||
|
<div class="filter-wraper">
|
||||||
|
<div class="bottom-filter-tip">
|
||||||
|
<div class="filter-label txtjustify">批次</div>
|
||||||
|
<div class="fxcol mgl20">
|
||||||
|
<input type="text" class="filter-input filter-scan-input" placeholder="批次号" v-model="val1">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="grid-wraper">
|
<div class="grid-wraper">
|
||||||
<div class="left_fixed">
|
<div class="left_fixed">
|
||||||
<table class="layout-t left_layout_t">
|
<table class="layout-t left_layout_t">
|
||||||
@@ -37,6 +45,7 @@
|
|||||||
<div class="loading-tips">{{desc}}</div>
|
<div class="loading-tips">{{desc}}</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="submit-bar">
|
<section class="submit-bar">
|
||||||
|
<button class="btn submit-button" @click="toSearch">查询</button>
|
||||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" @click="toSure">确认</button>
|
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" @click="toSure">确认</button>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
@@ -52,19 +61,30 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
val1: '',
|
||||||
dataList: [],
|
dataList: [],
|
||||||
pkId: '',
|
pkId: '',
|
||||||
pkObj: {},
|
pkObj: {},
|
||||||
page: 1,
|
page: 1,
|
||||||
size: '10',
|
size: '10',
|
||||||
busy: false,
|
busy: false,
|
||||||
desc: '加载数据中...'
|
desc: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this._getBillDtl()
|
// this._getBillDtl()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
toSearch () {
|
||||||
|
this.dataList = []
|
||||||
|
this.pkId = ''
|
||||||
|
this.pkObj = {}
|
||||||
|
this.page = 1
|
||||||
|
this.size = '10'
|
||||||
|
this.busy = false
|
||||||
|
this.desc = ''
|
||||||
|
this._getBillDtl()
|
||||||
|
},
|
||||||
toCheck (e) {
|
toCheck (e) {
|
||||||
this.pkId = this.pkId === e.source_billdtl_id ? '' : e.source_billdtl_id
|
this.pkId = this.pkId === e.source_billdtl_id ? '' : e.source_billdtl_id
|
||||||
this.pkObj = this.pkId === e.source_billdtl_id ? e : {}
|
this.pkObj = this.pkId === e.source_billdtl_id ? e : {}
|
||||||
@@ -80,7 +100,8 @@ export default {
|
|||||||
async loadMore () {
|
async loadMore () {
|
||||||
this.busy = true
|
this.busy = true
|
||||||
this.page++
|
this.page++
|
||||||
let res = await getBillDtl(this.page + '', this.size)
|
this.desc = '加载数据中...'
|
||||||
|
let res = await getBillDtl(this.page + '', this.size, this.val1)
|
||||||
if (res.code === '1') {
|
if (res.code === '1') {
|
||||||
let newArr = []
|
let newArr = []
|
||||||
res.rows.map(el => { newArr.push(Object.assign({}, el, {checked: 0})) })
|
res.rows.map(el => { newArr.push(Object.assign({}, el, {checked: 0})) })
|
||||||
@@ -97,7 +118,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async _getBillDtl () {
|
async _getBillDtl () {
|
||||||
let res = await getBillDtl(this.page + '', this.size)
|
let res = await getBillDtl(this.page + '', this.size, this.val1)
|
||||||
if (res.code === '1') {
|
if (res.code === '1') {
|
||||||
let newArr = []
|
let newArr = []
|
||||||
res.rows.map(el => { newArr.push(Object.assign({}, el, {checked: 0})) })
|
res.rows.map(el => { newArr.push(Object.assign({}, el, {checked: 0})) })
|
||||||
|
|||||||
@@ -15,6 +15,37 @@
|
|||||||
<input type="text" class="filter-input filter-scan-input" v-model="val2">
|
<input type="text" class="filter-input filter-scan-input" v-model="val2">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="bottom-filter-tip">
|
||||||
|
<div class="filter-label txtjustify">开始时间</div>
|
||||||
|
<div class="fxcol mgl20">
|
||||||
|
<div class="filter-input filter-input_1 pointer" style="min-height: 0.9rem" @click="showStart = true">
|
||||||
|
{{ startDateText }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bottom-filter-tip">
|
||||||
|
<div class="filter-label txtjustify">结束时间</div>
|
||||||
|
<div class="fxcol mgl20">
|
||||||
|
<div class="filter-input filter-input_1 pointer" style="min-height: 0.9rem" @click="showEnd = true">
|
||||||
|
{{ endDateText }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 开始时间日历 -->
|
||||||
|
<van-calendar
|
||||||
|
v-model="showStart"
|
||||||
|
:min-date="minDate"
|
||||||
|
:default-date="defaultStartDate"
|
||||||
|
@confirm="onConfirmStart"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 结束时间日历 -->
|
||||||
|
<van-calendar
|
||||||
|
v-model="showEnd"
|
||||||
|
:min-date="minDate"
|
||||||
|
:default-date="defaultEndDate"
|
||||||
|
@confirm="onConfirmEnd"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid-wraper">
|
<div class="grid-wraper">
|
||||||
<div class="left_fixed">
|
<div class="left_fixed">
|
||||||
@@ -54,15 +85,31 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { Calendar } from 'vant'
|
||||||
import NavBar from '@components/NavBar.vue'
|
import NavBar from '@components/NavBar.vue'
|
||||||
import {getRecBillDtl} from '@config/getData2.js'
|
import {getRecBillDtl} from '@config/getData2.js'
|
||||||
export default {
|
export default {
|
||||||
name: 'SearchSoftWasteBill',
|
name: 'SearchSoftWasteBill',
|
||||||
components: {
|
components: {
|
||||||
NavBar
|
NavBar,
|
||||||
|
[Calendar.name]: Calendar
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
|
// 获取今天(零点)
|
||||||
|
const today = new Date()
|
||||||
|
today.setHours(0, 0, 0, 0)
|
||||||
|
// 三天前
|
||||||
|
const threeDaysAgo = new Date(today)
|
||||||
|
threeDaysAgo.setDate(today.getDate() - 3)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
minDate: new Date(2000, 0, 1), // 可选最早日期
|
||||||
|
defaultStartDate: threeDaysAgo, // 开始时间默认三天前(Date对象)
|
||||||
|
defaultEndDate: today, // 结束时间默认今天(Date对象)
|
||||||
|
startDate: threeDaysAgo, // 当前选中的开始时间(Date)
|
||||||
|
endDate: today, // 当前选中的结束时间(Date)
|
||||||
|
showStart: false, // 控制开始日历弹窗
|
||||||
|
showEnd: false, // 控制结束日历弹窗
|
||||||
dataList: [],
|
dataList: [],
|
||||||
pkId: '',
|
pkId: '',
|
||||||
pkObj: {},
|
pkObj: {},
|
||||||
@@ -74,10 +121,53 @@ export default {
|
|||||||
val2: ''
|
val2: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 格式化显示的文本
|
||||||
|
startDateText () {
|
||||||
|
return this.formatDate(this.startDate)
|
||||||
|
},
|
||||||
|
endDateText () {
|
||||||
|
return this.formatDate(this.endDate)
|
||||||
|
}
|
||||||
|
},
|
||||||
created () {
|
created () {
|
||||||
this._getRecBillDtl()
|
this._getRecBillDtl()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 格式化日期为 YYYY-MM-DD (确保参数为Date对象)
|
||||||
|
formatDate (date) {
|
||||||
|
if (!(date instanceof Date) || isNaN(date.getTime())) {
|
||||||
|
console.warn('formatDate received invalid date:', date)
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
|
return `${year}-${month}-${day}`
|
||||||
|
},
|
||||||
|
|
||||||
|
// 开始时间日历确认
|
||||||
|
onConfirmStart (date) {
|
||||||
|
this.showStart = false
|
||||||
|
if (date instanceof Date) {
|
||||||
|
this.startDate = date
|
||||||
|
// 可选:如果开始时间晚于结束时间,自动调整结束时间
|
||||||
|
if (this.startDate > this.endDate) {
|
||||||
|
this.endDate = new Date(this.startDate)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 结束时间日历确认
|
||||||
|
onConfirmEnd (date) {
|
||||||
|
this.showEnd = false
|
||||||
|
if (date instanceof Date) {
|
||||||
|
this.endDate = date
|
||||||
|
// 可选:如果结束时间早于开始时间,自动调整开始时间
|
||||||
|
if (this.endDate < this.startDate) {
|
||||||
|
this.startDate = new Date(this.endDate)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
toCheck (e) {
|
toCheck (e) {
|
||||||
this.pkId = this.pkId === e.source_billdtl_id ? '' : e.source_billdtl_id
|
this.pkId = this.pkId === e.source_billdtl_id ? '' : e.source_billdtl_id
|
||||||
this.pkObj = this.pkId === e.source_billdtl_id ? e : {}
|
this.pkObj = this.pkId === e.source_billdtl_id ? e : {}
|
||||||
@@ -92,7 +182,7 @@ export default {
|
|||||||
this.busy = true
|
this.busy = true
|
||||||
this.page++
|
this.page++
|
||||||
this.desc = '加载数据中...'
|
this.desc = '加载数据中...'
|
||||||
let res = await getRecBillDtl(this.page + '', this.size, this.val1, this.val2)
|
let res = await getRecBillDtl(this.page + '', this.size, this.val1, this.val2, this.formatDate(this.startDate), this.formatDate(this.endDate))
|
||||||
if (res.code === '1') {
|
if (res.code === '1') {
|
||||||
this.dataList = [...this.dataList, ...res.rows]
|
this.dataList = [...this.dataList, ...res.rows]
|
||||||
if (res.rows.length < 10) {
|
if (res.rows.length < 10) {
|
||||||
@@ -107,7 +197,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async _getRecBillDtl () {
|
async _getRecBillDtl () {
|
||||||
let res = await getRecBillDtl(this.page + '', this.size, this.val1, this.val2)
|
let res = await getRecBillDtl(this.page + '', this.size, this.val1, this.val2, this.formatDate(this.startDate), this.formatDate(this.endDate))
|
||||||
if (res.code === '1') {
|
if (res.code === '1') {
|
||||||
this.dataList = [...res.rows]
|
this.dataList = [...res.rows]
|
||||||
if (res.rows.length < 10) {
|
if (res.rows.length < 10) {
|
||||||
|
|||||||
Reference in New Issue
Block a user