|
|
|
@ -3,7 +3,7 @@ |
|
|
|
<view class="page1"> |
|
|
|
<view class="content"> |
|
|
|
<view class="content-box"> |
|
|
|
<view class="shop-box" style="position: fixed;top:0;z-index: 99;width:100%;border-bottom: 1px solid #eee;margin-bottom: 20rpx;"> |
|
|
|
<view class="shop-box" v-if="stock.delFlag == 0" style="width:100%;height:132rpx;border-bottom: 1px solid #eee;margin-bottom: 20rpx;"> |
|
|
|
<u-grid :col="2" border> |
|
|
|
<u-grid-item index="add" @tap.stop="scanCodeAdd"> |
|
|
|
<u-icon name="scan" size="36"></u-icon> |
|
|
|
@ -15,33 +15,34 @@ |
|
|
|
</u-grid-item> |
|
|
|
</u-grid> |
|
|
|
</view> |
|
|
|
<view class="shop-box" style="border-top:5px solid #eee;margin-top: 132rpx;" v-for="(value,key) in Array.from(carList)" |
|
|
|
:key="key"> |
|
|
|
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(item,index) in stockList" :key="key"> |
|
|
|
<view class="shop-name"> |
|
|
|
<img class="img-radius" :src="value[1].productPicture" alt="" |
|
|
|
<img class="img-radius" :src="item.productPicture" alt="" |
|
|
|
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;"> |
|
|
|
<view class="shop-productName"> |
|
|
|
<view style="color:#FF5809;">品名:{{value[1].productName}} ({{value[1].productSn}})</view> |
|
|
|
<view>单价:{{value[1].purchasePrice || 0}} 数量:{{value[1].productCount}}</view> |
|
|
|
<view>总价:{{value[1].price}}</view> |
|
|
|
<view style="color:#FF5809;">品名:{{item.productName}}</view> |
|
|
|
<view style="color:#FF5809;">货号:{{item.productSn}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="tui-order-content"> |
|
|
|
<u-collapse> |
|
|
|
<u-collapse-item v-for="(item,index) in returnList" :key="index" :title="item.returnSale.createTime" |
|
|
|
:name="item.returnSale.saleId"> |
|
|
|
<u-collapse-item :title="'点击查看商品盘点详情'"> |
|
|
|
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;"> |
|
|
|
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;">商品规格</view> |
|
|
|
<view style="width: 50%;text-align: center;">总数量</view> |
|
|
|
<view style="width: 60%;text-align: center;border-right: 1px solid #eee;">商品规格</view> |
|
|
|
<view style="width: 20%;text-align: center;">原数量</view> |
|
|
|
<view style="width: 20%;text-align: center;">盘点数</view> |
|
|
|
</view> |
|
|
|
<view v-for="(items,index1) in item.purchaseDetails"> |
|
|
|
<view v-for="(data,index2) in items.stockLogList1" style='height: 50rpx;line-height: 50rpx;'> |
|
|
|
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;float: left;"> |
|
|
|
{{data.attributeList | sliceMsg}} |
|
|
|
<view v-for="(item1,index1) in item.checkStockAttributeVos" :key="index1"> |
|
|
|
<view style='height: 50rpx;line-height: 50rpx;'> |
|
|
|
<view style="width: 60%;text-align: center;border-right: 1px solid #eee;float: left;"> |
|
|
|
{{item1.attributeList | sliceMsg}} |
|
|
|
</view> |
|
|
|
<view style="width: 50%;text-align: center;float: left;"> |
|
|
|
{{data.productCount}} |
|
|
|
<view style="width: 20%;text-align: center;float: left;"> |
|
|
|
{{item1.stockCount}} |
|
|
|
</view> |
|
|
|
<view style="width: 20%;text-align: center;float: left;"> |
|
|
|
{{item1.pdNum}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -50,85 +51,30 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content-box" style="margin-bottom:110rpx;" :style="{'margin-top':(carList.size>0?0:132) + 'rpx' }"> |
|
|
|
<!-- 账号权限是否可以维护成本价格(主账号和被授权的账号可以维护),参数名:shop_admin_cost,维护在用户表中,存在前后端缓存里,把备注栏挪出来,谁都可以备注 --> |
|
|
|
<view class="price-box-list"> |
|
|
|
<view class="content-box" style="margin-bottom:110rpx;"> |
|
|
|
<view class="content-list" v-if="stock.delFlag == 1"> |
|
|
|
<view class="list-name">备注:{{stock.remark == null ?'':stock.remark}}</view> |
|
|
|
</view> |
|
|
|
<view class="price-box-list" v-else> |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-name">备注</view> |
|
|
|
<view class=""> |
|
|
|
<textarea v-model="remark" /> |
|
|
|
<textarea v-model="remark" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="bottom-box"> |
|
|
|
<view class="bottom-left"> |
|
|
|
<text>合计:{{totalAmount}}</text> |
|
|
|
<text style="color: #ffa200;">¥{{shouldPay}}</text> |
|
|
|
<text>共盘点:{{stockList.length}}款</text> |
|
|
|
</view> |
|
|
|
<view class="bottom-right"> |
|
|
|
<button class="bottom-btn" @tap='inventorySubmit'>入库</button> |
|
|
|
<view class="bottom-right" v-if="stock.delFlag == 0"> |
|
|
|
<button class="bottom-btn" @tap='inventorySubmit'>确认盘点</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 弹出层 --> |
|
|
|
<view> |
|
|
|
<uni-popup ref="shopPopup" background-color="#fff"> |
|
|
|
<view class="shop-popup-content"> |
|
|
|
<view class="shop-popup-title"> |
|
|
|
<view class="shop-popup-title-left"> |
|
|
|
<img class="img-radius" :src="goodsDetail.productPicture" alt="" v-if="goodsDetail.productPicture"> |
|
|
|
<view class="noPic" v-else>暂无图片</view> |
|
|
|
</view> |
|
|
|
<view class="shop-popup-title-right"> |
|
|
|
<view class="shop-popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}} |
|
|
|
</view> |
|
|
|
<view class="shop-popup-title-right-box">{{goodsDetail.productSn}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="shop-popup-container"> |
|
|
|
<ul style="border-top:20rpx;"> |
|
|
|
<li v-for="(items,index) in goodsDetail.attributeList" :key="index"> |
|
|
|
<view class="shop-title-fur"> |
|
|
|
<view class="shop-title-name">{{items.name}}</view> |
|
|
|
</view> |
|
|
|
<view class="shop-attrs"> |
|
|
|
<uni-data-checkbox v-model="value" :localdata="range"></uni-data-checkbox> |
|
|
|
<text v-for="(itemTag, index1) in items.value" :key="index1" |
|
|
|
@tap.stop="attrNameChange(index,index1) " |
|
|
|
:class="itemTag.isChecked ? 'checkedText' : '' "> {{itemTag.value}}</text> |
|
|
|
</view> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
<view style="padding-bottom: 100rpx;"> |
|
|
|
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index"> |
|
|
|
<view @tap.stop="delCarData(index)" style="margin-right: 20rpx"> |
|
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
|
</view> |
|
|
|
<view class="shop-checkList-box"> |
|
|
|
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text> |
|
|
|
</view> |
|
|
|
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="shop-popup-bottom" v-for="(item,index) in temporaryList" :key="index"> |
|
|
|
<view class="shop-popup-bottom-left"> |
|
|
|
<text>数量:{{zNum}} 件</text> |
|
|
|
</view> |
|
|
|
<view class="shop-popup-bottom-right"> |
|
|
|
<view class="bottom-btn" @tap="temporaryCheck">选好了</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
</view> |
|
|
|
<!-- 弹出输入框 --> |
|
|
|
<uni-popup ref="inputDialog" type="dialog"> |
|
|
|
<uni-popup-dialog ref="inputClose" mode="input" title="采购价" placeholder="请输入采购价" |
|
|
|
@confirm="changePrice"></uni-popup-dialog> |
|
|
|
</uni-popup> |
|
|
|
</view> |
|
|
|
<!-- <u-loadmore :status="status" /> --> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -140,32 +86,13 @@ |
|
|
|
computed: mapState(['shopName']), |
|
|
|
data() { |
|
|
|
return { |
|
|
|
// 表单数据 |
|
|
|
formData: { |
|
|
|
name: '', |
|
|
|
manufacturer: '', |
|
|
|
price: '', |
|
|
|
single: '' |
|
|
|
}, |
|
|
|
khName: [], |
|
|
|
carList: new Map(), |
|
|
|
remark: '', |
|
|
|
otherPay: '', |
|
|
|
noPay: 0, |
|
|
|
alreadyPay: '', |
|
|
|
realAmount: 0, |
|
|
|
shouldPay: '', |
|
|
|
totalAmount: 0, |
|
|
|
index: '', |
|
|
|
index1: '', |
|
|
|
goodsDetail: [], |
|
|
|
columns: [], |
|
|
|
keyList: [], |
|
|
|
temporaryList: [], |
|
|
|
zNum: 0, |
|
|
|
storageType:'', |
|
|
|
productNum:0, |
|
|
|
productId:'' |
|
|
|
stockId:'', |
|
|
|
stockList:[], |
|
|
|
stock:[], |
|
|
|
status: 'loadmore', |
|
|
|
pages: 1, |
|
|
|
totalPages: 0, |
|
|
|
remark:'' |
|
|
|
} |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
@ -180,81 +107,59 @@ |
|
|
|
return name; |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
let that = this; |
|
|
|
this.khName = JSON.parse(JSON.stringify(this.khName)) || '' |
|
|
|
if (this.carList.size == 0) { //当前页没有数据 |
|
|
|
for (let i = 0; i < this.carList1.length; i++) { |
|
|
|
let obj = { |
|
|
|
purchasePrice: "", //进货价 |
|
|
|
price: 0, |
|
|
|
productCount: 0, |
|
|
|
productId: this.carList1[i].id, |
|
|
|
productName: this.carList1[i].productName, |
|
|
|
productPicture: this.carList1[i].productPicture, |
|
|
|
productSn: this.carList1[i].productSn, |
|
|
|
stockLogList: new Map(), |
|
|
|
stockLogList1: [] |
|
|
|
} |
|
|
|
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { |
|
|
|
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i] |
|
|
|
.saleDetailQueryDTO[m].productCount) |
|
|
|
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount |
|
|
|
} |
|
|
|
this.carList.set(this.carList1[i].id, obj) |
|
|
|
} |
|
|
|
this.carList1 = [] |
|
|
|
} else { //当前页有数据 |
|
|
|
for (let i = 0; i < this.carList1.length; i++) { |
|
|
|
if (this.carList.has(this.carList1[i].id) == true) { //商品相同 |
|
|
|
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { |
|
|
|
if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i].saleDetailQueryDTO[ |
|
|
|
m].attributeList) == true) { //规格相同 |
|
|
|
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[ |
|
|
|
m].attributeList, this.carList.get(this.carList1[i].id).stockLogList.get(this |
|
|
|
.carList1[i].saleDetailQueryDTO[m].attributeList) + this.carList1[i] |
|
|
|
.saleDetailQueryDTO[m].productCount) |
|
|
|
|
|
|
|
} else { //规格不同 |
|
|
|
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[ |
|
|
|
m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount) |
|
|
|
|
|
|
|
} |
|
|
|
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[ |
|
|
|
m].productCount |
|
|
|
} |
|
|
|
} else { //商品不同 |
|
|
|
let obj = { |
|
|
|
purchasePrice: "", //进货价 |
|
|
|
price: 0, |
|
|
|
productCount: 0, |
|
|
|
productId: this.carList1[i].id, |
|
|
|
productName: this.carList1[i].productName, |
|
|
|
productPicture: this.carList1[i].productPicture, |
|
|
|
productSn: this.carList1[i].productSn, |
|
|
|
stockLogList: new Map(), |
|
|
|
stockLogList1: [], |
|
|
|
name: '' |
|
|
|
} |
|
|
|
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { |
|
|
|
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i] |
|
|
|
.saleDetailQueryDTO[m].productCount) |
|
|
|
obj.name = this.carList1[i].saleDetailQueryDTO[m].name |
|
|
|
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount |
|
|
|
} |
|
|
|
this.carList.set(this.carList1[i].id, obj) |
|
|
|
} |
|
|
|
|
|
|
|
this.carList.get(this.carList1[i].id).price = this.carList.get(this.carList1[i].id).purchasePrice * this.carList.get(this.carList1[i].id).productCount; |
|
|
|
} |
|
|
|
this.carList1 = [] |
|
|
|
} |
|
|
|
this.getAllPrice() |
|
|
|
onShow() { |
|
|
|
this.getStockList(); |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.storageType = uni.getStorageSync('type') |
|
|
|
}, |
|
|
|
this.stockId = uni.getStorageSync('stockId') |
|
|
|
}, |
|
|
|
// onReachBottom() { |
|
|
|
// if (this.pages >= this.totalPages) return; |
|
|
|
// this.status = 'loading'; |
|
|
|
// this.pages = ++this.pages; |
|
|
|
// this.getStockList(); |
|
|
|
// }, |
|
|
|
methods: { |
|
|
|
// 获取 |
|
|
|
getStockList(){ |
|
|
|
this.stockList = [] |
|
|
|
this.tui.request("/app/checkStock/getCheckStock", "POST", { |
|
|
|
checkStockId:this.stockId, |
|
|
|
pageNum:this.pages, |
|
|
|
pageSize:10 |
|
|
|
}, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.stock = res.result |
|
|
|
if (this.pages == 1) { |
|
|
|
this.stockList = res.result.checkStockDetailVoList.records |
|
|
|
} else { |
|
|
|
this.stockList = [...this.stockList, ...res.result.checkStockDetailVoList.records] |
|
|
|
} |
|
|
|
this.totalPages = res.result.pages |
|
|
|
this.carType = this.stockList.length |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
|
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
//通过商品id查询商品详细信息 |
|
|
|
getById(id) { |
|
|
|
this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
if(res.result.delFlag ==0 || res.result.purchasePrice==null || res.result.inStorageStatus == 0){ |
|
|
|
this.tui.toast("请将商品上架或入库后再操作!") |
|
|
|
return |
|
|
|
}else{ |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/package1/stock/stockDetail?item=' + JSON.stringify(res.result) |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
//扫一扫功能 |
|
|
|
scanCodeAdd() { |
|
|
|
uni.scanCode({ |
|
|
|
@ -264,7 +169,7 @@ |
|
|
|
let shopId = res.result.split(',')[1] |
|
|
|
if(shopId == uni.getStorageSync('shopId')){ |
|
|
|
this.productId = res.result.split(',')[0] |
|
|
|
this.toggle('bottom', res.result.split(',')[0]); |
|
|
|
this.getById(res.result.split(',')[0]); |
|
|
|
if (item.saleDetailDTOList) { |
|
|
|
for (let i = 0; i < item.saleDetailDTOList.length; i++) { |
|
|
|
this.carList.push(item.saleDetailDTOList[i]) |
|
|
|
@ -282,7 +187,7 @@ |
|
|
|
if(res1.result == ''){ |
|
|
|
this.tui.toast('您的店铺中暂无该商品!') |
|
|
|
}else{ |
|
|
|
this.toggle('bottom', res1.result[0].id); |
|
|
|
this.getById(res1.result[0].id); |
|
|
|
if (item.saleDetailDTOList) { |
|
|
|
for (let i = 0; i < item.saleDetailDTOList.length; i++) { |
|
|
|
this.carList.push(item.saleDetailDTOList[i]) |
|
|
|
@ -336,21 +241,25 @@ |
|
|
|
}, |
|
|
|
//确认盘点 |
|
|
|
inventorySubmit() { |
|
|
|
let that = this; |
|
|
|
uni.showModal({ |
|
|
|
title: "提示", |
|
|
|
content: "请再次确认盘点信息是否正确。确认完成盘点吗?", |
|
|
|
content: "请再次确认盘点信息是否正确,确认完成盘点吗?", |
|
|
|
success: function(res) { |
|
|
|
if(res.confirm){ |
|
|
|
that.tui.request("/app/checkStock/submitToStock", "post", {}, false, false).then((res) => { |
|
|
|
that.tui.request("/app/checkStock/submitToStock", "post", { |
|
|
|
id:uni.getStorageSync('stockId'), |
|
|
|
remark:that.remark |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
uni.showToast({ |
|
|
|
title: "盘点成功", |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
setTimeout(res=> { |
|
|
|
uni.navigateBack({ |
|
|
|
delta: 1 |
|
|
|
}) |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/index/index' |
|
|
|
}); |
|
|
|
},2000) |
|
|
|
|
|
|
|
} else { |
|
|
|
@ -693,7 +602,6 @@ |
|
|
|
} |
|
|
|
.tui-order-content { |
|
|
|
width: 100%; |
|
|
|
padding: 24rpx 30rpx; |
|
|
|
box-sizing: border-box; |
|
|
|
background: #fff; |
|
|
|
font-size: 24rpx; |
|
|
|
|