|
@@ -80,16 +80,23 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
+ <!-- 上架确认 -->
|
|
|
+ <choose-type-modal v-if="chooseModal" :totalKs="totalKs" :totalNums="totalNums" :openModal="chooseModal" @confirm="confirmPut" @close="chooseModal = false" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { clzConfirm, numberToFixed } from '@/libs/tools';
|
|
|
- import {queryMapList, queryCountList, shelfCartSave, shelfCartDelete} from '@/api/shelfCart.js'
|
|
|
+ import {queryMapList, queryCountList, shelfCartSave, shelfCartDelete, queryEmptyCostList, shelfCartConfirm} from '@/api/shelfCart.js'
|
|
|
+ import chooseTypeModal from './chooseTypeModal'
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ chooseTypeModal
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
showPop: false,
|
|
|
+ chooseModal: false,
|
|
|
shelfSn: '',
|
|
|
shelfName: '',
|
|
|
shelfPlaceList: null,
|
|
@@ -103,6 +110,9 @@
|
|
|
curLayer: ''
|
|
|
}
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ this.curLayer = ''
|
|
|
+ },
|
|
|
onLoad(opts) {
|
|
|
this.layerList = 'A、B、C、D、E、F、G、H、I、J、K、L、M、N、O、P、Q、R、S、T、U、V、W、X、Y、Z'.split('、');
|
|
|
this.shelfSn = opts.shelfSn
|
|
@@ -113,10 +123,25 @@
|
|
|
uni.$on("updateTempHw",()=>{
|
|
|
this.pageInit(true)
|
|
|
})
|
|
|
+
|
|
|
+ uni.$on("setCostOk",()=>{
|
|
|
+ this.chooseModal = true
|
|
|
+ })
|
|
|
},
|
|
|
onUnload() {
|
|
|
uni.$off("updateTempHw")
|
|
|
},
|
|
|
+ onNavigationBarButtonTap(e) {
|
|
|
+ console.log(e)
|
|
|
+ // 上架入库
|
|
|
+ if(e.index == 0){
|
|
|
+ this.toPutaway()
|
|
|
+ }
|
|
|
+ // 打印贴签
|
|
|
+ if(e.index == 1){
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
pageInit(flag){
|
|
|
this.placeTab = []
|
|
@@ -127,18 +152,53 @@
|
|
|
},
|
|
|
scanProduct(){
|
|
|
this.showLayer = false
|
|
|
- this.curLayer = ''
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/batchShelves/scanProduct?shelfSn="+this.shelfSn+'&layer='+this.curLayer+'&shelfName='+this.shelfName+'&customerSn='+this.customerSn
|
|
|
})
|
|
|
},
|
|
|
searchProduct(){
|
|
|
this.showLayer = false
|
|
|
- this.curLayer = ''
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/batchShelves/searchProduct?shelfSn="+this.shelfSn+'&layer='+this.curLayer+'&shelfName='+this.shelfName+'&customerSn='+this.customerSn
|
|
|
})
|
|
|
},
|
|
|
+ // 上架入库
|
|
|
+ toPutaway(){
|
|
|
+ uni.showLoading({
|
|
|
+ title: '正在查询...',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ queryEmptyCostList({shelfSn: this.shelfSn}).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.data&&res.data.length){
|
|
|
+ this.$store.state.vuex_tempData = res.data
|
|
|
+ // 去设置价格
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/batchShelves/setProductCost?shelfSn="+this.shelfSn+'&shelfName='+this.shelfName+'&customerSn='+this.customerSn
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.chooseModal = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //确认上架
|
|
|
+ confirmPut(data){
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true,
|
|
|
+ title: '正在上架...'
|
|
|
+ })
|
|
|
+ shelfCartConfirm({
|
|
|
+ shelfSn: this.shelfSn,
|
|
|
+ ...data
|
|
|
+ }).then(res => {
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.status == 200){
|
|
|
+ uni.$emit("updateHw")
|
|
|
+ uni.navigateBack()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 编辑
|
|
|
editRow(item){
|
|
|
this.$store.state.vuex_tempData = item
|
|
@@ -149,6 +209,7 @@
|
|
|
// 获取产品列表
|
|
|
getList(flag){
|
|
|
uni.showLoading({
|
|
|
+ mask: true,
|
|
|
title: '正在加载...'
|
|
|
})
|
|
|
queryMapList({ shelfSn: this.shelfSn }).then(res => {
|
|
@@ -199,6 +260,7 @@
|
|
|
success (ret) {
|
|
|
if (ret.confirm || ret.index == 0) {
|
|
|
uni.showLoading({
|
|
|
+ mask: true,
|
|
|
title: '正在删除...'
|
|
|
})
|
|
|
shelfCartDelete({ shelfCartSn: row.shelfCartSn }).then(res => {
|
|
@@ -227,13 +289,14 @@
|
|
|
}
|
|
|
// 继续修改数量
|
|
|
uni.showLoading({
|
|
|
+ mask: true,
|
|
|
title: '正在保存...'
|
|
|
})
|
|
|
const params = {
|
|
|
shelfSn: row.shelfSn,
|
|
|
shelfName: this.shelfName,
|
|
|
shelfTierCode: row.shelfTierCode,
|
|
|
- shelfPlaceSn: row.shelfPlaceSn,
|
|
|
+ shelfPlaceSn: row.shelfPlaceSn||undefined,
|
|
|
shelfPlaceCode: row.shelfPlaceCode,
|
|
|
productSn: row.productSn,
|
|
|
productCode: row.productCode,
|