wangfukang 2 years ago
parent
commit
0a768b1516
  1. BIN
      pages/.DS_Store
  2. 189
      pages/billing/changeGoods1.vue
  3. 1
      pages/index/checkShop.vue
  4. 11
      pages/index/index.vue
  5. 2
      pages/index/waitStorage.vue
  6. 1
      pages/index/waitStorageDetail.vue
  7. 5
      pages/inventory/changeGoods1.vue
  8. 683
      pages/inventory/goodsList1.vue
  9. 7
      pages/inventory/inventory.vue
  10. 14
      pages/inventory/inventoryDetail.vue

BIN
pages/.DS_Store

Binary file not shown.

189
pages/billing/changeGoods1.vue

@ -4,7 +4,7 @@
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none"
@confirm="search" @blur="search" @clear="clearSearch" />
</view>
<view class="content-box" style="height:100%;margin-bottom: 100rpx;">
<view class="content-box" style="height:97%;">
<view class="content-left">
<view class="left-box" v-if="gateType == ''" v-for="(item, index) in indexList" :key="index"
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
@ -173,7 +173,26 @@
</view>
</view>
</uni-popup>
</view>
</view>
<uni-popup ref="goodsNumDialog" background-color="#fff">
<view class="add-popup-content">
<view class="add-popup-title">
<text>请输入拿货数量</text>
<uni-icons @tap='$refs.goodsNumDialog.close()' type="closeempty" color='red' size="16"
style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons>
</view>
<view class="add-popup-container">
<view>
<text style="color:red;font-size:22rpx;">*您的此款商品只有一个规格,可直接输入拿货数量即可</text>
</view>
<input type="number" v-model="goodsNum" :focus="focus" style="width: 100%;border: 1px solid #eee;height: 80rpx;padding-left: 20rpx;margin:20rpx 0;font-size: 25rpx;line-height: 80rpx;"
placeholder="请输入此商品拿货数量">
<view class="add-popup-bottom">
<view class="add-popup-btn" @tap="oneGoodsToCarList">确认</view>
</view>
</view>
</view>
</uni-popup>
<!-- 购物车弹出层 -->
<uni-popup ref="carPopup" background-color="#fff" @change="change">
<view class="popup-content">
@ -228,7 +247,8 @@
components: {},
data() {
return {
indexList: [],
indexList: [],
focus:false,
pageNum: 1, //分页的页码
shopList: [],
shopList1:[],
@ -238,17 +258,18 @@
shopId: '', //店铺id,
checkbox: [], //需要分享的商品id
temporaryNum: 0,
allChangeNum:0,
allChangeNum:0,
oneGoodsSpec:[],
goodsDetail: [],
attrNameList: [],
temporaryList: [],
isPlusAndMinus:false,
carList: [],
evalue: [],
attributeList: [],
purchasePrice: 0,
zPrice: 0,
zNum: 0,
zNum: 0,
goodsNum:'',
storageType: '',
carNum: 0,
carType: 0,
@ -666,7 +687,7 @@
data = {
categoryId: "",
searchStr: this.searchName,
pageNum: this.pageNum,
pageNum: 1,
pageSize: '10'
}
}else{
@ -735,7 +756,6 @@
this.goodsList = []
this.allChangeNum = 0
this.checkGoods(item);
this.$refs.popup.open('bottom')
}
},
@ -759,7 +779,7 @@
}
await this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
categoryId: this.goodsDetail.attrId
}, false, true).then((res1) => {
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
@ -798,32 +818,45 @@
value: valueObj
})
}
this.goodsDetail.attributeList = newArr;
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
let oldCheck = false
let oldValue = []
for (var m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) {
if(this.goodsDetail.attributeList[i].value[m].isChecked == true){
oldCheck = true
oldValue.push(this.goodsDetail.attributeList[i].value[m].value)
}
}
if(oldCheck){
let specs1 = {
specs:[]
this.focus = false
if(newArr[0].value.length == 1 && newArr[1].value.length == 1){
console.log('只有一个',newArr)
this.oneGoodsSpec = newArr
// this.oneGoodsToCarList(newArr)
this.$refs.goodsNumDialog.open('center')
this.$nextTick(() => {
this.focus = true
})
}else{
this.$refs.popup.open('bottom')
this.goodsDetail.attributeList = newArr;
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
let oldCheck = false
let oldValue = []
for (var m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) {
if(this.goodsDetail.attributeList[i].value[m].isChecked == true){
oldCheck = true
oldValue.push(this.goodsDetail.attributeList[i].value[m].value)
}
}
specs1.specs = oldValue
this.goodsList.push(specs1)
}else{
let specs1 = {
specs:[]
if(oldCheck){
let specs1 = {
specs:[]
}
specs1.specs = oldValue
this.goodsList.push(specs1)
}else{
let specs1 = {
specs:[]
}
this.goodsList.push(specs1)
}
this.goodsList.push(specs1)
oldCheck = false
oldValue = []
}
oldCheck = false
oldValue = []
}
}
} else {
@ -832,6 +865,64 @@
}).catch((res) => {})
this.getKCList(item.id);
},
oneGoodsToCarList(){
let that = this;
// this.oneGoodsSpec //规格
// this.goodsNum //数量
this.evalue = []
var value = []
var name = ''
let value1 = "{"
name = this.oneGoodsSpec[0].value[0].value + '/' + this.oneGoodsSpec[1].value[0].value
value1 += '"'+this.oneGoodsSpec[0].name + '":"' + this.oneGoodsSpec[0].value[0].value + '",'
value1 += '"'+this.oneGoodsSpec[1].name + '":"' + this.oneGoodsSpec[1].value[0].value + '"'
value1 += "}"
value.push(value1)
this.evalue.push(name)
for (var i = 0; i < value.length; i++) {
this.attributeList = {
attributeList: value[i],
productCount: this.goodsNum,
productNum:0,
name: this.evalue[i],
price: this.goodsDetail.purchasePrice
}
this.temporaryList.push(this.attributeList);
}
let data = {
id: this.goodsDetail.id,
price: this.zPrice,
num: this.zNum,
categoryId:this.goodsDetail.categoryId,
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture,
supplierName: this.goodsDetail.supplierName,
saleDetailQueryDTO: this.temporaryList,
saleDetailQueryDTO1: [],
wholesalePrice: this.goodsDetail.wholesalePrice,
lsprice: this.goodsDetail.price
}
if (this.carList.length == 0) {
this.carList.push(data)
} else {
let aa = true;
for (let i = 0; i < this.carList.length; i++) {
if (this.carList[i].id == data.id) {
this.carList[i] = data
aa = false
}
}
if (aa) {
this.carList.push(data)
}
}
this.$nextTick(()=>{
that.$refs.goodsNumDialog.close()
that.goodsNum = ''
})
},
//库存商品详情
getKCList(id) {
this.yanseList = new Map()
@ -1229,7 +1320,8 @@
.content-right {
flex: 1;
overflow-y: scroll;
overflow-y: scroll;
padding-bottom: 100rpx;
}
.right-box {
@ -1466,5 +1558,38 @@
.zuni-numbox .zuni-numbox--disabled {
color: #c0c0c0 !important;
cursor: not-allowed;
}
.add-popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: 410rpx;
background-color: #fff;
}
.add-popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.add-popup-container {
margin-top: 20rpx;
}
.add-popup-bottom {
display: flex;
height: 80rpx;
color: #fff;
line-height: 80rpx;
margin-top: 30rpx;
}
.add-popup-btn {
flex: 1;
text-align: center;
background: linear-gradient(90deg, #60F3FF, #088FEB);
}
</style>

1
pages/index/checkShop.vue

@ -86,6 +86,7 @@
uni.setStorageSync('shopName', this.name)
uni.setStorageSync('shopAddress', res.result.shopAddress)
uni.setStorageSync('shopIcon', res.result.shopIcon)
uni.setStorageSync('type', res.result.userType)
this.tui.toast('切换店铺成功', 2000, true)
setTimeout(() => {
uni.reLaunch({

11
pages/index/index.vue

@ -135,7 +135,7 @@
<u-cell icon="account-fill" url="/package1/index/order?type=dingdan" title="销售单历史" clickable
isLink arrow-direction="left"></u-cell>
<view class="border-line"></view>
<u-cell v-if="shopName == '老王测试店铺' || shopName == '田一的店'" icon="integral-fill" url="/package1/AI/addAiList" title="管理员登录" clickable isLink
<u-cell v-if="shopName == '老王测试店铺' || shopName == '田一的店' || shopName == '青星'|| shopName == '侧视颠仆'" icon="integral-fill" url="/package1/AI/addAiList" title="管理员登录" clickable isLink
arrow-direction="left"></u-cell>
<!-- <u-cell icon="integral-fill" url="" title="电费缴纳" clickable isLink
arrow-direction="left"></u-cell>
@ -233,10 +233,6 @@
return val;
}
},
onShow() {
this.getSaleInfo()
},
onLoad() {
let that = this;
wx.getLocation({
@ -266,7 +262,7 @@
uni.setStorageSync("publicize", day)
this.$refs.publicizepopup.open('center')
}
this.getSaleInfo()
},
onTabItemTap(e) {
this.getSaleInfo()
@ -276,7 +272,8 @@
this.$refs.publicizepopup.close()
},
getSaleInfo() {
this.shopInfo = {}
this.shopInfo = {}
this.inventoryList = []
this.tui.request("/app/sale/getShopAll", "POST", {
pageVo: {
pageSize: 5,

2
pages/index/waitStorage.vue

@ -16,7 +16,7 @@
<view class="uni-body"><text class="cardText">
入库人:</text>{{item.createByName == null ?'暂无':item.createByName}}
</view>
<view class="uni-body" v-if="type==0">
<view class="uni-body" v-if="item.inStorageStatus != 0 && type==0">
<text class="cardText">总成本:</text>
<text class="priceText">{{item.shouldPay == null ?'暂无':item.shouldPay}} </text>
<text decode class="cardText">{{'&nbsp;&nbsp;&nbsp;&nbsp; 欠款: '}} </text>

1
pages/index/waitStorageDetail.vue

@ -329,6 +329,7 @@
//计算价格
changePrice(val) {
let that = this;
this.$refs.inputClose.value = ''
that.shouldPay = 0
that.goodsList[that.index].purchasePrice = val
that.goodsList[that.index].price = val * that.goodsList[that.index].productCount;

5
pages/inventory/changeGoods1.vue

@ -682,7 +682,7 @@
}
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
categoryId: this.goodsDetail.attrId
}, false, true).then((res1) => {
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
@ -839,7 +839,8 @@
//弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() {
this.evalue = []
let data = {
let data = {
attrId:this.goodsDetail.attrId,
id: this.goodsDetail.id,
price: this.goodsDetail.price,
categoryId:this.goodsDetail.categoryId,

683
pages/inventory/goodsList1.vue

@ -110,8 +110,7 @@
库存
</text>
</view>
<view
style="font-size: 30rpx;color: #000;font-weight: bold;width: 152rpx;display: inline-block;text-align: right;">
<view style="font-size: 30rpx;color: #000;font-weight: bold;width: 152rpx;display: inline-block;text-align: right;">
数量
</view>
</view>
@ -127,12 +126,12 @@
<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>
<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;">
<uni-number-box min="-10000" max="100000" style="margin-top:9rpx;border-right:0;"
v-model="values[1].productCount"
@change="GoodsNumChange($event,value,values[0])" />
v-model="values[1].productCount" @change="GoodsNumChange($event,value,values[0])"/>
</view>
</view>
</view>
@ -187,10 +186,16 @@
</uni-data-select>
</view>
<view class="content-list">
<view class="list-name" id="idss">总金额</view>
<view class="list-name" id="idss">销售总额</view>
<view class="list-val">
<input type="digit" v-model="shouldPay" disabled>
</view>
</view>
<view class="content-list">
<view class="list-name" id="idss">退货金额</view>
<view class="list-val">
<input type="digit" v-model="returnPay">
</view>
</view>
<view class="content-list">
<view class="list-name">实收金额</view>
@ -326,18 +331,27 @@
<view class="popup-pay-title">
<text>选择商品价格</text>
</view>
<view class="popup-pay-container" @tap.stop="checkPay(lsprice)">
<view class="popup-pay-container" @tap.stop="checkPay(lsprice,'')">
<text style="display: inline-block">零售价:¥{{lsprice}}</text>
</view>
<view class="popup-pay-container" @tap.stop="checkPay(wholesalePrice)">
<view class="popup-pay-container" @tap.stop="checkPay(wholesalePrice,'')">
<text style="display: inline-block">批发价:¥{{wholesalePrice}}</text>
</view>
<view class="popup-pay-title" style="font-size: 18px;margin-top: 10px;border-top: 1px solid #eee;padding: 10px;border-bottom: 1px solid #eee;">
<text>自定义价格</text>
</view>
<view class="popup-pay-container" style="background: #fff;display: flex;width: 100%;">
<input type="digit" style="height: 100rpx;line-height: 100rpx;color:#000;width: 296rpx;"
placeholder="请输入价格" @input="changePay">
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;width: 144rpx;"
@tap.stop="checkPay(customPrice)">确定</view>
</view>
<view class="popup-pay-container" style="background: #fff;display: flex;width: 100%;height: 70rpx;color: #000;border: none;line-height: 70rpx;">
<view style="width:120rpx;text-align: left;">售价:</view>
<input type="digit" style="height: 70rpx;line-height: 70rpx;color: #000;width: 296rpx;border-bottom: 1px solid #eee;"
placeholder="请输入售价" @input="changePay">
</view>
<view class="popup-pay-container" style="background: #fff;display: flex;width: 100%;height: 70rpx;color: #000;border: none;line-height: 70rpx;">
<view style="width:120rpx;">退货价:</view>
<input type="digit" style="height: 70rpx;line-height: 70rpx;color: #000;width: 296rpx;border-bottom: 1px solid #eee;"
placeholder="请输入退货价" @input="changeReturnPay">
</view>
<view style="width: 100%;color: #fff;height: 70rpx;background: #088FEB;border-radius: 5px;font-size: 30rpx;text-align: center;line-height: 70rpx;margin-top: 20rpx;"
@tap.stop="checkPay(customPrice,returnPrice)">确定</view>
</view>
</uni-popup>
<!-- <canvas canvas-id="myCanvas"></canvas> -->
@ -446,7 +460,7 @@
<view style="height: 150rpx;line-height: 150rpx;text-align: center;">暂无拿货历史</view>
</view>
<view class="popup-bottom" v-if="historyList != null">
<view class="popup-btn" @tap="checkPay(historyList.discountAmount)">一键使用历史价格</view>
<view class="popup-btn" @tap="checkPay(historyList.discountAmount,'')">一键使用历史价格</view>
</view>
</view>
</uni-popup>
@ -685,9 +699,11 @@
lbgName: [], //拉包工姓名
carList: new Map(), //添加商品页传回来的商品信息
xsyId: '',
shouldPay: 0,
shouldPay: 0,
returnPay:0,
totalAmount: 0,
customPrice: 0, //选择自定义金额
customPrice: 0, //选择自定义金额
returnPrice:0,
remark: '',
pbAddress: '',
yanseList: new Map(),
@ -727,11 +743,21 @@
kkPrinter
},
onHide(){
console.log('1加载了啊')
console.log("1111")
this.recordState = false
setTimeout(res=>{
uni.closeBLEConnection({
deviceId:uni.getStorageSync('deviceId'),
success(res) {
console.log(res)
},fail(err){
console.log(err)
}
})
},5000)
},
onShow() {
console.log('加载了啊')
this.recordState = false
// 初始化蓝牙模块
wx.openBluetoothAdapter({
@ -870,23 +896,22 @@
},
handleData() {
let that = this;
for (let i = 0; i < this.carList1.length; i++) {
if (this.carList1[i].saleDetailQueryDTO) {
if (this.carList.size == 0) { //当前页没有数据
let obj = {
purchasePrice: this.carList1[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
categoryId: this.carList1[i].categoryId,
unitPrice: this.carList1[i].unitPrice || 0, //单价
discountAmount: this.carList1[i].wholesalePrice || 0, //折后价
discountAmount: this.carList1[i].wholesalePrice || 0, //折后价
returnPrice:this.carList1[i].wholesalePrice || 0,
disNoAmount: 0, //折前价,用于计算整体折扣
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].lsprice, //零售价
productCount: 0, //总数量
productCount: 0, //总数量
returnCount:0, //退货数量
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
@ -904,8 +929,13 @@
.saleDetailQueryDTO[m].stockCount
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
if(this.carList1[i].saleDetailQueryDTO[m].productCount < 0){ //退货数量
obj.returnCount += Math.abs(this.carList1[i].saleDetailQueryDTO[m].productCount)
}else{
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
}
this.carList.set(this.carList1[i].id, obj)
} else { //当前页有数据
@ -952,10 +982,13 @@
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
.saleDetailQueryDTO[
m].attributeList, data1)
}
if(this.carList1[i].saleDetailQueryDTO[m].productCount < 0){ //退货数量
this.carList.get(this.carList1[i].id).returnCount += Math.abs(this.carList1[i].saleDetailQueryDTO[m].productCount)
}else{
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.get(this.carList1[i].id).productCount += this.carList1[i]
.saleDetailQueryDTO[
m].productCount
}
} else { //商品不同
let obj = {
@ -963,12 +996,14 @@
price: 0,
discount: 10,
categoryId: this.carList1[i].categoryId,
discountAmount: this.carList1[i].wholesalePrice || 0,
discountAmount: this.carList1[i].wholesalePrice || 0,
returnPrice: this.carList1[i].wholesalePrice || 0,
disNoAmount: 0, //折前价,用于计算整体折扣
unitPrice: this.carList1[i].unitPrice || 0, //单价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].lsprice, //零售价
productCount: 0,
productCount: 0,
returnCount:0,
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
@ -990,8 +1025,12 @@
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.name = this.carList1[i].saleDetailQueryDTO[m].name
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
obj.name = this.carList1[i].saleDetailQueryDTO[m].name
if(this.carList1[i].saleDetailQueryDTO[m].productCount < 0){ //退货数量
obj.returnCount += Math.abs(this.carList1[i].saleDetailQueryDTO[m].productCount)
}else{
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
}
this.carList.set(this.carList1[i].id, obj)
}
@ -1032,7 +1071,8 @@
setTimeout(res => {
uni.hideLoading();
}, 300)
}
}
console.log('退货金额',this.carList)
},
invenRadio() {
@ -1053,7 +1093,8 @@
productId: this.carList1[i].productId,
categoryId: this.carList1[i].categoryId,
unitPrice: this.carList1[i].wholesalePrice || 0, //单价
discountAmount: this.carList1[i].wholesalePrice || 0, //折后价
discountAmount: this.carList1[i].wholesalePrice || 0, //折后价
returnPrice: this.carList1[i].wholesalePrice || 0,
disNoAmount: 0, //折前价,用于计算整体折扣
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].price, //零售价
@ -1117,7 +1158,8 @@
categoryId: this.carList1[i].categoryId,
productId: this.carList1[i].productId,
unitPrice: this.carList1[i].wholesalePrice || 0, //单价
discountAmount: this.carList1[i].wholesalePrice || 0, //折后价
discountAmount: this.carList1[i].wholesalePrice || 0, //折后价
returnPrice: this.carList1[i].wholesalePrice || 0,
disNoAmount: 0, //折前价,用于计算整体折扣
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].price, //零售价
@ -1676,9 +1718,10 @@
'实件': '10件',
'景': '#',
'警': '#',
'颈': '#',
'颈': '#',
'括号':'货号'
};
const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|金色|井|时间|事件|世间|实践|实件|景|警|颈)/g;
const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|金色|井|时间|事件|世间|实践|实件|景|警|颈|括号)/g;
return str.replace(regex, match => chineseNumToArabic[match]);
},
//编辑挂单信息
@ -1711,6 +1754,9 @@
if(convertedStr.indexOf(',') == 0){
console.log('位置',convertedStr.indexOf(','))
convertedStr = convertedStr.substr(1)
}
if (convertedStr.startsWith("号")) {
convertedStr = "货号" + convertedStr.substr(1);
}
this.getMsg = convertedStr
this.tui.request("/app/sale/buyAi", "POST", {
@ -1841,9 +1887,11 @@
await this.carList.forEach(function(value, key) {
that.index = value.productId || value.id
if (e == '0') { //零售
value.discountAmount = value.lsprice
value.discountAmount = value.lsprice
value.returnPrice= value.lsprice
} else { //批发
value.discountAmount = value.wholesalePrice
value.discountAmount = value.wholesalePrice
value.returnPrice= value.wholesalePrice
}
})
await this.getAllPrice()
@ -1854,7 +1902,7 @@
this.$forceUpdate()
},
//商品上选择是零售价还是批发价
checkPay(price) {
checkPay(price,returnPrice) {
if (price == undefined || price == null) {
this.tui.toast("暂无拿货记录")
@ -1863,7 +1911,10 @@
let that = this;
let num = this.carList.get(this.index)
num.discountAmount = price
num.discountAmount = price
if(returnPrice != ''){
num.returnPrice = returnPrice
}
num.unitPrice = price;
num.price = price * num.productCount;
this.$refs.inputDialog.close()
@ -2239,7 +2290,8 @@
discount: 10, //折扣
unitPrice: 0, //单价
categoryId: carList1[i].categoryId,
discountAmount: carList1[i].wholesalePrice || 0, //折后价
discountAmount: carList1[i].wholesalePrice || 0, //折后价
returnPrice: carList1[i].wholesalePrice || 0,
disNoAmount: 0, //折前价,用于计算整体折扣
wholesalePrice: carList1[i].wholesalePrice, //批发价
lsprice: carList1[i].lsprice, //零售价
@ -2304,7 +2356,8 @@
purchasePrice: carList1[i].price, //采购价
price: 0,
discount: 10,
discountAmount: carList1[i].wholesalePrice || 0,
discountAmount: carList1[i].wholesalePrice || 0,
returnPrice: carList1[i].wholesalePrice || 0,
disNoAmount: 0, //折前价,用于计算整体折扣
unitPrice: 0, //单价
categoryId: carList1[i].categoryId,
@ -2424,6 +2477,9 @@
}
if(convertedStr.indexOf(',') == 0){
convertedStr = convertedStr.substr(1)
}
if (convertedStr.startsWith("号")) {
convertedStr = "货号" + convertedStr.substr(1);
}
if (that.voiceText == '' || that.voiceText == null) {
that.voiceText = convertedStr
@ -2457,7 +2513,8 @@
}
}
},
showPrice() {
showPrice() {
let that = this;
if (this.khName == '') {
this.tui.toast('请选择客户!')
return
@ -2496,11 +2553,23 @@
} else {
this.tui.toast('请选择发货方式!')
return
}
}
let printHeight = 800
this.carList.forEach(function(value, key) {
printHeight += 30
value.stockLogList.forEach(function(value1, key1) {
printHeight += 30
})
})
this.printTotal = printHeight
this.bufferData = []
let strCmd = this.getPrintData()
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
this.$refs.showPopup.open()
},
//点击底部开单按钮
goSell(print) {
async goSell(print) {
let that = this;
uni.showLoading({
title: '加载中...'
@ -2535,51 +2604,121 @@
companyName: this.wlName.shippingMethod || this.wlName.companyName,
companyPhone: this.wlName.mobile
},
saleDetailList: []
saleDetailList: [],
saleReturnDTO:[]
}
let purchaseDetails = [];
this.carList.forEach(function(value, key) {
let purchaseDetails = [];
let returnList = [];
console.log('carList',this.carList)
await this.carList.forEach(function(value, key) {
let returnGoods = []
let goodsList = []
value.stockLogList.forEach(function(values, keys) {
if (values <= 0) {
if (values.productCount == 0) {
that.tui.toast("商品数量不能为零!")
return;
}
console.log('values',values)
if(values.productCount < 0){
console.log()
let obj1 = {
productCount: values.productCount,
attributeList: keys
}
returnGoods.push(obj1)
}else{
let obj1 = {
productCount: values.productCount,
attributeList: keys
}
goodsList.push(obj1)
}
let obj = {
productCount: values.productCount,
attributeList: keys
}
value.stockLogList1.push(obj)
})
that.$nextTick(()=>{
if(returnGoods.length > 0){
let data = {
categoryId: value.categoryId,
disNoAmount: value.disNoAmount,
discount: value.discount,
discountAmount: value.discountAmount,
lsprice: value.lsprice,
price: value.price,
productCount: value.productCount,
productId: value.productId,
productName: value.productName,
productPicture: value.productPicture,
productSn: value.productSn,
purchasePrice: value.purchasePrice,
returnCount: value.returnCount,
returnPrice: value.returnPrice,
stockLogList: value.stockLogList,
stockLogList1: returnGoods,
supplierName: value.supplierName,
unitPrice: value.unitPrice,
wholesalePrice: value.wholesalePrice
}
returnList.push(data)
}
if(goodsList.length > 0){
let data = {
categoryId: value.categoryId,
disNoAmount: value.disNoAmount,
discount: value.discount,
discountAmount: value.discountAmount,
lsprice: value.lsprice,
price: value.price,
productCount: value.productCount,
productId: value.productId,
productName: value.productName,
productPicture: value.productPicture,
productSn: value.productSn,
purchasePrice: value.purchasePrice,
returnCount: value.returnCount,
returnPrice: value.returnPrice,
stockLogList: value.stockLogList,
stockLogList1: goodsList,
supplierName: value.supplierName,
unitPrice: value.unitPrice,
wholesalePrice: value.wholesalePrice
}
purchaseDetails.push(data)
}
})
purchaseDetails.push(value)
})
this.saleDetailList = purchaseDetails;
obj.saleDetailList = purchaseDetails;
let url = ''
if (this.saleId != '') {
url = '/app/sale/shareToBuyNew'
} else {
url = '/app/sale/buyNew'
}
this.tui.request(url, "post", obj, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "开单成功",
icon: 'none'
})
if (print != 'print') {
setTimeout(res => {
this.$refs.showPopup.close()
that.clearAll1()
uni.switchTab({
url: '/pages/index/index'
});
}, 1000)
}
} else {
this.tui.toast(res.message)
}
})
await that.$nextTick(()=>{
setTimeout(res=>{
obj.saleDetailList = purchaseDetails;
obj.saleReturnDTO = returnList;
let url = ''
if (this.saleId != '') {
url = '/app/sale/shareToBuyNew'
} else {
url = '/app/sale/buyNew'
}
this.tui.request(url, "post", obj, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "开单成功",
icon: 'none'
})
if (print != 'print') {
setTimeout(res => {
this.$refs.showPopup.close()
that.clearAll1()
uni.switchTab({
url: '/pages/index/index'
});
}, 1000)
}
} else {
this.tui.toast(res.message)
}
})
},500)
})
setTimeout(res => {
uni.hideLoading();
}, 1000)
@ -2591,236 +2730,111 @@
// url: '/pages/index/index'
// });
// },
//打印小票
onPrint(opt) {
let that = this;
this.goSell('print')
let strCmd = ''
that.yNum = 150
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(2);
strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, uni.getStorageSync('shopName'))
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:' + this.khName.name)
// strCmd += blesdk.addCPCLText('280', '100', '24', '0', 0, this.sales.id)
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:' + this.createByName)
strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:' + this.formatDate(new Date(),
'YYYY-MM-DD')) //+
strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0,
'=========================================================')
this.carList.forEach(function(value, key) {
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, value.productName + '(' +
value.productSn + ')')
} else {
that.yNum = 0
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, value.productName +
'(' +
value.productSn + ')')
}
value.stockLogList.forEach(function(value1, key1) {
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, '□ ' + (that
.slicePrint(
key1)) + '*' + value1.productCount)
strCmd += blesdk.addCPCLText('240', that.yNum, '24', '0', 0, '单价:' + value
.discountAmount)
strCmd += blesdk.addCPCLText('400', that.yNum, '24', '0', 0, '总价:' + (value
.discountAmount * value1.productCount))
} else {
that.yNum = 0
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '□ ' + (that
.slicePrint(key1)) + '*' + value1.productCount)
strCmd += blesdk.addCPCLText('240', that.yNum, '24', '0', 0, '单价:' + value
.discountAmount)
strCmd += blesdk.addCPCLText('400', that.yNum, '24', '0', 0, '总价:' + (value
.discountAmount * value1.productCount))
}
})
})
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,
'===============================================================')
} else {
this.yNum = 0
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,
'===============================================================')
}
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '总数量:' + this.totalAmount)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额:' + this.shouldPay)
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice)
} else {
this.yNum = 0
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (this.yNum += 30), '24', '0', 0, '总数量:' + this.totalAmount)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额:' + this.shouldPay)
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice)
}
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '实收:' + this.priceOk)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.relPrice - this.priceOk)
.toFixed(2))
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.otherExpense == '' ? 0 :
this.otherExpense))
} else {
this.yNum = 0
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (this.yNum += 30), '24', '0', 0, '实收:' + this.priceOk)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.relPrice - this.priceOk)
.toFixed(2))
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.otherExpense == '' ? 0 :
this.otherExpense))
}
if (Math.ceil(Number(this.remark.length) / 20) * 30 + this.yNum < that.printTotal) {
if (this.remark.length > 20) {
let position = 20;
let part1 = this.remark.substring(0, position);
let part2 = this.remark.substring(position);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1)
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2)
} else {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.remark)
}
} else {
this.yNum = 0
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
if (this.remark.length > 20) {
let position = 20;
let part1 = this.remark.substring(0, position);
let part2 = this.remark.substring(position);
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1)
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2)
} else {
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.remark)
}
}
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,
'===============================================================')
} else {
this.yNum = 0
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,
'===============================================================')
}
//店铺地址
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '店铺地址:' + uni.getStorageSync(
'shopAddress'))
} else {
this.yNum = 0
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '店铺地址:' + uni.getStorageSync(
'shopAddress'))
}
//店铺电话
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + uni.getStorageSync(
'username'))
} else {
that.yNum = 0
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '店铺电话:' + uni.getStorageSync(
'username'))
//打印小票
async onPrint(opt) {
let that = this;
await this.goSell('print')
this.$nextTick(() => {
uni.hideLoading();
that.$refs.showPopup.close()
that.bufferData = []
that.clearAll1()
uni.switchTab({
url: '/pages/index/index'
});
})
},
getPrintData(){
let that = this;
let strCmd = ''
that.yNum = 300
strCmd = blesdk.CreatCPCLPage(1000, this.printTotal, 1, 0);
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(2);
strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, '')
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(2);
strCmd += blesdk.addCPCLText('0', '110', '24', '0', 0, uni.getStorageSync('shopName'))
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLLocation(0);
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('0', '190', '24', '0', 0, '客户:' + that.khName.name)
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', '240', '24', '0', 0, '销售员:' + that.createByName)
strCmd += blesdk.addCPCLText('500', '240', '24', '0', 0, '日期:' + that.formatDate(new Date(),
'YYYY-MM-DD')) //+
strCmd += blesdk.addCPCLText('0', '300', '24', '0', 0,
'=====================================================================================')
that.carList.forEach(function(value, key) {
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, value.productName + '(' +
value.productSn + ')')
value.stockLogList.forEach(function(value1, key1) {
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, '□ ' + (that
.slicePrint(key1)))
strCmd += blesdk.addCPCLText('220', that.yNum, '24', '0', 0, '数量:'+ value1.productCount)
strCmd += blesdk.addCPCLText('400', that.yNum, '24', '0', 0, '单价:' + value
.discountAmount)
strCmd += blesdk.addCPCLText('650', that.yNum, '24', '0', 0, '总价:' + (value
.discountAmount * value1.productCount))
})
})
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0,
'==========================================================================================')
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '总数量:' + that.totalAmount)
strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '总金额:' + that.shouldPay)
strCmd += blesdk.addCPCLText('630', that.yNum, '24', '0', 0, '应收:' + that.relPrice)
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '实收:' + that.priceOk)
strCmd += blesdk.addCPCLText('300', that.yNum, '24', '0', 0, '欠款:' + (that.relPrice - that.priceOk)
.toFixed(2))
strCmd += blesdk.addCPCLText('630', that.yNum, '24', '0', 0, '其他费用:' + (that.otherExpense == '' ? 0 :
that.otherExpense))
if(that.remark != ''){
if (that.remark.length > 20) {
let position = 20;
let part1 = that.remark.substring(0, position);
let part2 = that.remark.substring(position);
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '备注:' + part1)
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, part2)
} else {
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '备注:' + that.remark)
}
}
if(this.qrArr.length != 0){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0,
'=========================================================================================')
//店铺地址
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, '店铺地址:' + uni.getStorageSync(
'shopAddress'))
//店铺电话
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '店铺电话:' + uni.getStorageSync(
'username'))
if(that.qrArr.length != 0){
//店铺微信/微信收款/支付宝收款/收款码收款(店铺,微信,支付,收款)
for (let i = 0; i < this.qrArr.length; i++) {
for (let i = 0; i < that.qrArr.length; i++) {
//店铺二维码
console.log(that.qrArr[i])
console.log(that.yNum)
console.log(that.countWidth(i,600/that.qrArr.length))
if ((that.yNum + 200) < that.printTotal) {
console.log('11111')
strCmd += blesdk.addCPCLQRCode(that.countWidth(i,600/that.qrArr.length), (that.yNum + 50), that.qrArr[i].level, '2', 3, that.qrArr[i].path) //二维码
strCmd += blesdk.addCPCLText(that.countWidth(i,600/that.qrArr.length), (that.yNum + 180), '24', '0', 0, that.qrArr[i].name)
strCmd += blesdk.addCPCLLocation(0);
if(this.qrArr.length == (i+1)){
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
}
} else {
console.log('2222')
// that.yNum = 0
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLQRCode(that.countWidth(i,600/that.qrArr.length) , 30, that.qrArr[i].level, '2', 3, that.qrArr[i].path) //二维码
strCmd += blesdk.addCPCLText(that.countWidth(i,600/that.qrArr.length), 180, '24', '0', 0, that.qrArr[i].name)
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
}
console.log('11111')
strCmd += blesdk.addCPCLQRCode(that.countWidth(i,1000/that.qrArr.length), (that.yNum + 80), that.qrArr[i].level, '2', 4, that.qrArr[i].path) //二维码
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText(that.countWidth(i,1000/that.qrArr.length), (that.yNum + 240), '24', '0', 0, that.qrArr[i].name)
strCmd += blesdk.addCPCLLocation(0);
}
}else{
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
}
uni.hideLoading();
this.$nextTick(() => {
console.log('bufferData',that.bufferData)
that.$refs.showPopup.close()
that.bufferData = []
that.clearAll1()
uni.switchTab({
url: '/pages/index/index'
});
})
return strCmd;
},
countWidth(num,len){
// if(num == 0){
@ -2831,11 +2845,11 @@
},
//计算打印机当前行高度
countPrint() {
if ((this.yNum + 50) >= 1040) {
return this.yNum += 50
} else {
// if ((this.yNum + 50) >= 1040) {
// return this.yNum += 50
// } else {
return this.yNum += 30
}
// }
},
//截取
slicePrint(val) {
@ -2871,6 +2885,10 @@
this.wholesalePrice = this.carList.get(this.index).wholesalePrice
this.lsprice = this.carList.get(this.index).lsprice
this.$refs.inputDialog.open()
},
//输入商品自定义退货金额
changeReturnPay(e) {
this.returnPrice = e.detail.value
},
//输入商品自定义金额
changePay(e) {
@ -2959,27 +2977,40 @@
let that = this;
this.shouldPay = 0
this.totalAmount = 0
that.returnPay = 0
this.carList.forEach(function(value, key) {
that.shouldPay = Number(that.shouldPay) + Number(value.price)
that.totalAmount = that.totalAmount + value.productCount
that.returnPay = Number(that.returnPay) + (Number(value.returnPrice) * Math.abs(Number(value.returnCount)))
if(value.productCount > 0){
that.totalAmount = that.totalAmount + value.productCount
}
})
that.shouldPay = that.shouldPay.toFixed(2)
that.shouldPay = that.shouldPay.toFixed(2)
that.returnPay = that.returnPay.toFixed(2)
this.relPrice = this.shouldPay
this.priceOk = this.shouldPay
this.priceOk = this.shouldPay - that.returnPay
this.$forceUpdate()
that.noPay = this.relPrice - (this.priceOk == '' ? 0 : this.priceOk)
that.noPay = this.relPrice - (this.priceOk == '' ? 0 : this.priceOk) - this.returnPay
that.noPay = that.noPay.toFixed(2)
},
//修改已选规格的数量
GoodsNumChange(e, index, index1) {
let that = this;
this.carList.get(index[0]).stockLogList.get(index1).productCount = e
this.carList.get(index[0]).productCount = 0
let that = this;
if(e < 0){
this.carList.get(index[0]).stockLogList.get(index1).productCount = e
}else{
this.carList.get(index[0]).stockLogList.get(index1).productCount = e
}
this.carList.get(index[0]).productCount = 0
this.carList.get(index[0]).returnCount = 0
this.carList.get(index[0]).stockLogList.forEach(function(value, key) {
that.carList.get(index[0]).productCount = that.carList.get(index[0]).productCount + value
.productCount
if(value.productCount < 0){
that.carList.get(index[0]).returnCount = that.carList.get(index[0]).returnCount + Math.abs(value.productCount)
}else{
that.carList.get(index[0]).productCount = that.carList.get(index[0]).productCount + value.productCount
}
if (that.discountType == 0) { //单品折扣
// that.carList.get(index[0]).price = that.carList.get(index[0]).productCount * (that.carList.get(
// index[0]).discountAmount * (that.carList.get(index[0]).discount / 10))

7
pages/inventory/inventory.vue

@ -38,8 +38,8 @@
</view>
<view class="title-right">
<view class="title-right-top title-btn" @tap.stop="onGridClick('1')">
新增入库
<view class="title-right-top title-btn" @tap.stop="onGridClick('2')">
新增商品
</view>
<view class="title-right-bottom title-btn" @tap.stop="onGridClick('3')">
更多
@ -138,9 +138,6 @@
<view class="popup-pay-container" @tap="onGridClick('0')">
<text style="display: inline-block">分类管理</text>
</view>
<view class="popup-pay-container" @tap="onGridClick('2')">
<text style="display: inline-block">新增商品</text>
</view>
<view class="popup-pay-container" @tap="onGridClick('4')">
<text style="display: inline-block">批量打印商品码</text>
</view>

14
pages/inventory/inventoryDetail.vue

@ -157,7 +157,7 @@
@confirm="changePrice"></uni-popup-dialog>
</uni-popup>
<view v-if="isPrint" class="bottom-btn">
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint1" :printNum="printNum" :defaultText="'打印'"></kk-printer>
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" :printNum="printNum" :defaultText="'打印'"></kk-printer>
</view>
<!-- 右下角悬浮按钮 -->
<uni-fab v-if="!isPrint" ref="fab" :content="content" :horizontal="horizontal"
@ -249,6 +249,18 @@
},
components: {
kkPrinter
},
onHide(){
setTimeout(res=>{
uni.closeBLEConnection({
deviceId:uni.getStorageSync('deviceId'),
success(res) {
console.log(res)
},fail(err){
console.log(err)
}
})
},5000)
},
onLoad(option) {
// 初始化蓝牙模块

Loading…
Cancel
Save