分页
This commit is contained in:
@@ -203,7 +203,9 @@
|
|||||||
,{
|
,{
|
||||||
"path" : "pages/ProductManage/SlittingFeeding",
|
"path" : "pages/ProductManage/SlittingFeeding",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"onReachBottomDistance": 50
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': mfg_order_name === pkId}">
|
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.container_name === pkId}">
|
||||||
<td>{{Number(i) + 1}}</td>
|
<td>{{Number(i) + 1}}</td>
|
||||||
<td>{{e.mfg_order_name}}</td>
|
<td>{{e.mfg_order_name}}</td>
|
||||||
<td>{{e.container_name}}</td>
|
<td>{{e.container_name}}</td>
|
||||||
@@ -62,10 +62,11 @@
|
|||||||
</table>
|
</table>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="submit-bar">
|
<view class="submit-bar">
|
||||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="toSure">呼叫</button>
|
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="toSure">呼叫</button>
|
||||||
<button class="submit-button" @tap="_feedingQueryMaterialInfo">查询</button>
|
<button class="submit-button" @tap="searchList">查询</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -87,14 +88,28 @@
|
|||||||
dataList: [],
|
dataList: [],
|
||||||
disabled: false,
|
disabled: false,
|
||||||
pkId: '',
|
pkId: '',
|
||||||
pkObj: {}
|
pkObj: {},
|
||||||
|
reload: false,
|
||||||
|
status: 'more',
|
||||||
|
contentText: {
|
||||||
|
contentdown: '查看更多',
|
||||||
|
contentrefresh: '加载中',
|
||||||
|
contentnomore: '没有更多'
|
||||||
|
},
|
||||||
|
totalCount: 0,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this._queryProductArea()
|
this._queryProductArea()
|
||||||
this._feedingQueryMaterialInfo()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
searchList () {
|
||||||
|
this.dataList = []
|
||||||
|
this.pageNum = 1
|
||||||
|
this._feedingQueryMaterialInfo()
|
||||||
|
},
|
||||||
/** 选择器 */
|
/** 选择器 */
|
||||||
selectChange(e) {
|
selectChange(e) {
|
||||||
this.index = e
|
this.index = e
|
||||||
@@ -106,8 +121,30 @@
|
|||||||
},
|
},
|
||||||
/** 初始化查询 */
|
/** 初始化查询 */
|
||||||
async _feedingQueryMaterialInfo () {
|
async _feedingQueryMaterialInfo () {
|
||||||
let res = await feedingQueryMaterialInfo(this.index, this.val1)
|
let res = await feedingQueryMaterialInfo(this.index, this.val1, this.pageNum + '', this.pageSize + '')
|
||||||
this.dataList = [...res.data]
|
this.totalCount = res.size
|
||||||
|
if (res.size > 0) {
|
||||||
|
const dataMap = res.data
|
||||||
|
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||||
|
this.reload = false
|
||||||
|
} else {
|
||||||
|
this.dataList = []
|
||||||
|
}
|
||||||
|
if (this.totalCount == this.dataList.length) {
|
||||||
|
this.reload = false
|
||||||
|
this.status = 'noMore'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom () {
|
||||||
|
if (this.totalCount > this.dataList.length) {
|
||||||
|
this.status = 'loading'
|
||||||
|
setTimeout(() => {
|
||||||
|
this.pageNum++
|
||||||
|
this._feedingQueryMaterialInfo()
|
||||||
|
}, 1000)
|
||||||
|
} else { //停止加载
|
||||||
|
this.status = 'noMore'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** 确认 */
|
/** 确认 */
|
||||||
async toSure () {
|
async toSure () {
|
||||||
@@ -117,10 +154,10 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await feedingConfirm([this.pkObj])
|
let res = await feedingConfirm(this.pkObj)
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
this.pkId = ''
|
this.pkId = ''
|
||||||
this._feedingQueryMaterialInfo()
|
this.searchList()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -130,8 +167,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
toCheck (e) {
|
toCheck (e) {
|
||||||
this.pkId = this.pkId === e.mfg_order_name ? '' : e.mfg_order_name
|
this.pkId = this.pkId === e.container_name ? '' : e.container_name
|
||||||
this.pkObj = this.pkId === e.mfg_order_name ? e : {}
|
this.pkObj = this.pkId === e.container_name ? e : {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,6 +115,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
searchList () {
|
searchList () {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
|
this.pageNum = 1
|
||||||
this._coolIOQuery()
|
this._coolIOQuery()
|
||||||
},
|
},
|
||||||
/** 选择器 */
|
/** 选择器 */
|
||||||
@@ -141,7 +142,6 @@
|
|||||||
this.reload = false
|
this.reload = false
|
||||||
this.status = 'noMore'
|
this.status = 'noMore'
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onReachBottom () {
|
onReachBottom () {
|
||||||
if (this.totalCount > this.dataList.length) {
|
if (this.totalCount > this.dataList.length) {
|
||||||
@@ -166,8 +166,7 @@
|
|||||||
this.disabled = false
|
this.disabled = false
|
||||||
this.pkId = ''
|
this.pkId = ''
|
||||||
this.pkObj = {}
|
this.pkObj = {}
|
||||||
this.dataList = []
|
this.searchList()
|
||||||
this._coolIOQuery()
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
|
|||||||
@@ -342,11 +342,13 @@ export const virtualprintType = (url) => request1({
|
|||||||
* 分切上料
|
* 分切上料
|
||||||
*/
|
*/
|
||||||
// 1.1分切计划初始化查询
|
// 1.1分切计划初始化查询
|
||||||
export const feedingQueryMaterialInfo = (area, code) => request({
|
export const feedingQueryMaterialInfo = (area, code, page, size) => request({
|
||||||
url:'api/pda/feeding/queryMaterialInfo',
|
url:'api/pda/feeding/queryMaterialInfo',
|
||||||
data: {
|
data: {
|
||||||
product_area: area,
|
product_area: area,
|
||||||
device_code: code
|
device_code: code,
|
||||||
|
page: page,
|
||||||
|
size: size
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 1.2呼叫
|
// 1.2呼叫
|
||||||
|
|||||||
Reference in New Issue
Block a user