From 572d1aa2985558f4627442c77bbac3a930703a40 Mon Sep 17 00:00:00 2001
From: wangfukang <15630117759@163.com>
Date: Sun, 10 Mar 2024 14:51:02 +0800
Subject: [PATCH] 11
---
pages/billing/changeGoods1.vue | 30 +-
pages/index/addHangOrder.vue | 26 +
.../index/customAndSupplierProductDetail.vue | 80 +-
pages/index/downStearmList.vue | 538 ++++++-----
pages/inventory/addinventory.vue | 28 +-
pages/inventory/changeGoods1.vue | 28 +-
pages/inventory/gategoryLow.vue | 911 +++++++++++-------
pages/inventory/getProductIdToList.vue | 6 +-
pages/inventory/goodsList1.vue | 32 +-
9 files changed, 1044 insertions(+), 635 deletions(-)
diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue
index 69a6afe..b38d7ec 100644
--- a/pages/billing/changeGoods1.vue
+++ b/pages/billing/changeGoods1.vue
@@ -89,7 +89,10 @@
-
+
+
+
+
{{item.name}} 库存:{{item.productNum}}
@@ -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) {
diff --git a/pages/index/addHangOrder.vue b/pages/index/addHangOrder.vue
index c161468..e7e9aa6 100644
--- a/pages/index/addHangOrder.vue
+++ b/pages/index/addHangOrder.vue
@@ -118,6 +118,9 @@
+
+
+
{{item.name}} 库存:{{item.productNum}}
@@ -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) {
diff --git a/pages/index/customAndSupplierProductDetail.vue b/pages/index/customAndSupplierProductDetail.vue
index 6f670f7..6982567 100644
--- a/pages/index/customAndSupplierProductDetail.vue
+++ b/pages/index/customAndSupplierProductDetail.vue
@@ -1,22 +1,48 @@
-
-
- 采购价:{{item.realPrice?item.realPrice:'暂无'}} 总数量:{{item.productCount?item.productCount:'暂无'}} 总价:{{item.shouldPay?item.shouldPay:'暂无'}}
-
-
- 商品规格
- 数量
+
+
+
+
+ {{data.createTime}}
+ 采购价:{{data.customerBuyProductDetailLogVos[0].realPrice}}
+
+
+
+ 商品规格
+ 数量
+
+
+
+ {{data1.attributeList | sliceMsg}}
+
+
+ {{data1.productCount}}
+
+
-
-
- {{data.attributeList | sliceMsg}}
+
+
+
+
+
+ {{data.createTime}}
+ 采购价:{{data.supplierBuyProductDetailLogVos[0].purchasePrice}}
+
+
+
+ 商品规格
+ 数量
+
+
+
+ {{data1.attributeList | sliceMsg}}
+
+
+ {{data1.productCount}}
+
-
- {{data.productCount}}
-
@@ -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
diff --git a/pages/index/downStearmList.vue b/pages/index/downStearmList.vue
index df41c75..f50458a 100644
--- a/pages/index/downStearmList.vue
+++ b/pages/index/downStearmList.vue
@@ -71,26 +71,29 @@
:class="itemTag.isChecked ? 'checkedText' : '' "> {{itemTag.value}}
-
-
+
+
-
- {{item.name}}
-
-
-
+
+
+
+
+ {{item.name}}
+
+
+
-
-
-
+
@@ -140,29 +143,31 @@
-
-
-
+
+
+
+
+
+
-
@@ -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 {
- 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 {
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
+
+
+
{{item.name}} 库存:{{item.productNum}}
@@ -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) {
diff --git a/pages/inventory/changeGoods1.vue b/pages/inventory/changeGoods1.vue
index 6a9ef70..6feabc7 100644
--- a/pages/inventory/changeGoods1.vue
+++ b/pages/inventory/changeGoods1.vue
@@ -97,6 +97,9 @@
+
+
+
{{item.name}} 库存:{{item.productNum}}
@@ -318,7 +321,7 @@
temporaryChange(val) {
this.zNum = 0
for (var i=0;i
-
+
@@ -9,13 +10,15 @@
{{items.attributeName}}
-
-
-
+
+
+
- {{item.value}}
+ {{item.value}}
@@ -27,82 +30,74 @@
@confirm="dialogInputConfirm" @close="dialogClose">
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -123,28 +118,160 @@
openIndex: '',
delType: '',
showList: {},
- dialogTit: '输入分类名',
- categoryId:'',
- goodsList:[]
- // type: 'center',
+ dialogTit: '输入分类名',
+ 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: {
- },
- filters: {
- sliceMsg(val) {
- var name = ''
- if (typeof(val) == 'string') {
- let newObj = JSON.parse(val)
- for (let as in newObj) {
- name += newObj[as] + '/'
- }
- }
- return name;
- }
},
- onLoad(options) {
+ filters: {
+ sliceMsg(val) {
+ var name = ''
+ if (typeof(val) == 'string') {
+ let newObj = JSON.parse(val)
+ for (let as in newObj) {
+ name += newObj[as] + '/'
+ }
+ }
+ return name;
+ }
+ },
+ onLoad(options) {
this.categoryId = options.id
this.getGategoryList(options.id)
},
@@ -158,7 +285,7 @@
this.attrList = res1.result;
if (res1.result.length > 0) {
this.attrList.forEach((items) => {
-
+
this.tui.request(
"/app/productAttributeValue/selectByAttributeId",
"get", {
@@ -167,56 +294,56 @@
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{
- this.tui.toast(res.message)
+ }
+ setTimeout(() => {
+ this.showList = this.attrList;
+ }, 1000)
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+ },
+ //查询分类下有没有库存
+ getTypeToNum() {
+ let that = this;
+ this.tui.request("/app/stock/getlistByAttributeList", "post", {
+ categoryId: this.categoryId,
+ attributeList: this.delItems.attributeName || this.delItems.value,
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ if (res.result != '') {
+ this.goodsList = res.result
+ this.$refs.carPopup.open('bottom')
+ } else {
+ that.show = true
+ // this.tui.request("/app/productAttribute/selectByCategoryId", "POST", {
+ // categoryId: this.delItems.id
+ // }, false, true).then((res1) => {
+ // if (res1.code == 200) {
+ // if (res1.result.length > 0) {
+ // uni.showModal({
+ // title: "提示",
+ // content: "此分类已经维护了子分类,确定继续删除吗?",
+ // success: function(res2) {
+ // if (res2.confirm) {
+ // that.delItemModal()
+ // }
+ // }
+ // })
+ // } else {
+ // that.show = true
+ // }
+ // }
+ // }).catch((res) => {})
+ }
}
}).catch((res) => {})
- },
- //查询分类下有没有库存
- getTypeToNum() {
- let that = this;
- this.tui.request("/app/stock/getlistByAttributeList", "post", {
- categoryId: this.categoryId,
- attributeList:this.delItems.attributeName || this.delItems.value,
- }, false, true).then((res) => {
- if (res.code == 200) {
- if (res.result != '') {
- this.goodsList = res.result
- this.$refs.carPopup.open('bottom')
- } else {
- that.show = true
- // this.tui.request("/app/productAttribute/selectByCategoryId", "POST", {
- // categoryId: this.delItems.id
- // }, false, true).then((res1) => {
- // if (res1.code == 200) {
- // if (res1.result.length > 0) {
- // uni.showModal({
- // title: "提示",
- // content: "此分类已经维护了子分类,确定继续删除吗?",
- // success: function(res2) {
- // if (res2.confirm) {
- // that.delItemModal()
- // }
- // }
- // })
- // } else {
- // that.show = true
- // }
- // }
- // }).catch((res) => {})
- }
- }
- }).catch((res) => {})
},
// 获取属性名
getProductAttribute() {
@@ -236,178 +363,230 @@
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.tui.request("/app/productAttributeValue/selectByAttributeId", "get", {
id: item.id
}, 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))
-
+
},
inputDialogToggle(type, item, parent) {
- this.typeModel = type;
- if(type == 'edit') {
- this.inputVal = item.categoryName ;
- this.editItem = item;
- }else if ( type == 'add' || type == 'attrAdd' || type == 'attrValAdd') {
- this.inputVal = '';
- this.isOpenId = item;
- if(type == 'add') {
- this.dialogTit = '输入分类名'
- } else if(type == 'attrAdd') {
- this.dialogTit = '输入属性名'
- // this.$refs.addPopup.open()
- // return;
- } else if(type == 'attrValAdd') {
- this.dialogTit = '输入属性值'
- }
- } else if ( type == 'attrEdit') {
- this.inputVal = item.attributeName ;
- this.editItem = item;
- }
- this.$refs.inputDialog.open()
+ this.typeModel = type;
+ if (type == 'edit') {
+ this.inputVal = item.categoryName;
+ this.editItem = item;
+ } else if (type == 'add' || type == 'attrAdd' || type == 'attrValAdd') {
+ this.inputVal = '';
+ this.isOpenId = item;
+ if (type == 'add') {
+ this.dialogTit = '输入分类名'
+ } else if (type == 'attrAdd') {
+ this.$refs.addTypeDialog.open('bottom')
+ return;
+ } else if (type == 'attrValAdd') {
+ this.dialogTit = '输入属性值'
+ }
+ } else if (type == 'attrEdit') {
+ this.inputVal = item.attributeName;
+ this.editItem = item;
+ }
+ this.$refs.inputDialog.open()
},
dialogInputConfirm(e) {
- switch (this.typeModel) {
- case 'add':
-
- 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'
- })
- }
-
- }).catch((res) => {})
- break;
- case 'edit':
- this.tui.request("/app/productCategory/edit", "post", {
- categoryName: e,
- 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;
- case 'attrAdd':
- for(let i=0;i {
- if (res.code == 200) {
- this.getGategoryList()
- uni.showToast({
- title:"添加成功",
- icon: 'none'
- })
- } else {
- uni.showToast({
- title:"添加失败",
- icon: 'none'
- })
- }
- }).catch((res) => {})
- break;
- case 'attrValAdd':
- if(e == ''){
- uni.showToast({
- title:"不能为空!",
- icon: 'none'
- })
- return
- }
- this.tui.request("/app/productAttributeValue/save", "post", {
- value: e,
- attributeId: this.isOpenId
- }, false, true).then((res) => {
- if (res.code == 200) {
- this.getGategoryList()
- uni.showToast({
- title:"添加成功",
- icon: 'none'
- })
- } else {
- uni.showToast({
- 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;
- default:
- }
- this.$refs.inputClose.val=''
+ switch (this.typeModel) {
+ case 'add':
+
+ 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'
+ })
+ }
+
+ }).catch((res) => {})
+ break;
+ case 'edit':
+ this.tui.request("/app/productCategory/edit", "post", {
+ categoryName: e,
+ 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;
+ case 'attrAdd':
+ for (let i = 0; i < this.attrList.length; i++) {
+ if (this.attrList[i].attributeName == e) {
+ uni.showToast({
+ title: "请勿重复添加",
+ icon: 'none'
+ })
+ return
+ }
+ }
+ this.tui.request("/app/productAttribute/save", "post", {
+ attributeName: e,
+ categoryId: this.isOpenId
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ this.getGategoryList()
+ uni.showToast({
+ title: "添加成功",
+ icon: 'none'
+ })
+ } else {
+ uni.showToast({
+ title: "添加失败",
+ icon: 'none'
+ })
+ }
+ }).catch((res) => {})
+ break;
+ case 'attrValAdd':
+ if (e == '') {
+ uni.showToast({
+ title: "不能为空!",
+ icon: 'none'
+ })
+ return
+ }
+ this.tui.request("/app/productAttributeValue/save", "post", {
+ value: e,
+ attributeId: this.isOpenId
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ this.getGategoryList()
+ uni.showToast({
+ title: "添加成功",
+ icon: 'none'
+ })
+ } else {
+ uni.showToast({
+ 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;
+ default:
+ }
+ this.$refs.inputClose.val = ''
},
dialogClose() {
this.inputVal = '';
@@ -422,13 +601,13 @@
this.tui.request("/app/productCategory/delById", "post", {
id: this.delItems.id,
}, false, true).then((res) => {
-
+
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "删除成功",
icon: 'none'
- })
+ })
this.$refs.carPopup.close()
} else {
uni.showToast({
@@ -443,13 +622,13 @@
attributeName: this.delItems.attributeName,
id: this.delItems.id,
}, false, true).then((res) => {
-
+
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "删除成功",
icon: 'none'
- })
+ })
this.$refs.carPopup.close()
} else {
uni.showToast({
@@ -464,13 +643,13 @@
value: this.delItems.value,
id: this.delItems.id,
}, false, true).then((res) => {
-
+
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "删除成功",
icon: 'none'
- })
+ })
this.$refs.carPopup.close()
} else {
uni.showToast({
@@ -483,7 +662,7 @@
},
delItem(item, type) {
this.delType = type;
- this.delItems = item;
+ this.delItems = item;
this.getTypeToNum()
// this.show = true;
},
@@ -553,69 +732,105 @@
margin: 20rpx 0 0 20rpx;
}
- .content-low:hover {
- background: #eee;
+ .popup-content {
+ align-items: center;
+ justify-content: center;
+ padding: 15px;
+ height: 1200rpx;
+ background-color: #fff;
+ margin-bottom: 30rpx;
+ overflow: scroll;
+ }
+
+ .popup-container {
+ width: 100%;
+ background: #fff;
+ height: 50rpx;
+ }
+
+ .checkList {
+ display: flex;
+ height: 50rpx;
+ font-size: 28rpx;
+ line-height: 50rpx;
+ margin: 20rpx 0;
+ }
+
+ .checkList-box {
+ height: 50rpx;
+ width: 60%;
+ }
+
+ .popup-bottom {
+ width: 95%;
+ height: 100rpx;
+ position: fixed;
+ bottom: 0;
+ left: 2.5%;
+ display: flex;
+ z-index: 99;
+ background: #fff;
+ }
+
+ .popup-bottom-left {
+ width: 50%;
+ line-height: 80rpx;
+ }
+
+ .popup-bottom-right {
+ width: 50%;
+ line-height: 100rpx;
+ }
+
+ .bottom-btn {
+ width: 70%;
+ line-height: 35px;
+ height: 70rpx;
+ text-align: center;
+ /* margin-top: 10rpx; */
+ color: #fff;
+ font-size: 28rpx;
+ margin: 0 auto;
+ background: linear-gradient(90deg, #60F3FF, #088FEB);
+ border-radius: 70rpx;
+ }
+ .checked{
+ background: #60F3FF;
+ color: #fff;
}
- .popup-content {
+
+
+ .add-popup-content {
align-items: center;
justify-content: center;
padding: 15px;
- height: 1200rpx;
- background-color: #fff;
- margin-bottom: 30rpx;
- overflow: scroll;
- }
-
- .popup-container {
width: 100%;
- background: #fff;
- height: 50rpx;
+ height: 1300rpx;
+ background-color: #fff;
}
- .checkList {
- display: flex;
- height: 50rpx;
- font-size: 28rpx;
- line-height: 50rpx;
- margin: 20rpx 0;
+ .add-popup-title {
+ font-size: 36rpx;
+ font-weight: bold;
+ text-align: center;
+ position: relative;
}
- .checkList-box {
- height: 50rpx;
- width: 60%;
+ .add-popup-container {
+ margin-top: 20rpx;
}
- .popup-bottom {
- width: 95%;
- height: 100rpx;
- position: fixed;
- bottom: 0;
- left: 2.5%;
+ .add-popup-bottom {
display: flex;
- z-index: 99;
- background: #fff;
- }
-
- .popup-bottom-left {
- width: 50%;
+ height: 80rpx;
+ color: #fff;
line-height: 80rpx;
+ margin-top: 50rpx;
}
- .popup-bottom-right {
- width: 50%;
- line-height: 100rpx;
- }
-
- .bottom-btn {
- width: 70%;
- line-height: 35px;
- height: 70rpx;
+ .add-popup-btn {
+ flex: 1;
text-align: center;
- /* margin-top: 10rpx; */
- color: #fff;
- font-size: 28rpx;
- margin: 0 auto;
background: linear-gradient(90deg, #60F3FF, #088FEB);
- border-radius: 70rpx;
}
\ No newline at end of file
diff --git a/pages/inventory/getProductIdToList.vue b/pages/inventory/getProductIdToList.vue
index 1aacb5a..d94d057 100644
--- a/pages/inventory/getProductIdToList.vue
+++ b/pages/inventory/getProductIdToList.vue
@@ -2,8 +2,8 @@
-
- 单价:{{item.saleDetailDTOList[0].discountAmount}} 数量:{{item.productCount}} 总价:{{item.realAmount}}
+
+ 单价:{{item.saleDetailDTOList[0].discountAmount}} 数量:{{item.productCount}}
商品规格
@@ -24,7 +24,7 @@
- 采购价:{{item.purchaseDetails[0].purchasePrice?item.purchaseDetails[0].purchasePrice:'暂无'}} 总数量:{{item.purchase.totalAmount?item.purchase.totalAmount:'暂无'}} 总价:{{item.purchase.shouldPay?item.purchase.shouldPay:'暂无'}}
+ 采购价:{{item.purchaseDetails[0].purchasePrice?item.purchaseDetails[0].purchasePrice:'暂无'}} 总数量:{{item.purchase.totalAmount?item.purchase.totalAmount:'暂无'}}
商品规格
diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue
index 9ab7128..bef8b08 100644
--- a/pages/inventory/goodsList1.vue
+++ b/pages/inventory/goodsList1.vue
@@ -83,7 +83,7 @@
供应商:{{value[1].supplierName}}
改价
-
+
@@ -301,6 +301,9 @@
+
+
+
{{item.name}} 库存:{{item.productNum}}
@@ -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) {