|
|
@@ -9,7 +9,7 @@
|
|
|
clearable
|
|
|
filterable
|
|
|
placeholder="请选择项目名"
|
|
|
- @keyup.enter.native="fetchData" />
|
|
|
+ @keyup.enter.native="fetchData(1)" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="工单类型">
|
|
|
<el-select
|
|
|
@@ -17,7 +17,7 @@
|
|
|
clearable
|
|
|
filterable
|
|
|
placeholder="请选择工单类型"
|
|
|
- @change="fetchData">
|
|
|
+ @change="fetchData(1)">
|
|
|
<el-option v-for="user in orderTypeList" :key="user.val" :label="user.val" :value="user.val" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -27,7 +27,7 @@
|
|
|
clearable
|
|
|
filterable
|
|
|
placeholder="请输入分派人员"
|
|
|
- @keyup.enter.native="fetchData" />
|
|
|
+ @keyup.enter.native="fetchData(1)" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="销售工程师">
|
|
|
<el-input
|
|
|
@@ -35,7 +35,7 @@
|
|
|
clearable
|
|
|
filterable
|
|
|
placeholder="请输入销售工程师"
|
|
|
- @keyup.enter.native="fetchData" />
|
|
|
+ @keyup.enter.native="fetchData(1)" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="时间">
|
|
|
<el-date-picker
|
|
|
@@ -46,17 +46,17 @@
|
|
|
style="width: 100%"
|
|
|
type="datetimerange"
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- @change="fetchData" />
|
|
|
+ @change="fetchData(1)" />
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button icon="el-icon-search" type="primary" @click="fetchData">查询</el-button>
|
|
|
+ <el-button icon="el-icon-search" type="primary" @click="fetchData(1)">查询</el-button>
|
|
|
<el-button icon="el-icon-refresh-right" @click="reset">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</vab-query-form-top-panel>
|
|
|
</vab-query-form>
|
|
|
<el-empty v-if="dynamicsList.length == 0" :image-size="200" />
|
|
|
- <ul v-else class="records" :style="{ height: height }">
|
|
|
+ <ul v-else v-infinite-scroll="loadData" class="records" :style="{ height: height }">
|
|
|
<li v-for="(v, index) in dynamicsList" :key="index">
|
|
|
<div class="date">
|
|
|
<h2>{{ parseTime(v.updatedTime, '{y}-{m}-{d}').split('-')[2] }}</h2>
|
|
|
@@ -238,10 +238,13 @@
|
|
|
orderTypeName: '',
|
|
|
assignUserName: '',
|
|
|
saleName: '',
|
|
|
- trialTime: [this.getFirstDay(), this.getLastDay()],
|
|
|
- updatedTimeStart: this.getFirstDay(),
|
|
|
- updatedTimeEnd: this.getLastDay(),
|
|
|
+ trialTime: [],
|
|
|
+ updatedTimeStart: null,
|
|
|
+ updatedTimeEnd: null,
|
|
|
+ pageSize: 10,
|
|
|
+ pageNum: 1,
|
|
|
},
|
|
|
+ total: 0,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -262,10 +265,16 @@
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.fetchData()
|
|
|
- console.log(this.getFirstDay(), this.getLastDay())
|
|
|
+ this.fetchData(1)
|
|
|
},
|
|
|
methods: {
|
|
|
+ loadData() {
|
|
|
+ console.log('load')
|
|
|
+ if (this.total > this.dynamicsList.length) {
|
|
|
+ this.queryForm.pageNum++
|
|
|
+ this.fetchData()
|
|
|
+ }
|
|
|
+ },
|
|
|
getFirstDay() {
|
|
|
var y = new Date().getFullYear() //获取年份
|
|
|
var m = new Date().getMonth() + 1 //获取月份
|
|
|
@@ -289,29 +298,33 @@
|
|
|
orderTypeName: '',
|
|
|
assignUserName: '',
|
|
|
saleName: '',
|
|
|
- trialTime: [this.getFirstDay(), this.getLastDay()],
|
|
|
- updatedTimeStart: this.getFirstDay(),
|
|
|
- updatedTimeEnd: this.getLastDay(),
|
|
|
+ trialTime: [],
|
|
|
+ updatedTimeStart: null,
|
|
|
+ updatedTimeEnd: null,
|
|
|
}
|
|
|
- this.fetchData()
|
|
|
+ this.fetchData(1)
|
|
|
},
|
|
|
changeLength(index, length) {
|
|
|
this.$set(this.dynamicsList[index], 'showLength', length)
|
|
|
},
|
|
|
- async fetchData() {
|
|
|
+ async fetchData(num) {
|
|
|
let params = this.queryForm
|
|
|
- console.log(params)
|
|
|
+ params.pageNum = num || params.pageNum
|
|
|
if (params.trialTime && params.trialTime.length == 2) {
|
|
|
params.updatedTimeStart = params.trialTime[0]
|
|
|
params.updatedTimeEnd = params.trialTime[1]
|
|
|
} else {
|
|
|
- params.updatedTimeStart = ''
|
|
|
- params.updatedTimeEnd = ''
|
|
|
+ params.updatedTimeStart = null
|
|
|
+ params.updatedTimeEnd = null
|
|
|
}
|
|
|
const [err, res] = await to(workApi.getListFull(params))
|
|
|
if (err) return
|
|
|
if (res.code == 200) {
|
|
|
- this.dynamicsList = res.data.list
|
|
|
+ if (this.queryForm.pageNum == 1) {
|
|
|
+ this.dynamicsList = res.data.list
|
|
|
+ } else {
|
|
|
+ this.dynamicsList = this.dynamicsList.concat(res.data.list)
|
|
|
+ }
|
|
|
this.total = res.data.total
|
|
|
}
|
|
|
},
|