wangfukang 3 years ago
parent
commit
3d0f5f5a9e
  1. 125
      pages/billing/changeGoods1.vue
  2. 2
      pages/index/addHangOrder.vue
  3. 37
      pages/index/downStearmList.vue
  4. 5
      pages/index/downstream.vue
  5. 104
      pages/index/orderDetail.vue
  6. 4
      pages/index/peopleList.vue
  7. 100
      pages/inventory/AIInventory.vue
  8. 94
      pages/inventory/addinventory.vue
  9. 112
      pages/inventory/changeGoods1.vue
  10. 197
      pages/inventory/goodsList1.vue
  11. 96
      pages/inventory/inventory.vue
  12. 191
      pages/inventory/inventoryDetail.vue
  13. 17
      pages/login/login.vue

125
pages/billing/changeGoods1.vue

@ -2,11 +2,11 @@
<view class="page1"> <view class="page1">
<view class="title-box"> <view class="title-box">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none" <uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none"
@confirm="search" /> @confirm="search" @blur="search" @clear="clearSearch" />
</view> </view>
<view class="content-box" :style="{height:height - 240 +'rpx'}"> <view class="content-box" :style="{height:height - 240 +'rpx'}">
<view class="content-left"> <view class="content-left">
<view class="left-box" v-for="(item, index) in indexList" :key="index" <view class="left-box" v-if="gateType == ''" v-for="(item, index) in indexList" :key="index"
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)"> :class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;" <text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;"
:class="item.parentId ? 'red' :''">{{item.categoryName}}</text> :class="item.parentId ? 'red' :''">{{item.categoryName}}</text>
@ -42,6 +42,36 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<view class="right-box" v-for="(item,index) in shopList1" :key="index" @tap="toggle('bottom',item)">
<!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 -->
<view class="shop-mask" v-if="item.delFlag == 0 || item.purchasePrice==null || item.inStorageStatus == 0" @tap.stop="clickMask"></view>
<view class="box-left">
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="box-right">
<view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price">
<view class="price-box" v-if="storageType== 0">
<text>{{item.inStorageStatus==0?'待入库':item.purchasePrice == null ?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -104,7 +134,7 @@
<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">
<text style="width: 250rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text> <text style="width: 250rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">{{item.productNum}}</text>
</view> </view>
<uni-number-box max="100000" v-model="item.productCount" @change="temporaryChange" /> <uni-number-box max="100000" v-model="item.productCount" @change="temporaryChange" />
</view> </view>
@ -177,7 +207,8 @@
return { return {
indexList: [], indexList: [],
pageNum: 1, //分页的页码 pageNum: 1, //分页的页码
shopList: [], shopList: [],
shopList1:[],
info: 0, info: 0,
categoryId: '', //分类id categoryId: '', //分类id
searchName: '', //搜索框输入值 searchName: '', //搜索框输入值
@ -207,7 +238,8 @@
oldTemList:[], oldTemList:[],
goodsList:[], goodsList:[],
newTemList:[], newTemList:[],
dataObj :new Map() dataObj :new Map(),
gateType:''
} }
}, },
filters: { filters: {
@ -249,7 +281,7 @@
} }
} }
this.categoryId = this.indexList[0].id this.categoryId = this.indexList[0].id
this.getShareList(this.indexList[0].id); this.getShareList();
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
@ -330,7 +362,6 @@
} }
var resultList = [] var resultList = []
if(jishuqi == this.goodsList.length){ if(jishuqi == this.goodsList.length){
resultList = this.combination(this.goodsList); resultList = this.combination(this.goodsList);
} }
var evalue = [] var evalue = []
@ -457,27 +488,60 @@
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
},
//顶部搜索框
search(e) {
if(e.value == ''){
this.searchName = ""
this.getShareList()
}else{
this.searchName = e.value
this.getShareList('search')
}
},
//清空搜索条件
clearSearch(){
this.searchName = ''
this.getShareList()
}, },
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(type) {
this.tui.request("/app/product/getShareList", "POST", { let data = {}
categoryId: this.categoryId, if(type=='search'){
searchStr: this.searchName, this.gateType = 'search'
pageNum: this.pageNum, data = {
pageSize: '10' categoryId: "",
}, false, false).then((res) => { searchStr: this.searchName,
if (res.code == 200) { pageNum: this.pageNum,
pageSize: '100'
this.shopList = res.result.records }
} else { }else{
this.tui.toast(res.message) this.gateType = ''
} data = {
categoryId: this.categoryId,
searchStr: this.searchName,
pageNum: this.pageNum,
pageSize: '100'
}
}
this.tui.request("/app/product/getShareList", "POST", data, false, false).then((res) => {
if (res.code == 200) {
if(type=='search'){
this.shopList = []
this.shopList1 = res.result.records
}else{
this.shopList1 = []
this.shopList = res.result.records
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {}) }).catch((res) => {})
}, },
change() { change() {
this.oldTemList = []
}, },
//
carChange(e, index, index1) { carChange(e, index, index1) {
this.carNum = 0 this.carNum = 0
for (let i = 0; i < this.carList.length; i++) { for (let i = 0; i < this.carList.length; i++) {
@ -569,9 +633,7 @@
value: valueObj value: valueObj
}) })
} }
console.log(that.dataObj)
this.goodsDetail.attributeList = newArr; this.goodsDetail.attributeList = newArr;
console.log('看看看看',this.goodsDetail.attributeList)
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
let oldCheck = false let oldCheck = false
let oldValue = [] let oldValue = []
@ -597,7 +659,6 @@
oldCheck = false oldCheck = false
oldValue = [] oldValue = []
} }
console.log(this.goodsList)
} }
} else { } else {
@ -621,11 +682,7 @@
uni.hideLoading(); uni.hideLoading();
}, 200) }, 200)
}, },
//顶部搜索框
search(res) {
this.searchName = res.value
this.getShareList()
},
//未入库遮罩 //未入库遮罩
clickMask() { clickMask() {
uni.showToast({ uni.showToast({
@ -643,7 +700,7 @@
} }
} }
this.categoryId = this.indexList[index].id this.categoryId = this.indexList[index].id
this.getShareList(this.indexList[index].id) this.getShareList()
}, },
//临时改价 //临时改价
changePrice(val) { changePrice(val) {
@ -658,7 +715,8 @@
let data = { let data = {
id: this.goodsDetail.id, id: this.goodsDetail.id,
price: this.zPrice, price: this.zPrice,
num: this.zNum, num: this.zNum,
categoryId:this.goodsDetail.categoryId,
productName: this.goodsDetail.productName, productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn, productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture, productPicture: this.goodsDetail.productPicture,
@ -691,7 +749,8 @@
} }
} }
this.temporaryList = [] this.temporaryList = []
this.oldTemList = []
this.purchasePrice = '' this.purchasePrice = ''
this.zPrice = '' this.zPrice = ''
this.zNum = '' this.zNum = ''

2
pages/index/addHangOrder.vue

@ -319,7 +319,7 @@
}else if(that.voiceText == null){ }else if(that.voiceText == null){
that.voiceText = res.result that.voiceText = res.result
}else{ }else{
res.result = '\n' + res.result res.result = ' ' + res.result
that.voiceText += res.result that.voiceText += res.result
} }
} }

37
pages/index/downStearmList.vue

@ -2,7 +2,7 @@
<view class="page1"> <view class="page1">
<view class="title-box"> <view class="title-box">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称/货号" cancelButton="none" <uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称/货号" cancelButton="none"
@confirm="search" /> @confirm="search" @blur="search" @clear="clearSearch" />
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="content-right"> <view class="content-right">
@ -146,10 +146,9 @@
</view> </view>
</view> </view>
<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" :key="index1">
<view class="checkList"> <view class="checkList">
<view style="margin-right:5%;" @tap="delShopSpec(item.productId,item1.attributeList)" <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">
@ -407,9 +406,16 @@
}).catch((res) => {}) }).catch((res) => {})
}, },
//顶部搜索框 //顶部搜索框
search(res) { search(res) {
this.pages = 1
this.searchName = res.value this.searchName = res.value
this.getShareList() this.getShareList()
},
//清空搜索条件
clearSearch(){
this.pages = 1
this.searchName = ''
this.getShareList()
}, },
inputDialogToggle() { inputDialogToggle() {
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
@ -505,24 +511,6 @@
delCarData(index) { delCarData(index) {
this.temporaryList.splice(index, 1); this.temporaryList.splice(index, 1);
this.temporaryChange() 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) {
@ -611,7 +599,8 @@
}, },
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {
this.status = 'loading'; this.status = 'loading';
// this.shopList = []
this.tui.request("/app/productShare/getShareList", "POST", { this.tui.request("/app/productShare/getShareList", "POST", {
searchStr: this.searchName, searchStr: this.searchName,
id: this.khid, id: this.khid,

5
pages/index/downstream.vue

@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<view class="formBox"> <view class="formBox">
<u-alert description="点击可查看对应每笔入库单" type="primary"></u-alert> <u-alert description="点击可查看对应每笔销售单" type="primary"></u-alert>
<view class="swipe-action"> <view class="swipe-action">
<view class="swipe-action__content" @tap="onItemClick(item)" v-for="(item,index) in list" :key="index"> <view class="swipe-action__content" @tap="onItemClick(item)" v-for="(item,index) in list" :key="index">
<view class="swipe-action__content__left"> <view class="swipe-action__content__left">
@ -9,7 +9,8 @@
</view> </view>
<view class="swipe-action__content__right"> <view class="swipe-action__content__right">
<view class="swipe-action__content__right__text">欠款总金额:</view> <view class="swipe-action__content__right__text">欠款总金额:</view>
<view class="swipe-action__content__right__money">{{ item.no_earn == null ?'暂无':item.no_earn }} <view class="swipe-action__content__right__money">
{{ item.no_earn == null ?'暂无':item.no_earn }}
</view> </view>
</view> </view>
</view> </view>

104
pages/index/orderDetail.vue

@ -1,11 +1,13 @@
<template> <template>
<view class="container"> <view class="container">
<view v-if="sales.userName !='散客'"> <view v-if="sales.userName !='散客'">
<uni-card :title="sales.userName == null ?'暂无':sales.userName+'('+order.phone+')'" <uni-card :title="sales.userName == null ?'暂无':sales.userName+'('+order.phone+')'">
thumbnail="/static/images/dingdan/dd0.png">
<view class="uni-body" v-if="sales.province != null"> <view class="uni-body" v-if="sales.province != null">
{{sales.province + sales.area + sales.city + sales.receiveAddress}} </view> {{sales.province + sales.city + sales.area + sales.receiveAddress}} </view>
</uni-card> </uni-card>
<button open-type="share" style="font-size: 22rpx;position: absolute;top: 50rpx;right: 70rpx;background: blue;color: #fff;width: 100rpx;height: 50rpx;text-align: center;line-height: 50rpx;border-radius: 7px;">
分享
</button>
</view> </view>
<view v-else> <view v-else>
<uni-card :title="sales.userName == null ?'暂无':sales.userName" <uni-card :title="sales.userName == null ?'暂无':sales.userName"
@ -254,9 +256,9 @@
<view class="tui-btn-mr" v-if="sales.status != 6 && sales.status != 2"> <view class="tui-btn-mr" v-if="sales.status != 6 && sales.status != 2">
<kk-printer ref="kkprinter" :bufferData="bufferData" :defaultText="'打印小票'" @onPrintSmall="onPrintSmall"></kk-printer> <kk-printer ref="kkprinter" :bufferData="bufferData" :defaultText="'打印小票'" @onPrintSmall="onPrintSmall"></kk-printer>
</view> </view>
<view class="tui-btn-mr" v-if="sales.status == 0 || sales.status == 1" @click="cancelOrder('qxdd')">取消订单</view> <view class="tui-btn-mr" v-if="sales.status == '0' || sales.status == '1'" @click="cancelOrder('qxdd')">取消订单</view>
<view class="tui-btn-mr" v-if="sales.status == '0' || sales.status == '1' || sales.status == '00' || sales.status == '01'" @click="cancelOrder('qxps')">取消配送</view> <view class="tui-btn-mr" v-if="sales.status == '0' || sales.status == '1' || sales.status == '00' || sales.status == '01'" @click="cancelOrder('qxps')">取消配送</view>
<view class="tui-btn-mr" v-if="sales.status == 4" @click="returnGoods">{{ !isReturn ? '退货' : '确认退货'}}</view> <view class="tui-btn-mr" v-if="sales.status == '4'" @click="returnGoods">{{ !isReturn ? '退货' : '确认退货'}}</view>
<view class="tui-btn-mr" @tap="inputDialogToggle()" v-if="sales.status != 6 && !editNoPrice && sales.status != 2 && sales.noEarn >0">回款</view> <view class="tui-btn-mr" @tap="inputDialogToggle()" v-if="sales.status != 6 && !editNoPrice && sales.status != 2 && sales.noEarn >0">回款</view>
</view> </view>
<!-- 回款金额输入框 --> <!-- 回款金额输入框 -->
@ -319,7 +321,8 @@
changeA: '', changeA: '',
sAmout: 0, sAmout: 0,
yNum: 150, yNum: 150,
printTotal:1040, printTotal:1040,
zReturnNum:""
} }
}, },
components: { components: {
@ -362,19 +365,22 @@
return 0 return 0
} }
} }
},
onShareAppMessage() {
return {
title: '查看采购单详情',
imageUrl:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/abdc5c897c4f4fe198b74091a708030b.jpg',
path: '/pages/login/login?saleId=' + this.saleId + '&userId=' + this.order.id
}
}, },
onShow() { onShow() {
// 初始化蓝牙模块 // 初始化蓝牙模块
wx.openBluetoothAdapter({mode: 'central'}) wx.openBluetoothAdapter({mode: 'central'})
this.lbgName = JSON.parse(JSON.stringify(this.lbgName)) this.lbgName = JSON.parse(JSON.stringify(this.lbgName))
this.type = uni.getStorageSync('type') this.type = uni.getStorageSync('type')
// 初始化蓝牙模块
wx.openBluetoothAdapter({ //111
mode: 'central',
success: (res2) => {}
})
}, },
onLoad(option) { onLoad(option) {
this.saleId = option.id
if (option.id != null && option.id != undefined && option.id != "") { if (option.id != null && option.id != undefined && option.id != "") {
if (option.type == 'gys') { if (option.type == 'gys') {
this.type = option.type; this.type = option.type;
@ -758,25 +764,29 @@
i].stockLogList1[m].productCount) i].stockLogList1[m].productCount)
} }
} }
} }
for (let i = 0; i < that.list.length; i++) { this.zReturnNum = 0
for (let z = 0; z < that.list[i].stockLogList1 this.$nextTick(()=>{
.length; z++) { for (let i = 0; i < that.list.length; i++) {
if (returnDat.has(that.list[i].productId + '-' + for (let z = 0; z < that.list[i].stockLogList1.length; z++) {
that.list[i].stockLogList1[z].attributeList
) == true) { that.zReturnNum += that.list[i].stockLogList1[z].productCount
that.list[i].stockLogList1[z].maxNum = that if (returnDat.has(that.list[i].productId + '-' + that.list[i].stockLogList1[z].attributeList) == true) {
.list[i].stockLogList1[z].productCount - that.list[i].stockLogList1[z].maxNum = that.list[i].stockLogList1[z].productCount -
returnDat.get(that.list[i].productId + returnDat.get(that.list[i].productId + '-' + that.list[i].stockLogList1[z].attributeList)
'-' + that.list[i].stockLogList1[z] }else{
.attributeList) that.list[i].stockLogList1[z].maxNum = that.list[i].stockLogList1[z]
.productCount
}else{ }
that.list[i].stockLogList1[z].maxNum = that.list[i].stockLogList1[z] }
.productCount }
}
} })
} console.log(returnDat);
returnDat.forEach(function(value, key) {
that.zReturnNum -= value
})
console.log('退货',that.zReturnNum)
} }
}).catch((res) => {}) }).catch((res) => {})
}) })
@ -808,9 +818,13 @@
}, },
//调用退货接口 //调用退货接口
sureReturn() { sureReturn() {
uni.showLoading({ // uni.showLoading({
title: '加载中...' // title: '加载中...'
}) // })
if(this.sales.productCount - this.zReturnNum == 0){
this.tui.toast("已经超过最大退货数量")
return
}
if (this.radio1 == 0 && this.changeA == '') { if (this.radio1 == 0 && this.changeA == '') {
this.tui.toast("请输入取货地址") this.tui.toast("请输入取货地址")
return return
@ -820,14 +834,22 @@
return return
} }
let returnNum = 0 let returnNum = 0
if(this.$refs.returnClose.val > this.inventoryList[0].realAmount - returnNum){
this.tui.toast('退货金额不能超出可退货金额')
return
}
for(let i=0;i<this.inventoryList.length;i++){ for(let i=0;i<this.inventoryList.length;i++){
returnNum += this.inventoryList[i].totalAmount returnNum += this.inventoryList[i].totalAmount
} }
if(this.inventoryList == ''){
if(this.$refs.returnClose.val > this.sales.realAmount){
this.tui.toast('退货金额不能超出可退货金额')
return
}
}else{
if(this.$refs.returnClose.val > this.inventoryList[0].realAmount - returnNum){
this.tui.toast('退货金额不能超出可退货金额')
return
}
}
for (var i = 0; i < this.list.length; i++) { for (var i = 0; i < this.list.length; i++) {
this.list[i].stockLogList = [] this.list[i].stockLogList = []
for (var m = 0; m < this.list[i].stockLogList1.length; m++) { for (var m = 0; m < this.list[i].stockLogList1.length; m++) {
@ -836,7 +858,7 @@
} }
} }
} }
console.log(this.list) console.log('list',this.list)
for (var i = 0; i < this.list.length; i++) { for (var i = 0; i < this.list.length; i++) {
if(this.list[i].stockLogList.length != 0){ if(this.list[i].stockLogList.length != 0){
for (var m = 0; m < this.list[i].stockLogList.length; m++) { for (var m = 0; m < this.list[i].stockLogList.length; m++) {

4
pages/index/peopleList.vue

@ -102,11 +102,11 @@
<text style="line-height: 75rpx;" v-if="item.workerName">{{item.workerName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text> <text style="line-height: 75rpx;" v-if="item.workerName">{{item.workerName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
</view> </view>
<view class="standard-box" @tap.stop="toggle('center',item)"> <view class="standard-box" @tap.stop="toggle('center',item)">
<view class=""> <view class="" v-if="popleType !='kdyName' && popleType !='lbgName'">
<text style="padding-left:40rpx;">收费标准</text> <text style="padding-left:40rpx;">收费标准</text>
<uni-icons type="info" color='#088FEB' size="16" style="line-height: 75rpx;"></uni-icons> <uni-icons type="info" color='#088FEB' size="16" style="line-height: 75rpx;"></uni-icons>
</view> </view>
<view class="phone-btn" @tap.stop="clickPhone(item.mobile)" v-if="popleType != 'kdName'">拨打电话</view> <view class="phone-btn" :style="{'line-height':(popleType !='kdyName' && popleType !='lbgName')?'':'80rpx'}" @tap.stop="clickPhone(item.mobile)" v-if="popleType != 'kdName'">拨打电话</view>
</view> </view>
<!-- <view style="position: absolute;bottom: 0;left: 40rpx;" v-if="popleType == 'fcName' || popleType == 'lbgName' || popleType == 'wlName'"> <!-- <view style="position: absolute;bottom: 0;left: 40rpx;" v-if="popleType == 'fcName' || popleType == 'lbgName' || popleType == 'wlName'">
<text style="line-height: 45rpx;color:red;font-size: 24rpx;" v-if="item.rebateAmount">本单返佣{{item.rebateAmount}}元</text> <text style="line-height: 45rpx;color:red;font-size: 24rpx;" v-if="item.rebateAmount">本单返佣{{item.rebateAmount}}元</text>

100
pages/inventory/AIInventory.vue

@ -76,7 +76,12 @@
<view @tap.stop="delShopSpec(value[0],values[0])"> <view @tap.stop="delShopSpec(value[0],values[0])">
<uni-icons color="red" type="minus" size="26"></uni-icons> <uni-icons color="red" type="minus" size="26"></uni-icons>
</view> </view>
<text @tap="checkSpec('颜色',value[0],values[0],numData(values[0])[0])">{{numData(values[0])[0]}}</text><text @tap="checkSpec('尺码',value[0],values[0],numData(values[0])[1])">{{numData(values[0])[1]}}</text> <text @tap="checkSpec('颜色',value[0],values[0],numData(values[0])[0])">
{{numData(values[0])[0]}}
</text>
<text @tap="checkSpec('尺码',value[0],values[0],numData(values[0])[1])">
{{numData(values[0])[1]}}
</text>
<!-- <text style="color: red;">单价:¥{{item.price}}</text> --> <!-- <text style="color: red;">单价:¥{{item.price}}</text> -->
<view style="text-align: left;padding-left: 5px;width:40%;display: flex;"><uni-number-box <view style="text-align: left;padding-left: 5px;width:40%;display: flex;"><uni-number-box
max="100000" style="margin-top:16rpx;" v-model="values[1].productCount" max="100000" style="margin-top:16rpx;" v-model="values[1].productCount"
@ -351,20 +356,41 @@
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}) })
let that = this; let that = this,
isTrue = false
if(this.merge ==1){ if(this.merge ==1){
this.$refs.mergePopup.close(); this.$refs.mergePopup.close();
this.carList.get(this.mergeId).productId = this.carList1.id if(this.carList.has(this.carList1.id) == true){ //跟当前页面有相同的商品
this.carList.get(this.mergeId).id = this.carList1.id that.carList.get(that.mergeId).stockLogList.forEach(function(value1, key1) {
this.carList.get(this.mergeId).productName = this.carList1.productName that.carList.get(that.carList1.id).stockLogList.forEach(function(value, key) {
this.carList.get(this.mergeId).productPicture = this.carList1.productPicture if(key1 == key){
this.carList.get(this.mergeId).productSn = this.carList1.productSn that.carList.get(that.carList1.id).stockLogList.get(key).productCount =
this.carList.get(this.mergeId).categoryId = this.carList1.categoryId that.carList.get(that.carList1.id).stockLogList.get(key).productCount + value1.productCount
this.carList.get(this.mergeId).wholesalePrice=this.carList1.wholesalePrice || 0 isTrue = true
this.carList.get(this.mergeId).lsprice= this.carList1.price || 0 that.carList.get(that.carList1.id).productCount += value1.productCount
this.carList.get(this.mergeId).isNew=false }
this.carList.set(this.carList1.id,this.carList.get(this.mergeId)) })
if(isTrue == false){
that.carList.get(that.carList1.id).stockLogList.set(key1,value1)
that.carList.get(that.carList1.id).productCount += value1.productCount
}
})
}else{
this.carList.get(this.mergeId).productId = this.carList1.id
this.carList.get(this.mergeId).id = this.carList1.id
this.carList.get(this.mergeId).productName = this.carList1.productName
this.carList.get(this.mergeId).productPicture = this.carList1.productPicture
this.carList.get(this.mergeId).productSn = this.carList1.productSn
this.carList.get(this.mergeId).categoryId = this.carList1.categoryId
this.carList.get(this.mergeId).wholesalePrice=this.carList1.wholesalePrice || 0
this.carList.get(this.mergeId).lsprice= this.carList1.price || 0
this.carList.get(this.mergeId).isNew=false
this.carList.set(this.carList1.id,this.carList.get(this.mergeId))
}
this.carList.delete(this.mergeId) this.carList.delete(this.mergeId)
this.getAllPrice()
setTimeout(res => { setTimeout(res => {
uni.hideLoading(); uni.hideLoading();
}, 300) }, 300)
@ -397,24 +423,47 @@
productSn: this.carList1[i].productSn, productSn: this.carList1[i].productSn,
stockLogList: new Map(), stockLogList: new Map(),
stockLogList1: [] stockLogList1: []
} }
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
// let attrMap = new Map()
// let newSaleDetailDTOList = []
// for(let m = 0; m < item.saleDetailDTOList[i].stockLogList1.length; m++){
// if(attrMap.has(item.saleDetailDTOList[i].stockLogList1[m].attributeList) == true){
// let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList)
// let trueCount = hasCount.split('-')[0]
// let lastConut = Number(trueCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount)
// newSaleDetailDTOList[hasCount.split('-')[1]].productCount = lastConut
// }else{
// newSaleDetailDTOList.push(item.saleDetailDTOList[i].stockLogList1[m])
// attrMap.set(item.saleDetailDTOList[i].stockLogList1[m].attributeList,item.saleDetailDTOList[i].stockLogList1[m].productCount+'-'+m)
// }
// }
// obj.saleDetailQueryDTO = newSaleDetailDTOList
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
let productCount = this.carList1[i].saleDetailQueryDTO[m].productCount
if(obj.stockLogList.has(this.carList1[i].saleDetailQueryDTO[m].attributeList) ==true){
productCount += obj.stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount
}
var data1 = { var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount, productCount: productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name name: this.carList1[i].saleDetailQueryDTO[m].name
} }
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1) obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
obj.price1 = obj.productCount * this.carList1[i].purchasePrice obj.price1 = obj.productCount * this.carList1[i].purchasePrice
} }
this.carList.set(this.carList1[i].id, obj) let id = this.carList1[i].isNew ==true ?this.carList1[i].id : this.carList1[i].productId
that.carList.get(that.carList1[i].id).price = that.carList.get(that.carList1[i].id).purchasePrice * this.carList.set(id, obj)
that.carList.get(that.carList1[i].id).productCount; that.carList.get(id).price = that.carList.get(id).purchasePrice *
that.carList.get(id).productCount;
} }
this.carList1 = [] this.carList1 = []
} else { //当前页有数据 } else { //当前页有数据
console.log('111') console.log('111')
for (let i = 0; i < this.carList1.length; i++) { for (let i = 0; i < this.carList1.length; i++) {
let id = this.carList1[i].isNew == true ? this.carList1[i].id : this.carList1[i].productId
if (this.carList.has(this.carList1[i].id) == true) { //商品相同 if (this.carList.has(this.carList1[i].id) == true) { //商品相同
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i].saleDetailQueryDTO[ if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i].saleDetailQueryDTO[
@ -470,11 +519,12 @@
obj.name = this.carList1[i].saleDetailQueryDTO[m].name obj.name = this.carList1[i].saleDetailQueryDTO[m].name
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
obj.price1 = obj.productCount * this.carList1[i].purchasePrice obj.price1 = obj.productCount * this.carList1[i].purchasePrice
} }
this.carList.set(this.carList1[i].id, obj)
this.carList.set(id, obj)
} }
that.carList.get(that.carList1[i].id).price = that.carList.get(that.carList1[i].id).purchasePrice * that.carList.get(id).price = that.carList.get(id).purchasePrice *
that.carList.get(that.carList1[i].id).productCount; that.carList.get(id).productCount;
} }
@ -1383,7 +1433,7 @@
return return
} }
if((value.categoryId == '' && value.productId == '') || (value.categoryId == null && value.productId == '')){ if((value.categoryId == '' && value.productId == '') || (value.categoryId == null && value.productId == '')){
that.tui.toast(value.productName + "的分类未维护!") that.tui.toast(value.productName + "分类未维护!")
return; return;
} }
value.stockLogList.forEach(function(values, keys) { value.stockLogList.forEach(function(values, keys) {

94
pages/inventory/addinventory.vue

@ -601,7 +601,6 @@
} }
}, },
AiAddSpec(value){ AiAddSpec(value){
console.log(value)
if(value.categoryId == ''){ if(value.categoryId == ''){
this.tui.toast('请先选择商品分类') this.tui.toast('请先选择商品分类')
return; return;
@ -985,58 +984,63 @@
}) })
}, },
inventorySubmit() { inventorySubmit() {
let that = this;
if (this.khName == '' || this.carList == '') { if (this.khName == '' || this.carList == '') {
uni.showToast({ uni.showToast({
title: "请选择供应商后入库!", title: "请选择供应商后入库!",
icon: 'none' icon: 'none'
}) })
return return
} else { }
if (this.storageType == 0) { let isTrue = false;
this.carList.forEach(function(value, key) { if (this.storageType == 0) {
if (value.purchasePrice == '' || value.purchasePrice == 0) { this.carList.forEach(function(value, key) {
uni.showToast({ // console.log('这里',value)
title: value.productName + "的价格必须维护!", console.log('这里',value.purchasePrice == '' || value.purchasePrice == 0)
icon: 'none' if (value.purchasePrice == '' || value.purchasePrice == 0) {
}) uni.showToast({
return title: value.productName + "的价格必须维护!",
} icon: 'none'
}) })
} isTrue = true;
} return
let that = this;
let purchase = {
alreadyPay: this.alreadyPay == '' ? 0 : this.alreadyPay, //已付金额
noPay: this.noPay == '' ? 0 : this.noPay, //欠款
shouldPay: this.shouldPay, //应付金额
totalAmount: this.totalAmount, //总数量
remark: this.remark,
otherPay: this.otherPay == '' ? 0 : this.otherPay,
supplierId: this.khName.id, //供应商id和姓名
supplierName: this.khName.consigneeName
}
let purchaseDetails = [];
this.carList.forEach(function(value, key) {
value.stockLogList1 = []
value.stockLogList.forEach(function(values, keys) {
if (values <= 0) {
that.tui.toast("入库数量不能为零!")
return;
}
let obj = {
productCount: values.productCount,
attributeList: keys
} }
value.stockLogList1.push(obj)
}) })
purchaseDetails.push(value) }
}) if(isTrue == false){
console.log(purchaseDetails) let purchase = {
console.log(purchase) alreadyPay: that.alreadyPay == '' ? 0 : that.alreadyPay, //已付金额
uni.navigateTo({ noPay: that.noPay == '' ? 0 : that.noPay, //欠款
url: '/package1/inventory/inventoryConfirm?purchase=' + JSON.stringify(purchase) + '&purchaseDetails=' + JSON.stringify(purchaseDetails) shouldPay: that.shouldPay, //应付金额
}) totalAmount: that.totalAmount, //总数量
remark: that.remark,
otherPay: that.otherPay == '' ? 0 : that.otherPay,
supplierId: that.khName.id, //供应商id和姓名
supplierName: that.khName.consigneeName
}
let purchaseDetails = [];
that.carList.forEach(function(value, key) {
value.stockLogList1 = []
value.stockLogList.forEach(function(values, keys) {
if (values <= 0) {
that.tui.toast("入库数量不能为零!")
return;
}
let obj = {
productCount: values.productCount,
attributeList: keys
}
value.stockLogList1.push(obj)
})
purchaseDetails.push(value)
})
uni.navigateTo({
url: '/package1/inventory/inventoryConfirm?purchase=' + JSON.stringify(purchase) + '&purchaseDetails=' + JSON.stringify(purchaseDetails)
})
}
}, },
//编辑每一个的单价 //编辑每一个的单价
clickCollapse(index) { clickCollapse(index) {

112
pages/inventory/changeGoods1.vue

@ -6,12 +6,12 @@
</view> </view>
<view class="title-box"> <view class="title-box">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none" <uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none"
@confirm="search" /> @confirm="search" @blur="search" @clear="clearSearch" />
</view> </view>
</view> </view>
<view class="content-box" :style="{height:height - 360 +'rpx'}"> <view class="content-box" :style="{height:height - 360 +'rpx'}">
<view class="content-left"> <view class="content-left">
<view class="left-box" v-for="(item, index) in indexList" :key="item" <view class="left-box" v-if="gateType == ''" v-for="(item, index) in indexList" :key="index"
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)"> :class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;" <text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;"
:class="item.parentId ? 'red' :''">{{item.categoryName}}</text> :class="item.parentId ? 'red' :''">{{item.categoryName}}</text>
@ -48,6 +48,37 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<view class="right-box" v-for="(item,index) in shopList1" :key="index" @tap="toggle('bottom',item)">
<!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 -->
<view class="shop-mask" v-if="item.delFlag == 0 || item.inStorageStatus == 0"
@tap.stop="clickMask(item)"></view>
<view class="box-left">
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="box-right">
<view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price">
<view class="price-box" v-if="storageType == 0">
<text>{{item.inStorageStatus==0?'待入库':item.purchasePrice == null ?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -188,12 +219,11 @@
return { return {
indexList: [], indexList: [],
pageNum: 1, //分页的页码 pageNum: 1, //分页的页码
shopList: [], shopList: [],
shopList1: [],
info: 0, info: 0,
categoryId: '', //分类id categoryId: '', //分类id
searchName: '', //搜索框输入值 searchName: '', //搜索框输入值
shopId: '', //店铺id,
checkbox: [], //需要分享的商品id
temporaryNum: 0, temporaryNum: 0,
allChangeNum:0, allChangeNum:0,
goodsDetail: [], goodsDetail: [],
@ -219,6 +249,7 @@
goodsList:[], goodsList:[],
newTemList:[], newTemList:[],
pecsList:[], pecsList:[],
gateType:'',
dataObj :new Map() //拿到的 规格值为key的 dataObj :new Map() //拿到的 规格值为key的
} }
}, },
@ -264,7 +295,7 @@
} }
} }
this.categoryId = this.indexList[0].id this.categoryId = this.indexList[0].id
this.getShareList(this.indexList[0].id); this.getShareList();
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
@ -473,20 +504,38 @@
delta: 1 delta: 1
}) })
}, },
//点击分类获取商品列表 getShareList(type) {
getShareList(id) { let data = {}
this.tui.request("/app/product/getShareList", "POST", { if(type=='search'){
categoryId: this.categoryId, this.gateType = 'search'
searchStr: this.searchName, data = {
pageNum: this.pageNum, categoryId: "",
pageSize: '10' searchStr: this.searchName,
}, false, false).then((res) => { pageNum: this.pageNum,
if (res.code == 200) { pageSize: '100'
this.shopList = res.result.records }
} else { }else{
this.tui.toast(res.message) this.gateType = ''
} data = {
}).catch((res) => {}) categoryId: this.categoryId,
searchStr: this.searchName,
pageNum: this.pageNum,
pageSize: '100'
}
}
this.tui.request("/app/product/getShareList", "POST", data, false, false).then((res) => {
if (res.code == 200) {
if(type=='search'){
this.shopList = []
this.shopList1 = res.result.records
}else{
this.shopList1 = []
this.shopList = res.result.records
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}, },
//获取弹出层状态 //获取弹出层状态
change(e) { change(e) {
@ -645,9 +694,20 @@
}, 200) }, 200)
}, },
//顶部搜索框 //顶部搜索框
search(res) { search(e) {
this.searchName = res.value if(e.value == ''){
this.getShareList() this.searchName = ""
this.getShareList()
}else{
this.searchName = e.value
this.getShareList('search')
}
},
//清空搜索条件
clearSearch(){
this.searchName = ''
this.getShareList()
}, },
//未入库遮罩 //未入库遮罩
clickMask(item) { clickMask(item) {
@ -720,7 +780,8 @@
} }
} }
this.temporaryList = [] this.temporaryList = []
this.purchasePrice = "" this.purchasePrice = ""
this.oldTemList = []
this.zPrice = '' this.zPrice = ''
this.zNum = '' this.zNum = ''
for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { for (let i = 0; i < this.goodsDetail.attributeList.length; i++) {
@ -751,6 +812,9 @@
that.$forceUpdate() that.$forceUpdate()
} }
}) })
},
change() {
this.oldTemList = []
}, },
//选商品的时候能删除规格 //选商品的时候能删除规格
delCarData(index) { delCarData(index) {

197
pages/inventory/goodsList1.vue

@ -94,20 +94,29 @@
</view> </view>
<view class="shop-checkList" v-if="value[1].stockLogList !=''"> <view class="shop-checkList" v-if="value[1].stockLogList !=''">
<view class="shop-checkList-box" style="width: 67%;"> <view class="shop-checkList-box" style="width: 67%;">
<text style="text-align:center;width: 356rpx;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;">规格</text> <text style="text-align:center;width: 400rpx;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;">
<text style="font-size: 30rpx;color: #000;font-weight: bold;width: 110rpx;display: inline-block;text-align: center;">库存</text> 规格
</text>
<text style="font-size: 30rpx;color: #000;font-weight: bold;width: 60rpx;display: inline-block;text-align: center;">
库存
</text>
</view> </view>
<view style="font-size: 30rpx;color: #000;font-weight: bold;width: 140rpx;display: inline-block;text-align: right;">数量</view> <view style="font-size: 30rpx;color: #000;font-weight: bold;width: 152rpx;display: inline-block;text-align: right;">数量</view>
</view> </view>
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" <view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)"
:key='keys'> :key='keys'>
<view @tap.stop="delShopSpec(value[0],values[0])"> <view @tap.stop="delShopSpec(value[0],values[0])">
<uni-icons color="red" type="minus" size="26"></uni-icons> <uni-icons color="red" type="minus" size="26"></uni-icons>
</view> </view>
<text>{{values[0] | sliceMsg}}</text> <text @tap="checkSpec('颜色',value[0],values[0],numData(values[0])[0])">
<text style="width: 15%;">{{values[1].productNum}}</text> {{numData(values[0])[0]}}
</text>
<text @tap="checkSpec('尺码',value[0],values[0],numData(values[0])[1])">
{{numData(values[0])[1]}}
</text>
<text style="width: 25%;font-size: 22rpx;">{{values[1].productNum == null ?'无库存':values[1].productNum}}</text>
<view style="text-align: left;padding-left: 5px;width:50%;display: flex;"> <view style="text-align: left;padding-left: 5px;width:50%;display: flex;">
<uni-number-box max="100000" style="margin-top:16rpx;" v-model="values[1].productCount" <uni-number-box max="100000" style="margin-top:9rpx;border-right:0;" v-model="values[1].productCount"
@change="GoodsNumChange($event,value,values[0])" /> @change="GoodsNumChange($event,value,values[0])" />
</view> </view>
</view> </view>
@ -452,6 +461,27 @@
</view> </view>
</view> </view>
</uni-popup>
<!-- 弹出规格选择 -->
<uni-popup ref="getaPopup" background-color="#fff" :is-mask-click="true">
<view class="type-popup" style="margin-bottom: 0;border-radius: 0;">
<view style="height: 80rpx;font-size: 36rpx;font-weight: bold;line-height: 80rpx;text-align: center;">
修改当前规格
</view>
<view class="card-list">
<ul>
<li v-for="items in attrList" :key="items.id">
<view class="title-fur">
<view class="name">{{items.attributeName}}</view>
</view>
<view class="content-fur">
<view class="content-low" v-for="item in attributeValue" :key="item.id"
@tap="changeSpec(item.value)">{{item.value}}</view>
</view>
</li>
</ul>
</view>
</view>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
@ -464,7 +494,9 @@
let manager = plugin.getRecordRecognitionManager() let manager = plugin.getRecordRecognitionManager()
export default { export default {
data() { data() {
return { return {
attrList:[],
attributeValue:[],
lsprice: 0, //临时零售价 lsprice: 0, //临时零售价
wholesalePrice: 0, // 临时显示批发价 wholesalePrice: 0, // 临时显示批发价
price: 0, //总金额 price: 0, //总金额
@ -661,6 +693,7 @@
purchasePrice: this.carList1[i].price, //采购价 purchasePrice: this.carList1[i].price, //采购价
price: 0, //总价 price: 0, //总价
discount: 10, //折扣 discount: 10, //折扣
categoryId:this.carList1[i].categoryId,
unitPrice: this.carList1[i].unitPrice || 0, //单价 unitPrice: this.carList1[i].unitPrice || 0, //单价
discountAmount: this.carList1[i].unitPrice || 0, //折后价 discountAmount: this.carList1[i].unitPrice || 0, //折后价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 wholesalePrice: this.carList1[i].wholesalePrice, //批发价
@ -727,6 +760,7 @@
purchasePrice: this.carList1[i].price, //采购价 purchasePrice: this.carList1[i].price, //采购价
price: 0, price: 0,
discount: 10, discount: 10,
categoryId:this.carList1[i].categoryId,
discountAmount: this.carList1[i].unitPrice || 0, discountAmount: this.carList1[i].unitPrice || 0,
unitPrice: this.carList1[i].unitPrice || 0, //单价 unitPrice: this.carList1[i].unitPrice || 0, //单价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 wholesalePrice: this.carList1[i].wholesalePrice, //批发价
@ -806,6 +840,7 @@
purchasePrice: this.carList1[i].purchasePrice, //采购价 purchasePrice: this.carList1[i].purchasePrice, //采购价
price: 0, //总价 price: 0, //总价
discount: 10, //折扣 discount: 10, //折扣
categoryId:this.carList1[i].categoryId,
unitPrice: this.carList1[i].price || 0, //单价 unitPrice: this.carList1[i].price || 0, //单价
discountAmount: this.carList1[i].unitPrice || 0, //折后价 discountAmount: this.carList1[i].unitPrice || 0, //折后价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 wholesalePrice: this.carList1[i].wholesalePrice, //批发价
@ -859,6 +894,7 @@
purchasePrice: this.carList1[i].purchasePrice, //采购价 purchasePrice: this.carList1[i].purchasePrice, //采购价
price: 0, //总价 price: 0, //总价
discount: 10, //折扣 discount: 10, //折扣
categoryId:this.carList1[i].categoryId,
unitPrice: this.carList1[i].price || 0, //单价 unitPrice: this.carList1[i].price || 0, //单价
discountAmount: this.carList1[i].unitPrice || 0, //折后价 discountAmount: this.carList1[i].unitPrice || 0, //折后价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 wholesalePrice: this.carList1[i].wholesalePrice, //批发价
@ -934,6 +970,81 @@
result = res result = res
}) })
return result; return result;
},
numData(val){
var name = []
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name.push(newObj[as])
}
}
return name;
},
checkSpec(type,id,attr,value){
this.temporary = [id,attr,type,value]
let num = type == '颜色' ? 0 : 1
this.getGategoryLowList()
},
//初始化获取子分类列表
getGategoryLowList() {
this.attrList = []
let num = this.temporary[2] == '颜色' ? 0 : 1
this.tui.request("/app/productAttribute/selectByCategoryId", "POST", {
categoryId: this.carList.get(this.temporary[0]).categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
this.attrList.push(res1.result[num])
if (res1.result.length > 0) {
this.attributeValue = []
this.tui.request(
"/app/productAttributeValue/selectByAttributeId",
"get", {
id: this.attrList[0].id
}, false, true).then((res2) => {
if (res2.code == 200) {
this.attributeValue = res2.result;
this.$forceUpdate()
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}
setTimeout(() => {
this.showList = this.attrList;
}, 1000)
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
this.$forceUpdate()
this.$refs.getaPopup.open()
},
//点击某一个规格,可修改
changeSpec(item){
let that = this;
if(item == ''){
this.tui.toast('请输入要修改的规格值')
return;
}
let data = this.temporary
let specMap = new Map() //新的临时存放值那个更改过的值的数组
this.carList.get(data[0]).stockLogList.forEach(function(value, key) {
if(key == data[1]){
let stringKey = key.replace(data[3],item) //拿到了更改过的key
specMap.set(stringKey,value) //name的值没有改,所有的数组都放在这个下面
that.carList.get(data[0]).stockLogList.delete(data[1])
}
})
if(this.carList.get(data[0]).stockLogList.size > 0){
this.carList.get(data[0]).stockLogList.forEach(function(value, key) {
specMap.set(key,value)
})
}
this.carList.get(data[0]).stockLogList = specMap
this.$forceUpdate()
this.$refs.getaPopup.close()
}, },
//销售员列表 //销售员列表
xsyList() { xsyList() {
@ -1154,10 +1265,24 @@
clearText(){ clearText(){
this.voiceText = '' this.voiceText = ''
}, },
spliceMsg(res){
let regex = /嗯|啊|儿|各|阿|恩/g;
return res.replace(regex, '')
},
convertChineseToArabic(str) {
const chineseNumToArabic = {
'零': 0, '一': 1, '二': 2, '两': 2, '三': 3,
'四': 4, '五': 5, '六': 6, '七': 7, '八': 8, '九': 9
};
const regex = /(零|一|二|两|三|四|五|六|七|八|九)/g;
return str.replace(regex, match => chineseNumToArabic[match]);
},
//编辑挂单信息 //编辑挂单信息
setDetail(e) { setDetail(e) {
let convertedStr = this.convertChineseToArabic(this.voiceText);
let getMsg = this.spliceMsg(convertedStr)
this.tui.request("/app/sale/buyAi", "POST", { this.tui.request("/app/sale/buyAi", "POST", {
aiMsg:this.voiceText aiMsg:getMsg
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.voiceText = '' this.voiceText = ''
@ -1322,11 +1447,6 @@
} }
}, },
AiAddSpec(value){ AiAddSpec(value){
if(value.categoryId == ''){
this.tui.toast('请先选择商品分类')
return;
}
console.log(value)
this.getById(value.productId || value.id); this.getById(value.productId || value.id);
}, },
//通过商品id查询商品详细信息 //通过商品id查询商品详细信息
@ -1624,6 +1744,7 @@
price: 0, //总价 price: 0, //总价
discount: 10, //折扣 discount: 10, //折扣
unitPrice: 0, //单价 unitPrice: 0, //单价
categoryId:carList1[i].categoryId,
discountAmount: 0, //折后价 discountAmount: 0, //折后价
wholesalePrice: carList1[i].wholesalePrice, //批发价 wholesalePrice: carList1[i].wholesalePrice, //批发价
lsprice: carList1[i].lsprice, //零售价 lsprice: carList1[i].lsprice, //零售价
@ -1699,6 +1820,7 @@
discount: 10, discount: 10,
discountAmount: 0, discountAmount: 0,
unitPrice: 0, //单价 unitPrice: 0, //单价
categoryId:carList1[i].categoryId,
wholesalePrice: carList1[i].wholesalePrice, //批发价 wholesalePrice: carList1[i].wholesalePrice, //批发价
lsprice: carList1[i].lsprice, //零售价 lsprice: carList1[i].lsprice, //零售价
productCount: 0, productCount: 0,
@ -1857,7 +1979,7 @@
return return
} }
let obj = { let obj = {
orderByWorker: this.lbgName.workerId, orderByWorker: this.lbgName.workerId || this.kdyName.workerId,
oldSaleId: this.saleId || '', oldSaleId: this.saleId || '',
sale: { sale: {
// relPrice:, // relPrice:,
@ -2868,5 +2990,52 @@
height: 180rpx; height: 180rpx;
background: #eee; background: #eee;
border-radius: 50%; border-radius: 50%;
}
.type-popup{
width: 500rpx;
height: auto;
background: #fff;
border-radius: 10px;
position: relative;
margin-bottom: 40rpx;
}
.card-list {
width: 95%;
border-radius: 10upx;
background: #fff;
height: auto;
margin: 40rpx auto 0;
}
.title-fur {
width: 95%;
height: 70rpx;
margin: 0 auto;
border-bottom: 1px solid #eee;
}
.name {
font-size: 30rpx;
width: 50%;
float: left;
height: 70rpx;
line-height: 70rpx;
}
.content-fur {
padding-bottom: 25rpx;
}
.content-low {
width: auto;
border: 1px solid #eee;
display: inline-block;
min-width: 90rpx;
padding: 5rpx;
font-size: 35rpx;
text-align: center;
color: #777;
margin: 20rpx 0 0 20rpx;
} }
</style> </style>

96
pages/inventory/inventory.vue

@ -37,17 +37,17 @@
</view> </view>
</view> </view>
<view class="search"> <view class="search">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none" @confirm="search" @clear="clearSearch" /> <uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none" @confirm="search" @blur="search" @clear="clearSearch" />
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="content-left"> <view class="content-left">
<view class="left-box" v-for="(item, index) in indexList" :key="item" <view v-if="gateType == ''" class="left-box" v-for="(item, index) in indexList" :key="index"
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)"> :class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;" :class="item.parentId ? 'red' :''">{{item.categoryName}}</text> <text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;" :class="item.parentId ? 'red' :''">{{item.categoryName}}</text>
</view> </view>
</view> </view>
<view class="content-right"> <view class="content-right">
<view class="right-box" v-for="item in shopList" :key="item" @tap="goDetail(item)"> <view class="right-box" v-for="(item,index) in shopList" :key="index" @tap="goDetail(item)">
<view class="box-left"> <view class="box-left">
<img :src="item.productPicture" class="img-radius" alt="" v-if="item.productPicture"> <img :src="item.productPicture" class="img-radius" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view> <view class="noPic" v-else>暂无图片</view>
@ -77,6 +77,37 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<view class="right-box" v-for="(item,index) in shopList1" :key="index" @tap="goDetail(item)">
<view class="box-left">
<img :src="item.productPicture" class="img-radius" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="box-right">
<view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view>
<!-- 1上架 0下架 -->
<view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">下架</view>
<view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">上架</view>
<view class="box-right-price">
<view class="price-box" v-if='type==0'>
<text style="color: red;">{{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -126,7 +157,9 @@
warnMsg:[], warnMsg:[],
searchName:'', searchName:'',
categoryIndex:0, categoryIndex:0,
windowHeight:0 windowHeight:0,
shopList1:[],
gateType:''
} }
}, },
onLoad(){ onLoad(){
@ -159,7 +192,7 @@
} }
} }
this.categoryId = this.indexList[this.categoryIndex].id this.categoryId = this.indexList[this.categoryIndex].id
this.getShareList(this.indexList[this.categoryIndex].id); this.getShareList();
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
@ -186,7 +219,7 @@
} }
} }
this.categoryId = this.indexList[index].id this.categoryId = this.indexList[index].id
this.getShareList(this.indexList[index].id) this.getShareList()
}, },
//入库单详情 //入库单详情
goDetail(item) { goDetail(item) {
@ -200,15 +233,34 @@
}) })
}, },
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(type) {
this.tui.request("/app/product/getShareList", "POST", { let data = {}
categoryId: this.categoryId, if(type=='search'){
searchStr: this.searchName, this.gateType = 'search'
pageNum: this.pageNum, data = {
pageSize: '10' categoryId: "",
}, false, false).then((res) => { searchStr: this.searchName,
if (res.code == 200) { pageNum: this.pageNum,
this.shopList = res.result.records pageSize: '100'
}
}else{
this.gateType = ''
data = {
categoryId: this.categoryId,
searchStr: this.searchName,
pageNum: this.pageNum,
pageSize: '100'
}
}
this.tui.request("/app/product/getShareList", "POST", data, false, false).then((res) => {
if (res.code == 200) {
if(type=='search'){
this.shopList = []
this.shopList1 = res.result.records
}else{
this.shopList1 = []
this.shopList = res.result.records
}
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
@ -233,7 +285,7 @@
that.tui.toast(res.message) that.tui.toast(res.message)
} }
this.categoryId = data.categoryId this.categoryId = data.categoryId
that.getShareList(data.categoryId) that.getShareList()
}).catch((res) => {}) }).catch((res) => {})
} else { //上架 } else { //上架
that.tui.request("/app/product/up", "POST", { that.tui.request("/app/product/up", "POST", {
@ -245,7 +297,7 @@
that.tui.toast(res.message) that.tui.toast(res.message)
} }
this.categoryId = data.categoryId this.categoryId = data.categoryId
that.getShareList(data.categoryId) that.getShareList()
}).catch((res) => {}) }).catch((res) => {})
} }
} }
@ -254,8 +306,14 @@
}, },
//搜索接口 //搜索接口
search(e){ search(e){
this.searchName = e.value if(e.value == ''){
this.getShareList() this.searchName = ""
this.getShareList()
}else{
this.searchName = e.value
this.getShareList('search')
}
}, },
//清空搜索条件 //清空搜索条件
clearSearch(){ clearSearch(){

191
pages/inventory/inventoryDetail.vue

@ -10,7 +10,12 @@
<view class="box-right-name">{{dataList.productName == null ? '暂无':dataList.productName}} ({{dataList.productSn == null ? '暂无':dataList.productSn}})</view> <view class="box-right-name">{{dataList.productName == null ? '暂无':dataList.productName}} ({{dataList.productSn == null ? '暂无':dataList.productSn}})</view>
<view class="box-right-num">供应商:{{dataList.supplierName == null ? '暂无':dataList.supplierName}}</view> <view class="box-right-num">供应商:{{dataList.supplierName == null ? '暂无':dataList.supplierName}}</view>
<view class="edit-btn" @tap="goToAddGoods">编辑</view> <view class="edit-btn" @tap="goToAddGoods">编辑</view>
<view @tap="clickPrint" style="width: 100rpx;height: 60rpx;line-height: 60rpx;color: #fff !important;background: #0072E3;position: absolute;top: 30rpx;right: 40rpx;border-radius: 10px;text-align: center;">打印</view> <view v-if="!isPrint" @tap="printBtn" class="print-btn">
打印
</view>
<view v-if="isPrint" @tap="printBtn" class="print-btn">
取消
</view>
<view class="box-right-num" style="color:#ffa200;"> <view class="box-right-num" style="color:#ffa200;">
<text style="padding-right: 20rpx;">{{dataList.delFlag==1?'已上架':'已下架'}}</text> <text style="padding-right: 20rpx;">{{dataList.delFlag==1?'已上架':'已下架'}}</text>
<!-- <text>{{dataList.delFlag==0?'已上架':'已下架'}}</text> --> <!-- <text>{{dataList.delFlag==0?'已上架':'已下架'}}</text> -->
@ -38,11 +43,15 @@
</view> </view>
<view class="container-box" v-for="(item,index) in pecsList" :key='index'> <view class="container-box" v-for="(item,index) in pecsList" :key='index'>
<view class="prec-list"> <view class="prec-list">
<view class="prec-list-box" style="width: 70%;"> <view class="prec-list-box" :style="{width:isPrint?'40%':'70%'}">
{{item.attributeList | sliceMsg}} {{item.attributeList | sliceMsg}}
</view> </view>
<view class="prec-list-box" style="font-size: 26rpx;"> <view class="prec-list-box" style="font-size: 26rpx;width: 26%;">
数量:{{item.stockCount}} 数量:{{item.stockCount}}
</view>
<view>
<uni-number-box v-if="isPrint" v-model="item.productCount" max="10000"
@change="changeNumBtn(item)" style="margin-top: 10rpx;display: block;" />
</view> </view>
</view> </view>
</view> </view>
@ -56,8 +65,32 @@
<view class="content-low" v-for="(item1,index1) in list" :key="index1" <view class="content-low" v-for="(item1,index1) in list" :key="index1"
@tap.stop="addMultipleType(item1)" :class="item1.checked?'checked':''">{{item1.type}}</view> @tap.stop="addMultipleType(item1)" :class="item1.checked?'checked':''">{{item1.type}}</view>
</view> </view>
<view class="popup-pay-container" > <view v-if="list[0].checked" style="display: flex;height: 80rpx;width: 100%;line-height: 80rpx;margin-top: 20rpx;">
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" :defaultText="'打印'"></kk-printer> <text style="display:inline-block;width:100rpx;font-size:22rpx;">
供应商:
</text>
<input v-if="isShow" v-model="dataList.supplierName" @change="changeText" type="text" placeholder="请输入供应商名称" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
</view>
<view v-if="list[1].checked" style="display: flex;height: 80rpx;width: 100%;line-height: 80rpx;margin-top: 20rpx;">
<text style="display:inline-block;width:100rpx;font-size:22rpx;">
货号:
</text>
<input v-if="isShow" v-model="dataList.productSn" @change="changeText" type="text" placeholder="请输入货号" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
</view>
<view v-if="list[2].checked" style="display: flex;height: 80rpx;width: 100%;line-height: 80rpx;margin-top: 20rpx;">
<text style="display:inline-block;width:100rpx;font-size:22rpx;">
零售价:
</text>
<input v-if="isShow" v-model="dataList.price" @change="changeText" type="number" placeholder="请输入零售价" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
</view>
<view v-if="list[3].checked" style="display: flex;height: 80rpx;width: 100%;line-height: 80rpx;margin-top: 20rpx;">
<text style="display:inline-block;width:100rpx;font-size:22rpx;">
批发价:
</text>
<input v-if="isShow" v-model="dataList.wholesalePrice" @change="changeText" type="number" placeholder="请输入批发价" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
</view>
<view class="popup-pay-container">
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" :printNum="printNum" :defaultText="'打印'"></kk-printer>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
@ -66,8 +99,9 @@
<uni-popup-dialog ref="inputClose" mode="input" title="采购价" placeholder="请输入采购价" <uni-popup-dialog ref="inputClose" mode="input" title="采购价" placeholder="请输入采购价"
@confirm="changePrice"></uni-popup-dialog> @confirm="changePrice"></uni-popup-dialog>
</uni-popup> </uni-popup>
<view v-if="isPrint" @tap="clickPrint" class="bottom-btn">确认打印</view>
<!-- 右下角悬浮按钮 --> <!-- 右下角悬浮按钮 -->
<uni-fab ref="fab" :content="content" :horizontal="horizontal" <uni-fab v-if="!isPrint" ref="fab" :content="content" :horizontal="horizontal"
@trigger="trigger" /> @trigger="trigger" />
</view> </view>
</template> </template>
@ -81,23 +115,29 @@
return { return {
pageNum: 1, //分页的页码 pageNum: 1, //分页的页码
dataList: [], dataList: [],
isPrint:false,
bufferData: [], bufferData: [],
horizontal: 'right', horizontal: 'right',
pecsList:[], pecsList:[],
defaultText:'', defaultText:'',
type:'', type:'',
printNum:1,
list:[{ list:[{
type:'供应商', type:'供应商',
checked:false, checked:false,
text:''
},{ },{
type:'货号', type:'货号',
checked:false, checked:false,
text:''
},{ },{
type:'零售价', type:'零售价',
checked:false, checked:false,
text:''
},{ },{
type:'批发价', type:'批发价',
checked:false, checked:false,
text:''
}], }],
multipleList:[], multipleList:[],
content: [{ content: [{
@ -115,7 +155,10 @@
selectedIconPath: '/static/images/tabbar/home-sel.png', selectedIconPath: '/static/images/tabbar/home-sel.png',
text: '删除商品', text: '删除商品',
active: false active: false
}] }],
printList:new Map(),
yNum: 10,
isShow:true
} }
}, },
filters: { filters: {
@ -140,7 +183,9 @@
components: { components: {
kkPrinter kkPrinter
}, },
onLoad(option) { onLoad(option) {
// 初始化蓝牙模块
wx.openBluetoothAdapter({mode: 'central'})
this.dataList = JSON.parse(option.item); this.dataList = JSON.parse(option.item);
this.type = uni.getStorageSync('type') this.type = uni.getStorageSync('type')
}, },
@ -161,13 +206,42 @@
}).catch((res) => {}) }).catch((res) => {})
}, },
changeText(){
console.log(this.dataList)
},
clickShow(){
this.isShow = false
},
changeNumBtn(item){
if(this.printList.has(item.attributeList) == true){ // map中已经有当前值
if(item.productCount == 0){
this.printList.delete(item.attributeList)
}else{
this.printList.get(item.attributeList).productCount = item.productCount
}
}else{
this.printList.set(item.attributeList,item)
}
console.log('打印的数组',this.printList)
},
printBtn(){
this.isPrint = !this.isPrint
},
//点击打印按钮 //点击打印按钮
clickPrint() { clickPrint() {
this.$refs.payDialog.open('center') this.$refs.payDialog.open('center')
}, },
//选择多个规格保存 //选择多个规格保存
addMultipleType(item1){ addMultipleType(item1){
if(item1.type== '供应商'){
item1.text = this.dataList.supplierName
}else if(item1.type== '货号'){
item1.text = this.dataList.productSn
}else if(item1.type== '零售价'){
item1.text = this.dataList.price
}else if(item1.type== '批发价'){
item1.text = this.dataList.wholesalePrice
}
item1.checked = !item1.checked item1.checked = !item1.checked
if(this.multipleList == ''){ if(this.multipleList == ''){
this.multipleList.push(item1.type) this.multipleList.push(item1.type)
@ -184,7 +258,7 @@
} }
} }
} }
console.log(this.multipleList); console.log(this.multipleList)
}, },
//去新增商品页编辑 //去新增商品页编辑
goToAddGoods(){ goToAddGoods(){
@ -192,30 +266,52 @@
url: "/package1/inventory/addGoods?dataList="+JSON.stringify(this.dataList) url: "/package1/inventory/addGoods?dataList="+JSON.stringify(this.dataList)
}) })
}, },
onPrint(opt) { sliceMsg(val) {
let strCmd = blesdk.CreatCPCLPage(440, 320, 1, 0); var name = ''
strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, '商品名:'+this.dataList.productName) if (typeof(val) == 'string') {
if(this.multipleList.indexOf('货号') != -1){ let newObj = JSON.parse(val)
console.log(this.multipleList.indexOf('货号')) for (let as in newObj) {
strCmd += blesdk.addCPCLText('0', '80', '24', '0', 0, '货 号:'+this.dataList.productSn) name += newObj[as] + ' '
} }
if(this.multipleList.indexOf('供应商') != -1){
console.log(this.multipleList.indexOf('供应商'))
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '供应商:'+this.dataList.supplierName)
}
if(this.multipleList.indexOf('批发价') != -1){
console.log(this.multipleList.indexOf('批发价'))
strCmd += blesdk.addCPCLText('0', '180', '24', '0', 0, '批发价:'+this.dataList.wholesalePrice)
}
if(this.multipleList.indexOf('零售价') != -1){
console.log(this.multipleList.indexOf('零售价'))
strCmd += blesdk.addCPCLText('0', '230', '24', '0', 0, '零售价:'+this.dataList.price)
} }
strCmd += blesdk.addCPCLQRCode(200, 140, 'H', '1', 6, [this.dataList.id,uni.getStorageSync('shopId')]) //二维码 return name;
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 },
strCmd += blesdk.addCPCLPrint(); //计算打印机当前行高度
this.bufferData.push(strCmd); countPrint(){
this.$refs.payDialog.close(); return this.yNum += 50
},
onPrint(opt) {
let that = this
this.printList.forEach((item, index) => {
for(let i=0;i<item.productCount;i++){
that.yNum = 10
let strCmd = blesdk.CreatCPCLPage(440, 320, 1, 0);
strCmd += blesdk.addCPCLText('0', '10', '24', '0', 0, '商品名:'+that.dataList.productName)
if(that.multipleList.indexOf('货号') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '货 号:'+that.dataList.productSn)
}
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '规 格:'+ that.sliceMsg(item.attributeList))
if(that.multipleList.indexOf('供应商') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '供应商:'+that.dataList.supplierName)
}
if(that.multipleList.indexOf('批发价') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '批发价:'+that.dataList.wholesalePrice)
}
if(that.multipleList.indexOf('零售价') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '零售价:'+that.dataList.price)
}
strCmd += blesdk.addCPCLQRCode(200, 140, 'H', '1', 6, [that.dataList.id,uni.getStorageSync('shopId')]) //二维码
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
}
})
that.$nextTick(()=>{
uni.navigateBack({
delta: 1
})
})
}, },
//悬浮按钮 //悬浮按钮
trigger(e) { trigger(e) {
@ -399,7 +495,7 @@
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.popup-pay-container { .popup-pay-container {
margin-top: 20rpx; margin-top: 40rpx;
height: 100rpx; height: 100rpx;
border-radius: 10px; border-radius: 10px;
background: #088FEB; background: #088FEB;
@ -415,6 +511,7 @@
} }
.content-fur { .content-fur {
padding-bottom: 25rpx; padding-bottom: 25rpx;
border-bottom: 1px solid #eee;
} }
.content-low { .content-low {
@ -427,5 +524,31 @@
text-align: center; text-align: center;
color: #777; color: #777;
margin: 20rpx 0 0 20rpx; margin: 20rpx 0 0 20rpx;
}
.print-btn{
width: 100rpx;
height: 60rpx;
line-height: 60rpx;
color: #fff !important;
background: #0072E3;
position: absolute;
top: 30rpx;
right: 40rpx;
border-radius: 10px;
text-align: center;
}
.bottom-btn{
width: 200rpx;
height: 80rpx;
line-height: 80rpx;
color: #fff;
background: #0072E3;
border-radius: 80rpx;
text-align: center;
position: fixed;
bottom: 75rpx;
right: 0;
left: 0;
margin: auto;
} }
</style> </style>

17
pages/login/login.vue

@ -103,16 +103,25 @@
choose: false, choose: false,
isChoose: false, isChoose: false,
clock: 60, // 倒计时 clock: 60, // 倒计时
shopList: [] shopList: [],
saleId:''
} }
}, },
computed: mapState(['type']), computed: mapState(['type']),
onLoad() { onLoad(option) {
this.saleId = option.saleId
this.userId = option.userId
if(uni.getStorageSync('hiver_token') != '' && uni.getStorageSync('wayValue') == 2){
uni.reLaunch({
url: '/package1/other/custom?saleId=' + this.saleId + '&userId=' + this.userId
})
}
this.getCaptchaImg(); this.getCaptchaImg();
this.username = uni.getStorageSync('username') this.username = uni.getStorageSync('username')
this.password = uni.getStorageSync('password') this.password = uni.getStorageSync('password')
}, },
methods: { methods: {
...mapMutations(['login']), ...mapMutations(['login']),
...mapActions(['getUserInfo']), ...mapActions(['getUserInfo']),
getCaptchaImg() { getCaptchaImg() {
@ -183,7 +192,7 @@
if(this.wayValue == 2){ //下游客户登录 if(this.wayValue == 2){ //下游客户登录
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/package1/other/custom' url: '/package1/other/custom?saleId=' + this.saleId
}) })
}, 200) }, 200)
this.tui.toast('登录成功', 2000, true) this.tui.toast('登录成功', 2000, true)

Loading…
Cancel
Save