Browse Source

修改盘点

dev_pda
李俊城 2 years ago
parent
commit
e34c215530
  1. 2
      fe/PDA/pages.js
  2. 2
      fe/PDA/pages.json
  3. 287
      fe/PDA/pages/task/count_detail.vue
  4. 2
      fe/PDA/uni_modules/z-paging/components/z-paging/js/modules/data-handle.js
  5. 4
      fe/PDA/uni_modules/z-paging/components/z-paging/z-paging.vue

2
fe/PDA/pages.js

@ -378,7 +378,7 @@ module.exports = () => ({
"path": "pages/task/count_detail", "path": "pages/task/count_detail",
"style": { "style": {
"navigationBarTitleText": "盘点任务详情", "navigationBarTitleText": "盘点任务详情",
"enablePullDownRefresh": true "enablePullDownRefresh": false
} }
}, },
{ {

2
fe/PDA/pages.json

@ -359,7 +359,7 @@
"path": "pages/task/count_detail", "path": "pages/task/count_detail",
"style": { "style": {
"navigationBarTitleText": "盘点任务详情", "navigationBarTitleText": "盘点任务详情",
"enablePullDownRefresh": true "enablePullDownRefresh": false
} }
}, },
{ {

287
fe/PDA/pages/task/count_detail.vue

@ -156,15 +156,155 @@
</view> </view>
</scroll-view> --> </scroll-view> -->
<view class="" v-if="allDetails.length>0"> <view class="" v-if="allDetails.length>0">
<z-paging ref="paging" use-virtual-list use-compatibility-mode cell-height-mode="dynamic" @query="queryList" <z-paging ref="paging" use-virtual-list cell-height-mode="dynamic" @query="queryList">
@openEditCount="openEditCount"
@openEditCountDesc="openEditCountDesc"
>
<template #top> <template #top>
<com-count-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount" <com-count-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount"
:newCount="newCount" :location="location"> :newCount="newCount" :location="location">
</com-count-scan-detail> </com-count-scan-detail>
</template> </template>
<template #cell="{item,index}">
<view>
<uni-swipe-action>
<uni-swipe-action-item :right-options="options" :auto-close="false"
@click="swipeClick($event,item,index)">
<view class="detail-content common_card">
<view class="choose_main">
<view class="ljh_box">
<view class="ljh_info">
<view class="tit_ljh">{{index+1+'.'+item.itemCode }}</view>
<view class="label_xm font_sm fr">{{ item.packingCode }}</view>
</view>
<view class="desc_card uni-flex space-between">
<view class="desc_ljh">
<view class="font_xs text_lightblue"> {{ item.itemName }}</view>
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}
</view>
</view>
</view>
</view>
<view class="list_form">
<view>
<uni-table style="overflow-x: hidden;">
<uni-tr>
<uni-th width="100"></uni-th>
<uni-th width="100" align="center">库存</uni-th>
<uni-th width="100" align="center">盘点</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="100">数量({{item.uom}})</uni-th>
<uni-th width="100" align="center">
<text class="text_black">{{item.inventoryQty}}</text>
</uni-th>
<uni-th width="100" align="center">
<!-- <com-number-box v-if="item.scaned && item.packingCode"
v-model="item.countQty" :max="99999" :min="0"
@change="qtyChanged($event,item)"
style='margin-right: 10px;padding: 2px;'>
</com-number-box>
<com-number-box v-if="item.packingCode==''"
v-model="item.countQty"
@change="qtyChanged($event,item)" :max="99999"
:min="0" style='margin-right: 10px;padding: 2px;'>
</com-number-box> -->
<view class="flex"
style="align-items: center;justify-content: center;"
v-if="item.scaned && item.packingCode">
<text class="text_black">{{item.countQty}} </text>
<view class="photo_btn fr" @click="openEditCount(item)">
<text class="fl font_xs">修改</text>
</view>
</view>
<view class="flex"
style="align-items: center;justify-content: center;"
v-if="item.packingCode==''">
<text class="text_black">{{item.countQty}} </text>
<view class="photo_btn fr" @click="openEditCount(item)">
<text class="fl font_xs">修改</text>
</view>
</view>
<view class="" v-else-if="!item.scaned">
<text class="text_black">{{item.countQty}}</text>
</view>
<!-- <text class="text_black" v-if="item.packingCode"
style="font-size: 1rem;">{{item.countQty}}</text> -->
<!-- <com-number-box v-else v-model="item.countQty"
:max="99999" :min="0"
style='margin-right: 10px;padding: 2px;'>
</com-number-box> -->
</uni-th>
</uni-tr>
</uni-table>
</view>
</view>
<view style="margin:0 20rpx 20rpx;">
<view class="uni-flex uni-row bot_card">
<view class="bot_card_item">
<label class="icon_bg icon_bg_kw" style="text-align: center;">
<text
style=" display: block; color: white;text-align: center;font-size: 28rpx;"></text>
<!-- <image class="icon_normal"
src="@/static/icons_ui/icon_kw.svg"> -->
</image>
</label>
<text>{{ item.locationCode }}</text>
</view>
<view class="bot_card_item">
<label class="icon_bg icon_bg_pc">
<text
style=" display: block; color: white;text-align: center;font-size: 28rpx;"></text>
<!-- <image class="icon_normal"
src="@/static/icons_ui/icon_pc.svg">
</image> -->
</label>
<text>{{item.lot}}</text>
</view>
<view class="bot_card_item" style="width: 25%;">
<view class="uni-flex" v-if="item.isNew ">
<!-- picker的index默认是0 -->
<picker @change="bindPickerChange($event,item)"
:value="item.status-1" :range="statusArray">
<view class="uni-flex " style="padding:5px 0px;">
<text class="state_point"
:class="item.status | statusStyle">{{statusArray[item.status-1]}}</text>
<image class="icon_normal"
src="@/static/icons_ui/icon_down.svg">
</image>
</view>
</picker>
</view>
<text v-else class="state_point" :class="item.status | statusStyle">
{{ item.status | statusColor}}
</text>
</view>
</view>
</view>
</view>
<view class="uni-flex space-between" style="margin:0 20rpx 20rpx;"
v-if="item.scaned || item.packingCode==''">
<text class="font_xs"
style="padding: 5px 2px; text-overflow: ellipsis; overflow: hidden;">{{item.countDescription}}</text>
<view class="photo_btn fr" @click="openEditCountDesc(item)">
<text class="fl font_xs" style="width:65px;">盘点描述</text>
</view>
</view>
<view v-if="item.scaned" class="choose_marked_count"
style="background-color: #5FCB94; opacity: 0.65">
<view class="" style="background-color: #5FCB94; width: 200rpx;height: 300rpx;">
</view>
<!-- <image src="@/static/image_marked.svg"></image> -->
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</template>
</z-paging> </z-paging>
</view> </view>
@ -265,22 +405,10 @@
ipage: 1, ipage: 1,
iSize: 20, iSize: 20,
testList: [], testList: [],
isload: false, isload: true,
loadingType: "", loadingType: "",
currentPage:1, currentPage: 0,
pageSize:10, pageSize: 20,
extraData: {
//zp-virtual-cellcell
id: 'test1',
//cell
//propscellemitcell@innerCellClick
editCountCallBack: (title) => {
//
console.log('点击了标题' + title)
}
},
// array: [{ // array: [{
// text: '', // text: '',
// value: 1 // value: 1
@ -333,24 +461,15 @@
}); });
} }
}, },
onReachBottom() { onReachBottom() {},
console.log("滑动底部")
// this.ipage = this.ipage + 1;
// this.refresh();
//
// if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
// return;
// }
// this.getList("more");
},
filters: { filters: {
statusStyle: function(val) { statusStyle: function(val) {
return getJobStatuStyle(val); return getJobStatuStyle(val);
}, },
statusColor: function(val) { // statusColor: function(val) {
return getJobStatuDesc(val); // return getJobStatuDesc(val);
}, // },
statusStyle: function(val) { statusStyle: function(val) {
return getInventoryTypeStyle(val); return getInventoryTypeStyle(val);
}, },
@ -398,7 +517,7 @@
.then(async res => { .then(async res => {
that.datacontent = res; that.datacontent = res;
// var test = res.details[0] // var test = res.details[0]
// for (var i = 0; i < 6000; i++) { // for (var i = 0; i < 10000; i++) {
// var detail = {} // var detail = {}
// var detail = Object.assign(detail, test) // var detail = Object.assign(detail, test)
// detail.id = i; // detail.id = i;
@ -415,8 +534,6 @@
} }
that.allDetails = res.details; that.allDetails = res.details;
that.allCount = res.details.length that.allCount = res.details.length
// that.refresh();
// this.details =this.getDataPage()
// //
let locationCode = that.datacontent.locationCode; let locationCode = that.datacontent.locationCode;
@ -430,59 +547,16 @@
uni.hideLoading(); uni.hideLoading();
}, },
getDataPage(pageNo, pageSize) {
refresh() {
let allPageSize = this.allDetails.length / this.iSize;
if (allPageSize + 1 > this.ipage) {
for (var i = (this.ipage - 1) * this.iSize; i < this.ipage * this.iSize; i++) {
if (i < this.allDetails.length) {
let item = this.allDetails[i];
//
let data = this.details.find(r => r.id == item.id);
if (data == null || data == undefined) {
this.details.push(item)
}
} else {
return;
}
}
}
},
getDataPage(){
// //
var totalPages= Math.ceil(this.allCount/this.pageSize); var totalPages = Math.ceil(this.allCount / pageSize);
// //
const start = (this.currentPage-1)*this.pageSize; const start = (pageNo - 1) * pageSize;
const end =start+this.pageSize;// const end = start + pageSize; //
return this.allDetails.slice(start,end) return this.allDetails.slice(start, end)
}, },
//
// this.navdelay(allData, this.ipage, 0);
navdelay(data, ipage, istart) {
//
if (istart != 0) {
istart++
}
for (let i = istart; i < data.length; i++) {
this.details.push(data[i]);
istart = i
console.log(istart)
if (i != 0 && i % ipage == 0) {
break
}
}
if (this.details == data.length) {
return
}
setTimeout(() => {
this.navdelay(data, ipage, istart)
}, 200)
},
getScanResult(result) { getScanResult(result) {
let that = this; let that = this;
this.scanResult = result; this.scanResult = result;
@ -497,7 +571,7 @@
if (items.length === 0) { if (items.length === 0) {
// //
if (this.datacontent.countMethod === 2) { if (this.datacontent.countMethod === 2) {
if (this.details[0].itemCode === itemCode) { if (this.allDetails[0].itemCode === itemCode) {
this.addNewDetail(result); this.addNewDetail(result);
} else { } else {
this.showMessage('扫描的库存不在列表中'); this.showMessage('扫描的库存不在列表中');
@ -517,7 +591,7 @@
} else { } else {
this.showMessage('盘点数量异常,箱码【' + packingCode + '】的出现多条数据'); this.showMessage('盘点数量异常,箱码【' + packingCode + '】的出现多条数据');
} }
this.scrollToTop(); // this.scrollToTop();
this.calcScanCount(); this.calcScanCount();
}, },
@ -534,7 +608,7 @@
if (confirm) { if (confirm) {
this.setDetailNoBalance(detail, result) this.setDetailNoBalance(detail, result)
this.allDetails.unshift(detail); this.allDetails.unshift(detail);
this.details.unshift(detail); // this.details.unshift(detail);
this.calcAllCount(); this.calcAllCount();
this.calcScanCount(); this.calcScanCount();
this.$forceUpdate(); this.$forceUpdate();
@ -554,7 +628,7 @@
if (confirm) { if (confirm) {
this.setDetailByBalance(detail, balanceItem); this.setDetailByBalance(detail, balanceItem);
this.allDetails.unshift(detail); this.allDetails.unshift(detail);
this.details.unshift(detail); // this.details.unshift(detail);
this.calcAllCount(); this.calcAllCount();
this.calcScanCount(); this.calcScanCount();
this.$forceUpdate(); this.$forceUpdate();
@ -651,18 +725,8 @@
item.countTime = new Date(); item.countTime = new Date();
item.countOperator = localStorage.userId; item.countOperator = localStorage.userId;
//
let data = this.details.find(r => r.id == item.id);
if (data == null || data == undefined) {
this.details.push(item);
}
// var list =[];
// var record ={}
// list.push(Object.assign(record, item))
// this.$refs.paging.addDataFromTop(list);
this.allDetails.sort(compare('countTime')); // this.allDetails.sort(compare('countTime')); //
this.$refs.paging.setLocalPaging(this.allDetails); this.$refs.paging.reload();
this.scanPopupGetfocus(); this.scanPopupGetfocus();
this.$forceUpdate(); this.$forceUpdate();
}, },
@ -681,7 +745,7 @@
content: '是否移除选择的行?', content: '是否移除选择的行?',
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
that.details.splice(index, 1); that.allDetails.splice(index, 1);
} }
} }
}); });
@ -722,6 +786,8 @@
}, },
submit() { submit() {
// let params = JSON.stringify(this.allDetails);
// console.log('params', params);
let that = this; let that = this;
let unCheckedItems = that.allDetails.filter(r => { let unCheckedItems = that.allDetails.filter(r => {
return r.scaned === false return r.scaned === false
@ -742,15 +808,16 @@
}, },
finish() { finish() {
if (this.details.length == 0) {
showConfirmMsg('还没有要盘点的任务详情,是否要继续提交?', confirm => {
if (confirm) {
this.finishJob(); this.finishJob();
} // if (this.details.length == 0) {
}); // showConfirmMsg(',?', confirm => {
} else { // if (confirm) {
this.finishJob(); // this.finishJob();
} // }
// });
// } else {
// this.finishJob();
// }
}, },
finishJob() { finishJob() {
@ -888,8 +955,10 @@
this.old.scrollTop = e.detail.scrollTop this.old.scrollTop = e.detail.scrollTop
}, },
queryList(pageNo, pageSize) { queryList(pageNo, pageSize) {
console.log("queryList") var list = []
this.$refs.paging.setLocalPaging(this.allDetails); this.currentPage = pageNo
list = this.getDataPage(pageNo, pageSize)
this.$refs.paging.complete(list)
} }
}, },

2
fe/PDA/uni_modules/z-paging/components/z-paging/js/modules/data-handle.js

@ -17,7 +17,7 @@ export default {
//自定义pageSize,默认为10 //自定义pageSize,默认为10
defaultPageSize: { defaultPageSize: {
type: [Number, String], type: [Number, String],
default: u.gc('defaultPageSize', 10), default: u.gc('defaultPageSize', 20),
validator: (value) => { validator: (value) => {
if (value <= 0) u.consoleErr('default-page-size必须大于0!'); if (value <= 0) u.consoleErr('default-page-size必须大于0!');
return value > 0; return value > 0;

4
fe/PDA/uni_modules/z-paging/components/z-paging/z-paging.vue

@ -96,8 +96,8 @@ by ZXLee
<view class="zp-list-container" :style="[innerListStyle]"> <view class="zp-list-container" :style="[innerListStyle]">
<template v-if="finalUseVirtualList"> <template v-if="finalUseVirtualList">
<view class="zp-list-cell" style="background-color: #fff;padding: 0;margin: 20rpx;border-radius: 16rpx;overflow: hidden;" :id="`zp-id-${item[virtualCellIndexKey]}`" v-for="(item,index) in virtualList" :key="item['zp_unique_index']" > <view class="zp-list-cell" style="background-color: #fff;padding: 0;margin: 20rpx;border-radius: 16rpx;overflow: hidden;" :id="`zp-id-${item[virtualCellIndexKey]}`" v-for="(item,index) in virtualList" :key="item['zp_unique_index']" >
<!-- <view v-if="useCompatibilityMode">使用兼容模式请在组件源码z-paging.vue第99行中注释这一行并打开下面一行注释</view> --> <view v-if="useCompatibilityMode"></view>
<zp-public-virtual-cell v-if="useCompatibilityMode" :extraData="extraData" :item="item" :index="virtualTopRangeIndex+index" @openEditCount="openEditCount(item,index)" @openEditCountDesc="openEditCountDesc(item,index)"/> <!-- <zp-public-virtual-cell v-if="useCompatibilityMode" :extraData="extraData" :item="item" :index="virtualTopRangeIndex+index" @openEditCount="openEditCount(item,index)" @openEditCountDesc="openEditCountDesc(item,index)"/> -->
<slot v-else name="cell" :item="item" :index="virtualTopRangeIndex+index"/> <slot v-else name="cell" :item="item" :index="virtualTopRangeIndex+index"/>
</view> </view>
</template> </template>

Loading…
Cancel
Save