wangfukang 3 years ago
parent
commit
572d1aa298
  1. 30
      pages/billing/changeGoods1.vue
  2. 26
      pages/index/addHangOrder.vue
  3. 80
      pages/index/customAndSupplierProductDetail.vue
  4. 538
      pages/index/downStearmList.vue
  5. 28
      pages/inventory/addinventory.vue
  6. 28
      pages/inventory/changeGoods1.vue
  7. 911
      pages/inventory/gategoryLow.vue
  8. 6
      pages/inventory/getProductIdToList.vue
  9. 32
      pages/inventory/goodsList1.vue

30
pages/billing/changeGoods1.vue

@ -89,7 +89,10 @@
</li>
</ul>
<view style="padding-bottom:160rpx;">
<view class="checkList" v-for="(item,index) in temporaryList" :key="index">
<view class="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="checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
</view>
@ -307,7 +310,7 @@
temporaryChange(val) {
this.zNum = 0
for (var i = 0; i < this.temporaryList.length; i++) {
this.zNum += this.temporaryList[i].productCount
this.zNum += this.temporaryList[i].productCount || 0
}
this.zPrice = this.zNum * this.purchasePrice
},
@ -514,6 +517,29 @@
that.$forceUpdate()
}
})
},
//选商品的时候能删除规格
delCarData(index) {
this.temporaryList.splice(index, 1);
this.temporaryChange()
// uni.showModal({
// title: "提示",
// content: "确定删除此条商品吗?",
// success: function(res) {
// if(res.confirm){
// that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name);
// that.carList.get(id).stockLogList.delete(name)
// that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).purchasePrice
// if(that.carList.get(id).stockLogList.size == 0){
// that.carList.delete(id)
// }
// that.getAllPrice()
// }
// that.$forceUpdate()
// }
// })
},
//删除商品下的某一个规格
delShopSpec(index, index1) {

26
pages/index/addHangOrder.vue

@ -118,6 +118,9 @@
</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>
@ -656,6 +659,29 @@
}
}
})
},
//选商品的时候能删除规格
delCarData(index) {
this.temporaryList.splice(index, 1);
this.temporaryChange()
// uni.showModal({
// title: "提示",
// content: "确定删除此条商品吗?",
// success: function(res) {
// if(res.confirm){
// that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name);
// that.carList.get(id).stockLogList.delete(name)
// that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).purchasePrice
// if(that.carList.get(id).stockLogList.size == 0){
// that.carList.delete(id)
// }
// that.getAllPrice()
// }
// that.$forceUpdate()
// }
// })
},
//删除商品下的单条规格
delGoodsPrecs(item, index, index1) {

80
pages/index/customAndSupplierProductDetail.vue

@ -1,22 +1,48 @@
<template>
<view class="container">
<view class="tui-order-item boxbg">
<view class="shop-box" v-for="(item,index3) in list" :key="index3">
<uni-card :title="item.productName?item.productName:'暂无'"
:sub-title="item.createTime?item.createTime:'暂无'" >
<view class="uni-body" style="text-align: center;"><text v-if="userType==0">采购价:{{item.realPrice?item.realPrice:'暂无'}}</text> 总数量:{{item.productCount?item.productCount:'暂无'}} <text v-if="userType==0">总价:{{item.shouldPay?item.shouldPay:'暂无'}}</text></view>
<view style="margin: 5px 0;height: 1px;background: #eee;"></view>
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;">
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;">商品规格</view>
<view style="width: 29%;text-align: center;">数量</view>
<view class="shop-box" v-for="(item,index4) in list">
<uni-card :title="item.productName?item.productName:'暂无'" v-if="type=='khName'">
<view v-for="(data,index2) in item.customerBuySaleVoList" style="padding-bottom: 20rpx;margin-bottom: 20rpx;border-bottom: 1px solid #eee;">
<view class="uni-body" style="text-align: center;display: flex;flex-direction: column;">
<text v-if="userType==0">{{data.createTime}} </text>
<text style="color:red;">采购价:{{data.customerBuyProductDetailLogVos[0].realPrice}}</text>
</view>
<view style="margin: 5px 0;height: 1px;background: #eee;"></view>
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;">
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;">商品规格</view>
<view style="width: 29%;text-align: center;">数量</view>
</view>
<view v-for="(data1,index) in data.customerBuyProductDetailLogVos" :key="index" style='height: 50rpx;line-height: 50rpx;'>
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;float: left;height: 50rpx;overflow: hidden;">
{{data1.attributeList | sliceMsg}}
</view>
<view style="width: 29%;text-align: center;float: left;">
{{data1.productCount}}
</view>
</view>
</view>
<view v-for="(data,index2) in item.customerBuyProductDetailLogVos" :key="index2" style='height: 50rpx;line-height: 50rpx;'>
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;float: left;height: 50rpx;overflow: hidden;">
{{data.attributeList | sliceMsg}}
</uni-card>
<uni-card :title="item.productName?item.productName:'暂无'" v-else>
<view v-for="(data,index2) in item.supplierBuySaleVos" style="padding-bottom: 20rpx;margin-bottom: 20rpx;border-bottom: 1px solid #eee;">
<view class="uni-body" style="text-align: center;display: flex;flex-direction: column;">
<text v-if="userType==0">{{data.createTime}} </text>
<text style="color:red;">采购价:{{data.supplierBuyProductDetailLogVos[0].purchasePrice}}</text>
</view>
<view style="margin: 5px 0;height: 1px;background: #eee;"></view>
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;">
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;">商品规格</view>
<view style="width: 29%;text-align: center;">数量</view>
</view>
<view v-for="(data1,index) in data.supplierBuyProductDetailLogVos" :key="index" style='height: 50rpx;line-height: 50rpx;'>
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;float: left;height: 50rpx;overflow: hidden;">
{{data1.attributeList | sliceMsg}}
</view>
<view style="width: 29%;text-align: center;float: left;">
{{data1.productCount}}
</view>
</view>
<view style="width: 29%;text-align: center;float: left;">
{{data.productCount}}
</view>
</view>
</uni-card>
</view>
@ -53,7 +79,7 @@
onLoad(option) {
this.userId = option.id
this.userType = uni.getStorageSync('type')
this.type = option.type
this.type = option.popleType
this.getList()
},
onReachBottom() {
@ -64,12 +90,24 @@
},
methods: {
getList(id) {
this.status = 'loading';
this.tui.request("/app/sale/getCustomerBuyProductLog", "post", {
userId: this.userId,
pageSize: 10,
pageNum: this.pageNum
}, false, false).then((res) => {
this.status = 'loading';
var url,data
if(this.type == 'gysName'){
url = "/app/sale/getSupplierBuyProductLog"
data = {
supplierId: this.userId,
pageSize: 10,
pageNum: this.pageNum
}
}else{
url = "/app/sale/getCustomerBuyProductLog"
data = {
userId: this.userId,
pageSize: 10,
pageNum: this.pageNum
}
}
this.tui.request(url, "post", data, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
// this.list = res.result.records

538
pages/index/downStearmList.vue

@ -71,26 +71,29 @@
:class="itemTag.isChecked ? 'checkedText' : '' "> {{itemTag.value}}</text>
</view>
</li>
</ul>
<view style="padding-bottom: 100rpx;">
</ul>
<view style="padding-bottom: 100rpx;">
<view class="checkList" v-for="item in temporaryList">
<view class="checkList-box">
{{item.name}}
</view>
<uni-number-box max="100000" v-model="item.productCount" @change="temporaryChange" />
</view>
<view @tap.stop="delCarData(index)" style="margin-right: 20rpx">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
{{item.name}}
</view>
<uni-number-box max="100000" v-model="item.productCount" @change="temporaryChange" />
</view>
</view>
</view>
</view>
<view class="popup-bottom" v-for="item in temporaryList">
<view class="popup-bottom-left">
<text>{{zNum}} 件</text>
<text>¥{{zPrice}}</text>
</view>
<view class="popup-bottom-right">
<view class="bottom-btn" @tap="temporaryCheck">选好了</view>
</view>
</view>
<view class="popup-bottom" v-for="item in temporaryList">
<view class="popup-bottom-left">
<text>{{zNum}} 件</text>
<text>¥{{zPrice}}</text>
</view>
<view class="popup-bottom-right">
<view class="bottom-btn" @tap="temporaryCheck">选好了</view>
</view>
</view>
</uni-popup>
</view>
@ -140,29 +143,31 @@
</view>
</view>
</view>
<view style="padding-bottom: 100rpx;">
<view class="popup-container" v-for="(item1,index1) in item.stockLogList1">
<view class="checkList" >
<view style="margin-right:5%;" @tap="delShopSpec(item.productId,item1.attributeList)" :key="index1">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
{{item1.name}}
</view>
<uni-number-box max="100000" v-model="item1.productCount" @change="carChange($event,index,index1)" />
</view>
</view>
</view>
<view style="padding-bottom: 100rpx;">
<view class="popup-container" v-for="(item1,index1) in item.stockLogList1">
<view class="checkList">
<view style="margin-right:5%;" @tap="delShopSpec(item.productId,item1.attributeList)"
:key="index1">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
{{item1.name}}
</view>
<uni-number-box max="100000" v-model="item1.productCount"
@change="carChange($event,index,index1)" />
</view>
</view>
</view>
</view>
</view>
<view class="popup-bottom">
<view class="popup-bottom-left">
<text>{{carType}} 款 {{carNum}} 件</text>
</view>
<view class="popup-bottom-right">
<view class="bottom-btn" @tap="this.$refs.carPopup.close()">关闭</view>
</view>
</view>
<view class="popup-bottom">
<view class="popup-bottom-left">
<text>{{carType}} 款 {{carNum}} 件</text>
</view>
<view class="popup-bottom-right">
<view class="bottom-btn" @tap="this.$refs.carPopup.close()">关闭</view>
</view>
</view>
</uni-popup>
</view>
@ -181,8 +186,8 @@
searchName: '', //搜索框输入值
shopId: '', //店铺id,
checkbox: [], //需要分享的商品id
temporaryNum: 0,
priceType:'',
temporaryNum: 0,
priceType: '',
goodsDetail: [],
attrNameList: [],
temporaryList: [],
@ -264,8 +269,8 @@
}
this.keyList.map((item, index) => {
obj[item] = evalue[index]
})
})
let jishuqi = 0;
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
if (this.goodsDetail.attributeList[i].isChecked == true) {
@ -290,25 +295,26 @@
if (this.temporaryList.length == 0) {
this.temporaryList.push(this.attributeList);
} else {
for (var i = 0; i < this.temporaryList.length; i++) {
if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this.temporaryList[i].name.indexOf(this.attributeList.name) == 1) {
if (this.temporaryList.length == (i + 1)) {
this.temporaryList.push(this.attributeList);
return
}
}else{
return
}
for (var i = 0; i < this.temporaryList.length; i++) {
if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this.temporaryList[i]
.name.indexOf(this.attributeList.name) == 1) {
if (this.temporaryList.length == (i + 1)) {
this.temporaryList.push(this.attributeList);
return
}
} else {
return
}
}
}
}
}
},
temporaryChange(val) {
this.zNum = 0
for (var i = 0; i < this.temporaryList.length; i++) {
this.zNum += this.temporaryList[i].productCount
this.zNum += this.temporaryList[i].productCount || 0
}
this.zPrice = this.zNum * this.purchasePrice
},
@ -318,18 +324,18 @@
},
//获取弹出层状态
change(e) {
},
//弹出购物车或者商品规格选择弹窗
toggle(type, item) {
this.type = type
if (type == 'carPopup') {
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carNum += this.carList[i].num
}
this.$refs.carPopup.open('bottom')
if (type == 'carPopup') {
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carNum += this.carList[i].num
}
this.$refs.carPopup.open('bottom')
this.carType = this.carList.length
} else {
this.checkGoods(item);
@ -338,90 +344,90 @@
},
//选择商品查询商品规格
checkGoods(item) {
if(this.priceType == 1){ //批发价
this.purchasePrice = item.wholesalePrice;
}else{
this.purchasePrice = item.price;
checkGoods(item) {
if (this.priceType == 1) { //批发价
this.purchasePrice = item.wholesalePrice;
} else {
this.purchasePrice = item.price;
}
this.goodsDetail = item;
this.temporaryList = []
this.columns = []
this.keyList = []
if(this.carList != ''){
this.zNum = 0
for(let i=0;i<this.carList.length;i++){
if(item.id == this.carList[i].productId){
this.zNum = this.carList[i].num
this.temporaryList = this.carList[i].stockLogList1
}
}
}
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
}
newArr.push({
name: val,
value: valueObj
})
}
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
})
}
} else {
this.tui.toast(res.message)
}
this.goodsDetail = item;
this.temporaryList = []
this.columns = []
this.keyList = []
if (this.carList != '') {
this.zNum = 0
for (let i = 0; i < this.carList.length; i++) {
if (item.id == this.carList[i].productId) {
this.zNum = this.carList[i].num
this.temporaryList = this.carList[i].stockLogList1
}
}
}
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
}
newArr.push({
name: val,
value: valueObj
})
}
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
})
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//顶部搜索框
search(res) {
this.searchName = res.value
this.searchName = res.value
this.getShareList()
},
inputDialogToggle() {
this.$refs.inputDialog.open()
},
carChange(e,index,index1) {
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].stockLogList1.length; m++) {
this.carList[i].num += this.carList[i].stockLogList1[m].productCount
}
this.carNum += this.carList[i].num
}
},
carChange(e, index, index1) {
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].stockLogList1.length; m++) {
this.carList[i].num += this.carList[i].stockLogList1[m].productCount
}
this.carNum += this.carList[i].num
}
},
//弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() {
for (var i = 0; i < this.temporaryList.length; i++) {
if(this.temporaryList[i].productCount <= 0){
this.tui.toast("商品数量不能为零!")
return;
}
temporaryCheck() {
for (var i = 0; i < this.temporaryList.length; i++) {
if (this.temporaryList[i].productCount <= 0) {
this.tui.toast("商品数量不能为零!")
return;
}
}
let data = {
productId: this.goodsDetail.id,
price: this.zPrice,
num: this.zNum,
realPrice:this.priceType == 0?this.goodsDetail.price:this.goodsDetail.wholesalePrice,
num: this.zNum,
realPrice: this.priceType == 0 ? this.goodsDetail.price : this.goodsDetail.wholesalePrice,
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture,
@ -429,30 +435,30 @@
stockLogList1: this.temporaryList,
wholesalePrice: this.goodsDetail.wholesalePrice,
lsprice: this.goodsDetail.price
}
if(this.carList.length == 0){
this.carList.push(data)
}else{
let aa = true;
for(let i = 0; i < this.carList.length; i++){
if(this.carList[i].productId == data.productId){
this.carList[i] = data
aa = false
}
}
if(aa){
this.carList.push(data)
}
}
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].stockLogList1.length; m++) {
this.carList[i].num += this.carList[i].stockLogList1[m].productCount
}
}
}
if (this.carList.length == 0) {
this.carList.push(data)
} else {
let aa = true;
for (let i = 0; i < this.carList.length; i++) {
if (this.carList[i].productId == data.productId) {
this.carList[i] = data
aa = false
}
}
if (aa) {
this.carList.push(data)
}
}
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].stockLogList1.length; m++) {
this.carList[i].num += this.carList[i].stockLogList1[m].productCount
}
}
this.temporaryList = []
this.purchasePrice = ''
this.zPrice = ''
@ -466,57 +472,81 @@
this.$refs.popup.close()
},
//删除整条商品
delShop(item) {
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
for(let i=0;i<that.carList.length;i++){
if(that.carList[i].productId == item.productId){
that.carNum -= that.carList[i].num
that.carList.splice(i, 1)
}
}
that.carType = that.carList.length
}
that.$forceUpdate()
}
})
//删除整条商品
delShop(item) {
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
for (let i = 0; i < that.carList.length; i++) {
if (that.carList[i].productId == item.productId) {
that.carNum -= that.carList[i].num
that.carList.splice(i, 1)
}
}
that.carType = that.carList.length
}
that.$forceUpdate()
}
})
},
//删除商品下的某一个规格
delShopSpec(index,index1) {
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
for(let i=0;i<that.carList.length;i++){
if(that.carList[i].productId == index){
for(let m=0;m<that.carList[i].stockLogList1.length;m++){
if(that.carList[i].stockLogList1[m].attributeList == index1){
that.carList[i].num -= that.carList[i].stockLogList1[m].productCount
that.carNum -= that.carList[i].stockLogList1[m].productCount
that.carList[i].stockLogList1.splice(m, 1)
continue;
}
}
}
if(that.carList[i].stockLogList1.length == 0){
that.carList.splice(i, 1)
}
}
that.carType = that.carList.length
}
that.$forceUpdate()
}
})
//选商品的时候能删除规格
delCarData(index) {
this.temporaryList.splice(index, 1);
this.temporaryChange()
// uni.showModal({
// title: "提示",
// content: "确定删除此条商品吗?",
// success: function(res) {
// if(res.confirm){
// that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name);
// that.carList.get(id).stockLogList.delete(name)
// that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).purchasePrice
// if(that.carList.get(id).stockLogList.size == 0){
// that.carList.delete(id)
// }
// that.getAllPrice()
// }
// that.$forceUpdate()
// }
// })
},
//删除商品下的某一个规格
delShopSpec(index, index1) {
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
for (let i = 0; i < that.carList.length; i++) {
if (that.carList[i].productId == index) {
for (let m = 0; m < that.carList[i].stockLogList1.length; m++) {
if (that.carList[i].stockLogList1[m].attributeList == index1) {
that.carList[i].num -= that.carList[i].stockLogList1[m]
.productCount
that.carNum -= that.carList[i].stockLogList1[m].productCount
that.carList[i].stockLogList1.splice(m, 1)
continue;
}
}
}
if (that.carList[i].stockLogList1.length == 0) {
that.carList.splice(i, 1)
}
}
that.carType = that.carList.length
}
that.$forceUpdate()
}
})
},
//点击底部下单按钮
backPrevPage() {
@ -524,8 +554,8 @@
this.$refs.form.validate().then(res => {
let obj = {
mobile: that.formData.consigneeMobile,
username: that.formData.consigneeName,
oldSaleId:this.khid,
username: that.formData.consigneeName,
oldSaleId: this.khid,
sale: {
area: this.addressObj.area,
city: this.addressObj.city,
@ -539,28 +569,24 @@
this.tui.request("/app/sale/savePresale", "post", obj, false, false).then((res) => {
if (res.code == 200) {
this.tui.toast("下单成功,待商家配货")
setTimeout(() => {
uni.reLaunch({
url:`/pages/login/login`
})
},2000)
setTimeout(() => {
uni.reLaunch({
url: `/pages/login/login`
})
}, 2000)
} else {
this.tui.toast(res.message)
}
})
}).catch(err => {
})
})
},
openPicker() {
this.show = true
},
onhideShow() {
this.show = false
},
//选中省市区
onsetCity(e) {
@ -573,8 +599,6 @@
city: data.city,
area: data.area,
}
},
//点击分类获取商品列表
getShareList(id) {
@ -585,17 +609,17 @@
pageSize: '10'
}, false, true).then((res) => {
if (res.code == 200) {
this.shopList = res.result.shareList.records
this.shopList = res.result.shareList.records
this.priceType = res.result.share.priceType
this.shopId = res.result.shareList.records[0].shopId
for(var i= 0;i<this.shopList.length;i++){
if(res.result.share.priceType == 1){ //批发价
this.shopList[i].discountAmount = this.shopList[i].wholesalePrice
}else{ //零售
this.shopList[i].discountAmount = this.shopList[i].price
}
}
this.shopId = res.result.shareList.records[0].shopId
for (var i = 0; i < this.shopList.length; i++) {
if (res.result.share.priceType == 1) { //批发价
this.shopList[i].discountAmount = this.shopList[i].wholesalePrice
} else { //零售
this.shopList[i].discountAmount = this.shopList[i].price
}
}
} else {
this.tui.toast(res.message)
}
@ -637,13 +661,13 @@
border-radius: 10px;
}
.popup-content {
align-items: center;
justify-content: center;
padding: 15px;
height: 1200rpx;
background-color: #fff;
margin-bottom: 30rpx;
.popup-content {
align-items: center;
justify-content: center;
padding: 15px;
height: 1200rpx;
background-color: #fff;
margin-bottom: 30rpx;
overflow: scroll;
}
@ -699,22 +723,22 @@
}
.popup-pay-content {
align-items: center;
justify-content: center;
padding: 0 15px 15px 15px;
width: 95%;
margin: 0 auto;
height: auto;
background-color: #fff;
align-items: center;
justify-content: center;
padding: 0 15px 15px 15px;
width: 95%;
margin: 0 auto;
height: auto;
background-color: #fff;
}
.bottom-box {
width: 100%;
height: 120rpx;
position: fixed;
bottom: 0;
display: flex;
background: #fff;
width: 100%;
height: 120rpx;
position: fixed;
bottom: 0;
display: flex;
background: #fff;
z-index: 99;
}
@ -783,7 +807,7 @@
.content-right {
width: 100%;
overflow-y: scroll;
overflow-y: scroll;
margin-bottom: 150rpx;
}
@ -909,13 +933,13 @@
}
.popup-bottom {
width: 95%;
height: 100rpx;
position: fixed;
bottom: 0;
left: 2.5%;
display: flex;
z-index: 99;
width: 95%;
height: 100rpx;
position: fixed;
bottom: 0;
left: 2.5%;
display: flex;
z-index: 99;
background: #fff;
}

28
pages/inventory/addinventory.vue

@ -134,6 +134,9 @@
</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>
@ -440,7 +443,7 @@
temporaryChange(val) {
this.zNum = 0
for (var i = 0; i < this.temporaryList.length; i++) {
this.zNum += this.temporaryList[i].productCount
this.zNum += this.temporaryList[i].productCount || 0
}
},
@ -568,6 +571,29 @@
}
})
},
//选商品的时候能删除规格
delCarData(index) {
this.temporaryList.splice(index, 1);
this.temporaryChange()
// uni.showModal({
// title: "提示",
// content: "确定删除此条商品吗?",
// success: function(res) {
// if(res.confirm){
// that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name);
// that.carList.get(id).stockLogList.delete(name)
// that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).purchasePrice
// if(that.carList.get(id).stockLogList.size == 0){
// that.carList.delete(id)
// }
// that.getAllPrice()
// }
// that.$forceUpdate()
// }
// })
},
//删除商品下的某一个规格
delShopSpec(id,name) {

28
pages/inventory/changeGoods1.vue

@ -97,6 +97,9 @@
</ul>
<view style="padding-bottom: 100rpx;">
<view class="checkList" v-for="item in temporaryList">
<view @tap.stop="delCarData(index)" style="margin-right: 20rpx">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
</view>
@ -318,7 +321,7 @@
temporaryChange(val) {
this.zNum = 0
for (var i=0;i<this.temporaryList.length;i++) {
this.zNum += this.temporaryList[i].productCount
this.zNum += this.temporaryList[i].productCount || 0
}
this.zPrice = this.zNum * this.purchasePrice
},
@ -538,6 +541,29 @@
}
})
},
//选商品的时候能删除规格
delCarData(index) {
this.temporaryList.splice(index, 1);
this.temporaryChange()
// uni.showModal({
// title: "提示",
// content: "确定删除此条商品吗?",
// success: function(res) {
// if(res.confirm){
// that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name);
// that.carList.get(id).stockLogList.delete(name)
// that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).purchasePrice
// if(that.carList.get(id).stockLogList.size == 0){
// that.carList.delete(id)
// }
// that.getAllPrice()
// }
// that.$forceUpdate()
// }
// })
},
//删除商品下的某一个规格
delShopSpec(index,index1){
var that = this;

911
pages/inventory/gategoryLow.vue

File diff suppressed because it is too large

6
pages/inventory/getProductIdToList.vue

@ -2,8 +2,8 @@
<view class="container">
<view class="tui-order-item boxbg">
<view class="shop-box" v-for="(item,index) in list" :key="index" v-if="type==0">
<uni-card :title="'时间:'+ item.createTime">
<view class="uni-body" style="text-align: center;">单价:{{item.saleDetailDTOList[0].discountAmount}} 数量:{{item.productCount}} 总价:{{item.realAmount}}</view>
<uni-card :title="'时间:'+ item.createTime" :sub-title="item.userName == null ?'暂无':item.userName">
<view class="uni-body" style="text-align: center;">单价:{{item.saleDetailDTOList[0].discountAmount}} 数量:{{item.productCount}}</view>
<view style="margin: 5px 0;height: 1px;background: #eee;"></view>
<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>
@ -24,7 +24,7 @@
<view class="shop-box" v-for="(item,index3) in list" :key="index3" v-else>
<uni-card :title="'供应商:'+ (item.purchase.supplierName?item.purchase.supplierName:'暂无')"
:sub-title="item.purchase.createTime?item.purchase.createTime:'暂无'" >
<view class="uni-body" style="text-align: center;"><text v-if="userType==0">采购价:{{item.purchaseDetails[0].purchasePrice?item.purchaseDetails[0].purchasePrice:'暂无'}}</text> 总数量:{{item.purchase.totalAmount?item.purchase.totalAmount:'暂无'}} <text v-if="userType==0">总价:{{item.purchase.shouldPay?item.purchase.shouldPay:'暂无'}}</text></view>
<view class="uni-body" style="text-align: center;"><text v-if="userType==0">采购价:{{item.purchaseDetails[0].purchasePrice?item.purchaseDetails[0].purchasePrice:'暂无'}}</text> 总数量:{{item.purchase.totalAmount?item.purchase.totalAmount:'暂无'}}</view>
<view style="margin: 5px 0;height: 1px;background: #eee;"></view>
<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>

32
pages/inventory/goodsList1.vue

@ -83,7 +83,7 @@
<view v-if="value[1].supplierName !=undefined">供应商:{{value[1].supplierName}}</view>
</view>
<view @tap.stop="clickPrice(value[0])" style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;">改价</view>
<view @tap.stop="getHistoryPrice(value[1].productId,value[0])" v-if="khName !=''" style="position: absolute;top: 126rpx;right: 120rpx;">
<view @tap.stop="getHistoryPrice(value[1].productId,value[0])" v-if="khName !=''&&khName.name !='散客'" style="position: absolute;top: 126rpx;right: 120rpx;">
<u-icon name="clock" size="20"></u-icon>
</view>
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[0])">
@ -301,6 +301,9 @@
</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>
@ -608,7 +611,8 @@
if(this.xsyId == ''){
this.xsyId = uni.getStorageSync('id')
this.createByName = uni.getStorageSync('nickname')
}
}
console.log(this.carList)
},
filters: {
sliceMsg(val) {
@ -807,6 +811,7 @@
num.unitPrice = price;
num.price = price * num.productCount;
this.$refs.inputDialog.close()
this.$refs.historyPopup.close()
num.discountAmount = num.unitPrice * num.discount / 10
num.price = num.unitPrice * num.discount / 10 * num.productCount
that.relPrice = that.shouldPay
@ -1342,6 +1347,29 @@
carlist.discountAmount = carlist.unitPrice * carlist.discount / 10
carlist.price = carlist.unitPrice * carlist.discount / 10 * carlist.productCount
this.getAllPrice()
},
//选商品的时候能删除规格
delCarData(index) {
this.temporaryList.splice(index, 1);
this.temporaryChange()
// uni.showModal({
// title: "提示",
// content: "确定删除此条商品吗?",
// success: function(res) {
// if(res.confirm){
// that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name);
// that.carList.get(id).stockLogList.delete(name)
// that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).purchasePrice
// if(that.carList.get(id).stockLogList.size == 0){
// that.carList.delete(id)
// }
// that.getAllPrice()
// }
// that.$forceUpdate()
// }
// })
},
//删除整条商品
delShop(id) {

Loading…
Cancel
Save