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