|
@@ -41,8 +41,8 @@
|
|
|
<text class="add" @click="addHw('add',1)"><u-icon name="plus"></u-icon></text>
|
|
|
</view>
|
|
|
<view class="hwAction flex justify_between">
|
|
|
- <u-button shape="circle" @click="showMenus=true" size="medium">更多功能</u-button>
|
|
|
- <u-button class="newbtn" @click="addHw('add',0)" type='primary' shape="circle" size="medium">新增货位</u-button>
|
|
|
+ <u-button shape="circle" @click="tapPopup(1)" size="medium">打印贴签</u-button>
|
|
|
+ <u-button class="newbtn" @click="tapPopup(2)" type='primary' shape="circle" size="medium">快速补货</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -50,16 +50,15 @@
|
|
|
<view v-else>
|
|
|
<view class="nodata">暂无货位信息,请点击 <text @click="addHw('add',0)">新增货位</text></view>
|
|
|
</view>
|
|
|
- <chunLeiPopups v-model="showMenus" theme="dark" :popData="popData" @tapPopup="tapPopup" :x="pleft" :y="ptop" placement="bottom-start"></chunLeiPopups>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import chunLeiPopups from "@/components/chunLei-popups/chunLei-popups.vue";
|
|
|
import { shelfDetail, shelfSave, modifFinishFlag, getProductPlace } from '@/api/shelf'
|
|
|
import { createShelfReplenishBill } from '@/api/shelfReplenish'
|
|
|
export default {
|
|
|
- components:{chunLeiPopups},
|
|
|
+ components:{
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
shelfSn: null,
|
|
@@ -106,13 +105,22 @@
|
|
|
tapPopup(e){
|
|
|
console.log(e)
|
|
|
// 打印贴签
|
|
|
- if(e.val == 1){
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/latePlay/chooseProduct?shelfSn="+this.shelfSn+'&shelfName='+this.detailData.shelfName
|
|
|
- })
|
|
|
+ if(e == 1){
|
|
|
+ if(this.hasNoBindPro()){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/latePlay/chooseProduct?shelfSn="+this.shelfSn+'&shelfName='+this.detailData.shelfName
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.showModal({
|
|
|
+ showCancel:false,
|
|
|
+ confirmText:"好的",
|
|
|
+ title: "提示",
|
|
|
+ content: "所有货位都没有绑定产品,无法打印贴签!"
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
// 快速补货
|
|
|
- if(e.val == 0){
|
|
|
+ if(e == 2){
|
|
|
createShelfReplenishBill({shelfSn: this.shelfSn}).then(res => {
|
|
|
console.log(res.data)
|
|
|
if(res.data&&res.data.length){
|
|
@@ -166,8 +174,8 @@
|
|
|
url: "/pages/shelfSetting/editShelf?shelfName="+this.detailData.shelfName
|
|
|
})
|
|
|
},
|
|
|
- // 按照产品搜索货位
|
|
|
- toSearchHw(){
|
|
|
+ // 是否没有绑定任何产品
|
|
|
+ hasNoBindPro(){
|
|
|
let noBindPro = null;
|
|
|
for(let i=0;i<this.placeTab.length;i++){
|
|
|
noBindPro = this.shelfPlaceList[this.placeTab[i]].find(item => item.shelfProductApiEntity && item.shelfProductApiEntity.productSn);
|
|
@@ -175,7 +183,11 @@
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- if(!!noBindPro){
|
|
|
+ return !!noBindPro
|
|
|
+ },
|
|
|
+ // 按照产品搜索货位
|
|
|
+ toSearchHw(){
|
|
|
+ if(this.hasNoBindPro()){
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/shelfSetting/searchShelfHw?shelfName="+this.detailData.shelfName+"&shelfSn="+this.shelfSn
|
|
|
})
|
|
@@ -206,7 +218,8 @@
|
|
|
if(type=='add'&&flag==1){
|
|
|
const row = this.shelfPlaceList[this.curTab]
|
|
|
const num = row[row.length-1].shelfPlaceCode.replace(this.curTab,'')
|
|
|
- shelfPlaceCode = this.curTab + (Number(num) + 1)
|
|
|
+ const nextNum = Number(num) + 1
|
|
|
+ shelfPlaceCode = this.curTab + (nextNum<10?'0':'') + nextNum
|
|
|
}
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/shelfSetting/addShelfHw?detailData="+encodeURIComponent(JSON.stringify(this.detailData))+"&type="+type+"&shelfPlaceCode="+shelfPlaceCode
|