utils
This commit is contained in:
@@ -12,13 +12,13 @@
|
|||||||
<view class="search-item">
|
<view class="search-item">
|
||||||
<label class="search-label">指令号</label>
|
<label class="search-label">指令号</label>
|
||||||
<view class="filter_input_wraper">
|
<view class="filter_input_wraper">
|
||||||
<input type="text" class="search-input-l" placeholder="指令号、MES号" v-model="val1">
|
<input type="text" class="search-input-l" placeholder="指令号、MES号" v-model="instNum">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="search-item">
|
<view class="search-item">
|
||||||
<label class="search-label">AGV号</label>
|
<label class="search-label">AGV号</label>
|
||||||
<view class="filter_input_wraper">
|
<view class="filter_input_wraper">
|
||||||
<input type="text" class="search-input-l" placeholder="车号" v-model="val2">
|
<input type="text" class="search-input-l" placeholder="车号" v-model="agvNum">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="search-item">
|
<view class="search-item">
|
||||||
@@ -26,32 +26,32 @@
|
|||||||
<view class="filter_input_wraper">
|
<view class="filter_input_wraper">
|
||||||
<search-box
|
<search-box
|
||||||
placeholder="入箱条码、出箱条码"
|
placeholder="入箱条码、出箱条码"
|
||||||
v-model="val3"
|
v-model="val1"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="search-item">
|
<view class="search-item">
|
||||||
<label class="search-label">起点</label>
|
<label class="search-label">起点</label>
|
||||||
<view class="filter_input_wraper">
|
<view class="filter_input_wraper">
|
||||||
<input type="text" class="search-input-l" placeholder="起始点位、起始设备" v-model="val4">
|
<input type="text" class="search-input-l" placeholder="起始点位、起始设备" v-model="startPoint">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="search-item">
|
<view class="search-item">
|
||||||
<label class="search-label">终点</label>
|
<label class="search-label">终点</label>
|
||||||
<view class="filter_input_wraper">
|
<view class="filter_input_wraper">
|
||||||
<input type="text" class="search-input-l" placeholder="目的点位、目的设备" v-model="val5">
|
<input type="text" class="search-input-l" placeholder="目的点位、目的设备" v-model="endPoint">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="search-item">
|
<view class="search-item">
|
||||||
<label class="search-label">开始日期</label>
|
<label class="search-label">开始日期</label>
|
||||||
<view class="filter_input_wraper">
|
<view class="filter_input_wraper">
|
||||||
<input type="text" class="search-input-l" v-model="val6" @click="open1">
|
<input type="text" class="search-input-l" v-model="startDate" @click="open1">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="search-item">
|
<view class="search-item">
|
||||||
<label class="search-label">结束日期</label>
|
<label class="search-label">结束日期</label>
|
||||||
<view class="filter_input_wraper">
|
<view class="filter_input_wraper">
|
||||||
<input type="text" class="search-input-l" v-model="val7" @click="open2">
|
<input type="text" class="search-input-l" v-model="endDate" @click="open2">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -118,6 +118,7 @@
|
|||||||
import NavBar from '@/components/NavBar.vue'
|
import NavBar from '@/components/NavBar.vue'
|
||||||
import SearchBox from '@/components/SearchBox.vue'
|
import SearchBox from '@/components/SearchBox.vue'
|
||||||
import {queryInstraction, instOperation} from '@/utils/getData2.js'
|
import {queryInstraction, instOperation} from '@/utils/getData2.js'
|
||||||
|
import {dateFtt} from '@/utils//utils.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
NavBar,
|
NavBar,
|
||||||
@@ -127,13 +128,13 @@
|
|||||||
return {
|
return {
|
||||||
options1: [],
|
options1: [],
|
||||||
index1: '',
|
index1: '',
|
||||||
|
startDate: dateFtt(new Date()),
|
||||||
|
endDate: dateFtt(new Date(new Date().setDate(new Date().getDate() + 1))),
|
||||||
|
instNum: '',
|
||||||
|
agvNum: '',
|
||||||
|
startPoint: '',
|
||||||
|
endPoint: '',
|
||||||
val1: '',
|
val1: '',
|
||||||
val2: '',
|
|
||||||
val3: '',
|
|
||||||
val4: '',
|
|
||||||
val5: '',
|
|
||||||
val6: '',
|
|
||||||
val7: '',
|
|
||||||
dataList: [],
|
dataList: [],
|
||||||
pkId: '',
|
pkId: '',
|
||||||
disabled: false
|
disabled: false
|
||||||
@@ -144,13 +145,13 @@
|
|||||||
this.$refs.calendar1.open()
|
this.$refs.calendar1.open()
|
||||||
},
|
},
|
||||||
confirm1(e) {
|
confirm1(e) {
|
||||||
this.val6 = e.fulldate
|
this.startDate = e.fulldate
|
||||||
},
|
},
|
||||||
open2(){
|
open2(){
|
||||||
this.$refs.calendar2.open()
|
this.$refs.calendar2.open()
|
||||||
},
|
},
|
||||||
confirm2(e) {
|
confirm2(e) {
|
||||||
this.val7 = e.fulldate
|
this.endDate = e.fulldate
|
||||||
},
|
},
|
||||||
/** 选择器1 */
|
/** 选择器1 */
|
||||||
selectChange1(e) {
|
selectChange1(e) {
|
||||||
|
|||||||
39
utils/utils.js
Normal file
39
utils/utils.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/**
|
||||||
|
* yy-mm-dd
|
||||||
|
*/
|
||||||
|
export const dateFtt = date => {
|
||||||
|
if (date == null) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
let year = date.getFullYear()
|
||||||
|
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
|
||||||
|
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
|
||||||
|
return `${year}-${month}-${day}`
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* yy-mm-dd hh:mm:ss
|
||||||
|
*/
|
||||||
|
export const dateTimeFtt = date => {
|
||||||
|
if (date == null) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
let year = date.getFullYear()
|
||||||
|
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
|
||||||
|
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
|
||||||
|
let hh = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
|
||||||
|
let mm = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
|
||||||
|
let ss = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
|
||||||
|
return `${year}-${month}-${day} ${hh}:${mm}:${ss}`
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将字符串形式的日期转换成日期对象
|
||||||
|
*/
|
||||||
|
export const dateNew = date => {
|
||||||
|
if (date === undefined || date === 'undefined') {
|
||||||
|
return new Date()
|
||||||
|
}
|
||||||
|
return new Date(Date.parse(date))
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user