From 764656c80807ea5d9b6ba5d4dba2c78a579c350d Mon Sep 17 00:00:00 2001
From: wangfukang <15630117759@163.com>
Date: Wed, 6 Nov 2024 08:41:35 +0800
Subject: [PATCH] 11
---
pages/index/index.vue | 2 +-
pages/inventory/goodsList1.vue | 93 ++-
pages/inventory/inventory.vue | 1220 ++++++++++++++++++--------------
pages/login/login.vue | 15 +-
4 files changed, 757 insertions(+), 573 deletions(-)
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 6b1b746..833caec 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -177,7 +177,7 @@
-
+
实收金额计算方式
@@ -1228,6 +1232,20 @@
+
+
+
+
@@ -1380,6 +1398,7 @@
voiceType:'new',
current: 0,
lunbocurrent: 4,
+ saomaotype:'0',
voiceText: ' ',
voiceText1:' ',
discCurrent: '', //折扣
@@ -1723,6 +1742,12 @@
this.oneGoodsId = id
this.$refs.returnDialog.open('bottom')
},
+ checkSaomaType(type){
+ let that = this;
+ this.saomaotype = type
+ this.$refs.saomaType.close()
+ this.scanCodeAdd()
+ },
onePecsReturnToCarList(){
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
@@ -2386,6 +2411,9 @@
}
},
+ checksaoma(){
+ this.$refs.saomaType.open()
+ },
AiHandleData() {
let that = this;
for (let i = 0; i < this.carList1.length; i++) {
@@ -3098,7 +3126,7 @@
if (this.isPlusAndMinus == false) {
for (var i = 0; i < this.temporaryList.length; i++) {
if (this.evalue.length == 0) {
- if(Number(this.allChangeNum) > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ if(Number(this.allChangeNum) > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
}else{
this.temporaryList[i].productCount = Number(this.allChangeNum)
@@ -3109,7 +3137,7 @@
} else {
for (var j = 0; j < this.evalue.length; j++) {
if (this.evalue[j] == this.temporaryList[i].name) {
- if(Number(this.allChangeNum) > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ if(Number(this.allChangeNum) > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
}else{
this.temporaryList[i].productCount = Number(this.allChangeNum)
@@ -3192,7 +3220,7 @@
if (this.temporaryList[i].productCount == undefined) {
this.temporaryList[i].productCount = 1
} else {
- if(this.temporaryList[i].productCount + 1 > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ if(this.temporaryList[i].productCount + 1 > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
}else{
this.temporaryList[i].productCount++
@@ -3204,7 +3232,7 @@
if (this.temporaryList[i].productCount == undefined) {
this.temporaryList[i].productCount = 1
} else {
- if(this.temporaryList[i].productCount + 1 > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ if(this.temporaryList[i].productCount + 1 > this.temporaryList[i].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast(this.temporaryList[i].name + "已超出可售数量",300)
}else{
this.temporaryList[i].productCount++
@@ -3625,17 +3653,8 @@
value1 += '"' + '颜色' + '":"' + data[i].value + '",'
value1 += '"' + '尺码' + '":"' + dataJ[j].value + '"'
value1 += "}"
- if(this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400'){
- for(let a = 0;a 0)){
- value.push(value1)
- this.evalue.push(name)
- }
- }
- }else{
- value.push(value1)
- this.evalue.push(name)
- }
+ value.push(value1)
+ this.evalue.push(name)
}
}
}
@@ -3780,7 +3799,7 @@
}
},
numChange(e, index) {
- if(Number(e) > this.temporaryList[index].productCount && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ if(Number(e) > this.temporaryList[index].productCount && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast("已超出可售数量",300)
}else{
this.temporaryList[index].productCount = Number(e)
@@ -3816,7 +3835,7 @@
},
mapnumChange(e, id, id1) {
let that = this;
- if(!this.carList.get(id).isNew && e > this.carList.get(id).stockLogList.get(id1).productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ if(!this.carList.get(id).isNew && e > this.carList.get(id).stockLogList.get(id1).productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast("已超出可售数量",300)
}else{
this.carList.get(id).productCount = 0
@@ -3886,7 +3905,7 @@
this.temporaryChange()
},
mapPlusNum(index) {
- if(this.temporaryList[index].productCount + 1 > this.temporaryList[index].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ if(this.temporaryList[index].productCount + 1 > this.temporaryList[index].productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast("已超出可售数量",300)
}else{
this.temporaryList[index].productCount++
@@ -3982,7 +4001,7 @@
},
onePlusNum(index, index1) {
let that = this;
- if(!this.carList.get(index).isNew && this.carList.get(index).stockLogList.get(index1).productCount + 1 > this.carList.get(index).stockLogList.get(index1).productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400')){
+ if(!this.carList.get(index).isNew && this.carList.get(index).stockLogList.get(index1).productCount + 1 > this.carList.get(index).stockLogList.get(index1).productNum && (this.shopId == '1838094297858183168' || this.shopId == '1811579958284390400' || this.shopId == '1818888277105709056')){
this.tui.toast("已超出可售数量")
}else{
this.carList.get(index).stockLogList.get(index1).productCount++
@@ -8638,18 +8657,21 @@
uni.scanCode({
success: (res) => {
if (res.scanType == "QR_CODE") { //二维码
- if(res.result.split(',').length > 2){
- that.attrBuilt = decodeURIComponent(res.result.split(',')[2].split('-')[0])+'-'+decodeURIComponent(res.result.split(',')[2].split('-')[1])
+ if(res.result.split(',').length > 2){
+ that.attrBuilt = decodeURIComponent(res.result.split(',')[2].split('-')[0])+'-'+decodeURIComponent(res.result.split(',')[2].split('-')[1])
}
let shopId = base.decode(res.result.split(',')[1])
if (shopId == uni.getStorageSync('shopId').substring('10','12')) {
that.productId = base.decode(res.result.split(',')[0])
that.toggle('bottom', base.decode(res.result.split(',')[0]));
+ setTimeout(res => {
+ that.scanCodeAdd()
+ }, 1100)
} else {
setTimeout(res => {
that.tui.toast('您的店铺中暂无该商品!')
}, 1000)
-
+
}
} else {
that.tui.request("/app/product/getByBarcode", "POST", {
@@ -8670,7 +8692,7 @@
}
}
}
-
+
} else {
that.tui.toast(res.message)
}
@@ -8678,7 +8700,14 @@
that.tui.toast(res)
})
}
-
+ uni.vibrateLong({
+ success: function () {
+ console.log('震动成功');
+ },
+ fail: function () {
+ console.log('震动失败');
+ }
+ })
},
fail: (res) => {
console.log('扫描失败',res)
@@ -10256,8 +10285,11 @@
this.tui.toast('失败了')
}
//this.getKCList(res1.result.stock)
- that.$nextTick(() => {
- let productcount1 = 1
+ that.$nextTick(() => {
+ let productcount1 = 1
+ if(that.saomaotype == '1'){
+ productcount1 = -1
+ }
let stockcount = null
if(this.pecsList.length == 1){
attr = this.pecsList[0].attributeList
@@ -10273,7 +10305,7 @@
if(that.carList.get(id).stockLogList.has(attr)){
let oldProductCount = that.carList.get(id).stockLogList.get(attr).productCount
if(oldProductCount != undefined){
- productcount1 += Number(oldProductCount)
+ productcount1 = productcount1 + Number(oldProductCount)
}
}
}
@@ -11739,6 +11771,7 @@
this.tui.request(url, "post", this.sellObj, false, false).then((res) => {
if (res.code == 200) {
+ that.saomaotype = ''
uni.showToast({
title: "开单成功",
icon: 'none'
@@ -12257,7 +12290,7 @@
this.khData = res.result.records[0]
this.khName = {
id: res.result.records[0].id,
- name: res.result.records[0].name,
+ name: res.result.records[0].name,
noEarn: res.result.records[0].noEarn,
categoryId: res.result.records[0].categoryId
}
@@ -12278,7 +12311,7 @@
this.khData = res.result
this.khName = {
id: res.result.userId,
- name: res.result.userName,
+ name: this.khName.name,
noEarn: res.result.amountOwed,
categoryId: res.result.categoryId
}
diff --git a/pages/inventory/inventory.vue b/pages/inventory/inventory.vue
index 7450e4c..ef48d3b 100644
--- a/pages/inventory/inventory.vue
+++ b/pages/inventory/inventory.vue
@@ -1,7 +1,8 @@
-
+
{{warnMsg.tailWarnCount}}
@@ -10,10 +11,10 @@
{{warnMsg.salesWeekCount}}
尾货预警
-
-
- {{total}}
- 待入库
+
+
+ {{total}}
+ 待入库
@@ -22,76 +23,87 @@
{{warnMsg.stockCount + warnMsg.minusStockCount}}
-
- 库存数
-
+
+ 库存数
+
{{type ==0?warnMsg.stockCost:'0'}}
-
- 库存成本
-
+
+ 库存成本
+
-
-
-
- 新增商品
-
-
- 更多
-
+
+
+
+ 新增商品
+
+
+ 更多
+
-
+
- {{item.categoryName}}
+ {{item.categoryName}}
-
+
款数:{{indexList[categoryIndex].count != undefined ? indexList[categoryIndex].count : 0}}
-
+
库存数:{{indexList[categoryIndex].stockCount != undefined ? indexList[categoryIndex].stockCount + indexList[categoryIndex].minusStockCount: 0}}
-
+
排序
-
-
-
-
+
+
+
+
-
- 暂无图片
+
+ 暂无图片
-
+
货号:{{item.productSn==null?'':item.productSn}}
- 名称:{{item.productName == null?'暂无':item.productName}}
+ 名称:{{item.productName == null?'暂无':item.productName}}
供应商:{{item.supplierName == null?'暂无':item.supplierName}}
下架
- 上架
-
-
+ 上架
+
+
- {{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}
+ {{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}
采购价
@@ -110,112 +122,122 @@
-
+
客户价格
-
-
-
-
- 暂无图片
-
+
+
+
+
+ 暂无图片
+
-
+
货号:{{item.productSn}}
名称:{{item.productName == null?'暂无':item.productName}}
- 供应商:{{item.supplierName == null?'暂无':item.supplierName}}
-
- 下架
- 上架
-
-
-
-
-
- {{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}
- 采购价
-
-
- {{item.wholesalePrice}}
- 批发价
-
-
- {{item.price}}
- 零售价
-
+ 供应商:{{item.supplierName == null?'暂无':item.supplierName}}
+
+ 下架
+ 上架
+
+
+
+
+
+ {{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}
+ 采购价
+
+
+ {{item.wholesalePrice}}
+ 批发价
+
+
+ {{item.price}}
+ 零售价
+
{{item.stockCount + item.minusStockCount}}
库存
-
+
-
+
客户价格
-
-
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -267,6 +289,9 @@
+
+
+
@@ -278,135 +303,238 @@
computed: mapState(['shopIndex', 'region']),
data() {
return {
+ canvasshow: false,
size: 30,
- customerCategoryList:[],
+ customerCategoryList: [],
indexList: [],
- zheng:'0',
- fu:'0',
- bigImg:[],
- swiperDotIndex:0,
+ zheng: '0',
+ canvasWidth:0,
+ canvasHeight:0,
+ fu: '0',
+ bigImg: [],
+ swiperDotIndex: 0,
// status: 'loadmore',
pageNum: 1, //分页的页码
shopList: [],
categoryId: '', //分类id
- shopId: '', //店铺id,
- type:'',
- orderSort:'',
- sort:'',
- warnMsg:[],
- goodsData:[],
- searchName:'',
- categoryIndex:0,
- windowHeight:0,
- shopList1:[],
- picture:'',
- gateType:'',
- total:0
+ shopId: '', //店铺id,
+ type: '',
+ orderSort: '',
+ sort: '',
+ warnMsg: [],
+ goodsData: [],
+ searchName: '',
+ base64: '',
+ categoryIndex: 0,
+ windowHeight: 0,
+ shopList1: [],
+ picture: '',
+ gateType: '',
+ total: 0
}
- },
- onLoad(option){
- if (option.khid != undefined) {
- uni.redirectTo({
- url: "/package1/index/downStearmList?khid=" + option.khid
- })
+ },
+ onLoad(option) {
+ if (option.khid != undefined) {
+ uni.redirectTo({
+ url: "/package1/index/downStearmList?khid=" + option.khid
+ })
}
// if(uni.getStorageSync('noReload') == true){
// uni.removeStorageSync('noReload')
- // }
- let that = this
- this.type=uni.getStorageSync('type')
- uni.getSystemInfo({
- success: function (info) {
- that.windowHeight = info.windowHeight
- }
- });
- },
- onShareAppMessage() {
- return {
- title: '查看我的推荐',
- imageUrl:this.picture,
- path: '/package1/index/downStearmList?khid=' + this.khid +'&userId=""'
- }
- },
- onReachBottom() {
- if (this.pageNum >= this.pages) return;
- // this.status = 'loading';
- this.pageNum ++;
- if(this.gateType == 'search'){
+ // }
+ let that = this
+ this.type = uni.getStorageSync('type')
+ uni.getSystemInfo({
+ success: function(info) {
+ that.windowHeight = info.windowHeight
+ }
+ });
+ },
+ onShareAppMessage() {
+ return {
+ title: '查看我的推荐',
+ imageUrl: this.picture,
+ path: '/package1/index/downStearmList?khid=' + this.khid + '&userId=""'
+ }
+ },
+ onReachBottom() {
+ if (this.pageNum >= this.pages) return;
+ // this.status = 'loading';
+ this.pageNum++;
+ if (this.gateType == 'search') {
this.getShareList('search');
- }else{
+ } else {
this.getShareList();
- }
-
+ }
+
},
onShow() {
- console.log('shopList',this.shopList)
- if(uni.getStorageSync('noReload') == true){
- this.searchName = ''
- uni.removeStorageSync('noReload')
- }else{
- this.searchName = ''
- this.getGategoryList()
- }
- this.getWarnMsg()
+ console.log('shopList', this.shopList)
+ if (uni.getStorageSync('noReload') == true) {
+ this.searchName = ''
+ uni.removeStorageSync('noReload')
+ } else {
+ this.searchName = ''
+ this.getGategoryList()
+ }
+ this.getWarnMsg()
this.getweiruku()
},
- methods: {
- lunbochange(e) {
- this.current = e.detail.current
+ methods: {
+ getUserData() {
+ let that = this;
+ this.tui.request("/order/ow/getWechatQrcode", "post", {
+ page: 'package1/index/downStearmList',
+ scene: this.khid,
+ envVersion: __wxConfig.envVersion,
+ }, false, true).then((res1) => {
+ if (res1.code == 200) {
+ let imgA = res1.result;
+ uni.downloadFile({
+ url: imgA,
+ success: (res2) => {
+ this.base64 = res2.tempFilePath
+ uni.showLoading({
+ title: '请求中...'
+ })
+ setTimeout(res3 => {
+ uni.hideLoading()
+ that.getData()
+ }, 500)
+ }
+ });
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {
+ console.log('报错', res)
+ })
+ },
+ getData() {
+ let that = this
+ uni.showLoading({
+ title: '生成中...'
+ })
+ this.canvasshow = true
+
+ //背景图
+ let imgA = this.goodsData.productPicture;
+
+ uni.getImageInfo({
+ src: imgA,
+ success: function(image) {
+ console.log(image.width);
+ console.log(image.height);
+ // 1920 1500 1920/1500 1.5 800/1.5
+ // if(image.height > 1500){
+ // that.canvasHeight = 1700
+ // that.canvasWidth = (image.width/ Number((image.height/1500).toFixed(2))).toFixed(0)
+ // }else{
+ that.canvasWidth = image.width
+ that.canvasHeight = image.height + 200
+ // }
+
+ const ctx = uni.createCanvasContext('myCanvas', this);
+ ctx.setFillStyle('#fff');
+ ctx.fillRect(0, 0, that.canvasWidth, that.canvasHeight);
+ // // 绘制第一张图片
+ ctx.drawImage(image.path, 0, 0, image.width, image.height);
+ ctx.draw()
+ // 绘制第二张图片
+ ctx.drawImage(that.base64, 25, that.canvasHeight - 175, 150, 150);
+ ctx.draw(true);
+ ctx.font = "20px 宋体";
+ // 设置字体样式
+ ctx.setFontSize(28)
+ // 设置文字颜色
+ ctx.fillStyle = '#FF5809';
+ // 绘制文字
+ ctx.fillText(uni.getStorageSync('shopName'), 200 , that.canvasHeight - 125);
+ // 设置字体样式
+ ctx.setFontSize(24)
+ // 设置文字颜色
+ ctx.fillStyle = '#000';
+ // 绘制文字
+ ctx.fillText('长按识别查看商品', 200 ,that.canvasHeight - 75);
+ ctx.draw(true)
+ setTimeout(ress => {
+ uni.canvasToTempFilePath({
+ x: 0,
+ y: 0,
+ width: that.canvasWidth,
+ height: that.canvasHeight,
+ destWidth: that.canvasWidth,
+ destHeight: that.canvasHeight,
+ canvasId: 'myCanvas',
+ success: (res3) => {
+ that.canvasshow = false
+ that.tempFilePath = res3.tempFilePath
+ uni.previewImage({
+ urls: [res3.tempFilePath]
+ })
+ uni.hideLoading()
+ }
+ });
+ }, 500)
+ }
+ });
+
+ },
+ lunbochange(e) {
+ this.current = e.detail.current
},
//排序
- goodsListSort(){
+ goodsListSort() {
//sort空 stockCount desc asc
this.pageNum = 1
this.shopList1 = []
this.shopList = []
this.sort = 'stockCount'
- if(this.orderSort == ''){
+ if (this.orderSort == '') {
this.orderSort = 'asc'
- }else if(this.orderSort == 'asc'){
+ } else if (this.orderSort == 'asc') {
this.orderSort = 'desc'
- }else if(this.orderSort == 'desc'){
+ } else if (this.orderSort == 'desc') {
this.orderSort = 'asc'
}
this.getShareList()
- },
- largeImg(img) {
- if(img.productPicture == null &&img.productPictures == null ){
- this.tui.toast("暂无可展示的图片",1000)
- return
- }
- this.bigImg = []
- if(img.productPicture != null){
- let data = {
- productPicture:img.productPicture
- }
- this.bigImg.push(data)
- }
- if(img.productPictures != null){
- for(let i=0;i {
- if (res.code == 200) {
- this.khid = res.result.id
- } else {
- this.tui.toast(res.message)
- }
- }).catch((res) => {})
- this.checkPayData = type
- this.$refs.sharePriceDialog.close()
- this.$refs.sharePopup.open('bottom')
},
- seeStockCount(zheng,fu){
+ largeImg(img) {
+ if (img.productPicture == null && img.productPictures == null) {
+ this.tui.toast("暂无可展示的图片", 1000)
+ return
+ }
+ this.bigImg = []
+ if (img.productPicture != null) {
+ let data = {
+ productPicture: img.productPicture
+ }
+ this.bigImg.push(data)
+ }
+ if (img.productPictures != null) {
+ for (let i = 0; i < img.productPictures.length; i++) {
+ this.bigImg.push(img.productPictures[i])
+ }
+ }
+ this.$refs.imgPopup.open()
+ },
+ checkPay(type) {
+ this.tui.request("/app/productShare/save", "POST", {
+ shareType: '2',
+ shareProductId: [this.goodsData.id],
+ priceType: type
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ this.khid = res.result.id
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+ this.checkPayData = type
+ this.$refs.sharePriceDialog.close()
+ this.$refs.sharePopup.open('bottom')
+ },
+ seeStockCount(zheng, fu) {
this.zheng = zheng;
this.fu = fu;
this.$refs.showPopup.open()
@@ -424,269 +552,271 @@
} else {
this.indexList[i].parentId = false
}
- }
- this.categoryId = this.indexList[this.categoryIndex].id
- this.pageNum = 1
- this.searchName = ""
- this.shopList1 = []
+ }
+ this.categoryId = this.indexList[this.categoryIndex].id
+ this.pageNum = 1
+ this.searchName = ""
+ this.shopList1 = []
this.shopList = []
this.getShareList();
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
- },
- //获取库存预警信息
- getWarnMsg(){
- this.tui.request("/app/stock/getShopStock", "POST", {}, false, false).then((res) => {
- if (res.code == 200) {
- this.warnMsg = res.result
- } else {
- this.tui.toast(res.message)
- }
- }).catch((res) => {})
+ },
+ //获取库存预警信息
+ getWarnMsg() {
+ this.tui.request("/app/stock/getShopStock", "POST", {}, false, false).then((res) => {
+ if (res.code == 200) {
+ this.warnMsg = res.result
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
},
//点击左侧菜单切换
- clickLeftBtn(index) {
- uni.removeStorageSync('noReload')
- for (var i = 0; i < this.indexList.length; i++) {
- if (i == index) {
- this.indexList[i].parentId = true
- } else {
- this.indexList[i].parentId = false
- }
+ clickLeftBtn(index) {
+ uni.removeStorageSync('noReload')
+ for (var i = 0; i < this.indexList.length; i++) {
+ if (i == index) {
+ this.indexList[i].parentId = true
+ } else {
+ this.indexList[i].parentId = false
+ }
}
- this.categoryIndex = index
- this.categoryId = this.indexList[index].id
- this.pageNum = 1
+ this.categoryIndex = index
+ this.categoryId = this.indexList[index].id
+ this.pageNum = 1
this.searchName = ""
this.orderSort = ""
- this.sort = ''
- this.shopList1 = []
- this.shopList = []
+ this.sort = ''
+ this.shopList1 = []
+ this.shopList = []
this.getShareList()
- },
- //待入库
- goRuku(){
- uni.navigateTo({
- url: '/package1/index/waitStorage?inStorageStatus=0'
- })
- },
- getweiruku(){
- this.tui.request("/app/purchase/list", "POST", {
- inStorageStatus: 0
- }, false, false).then((res) => {
- this.status = 'nomore';
- if (res.code == 200) {
- this.total = res.result.total
-
- } else {
- this.tui.toast(res.message)
- }
- })
+ },
+ //待入库
+ goRuku() {
+ uni.navigateTo({
+ url: '/package1/index/waitStorage?inStorageStatus=0'
+ })
+ },
+ getweiruku() {
+ this.tui.request("/app/purchase/list", "POST", {
+ inStorageStatus: 0
+ }, false, false).then((res) => {
+ this.status = 'nomore';
+ if (res.code == 200) {
+ this.total = res.result.total
+
+ } else {
+ this.tui.toast(res.message)
+ }
+ })
},
//库存详情
- goDetail(item) {
- uni.setStorageSync('noReload',true)
+ goDetail(item) {
+ uni.setStorageSync('noReload', true)
uni.navigateTo({
url: '/package1/inventory/inventoryDetail?item=' + JSON.stringify(item)
})
- },
- goWarnList(){
- uni.navigateTo({
- url: '/package1/inventory/inventoryWarn'
- })
- },
- clickModel(type){
- if(type="num"){
- this.tui.toast("商品规格库存数为负数,则该规格库存数不计入库存总数中")
- }else{
- this.tui.toast("商品规格库存数为负数,则该规格的库存成本不计入总库存成本")
- }
},
- seeCustomCategory(item){
- if(item == null || item == ''){
- this.tui.toast("暂无客户分类价格",300)
- }else{
+ goWarnList() {
+ uni.navigateTo({
+ url: '/package1/inventory/inventoryWarn'
+ })
+ },
+ clickModel(type) {
+ if (type = "num") {
+ this.tui.toast("商品规格库存数为负数,则该规格库存数不计入库存总数中")
+ } else {
+ this.tui.toast("商品规格库存数为负数,则该规格的库存成本不计入总库存成本")
+ }
+ },
+ seeCustomCategory(item) {
+ if (item == null || item == '') {
+ this.tui.toast("暂无客户分类价格", 300)
+ } else {
this.customerCategoryList = JSON.parse(item)
- if(Array.isArray(this.customerCategoryList)){
+ if (Array.isArray(this.customerCategoryList)) {
this.$refs.customPopup.open()
- }else{
- this.tui.toast("暂无客户分类价格",300)
+ } else {
+ this.tui.toast("暂无客户分类价格", 300)
}
}
-
+
},
//点击分类获取商品列表
- getShareList(type) {
- uni.showLoading({
- title:'加载中...',
- mask:true
- })
- let data = {}
- if(type=='search'){
- this.gateType = 'search'
- data = {
- categoryId: "",
- searchStr: this.searchName,
- pageNum: this.pageNum,
+ getShareList(type) {
+ uni.showLoading({
+ title: '加载中...',
+ mask: true
+ })
+ let data = {}
+ if (type == 'search') {
+ this.gateType = 'search'
+ data = {
+ categoryId: "",
+ searchStr: this.searchName,
+ pageNum: this.pageNum,
pageSize: '10',
- sort:"",
- order:""
- }
- }else{
- this.gateType = ''
- data = {
- categoryId: this.categoryId,
- searchStr: this.searchName,
- pageNum: this.pageNum,
+ sort: "",
+ order: ""
+ }
+ } else {
+ this.gateType = ''
+ data = {
+ categoryId: this.categoryId,
+ searchStr: this.searchName,
+ pageNum: this.pageNum,
pageSize: '10',
- sort:this.sort,
- order:this.orderSort
- }
- }
+ sort: this.sort,
+ order: this.orderSort
+ }
+ }
this.status = 'loading';
this.tui.request("/app/product/getShareList", "POST", data, false, false).then((res) => {
- if (res.code == 200) {
- if(type=='search'){
- this.shopList = []
- this.status = 'nomore';
- if (this.pages == 1) {
- this.shopList1 = res.result.records
- } else {
- this.shopList1 = [...this.shopList1, ...res.result.records]
- }
- this.pages = res.result.pages
- }else{
- this.shopList1 = []
- this.status = 'nomore';
- if (this.pages == 1) {
- this.shopList = res.result.records
- } else {
- this.shopList = [...this.shopList, ...res.result.records]
- }
- this.pages = res.result.pages
+ if (res.code == 200) {
+ if (type == 'search') {
+ this.shopList = []
+ this.status = 'nomore';
+ if (this.pages == 1) {
+ this.shopList1 = res.result.records
+ } else {
+ this.shopList1 = [...this.shopList1, ...res.result.records]
+ }
+ this.pages = res.result.pages
+ } else {
+ this.shopList1 = []
+ this.status = 'nomore';
+ if (this.pages == 1) {
+ this.shopList = res.result.records
+ } else {
+ this.shopList = [...this.shopList, ...res.result.records]
+ }
+ this.pages = res.result.pages
}
} else {
this.tui.toast(res.message)
}
- }).catch((res) => {})
+ }).catch((res) => {})
uni.hideLoading()
- },
- oneShare(item){
- this.goodsData = item
- this.picture = (item.productPicture == null || item.productPicture == "") ?'https://jewel-shop.oss-cn-beijing.aliyuncs.com/70c3d9a274ff4feeb6df0bcb8be0f733.jpg':item.productPicture
- this.$refs.sharePriceDialog.open()
+ },
+ oneShare(item) {
+ this.goodsData = item
+ this.picture = (item.productPicture == null || item.productPicture == "") ?
+ 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/70c3d9a274ff4feeb6df0bcb8be0f733.jpg' : item
+ .productPicture
+ this.$refs.sharePriceDialog.open()
},
//商品上下架
- upDown(type, data) {
- let that = this,
+ upDown(type, data) {
+ let that = this,
title = "确定将此款商品" + (type == 0 ? "下架" : "上架") + "吗?"
uni.showModal({
title: "提示",
content: title,
- success: function(res) {
- if(res.confirm){
- that.pageNum = 1
- that.searchName = ""
- that.shopList1 = []
- that.shopList = []
- if (type == 0) { //下架
- that.tui.request("/app/product/down", "POST", {
- id: data.id
- }, false, true).then((res) => {
- if (res.code == 200) {
- that.tui.toast("下架成功")
- } else {
- that.tui.toast(res.message)
- }
- that.categoryId = data.categoryId
- that.getShareList()
- }).catch((res) => {})
- } else { //上架
- that.tui.request("/app/product/up", "POST", {
- id: data.id
- }, false, true).then((res) => {
- if (res.code == 200) {
- that.tui.toast("上架成功")
- } else {
- that.tui.toast(res.message)
- }
- that.categoryId = data.categoryId
- that.getShareList()
- }).catch((res) => {})
- }
+ success: function(res) {
+ if (res.confirm) {
+ that.pageNum = 1
+ that.searchName = ""
+ that.shopList1 = []
+ that.shopList = []
+ if (type == 0) { //下架
+ that.tui.request("/app/product/down", "POST", {
+ id: data.id
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ that.tui.toast("下架成功")
+ } else {
+ that.tui.toast(res.message)
+ }
+ that.categoryId = data.categoryId
+ that.getShareList()
+ }).catch((res) => {})
+ } else { //上架
+ that.tui.request("/app/product/up", "POST", {
+ id: data.id
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ that.tui.toast("上架成功")
+ } else {
+ that.tui.toast(res.message)
+ }
+ that.categoryId = data.categoryId
+ that.getShareList()
+ }).catch((res) => {})
+ }
}
}
})
- },
- //搜索接口
- search(e){
- if(e.value == ''){
+ },
+ //搜索接口
+ search(e) {
+ if (e.value == '') {
this.pageNum = 1
this.shopList1 = []
- this.shopList = []
- this.searchName = ""
- this.getShareList()
- }else{
+ this.shopList = []
+ this.searchName = ""
+ this.getShareList()
+ } else {
this.pageNum = 1
this.shopList1 = []
- this.shopList = []
- this.searchName = e.value
- this.getShareList('search')
-
- }
- },
- //清空搜索条件
- clearSearch(){
+ this.shopList = []
+ this.searchName = e.value
+ this.getShareList('search')
+
+ }
+ },
+ //清空搜索条件
+ clearSearch() {
this.pageNum = 1
this.shopList1 = []
this.shopList = []
this.orderSort = ''
- this.sort = ''
- this.searchName = ''
- this.getShareList()
+ this.sort = ''
+ this.searchName = ''
+ this.getShareList()
},
//点击头部 更多 和 新增入库 按钮
onGridClick(target) {
if (target == '0') {
uni.navigateTo({
url: '/package1/inventory/gategory'
- })
+ })
this.$refs.payDialog.close()
- } else if (target == '1') {
- // this.$refs.popup.open('bottom')
- uni.navigateTo({
- url: '/pages/inventory/addinventory'
+ } else if (target == '1') {
+ // this.$refs.popup.open('bottom')
+ uni.navigateTo({
+ url: '/pages/inventory/addinventory'
})
-
+
} else if (target == '2') {
uni.navigateTo({
url: "/package1/inventory/addGoods"
- })
+ })
+ this.$refs.payDialog.close()
+ } else if (target == '3') {
+ this.$refs.payDialog.open('center')
+ } else if (target == '4') {
+ uni.navigateTo({
+ url: "/package1/inventory/batchPrint"
+ })
this.$refs.payDialog.close()
- }else if(target == '3'){
- this.$refs.payDialog.open('center')
- }else if(target == '4'){
- uni.navigateTo({
- url: "/package1/inventory/batchPrint"
- })
- this.$refs.payDialog.close()
- }else if(target == '5'){
+ } else if (target == '5') {
uni.navigateTo({
url: "/package1/inventory/goodsDelisting"
})
this.$refs.payDialog.close()
- }else if(target == '7'){
+ } else if (target == '7') {
uni.navigateTo({
url: "/package1/index/labelTemplate"
})
this.$refs.payDialog.close()
- }else{
- uni.navigateTo({
- url: "/package1/inventory/goodsDelete"
- })
- this.$refs.payDialog.close()
+ } else {
+ uni.navigateTo({
+ url: "/package1/inventory/goodsDelete"
+ })
+ this.$refs.payDialog.close()
}
}
}
@@ -695,11 +825,11 @@