wangfukang 3 years ago
parent
commit
572d1aa298
  1. 28
      pages/billing/changeGoods1.vue
  2. 26
      pages/index/addHangOrder.vue
  3. 58
      pages/index/customAndSupplierProductDetail.vue
  4. 46
      pages/index/downStearmList.vue
  5. 28
      pages/inventory/addinventory.vue
  6. 28
      pages/inventory/changeGoods1.vue
  7. 307
      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> </ul>
<view style="padding-bottom:160rpx;"> <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"> <view class="checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text> <text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
</view> </view>
@ -307,7 +310,7 @@
temporaryChange(val) { temporaryChange(val) {
this.zNum = 0 this.zNum = 0
for (var i = 0; i < this.temporaryList.length; i++) { 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 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) { delShopSpec(index, index1) {
var that = this; var that = this;

26
pages/index/addHangOrder.vue

@ -118,6 +118,9 @@
</ul> </ul>
<view style="padding-bottom: 100rpx;"> <view style="padding-bottom: 100rpx;">
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index"> <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"> <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> <text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
</view> </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) { delGoodsPrecs(item, index, index1) {
let that = this; let that = this;

58
pages/index/customAndSupplierProductDetail.vue

@ -1,21 +1,47 @@
<template> <template>
<view class="container"> <view class="container">
<view class="tui-order-item boxbg"> <view class="tui-order-item boxbg">
<view class="shop-box" v-for="(item,index3) in list" :key="index3"> <view class="shop-box" v-for="(item,index4) in list">
<uni-card :title="item.productName?item.productName:'暂无'" <uni-card :title="item.productName?item.productName:'暂无'" v-if="type=='khName'">
:sub-title="item.createTime?item.createTime:'暂无'" > <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;"><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 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>
</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="margin: 5px 0;height: 1px;background: #eee;"></view>
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;"> <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: 70%;text-align: center;border-right: 1px solid #eee;">商品规格</view>
<view style="width: 29%;text-align: center;">数量</view> <view style="width: 29%;text-align: center;">数量</view>
</view> </view>
<view v-for="(data,index2) in item.customerBuyProductDetailLogVos" :key="index2" style='height: 50rpx;line-height: 50rpx;'> <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;"> <view style="width: 70%;text-align: center;border-right: 1px solid #eee;float: left;height: 50rpx;overflow: hidden;">
{{data.attributeList | sliceMsg}} {{data1.attributeList | sliceMsg}}
</view> </view>
<view style="width: 29%;text-align: center;float: left;"> <view style="width: 29%;text-align: center;float: left;">
{{data.productCount}} {{data1.productCount}}
</view>
</view> </view>
</view> </view>
</uni-card> </uni-card>
@ -53,7 +79,7 @@
onLoad(option) { onLoad(option) {
this.userId = option.id this.userId = option.id
this.userType = uni.getStorageSync('type') this.userType = uni.getStorageSync('type')
this.type = option.type this.type = option.popleType
this.getList() this.getList()
}, },
onReachBottom() { onReachBottom() {
@ -65,11 +91,23 @@
methods: { methods: {
getList(id) { getList(id) {
this.status = 'loading'; this.status = 'loading';
this.tui.request("/app/sale/getCustomerBuyProductLog", "post", { 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, userId: this.userId,
pageSize: 10, pageSize: 10,
pageNum: this.pageNum pageNum: this.pageNum
}, false, false).then((res) => { }
}
this.tui.request(url, "post", data, false, false).then((res) => {
this.status = 'nomore'; this.status = 'nomore';
if (res.code == 200) { if (res.code == 200) {
// this.list = res.result.records // this.list = res.result.records

46
pages/index/downStearmList.vue

@ -74,6 +74,9 @@
</ul> </ul>
<view style="padding-bottom: 100rpx;"> <view style="padding-bottom: 100rpx;">
<view class="checkList" v-for="item in temporaryList"> <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"> <view class="checkList-box">
{{item.name}} {{item.name}}
</view> </view>
@ -144,13 +147,15 @@
<view style="padding-bottom: 100rpx;"> <view style="padding-bottom: 100rpx;">
<view class="popup-container" v-for="(item1,index1) in item.stockLogList1"> <view class="popup-container" v-for="(item1,index1) in item.stockLogList1">
<view class="checkList"> <view class="checkList">
<view style="margin-right:5%;" @tap="delShopSpec(item.productId,item1.attributeList)" :key="index1"> <view style="margin-right:5%;" @tap="delShopSpec(item.productId,item1.attributeList)"
:key="index1">
<uni-icons color="red" type="minus" size="26"></uni-icons> <uni-icons color="red" type="minus" size="26"></uni-icons>
</view> </view>
<view class="checkList-box"> <view class="checkList-box">
{{item1.name}} {{item1.name}}
</view> </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> </view>
</view> </view>
@ -291,7 +296,8 @@
this.temporaryList.push(this.attributeList); this.temporaryList.push(this.attributeList);
} else { } else {
for (var i = 0; i < this.temporaryList.length; i++) { 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)) { if (this.temporaryList.length == (i + 1)) {
this.temporaryList.push(this.attributeList); this.temporaryList.push(this.attributeList);
return return
@ -308,7 +314,7 @@
temporaryChange(val) { temporaryChange(val) {
this.zNum = 0 this.zNum = 0
for (var i = 0; i < this.temporaryList.length; i++) { 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 this.zPrice = this.zNum * this.purchasePrice
}, },
@ -486,6 +492,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) { delShopSpec(index, index1) {
var that = this; var that = this;
@ -499,7 +528,8 @@
for (let m = 0; m < that.carList[i].stockLogList1.length; m++) { for (let m = 0; m < that.carList[i].stockLogList1.length; m++) {
if (that.carList[i].stockLogList1[m].attributeList == index1) { if (that.carList[i].stockLogList1[m].attributeList == index1) {
that.carList[i].num -= that.carList[i].stockLogList1[m].productCount that.carList[i].num -= that.carList[i].stockLogList1[m]
.productCount
that.carNum -= that.carList[i].stockLogList1[m].productCount that.carNum -= that.carList[i].stockLogList1[m].productCount
that.carList[i].stockLogList1.splice(m, 1) that.carList[i].stockLogList1.splice(m, 1)
continue; continue;
@ -551,16 +581,12 @@
}).catch(err => { }).catch(err => {
}) })
}, },
openPicker() { openPicker() {
this.show = true this.show = true
}, },
onhideShow() { onhideShow() {
this.show = false this.show = false
}, },
//选中省市区 //选中省市区
onsetCity(e) { onsetCity(e) {
@ -573,8 +599,6 @@
city: data.city, city: data.city,
area: data.area, area: data.area,
} }
}, },
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {

28
pages/inventory/addinventory.vue

@ -134,6 +134,9 @@
</ul> </ul>
<view style="padding-bottom: 100rpx;"> <view style="padding-bottom: 100rpx;">
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index"> <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"> <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> <text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
</view> </view>
@ -440,7 +443,7 @@
temporaryChange(val) { temporaryChange(val) {
this.zNum = 0 this.zNum = 0
for (var i = 0; i < this.temporaryList.length; i++) { 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) { delShopSpec(id,name) {

28
pages/inventory/changeGoods1.vue

@ -97,6 +97,9 @@
</ul> </ul>
<view style="padding-bottom: 100rpx;"> <view style="padding-bottom: 100rpx;">
<view class="checkList" v-for="item in temporaryList"> <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"> <view class="checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text> <text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
</view> </view>
@ -318,7 +321,7 @@
temporaryChange(val) { temporaryChange(val) {
this.zNum = 0 this.zNum = 0
for (var i=0;i<this.temporaryList.length;i++) { 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 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){ delShopSpec(index,index1){
var that = this; var that = this;

307
pages/inventory/gategoryLow.vue

@ -1,7 +1,8 @@
<template> <template>
<view class="u-wrap"> <view class="u-wrap">
<view style="width: 100%;position: fixed;z-index: 99;"> <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>
<view class="card-list"> <view class="card-list">
<ul> <ul>
@ -9,13 +10,15 @@
<view class="title-fur"> <view class="title-fur">
<view class="name">{{items.attributeName}}</view> <view class="name">{{items.attributeName}}</view>
<view class="rightBox"> <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="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> </view>
<view class="content-fur"> <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> </view>
</li> </li>
</ul> </ul>
@ -27,49 +30,40 @@
@confirm="dialogInputConfirm" @close="dialogClose"> @confirm="dialogInputConfirm" @close="dialogClose">
</uni-popup-dialog> </uni-popup-dialog>
</uni-popup> </uni-popup>
<uni-popup ref="delDialog" type="dialog"> <!-- 添加分类弹出层 -->
<uni-popup-dialog ref="inputClose" mode="input" :title="dialogTit" :value="inputVal" placeholder="请输入名称" <uni-popup ref="addTypeDialog" background-color="#fff">
cancelText="删除" @confirm="dialogInputConfirm" @close="dialogDel"> <view class="add-popup-content">
</uni-popup-dialog> <view class="add-popup-title">
</uni-popup> <text>新增分类</text>
<!-- 查看商品库存弹出层 --> <uni-icons @tap='close' type="closeempty" color='red' size="16"
<uni-popup ref="carPopup" background-color="#fff"> style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons>
<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}}商品有以下库存,确认继续删除吗?
</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>
<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}}
</view>
<view style="width: 29%;text-align: center;float: left;">
{{item.stockCount}}
</view>
</view> </view>
<view class="add-popup-container">
<view>
<text style="color:red;font-size:22rpx;">*您可以点击默认项快捷添加分类,如没有想要的快捷项,可以手动输入</text>
</view> </view>
<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>
<!-- <u-loadmore :status="status" /> --> <view class="content-fur">
<view class="popup-bottom"> <view class="content-low" :class="item1.checked?'checked':''" v-for="(item1,index1) in item.list" :key="index1"
<view class="popup-bottom-left"> @tap.stop="addMultipleType(item,item1.type,index1)">{{item1.type}}</view>
<view class="bottom-btn" @tap="this.$refs.carPopup.close()"
style="background: linear-gradient(90deg, #FF9797, #FFC1E0);">再想想</view>
</view> </view>
<view class="popup-bottom-right"> </li>
<view class="bottom-btn" @tap="this.show = true">确认删除</view> </ul>
<view class="add-popup-bottom">
<view class="add-popup-btn" @tap="dialogInputConfirm(typeText)">确认</view>
</view> </view>
</view> </view>
</view> </view>
</uni-popup> </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 class="popup-content" style="height:auto !important;">
<view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view> <view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view>
<view v-if="goodsList !=''" <view v-if="goodsList !=''"
@ -83,7 +77,8 @@
</view> </view>
<view class="shop-box" v-for="(item,index) in goodsList" :key="index" style="position: relative;"> <view class="shop-box" v-for="(item,index) in goodsList" :key="index" style="position: relative;">
<view style='height: 50rpx;line-height: 50rpx;'> <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}} {{item.attributeList | sliceMsg}}
</view> </view>
<view style="width: 29%;text-align: center;float: left;"> <view style="width: 29%;text-align: center;float: left;">
@ -95,7 +90,7 @@
<!-- <u-loadmore :status="status" /> --> <!-- <u-loadmore :status="status" /> -->
<view class="popup-bottom"> <view class="popup-bottom">
<view class="popup-bottom-left"> <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> style="background: linear-gradient(90deg, #FF9797, #FFC1E0);">再想想</view>
</view> </view>
<view class="popup-bottom-right"> <view class="popup-bottom-right">
@ -125,8 +120,140 @@
showList: {}, showList: {},
dialogTit: '输入分类名', dialogTit: '输入分类名',
categoryId: '', categoryId: '',
goodsList:[] goodsList: [],
typeText:'',
// type: 'center', // 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: { computed: {
@ -248,6 +375,59 @@
}).catch((res) => {}) }).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) { getProductAttributeValue(index) {
@ -276,9 +456,8 @@
if (type == 'add') { if (type == 'add') {
this.dialogTit = '输入分类名' this.dialogTit = '输入分类名'
} else if (type == 'attrAdd') { } else if (type == 'attrAdd') {
this.dialogTit = '输入属性名' this.$refs.addTypeDialog.open('bottom')
// this.$refs.addPopup.open() return;
// return;
} else if (type == 'attrValAdd') { } else if (type == 'attrValAdd') {
this.dialogTit = '输入属性值' this.dialogTit = '输入属性值'
} }
@ -553,9 +732,6 @@
margin: 20rpx 0 0 20rpx; margin: 20rpx 0 0 20rpx;
} }
.content-low:hover {
background: #eee;
}
.popup-content { .popup-content {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -618,4 +794,43 @@
background: linear-gradient(90deg, #60F3FF, #088FEB); background: linear-gradient(90deg, #60F3FF, #088FEB);
border-radius: 70rpx; 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> </style>

6
pages/inventory/getProductIdToList.vue

@ -2,8 +2,8 @@
<view class="container"> <view class="container">
<view class="tui-order-item boxbg"> <view class="tui-order-item boxbg">
<view class="shop-box" v-for="(item,index) in list" :key="index" v-if="type==0"> <view class="shop-box" v-for="(item,index) in list" :key="index" v-if="type==0">
<uni-card :title="'时间:'+ item.createTime"> <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}} 总价:{{item.realAmount}}</view> <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="margin: 5px 0;height: 1px;background: #eee;"></view>
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;"> <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: 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> <view class="shop-box" v-for="(item,index3) in list" :key="index3" v-else>
<uni-card :title="'供应商:'+ (item.purchase.supplierName?item.purchase.supplierName:'暂无')" <uni-card :title="'供应商:'+ (item.purchase.supplierName?item.purchase.supplierName:'暂无')"
:sub-title="item.purchase.createTime?item.purchase.createTime:'暂无'" > :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="margin: 5px 0;height: 1px;background: #eee;"></view>
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;"> <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: 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 v-if="value[1].supplierName !=undefined">供应商:{{value[1].supplierName}}</view>
</view> </view>
<view @tap.stop="clickPrice(value[0])" style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;">改价</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> <u-icon name="clock" size="20"></u-icon>
</view> </view>
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[0])"> <view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[0])">
@ -301,6 +301,9 @@
</ul> </ul>
<view style="padding-bottom:100rpx;"> <view style="padding-bottom:100rpx;">
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index"> <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"> <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> <text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
</view> </view>
@ -609,6 +612,7 @@
this.xsyId = uni.getStorageSync('id') this.xsyId = uni.getStorageSync('id')
this.createByName = uni.getStorageSync('nickname') this.createByName = uni.getStorageSync('nickname')
} }
console.log(this.carList)
}, },
filters: { filters: {
sliceMsg(val) { sliceMsg(val) {
@ -807,6 +811,7 @@
num.unitPrice = price; num.unitPrice = price;
num.price = price * num.productCount; num.price = price * num.productCount;
this.$refs.inputDialog.close() this.$refs.inputDialog.close()
this.$refs.historyPopup.close()
num.discountAmount = num.unitPrice * num.discount / 10 num.discountAmount = num.unitPrice * num.discount / 10
num.price = num.unitPrice * num.discount / 10 * num.productCount num.price = num.unitPrice * num.discount / 10 * num.productCount
that.relPrice = that.shouldPay that.relPrice = that.shouldPay
@ -1343,6 +1348,29 @@
carlist.price = carlist.unitPrice * carlist.discount / 10 * carlist.productCount carlist.price = carlist.unitPrice * carlist.discount / 10 * carlist.productCount
this.getAllPrice() 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) { delShop(id) {
var that = this; var that = this;

Loading…
Cancel
Save