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

28
pages/billing/changeGoods1.vue

@ -90,6 +90,9 @@
</ul>
<view style="padding-bottom:160rpx;">
<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
},
@ -515,6 +518,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;

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>
@ -657,6 +660,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) {
let that = this;

76
pages/index/customAndSupplierProductDetail.vue

@ -1,21 +1,47 @@
<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="width: 29%;text-align: center;float: left;">
{{data.productCount}}
<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>
</uni-card>
@ -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() {
@ -65,11 +91,23 @@
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) => {
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

130
pages/index/downStearmList.vue

@ -74,6 +74,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">
{{item.name}}
</view>
@ -143,14 +146,16 @@
</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">
<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)" />
<uni-number-box max="100000" v-model="item1.productCount"
@change="carChange($event,index,index1)" />
</view>
</view>
</view>
@ -182,7 +187,7 @@
shopId: '', //店铺id,
checkbox: [], //需要分享的商品id
temporaryNum: 0,
priceType:'',
priceType: '',
goodsDetail: [],
attrNameList: [],
temporaryList: [],
@ -291,13 +296,14 @@
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[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{
} else {
return
}
}
@ -308,7 +314,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
},
@ -339,9 +345,9 @@
},
//选择商品查询商品规格
checkGoods(item) {
if(this.priceType == 1){ //批发价
if (this.priceType == 1) { //批发价
this.purchasePrice = item.wholesalePrice;
}else{
} else {
this.purchasePrice = item.price;
}
@ -349,11 +355,11 @@
this.temporaryList = []
this.columns = []
this.keyList = []
if(this.carList != ''){
if (this.carList != '') {
this.zNum = 0
for(let i=0;i<this.carList.length;i++){
for (let i = 0; i < this.carList.length; i++) {
if(item.id == this.carList[i].productId){
if (item.id == this.carList[i].productId) {
this.zNum = this.carList[i].num
this.temporaryList = this.carList[i].stockLogList1
}
@ -399,7 +405,7 @@
inputDialogToggle() {
this.$refs.inputDialog.open()
},
carChange(e,index,index1) {
carChange(e, index, index1) {
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
@ -412,7 +418,7 @@
//弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() {
for (var i = 0; i < this.temporaryList.length; i++) {
if(this.temporaryList[i].productCount <= 0){
if (this.temporaryList[i].productCount <= 0) {
this.tui.toast("商品数量不能为零!")
return;
}
@ -421,7 +427,7 @@
productId: this.goodsDetail.id,
price: this.zPrice,
num: this.zNum,
realPrice:this.priceType == 0?this.goodsDetail.price:this.goodsDetail.wholesalePrice,
realPrice: this.priceType == 0 ? this.goodsDetail.price : this.goodsDetail.wholesalePrice,
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture,
@ -431,17 +437,17 @@
lsprice: this.goodsDetail.price
}
if(this.carList.length == 0){
if (this.carList.length == 0) {
this.carList.push(data)
}else{
} else {
let aa = true;
for(let i = 0; i < this.carList.length; i++){
if(this.carList[i].productId == data.productId){
for (let i = 0; i < this.carList.length; i++) {
if (this.carList[i].productId == data.productId) {
this.carList[i] = data
aa = false
}
}
if(aa){
if (aa) {
this.carList.push(data)
}
}
@ -474,8 +480,8 @@
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
for(let i=0;i<that.carList.length;i++){
if(that.carList[i].productId == item.productId){
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)
}
@ -486,29 +492,53 @@
}
})
},
//选商品的时候能删除规格
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) {
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++){
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[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){
if (that.carList[i].stockLogList1.length == 0) {
that.carList.splice(i, 1)
}
}
@ -525,7 +555,7 @@
let obj = {
mobile: that.formData.consigneeMobile,
username: that.formData.consigneeName,
oldSaleId:this.khid,
oldSaleId: this.khid,
sale: {
area: this.addressObj.area,
city: this.addressObj.city,
@ -540,10 +570,10 @@
if (res.code == 200) {
this.tui.toast("下单成功,待商家配货")
setTimeout(() => {
uni.reLaunch({
url:`/pages/login/login`
})
},2000)
uni.reLaunch({
url: `/pages/login/login`
})
}, 2000)
} else {
this.tui.toast(res.message)
}
@ -551,16 +581,12 @@
}).catch(err => {
})
},
openPicker() {
this.show = true
},
onhideShow() {
this.show = false
},
//选中省市区
onsetCity(e) {
@ -573,8 +599,6 @@
city: data.city,
area: data.area,
}
},
//点击分类获取商品列表
getShareList(id) {
@ -588,10 +612,10 @@
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){ //批发价
for (var i = 0; i < this.shopList.length; i++) {
if (res.result.share.priceType == 1) { //批发价
this.shopList[i].discountAmount = this.shopList[i].wholesalePrice
}else{ //零售
} else { //零售
this.shopList[i].discountAmount = this.shopList[i].price
}
}
@ -700,12 +724,12 @@
.popup-pay-content {
align-items: center;
justify-content: center;
padding: 0 15px 15px 15px;
width: 95%;
margin: 0 auto;
height: auto;
background-color: #fff;
justify-content: center;
padding: 0 15px 15px 15px;
width: 95%;
margin: 0 auto;
height: auto;
background-color: #fff;
}
.bottom-box {

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;

459
pages/inventory/gategoryLow.vue

@ -1,7 +1,8 @@
<template>
<view class="u-wrap">
<view style="width: 100%;position: fixed;z-index: 99;">
<button size="default" type="default" @tap="inputDialogToggle('attrAdd',categoryId)" hover-class="is-hover">添加分类</button>
<button size="default" type="default" @tap="inputDialogToggle('attrAdd',categoryId)"
hover-class="is-hover">添加分类</button>
</view>
<view class="card-list">
<ul>
@ -9,13 +10,15 @@
<view class="title-fur">
<view class="name">{{items.attributeName}}</view>
<view class="rightBox">
<u-icon size="20" name="plus" color="#5fd9ee" @tap="inputDialogToggle('attrValAdd', items.id) "></u-icon>
<u-icon size="20" name="plus" color="#5fd9ee"
@tap="inputDialogToggle('attrValAdd', items.id) "></u-icon>
<!-- <u-icon size="24" name="edit-pen" color="#5fd9ee" @tap="inputDialogToggle('attrEdit', items, item) "></u-icon> -->
<u-icon size="24" name="trash" color="#f56c6c" @tap="delItem(items, 'attrDel')"></u-icon>
<u-icon size="24" name="trash" color="#f56c6c" @tap="delItem(items, 'attrDel')"></u-icon>
</view>
</view>
<view class="content-fur">
<view class="content-low" v-for="item in items.attributeValue" :key="item.id" @tap="delItem(item, 'attrNameDel')">{{item.value}}</view>
<view class="content-low" v-for="item in items.attributeValue" :key="item.id"
@tap="delItem(item, 'attrNameDel')">{{item.value}}</view>
</view>
</li>
</ul>
@ -27,49 +30,40 @@
@confirm="dialogInputConfirm" @close="dialogClose">
</uni-popup-dialog>
</uni-popup>
<uni-popup ref="delDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" :title="dialogTit" :value="inputVal" placeholder="请输入名称"
cancelText="删除" @confirm="dialogInputConfirm" @close="dialogDel">
</uni-popup-dialog>
</uni-popup>
<!-- 查看商品库存弹出层 -->
<uni-popup ref="carPopup" background-color="#fff">
<view class="popup-content" style="height:auto !important;">
<view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view>
<view v-if="goodsList !=''"
style="width:100%;font-weight:bold;text-align: center;font-size: 28rpx;margin: 20rpx 0;">
{{goodsList[0].productName}}商品有以下库存,确认继续删除吗?
<!-- 添加分类弹出层 -->
<uni-popup ref="addTypeDialog" background-color="#fff">
<view class="add-popup-content">
<view class="add-popup-title">
<text>新增分类</text>
<uni-icons @tap='close' type="closeempty" color='red' size="16"
style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons>
</view>
<view class="tui-order-item boxbg">
<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="add-popup-container">
<view>
<text style="color:red;font-size:22rpx;">*您可以点击默认项快捷添加分类,如没有想要的快捷项,可以手动输入</text>
</view>
<view class="shop-box" v-for="(item,index) in goodsList" :key="index" style="position: relative;">
<view style='height: 50rpx;line-height: 50rpx;'>
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;float: left;height: 50rpx;overflow: hidden;">
{{item.attributeList | sliceMsg}}
<textarea name="" id="" style="width: 100%;border: 1px solid #eee;height: 80rpx;padding: 12px;margin:20rpx 0;" v-model="typeText"
placeholder="请输入分类名称"></textarea>
<ul>
<li v-for="(item,index) in defaultList" :key="index">
<view class="title-fur">
<view class="name">{{item.name}}</view>
</view>
<view style="width: 29%;text-align: center;float: left;">
{{item.stockCount}}
<view class="content-fur">
<view class="content-low" :class="item1.checked?'checked':''" v-for="(item1,index1) in item.list" :key="index1"
@tap.stop="addMultipleType(item,item1.type,index1)">{{item1.type}}</view>
</view>
</view>
</view>
</view>
<!-- <u-loadmore :status="status" /> -->
<view class="popup-bottom">
<view class="popup-bottom-left">
<view class="bottom-btn" @tap="this.$refs.carPopup.close()"
style="background: linear-gradient(90deg, #FF9797, #FFC1E0);">再想想</view>
</view>
<view class="popup-bottom-right">
<view class="bottom-btn" @tap="this.show = true">确认删除</view>
</li>
</ul>
<view class="add-popup-bottom">
<view class="add-popup-btn" @tap="dialogInputConfirm(typeText)">确认</view>
</view>
</view>
</view>
</uni-popup>
<!-- 查看商品库存弹出层 -->
<uni-popup ref="addPopup" background-color="#fff">
<uni-popup ref="carPopup" background-color="#fff">
<view class="popup-content" style="height:auto !important;">
<view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view>
<view v-if="goodsList !=''"
@ -83,7 +77,8 @@
</view>
<view class="shop-box" v-for="(item,index) in goodsList" :key="index" style="position: relative;">
<view style='height: 50rpx;line-height: 50rpx;'>
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;float: left;height: 50rpx;overflow: hidden;">
<view
style="width: 70%;text-align: center;border-right: 1px solid #eee;float: left;height: 50rpx;overflow: hidden;">
{{item.attributeList | sliceMsg}}
</view>
<view style="width: 29%;text-align: center;float: left;">
@ -95,7 +90,7 @@
<!-- <u-loadmore :status="status" /> -->
<view class="popup-bottom">
<view class="popup-bottom-left">
<view class="bottom-btn" @tap="this.$refs.addPopup.close()"
<view class="bottom-btn" @tap="this.$refs.carPopup.close()"
style="background: linear-gradient(90deg, #FF9797, #FFC1E0);">再想想</view>
</view>
<view class="popup-bottom-right">
@ -124,9 +119,141 @@
delType: '',
showList: {},
dialogTit: '输入分类名',
categoryId:'',
goodsList:[]
categoryId: '',
goodsList: [],
typeText:'',
// type: 'center',
defaultList:[{
name:'颜色',
list:[{
type:'白色',
checked:false,
},{
type:'黑色',
checked:false,
},{
type:'浅蓝',
checked:false,
},{
type:'蓝色',
checked:false,
},{
type:'灰色',
checked:false,
},{
type:'咖色',
checked:false,
},{
type:'紫色',
checked:false,
},{
type:'红色',
checked:false,
},{
type:'米色',
checked:false,
},{
type:'均色',
checked:false,
}]
},{
name:'通用尺码',
list:[{
type:'XS',
checked:false
},{
type:'S',
checked:false,
},{
type:'M',
checked:false,
},{
type:'L',
checked:false,
},{
type:'XL',
checked:false,
},{
type:'XXL',
checked:false,
},{
type:'XXXL',
checked:false,
},{
type:'XXXXL',
checked:false,
},{
type:'均码',
checked:false,
}]
},{
name:'尺码',
list:[{
type:'25码',
checked:false
},{
type:'26码',
checked:false
},{
type:'27码',
checked:false
},{
type:'28码',
checked:false
},{
type:'29码',
checked:false
},{
type:'30码',
checked:false
},{
type:'31码',
checked:false
},{
type:'32码',
checked:false
},{
type:'33码',
checked:false
},{
type:'34码',
checked:false
},{
type:'35码',
checked:false
},{
type:'36码',
checked:false
},{
type:'37码',
checked:false
},{
type:'38码',
checked:false
},{
type:'39码',
checked:false
},{
type:'40码',
checked:false
},{
type:'41码',
checked:false
},{
type:'42码',
checked:false
},{
type:'43码',
checked:false
},{
type:'44码',
checked:false
},{
type:'45码',
checked:false
}]
}],
multipleList:[]
}
},
computed: {
@ -167,17 +294,17 @@
if (res2.code == 200) {
items.attributeValue = res2.result;
//
}else{
this.tui.toast(res.message)
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
})
}
setTimeout(() => {
this.showList = this.attrList;
},1000)
}else{
}, 1000)
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
@ -187,7 +314,7 @@
let that = this;
this.tui.request("/app/stock/getlistByAttributeList", "post", {
categoryId: this.categoryId,
attributeList:this.delItems.attributeName || this.delItems.value,
attributeList: this.delItems.attributeName || this.delItems.value,
}, false, true).then((res) => {
if (res.code == 200) {
if (res.result != '') {
@ -236,18 +363,71 @@
if (res.code == 200) {
items.attributeValue = res.result;
this.showList = this.attrList
}else{
this.tui.toast(res.message)
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
})
}
}else{
this.tui.toast(res.message)
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
})
},
//选择多个规格保存
addMultipleType(item,item1,index){
console.log(item);
console.log(item1);
item.list[index].checked = !item.list[index].checked
var list = []
if(this.multipleList == ''){
console.log("首次");
list.push(item1)
var data = {
name:item.name,
list: list
}
this.multipleList.push(data)
}else{
for(var i=0;i<this.multipleList.length;i++){
if(this.multipleList[i].name == item.name){ //同种分类
console.log("同分类");
for(var m=0;m<this.multipleList[i].list.length;m++){
if(this.multipleList[i].list[m] == item1){ //规格相同
console.log("同规格");
this.multipleList[i].list.splice(m,1)
console.log(this.multipleList);
return;
}else{ //规格不同
if(m+1 == this.multipleList[i].list.length){
console.log("不同规格");
this.multipleList[i].list.push(item1)
console.log(this.multipleList);
return;
}
}
}
}else{ //不同分类
if(this.multipleList.length == i+1){
console.log("不同分类");
list.push(item1)
var data = {
name:item.name,
list: list
}
this.multipleList.push(data)
console.log(this.multipleList);
return;
}
}
}
}
console.log(this.multipleList);
},
// 获取属性值
getProductAttributeValue(index) {
@ -257,9 +437,9 @@
}, false, true).then((res) => {
if (res.code == 200) {
item.attributeValue = res.result;
}else{
this.tui.toast(res.message)
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
})
this.showList = JSON.parse(JSON.stringify(this.attrList))
@ -267,23 +447,22 @@
},
inputDialogToggle(type, item, parent) {
this.typeModel = type;
if(type == 'edit') {
this.inputVal = item.categoryName ;
if (type == 'edit') {
this.inputVal = item.categoryName;
this.editItem = item;
}else if ( type == 'add' || type == 'attrAdd' || type == 'attrValAdd') {
} else if (type == 'add' || type == 'attrAdd' || type == 'attrValAdd') {
this.inputVal = '';
this.isOpenId = item;
if(type == 'add') {
if (type == 'add') {
this.dialogTit = '输入分类名'
} else if(type == 'attrAdd') {
this.dialogTit = '输入属性名'
// this.$refs.addPopup.open()
// return;
} else if(type == 'attrValAdd') {
} else if (type == 'attrAdd') {
this.$refs.addTypeDialog.open('bottom')
return;
} else if (type == 'attrValAdd') {
this.dialogTit = '输入属性值'
}
} else if ( type == 'attrEdit') {
this.inputVal = item.attributeName ;
} else if (type == 'attrEdit') {
this.inputVal = item.attributeName;
this.editItem = item;
}
this.$refs.inputDialog.open()
@ -292,24 +471,24 @@
switch (this.typeModel) {
case 'add':
this.tui.request("/app/productCategory/save", "post", {
categoryName: e
}, false, true).then((res) => {
this.tui.request("/app/productCategory/save", "post", {
categoryName: e
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title:"添加成功",
icon: 'none'
})
} else {
uni.showToast({
title:"添加失败",
icon: 'none'
})
}
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "添加成功",
icon: 'none'
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
}).catch((res) => {})
}).catch((res) => {})
break;
case 'edit':
this.tui.request("/app/productCategory/edit", "post", {
@ -319,22 +498,22 @@
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title:"修改成功",
title: "修改成功",
icon: 'none'
})
} else {
uni.showToast({
title:"修改失败",
title: "修改失败",
icon: 'none'
})
}
}).catch((res) => {})
break;
case 'attrAdd':
for(let i=0;i<this.attrList.length;i++){
if(this.attrList[i].attributeName == e){
for (let i = 0; i < this.attrList.length; i++) {
if (this.attrList[i].attributeName == e) {
uni.showToast({
title:"请勿重复添加",
title: "请勿重复添加",
icon: 'none'
})
return
@ -347,21 +526,21 @@
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title:"添加成功",
title: "添加成功",
icon: 'none'
})
} else {
uni.showToast({
title:"添加失败",
title: "添加失败",
icon: 'none'
})
}
}).catch((res) => {})
break;
break;
case 'attrValAdd':
if(e == ''){
if (e == '') {
uni.showToast({
title:"不能为空!",
title: "不能为空!",
icon: 'none'
})
return
@ -373,41 +552,41 @@
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title:"添加成功",
title: "添加成功",
icon: 'none'
})
} else {
uni.showToast({
title:res.message,
title: res.message,
icon: 'none'
})
}
}).catch((res) => {})
break;
case 'attrEdit':
this.tui.request("/app/productAttribute/edit", "post", {
attributeName: e,
categoryId: this.editItem.categoryId,
id: this.editItem.id
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title:"修改成功",
icon: 'none'
})
} else {
uni.showToast({
title:"修改失败",
icon: 'none'
})
}
}).catch((res) => {})
break;
break;
case 'attrEdit':
this.tui.request("/app/productAttribute/edit", "post", {
attributeName: e,
categoryId: this.editItem.categoryId,
id: this.editItem.id
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "修改成功",
icon: 'none'
})
} else {
uni.showToast({
title: "修改失败",
icon: 'none'
})
}
}).catch((res) => {})
break;
default:
}
this.$refs.inputClose.val=''
this.$refs.inputClose.val = ''
},
dialogClose() {
this.inputVal = '';
@ -553,9 +732,6 @@
margin: 20rpx 0 0 20rpx;
}
.content-low:hover {
background: #eee;
}
.popup-content {
align-items: center;
justify-content: center;
@ -618,4 +794,43 @@
background: linear-gradient(90deg, #60F3FF, #088FEB);
border-radius: 70rpx;
}
.checked{
background: #60F3FF;
color: #fff;
}
.add-popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 100%;
height: 1300rpx;
background-color: #fff;
}
.add-popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.add-popup-container {
margin-top: 20rpx;
}
.add-popup-bottom {
display: flex;
height: 80rpx;
color: #fff;
line-height: 80rpx;
margin-top: 50rpx;
}
.add-popup-btn {
flex: 1;
text-align: center;
background: linear-gradient(90deg, #60F3FF, #088FEB);
}
</style>

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>

30
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>
@ -609,6 +612,7 @@
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
@ -1343,6 +1348,29 @@
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) {
var that = this;

Loading…
Cancel
Save