wangfukang 3 years ago
parent
commit
ddfa9d2918
  1. 23
      pages/index/addHangOrder.vue
  2. 67
      pages/index/checkShop.vue
  3. 14
      pages/index/dataStatistics.vue
  4. 24
      pages/index/index.vue
  5. 18
      pages/index/orderDetail.vue
  6. 35
      pages/inventory/addGoods.vue
  7. 83
      pages/inventory/goodsList1.vue
  8. 12
      pages/inventory/inventory.vue

23
pages/index/addHangOrder.vue

@ -317,17 +317,28 @@
uni.scanCode({
success: (res) => {
this.hangId = item.id
let shopId = res.result.split(',')[1]
if(shopId == uni.getStorageSync('shopId')){
this.productId = res.result.split(',')[0]
this.toggle('bottom', res.result.split(',')[0]);
if(res.scanType == "QR_CODE"){ //二维码
let shopId = res.result.split(',')[1]
if(shopId == uni.getStorageSync('shopId')){
this.productId = res.result.split(',')[0]
this.toggle('bottom', res.result.split(',')[0]);
if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
this.carList.push(item.saleDetailDTOList[i])
}
}
}else{
this.tui.toast('您的店铺中暂无该商品!')
}
}else{
this.productId = res.result
this.toggle('bottom', res.result);
if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
this.carList.push(item.saleDetailDTOList[i])
}
}
}else{
this.tui.toast('您的店铺中暂无该商品!')
}
},

67
pages/index/checkShop.vue

@ -4,16 +4,16 @@
<u-alert description="右滑可编辑店铺名称" type="primary"></u-alert>
<view>
<u-swipe-action>
<u-swipe-action-item :options="options1" index="1" v-for="item in shopList" :key="item.shopId"
@click="onActionItemSwipe(item)">
<view class="swipe-action u-border-top u-border-bottom" @click="onActionItemClick(item)">
<u-swipe-action-item :options="options1" index="1" v-for="(item,index) in shopList" :key="index"
@tap.stop="onActionItemSwipe(item)">
<view class="swipe-action u-border-top u-border-bottom" @tap.stop="onActionItemClick(item)">
<view class="swipe-action__content">
<text class="swipe-action__content__text">{{ this.type=='wuliu'?item.companyName:item.shopName }}</text>
<view class="swipe-action__content__icon" v-if="item.shopId == current">
<u-icon color="#1ba035" name="checkmark-circle-fill"></u-icon>
</view>
<text class="swipe-action__content__text">{{ type=='wuliu'?item.companyName:item.shopName }}</text>
<view class="swipe-action__content__icon" v-if="item.id == current && type=='wuliu'">
<u-icon color="#1ba035" name="checkmark-circle-fill"></u-icon>
</view>
<view class="swipe-action__content__icon" v-if="item.shopId == current && type!='wuliu'">
<u-icon color="#1ba035" name="checkmark-circle-fill"></u-icon>
</view>
</view>
</view>
@ -75,29 +75,34 @@
},
methods: {
...mapMutations(['setShopIndex']),
submit() {
this.tui.request("/auth/chooseShop", "POST", {
shopId: this.current
}, false, true).then((res) => {
if (res.code == 200) {
uni.setStorageSync('shopName', this.name)
this.tui.toast('切换店铺成功', 2000, true)
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index'
})
}, 200)
} else {
this.tui.toast(res.message)
return
}
}).catch((res) => {})
submit() {
if(this.type == 'wuliu'){
this.getWuliuList()
}else{
this.tui.request("/auth/chooseShop", "POST", {
shopId: this.current
}, false, true).then((res) => {
if (res.code == 200) {
uni.setStorageSync('shopName', this.name)
this.tui.toast('切换店铺成功', 2000, true)
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index'
})
}, 200)
} else {
this.tui.toast(res.message)
return
}
}).catch((res) => {})
}
},
getWuliuList(){
let that = this;
uni.request({
url: this.tui.interfaceUrl() + "/app/logitics/chooseCompany",
data: {
companyId: uni.getStorageSync('transCompany')
companyId: this.current
},
header: {
'content-type': 'application/x-www-form-urlencoded',
@ -182,9 +187,15 @@
this.shopId = item.shopId
},
//切换店铺
onActionItemClick(item) {
this.current = item.shopId
this.name = item.shopName
onActionItemClick(item) {
console.log(item)
if(this.type == 'wuliu'){
this.current = item.id
this.name = item.companyName
}else{
this.current = item.shopId
this.name = item.shopName
}
},
onEditSave() {
if (!this.shopName) return this.tui.toast('请输入新店铺名称', 2000, )

14
pages/index/dataStatistics.vue

@ -10,8 +10,14 @@
<text class="grid-text">销售总金额</text>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalAlreadyEarn + shopInfo.totalPayAmount"></u-count-to>
<view class="grid-text">实收总额</view>
<uni-tooltip :content="'订单实收:' + shopInfo.totalAlreadyEarn +'回款:'+ shopInfo.totalPayAmount" placement="left">
<view class="grid-text" style="display: flex;">
<text>实收总额</text>
<u-icon name="question-circle" size="16"></u-icon>
</view>
</uni-tooltip>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="type==0?shopInfo.totalProfit:0" :decimals="2"></u-count-to>
@ -194,4 +200,10 @@
.uni-date{
background: #fff;
}
.uni-tooltip-popup{
width: 180rpx;
}
.u-icon{
padding: 0 0 0 8px !important;
}
</style>

24
pages/index/index.vue

@ -38,11 +38,19 @@
<u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalAmount" :decimals="2"></u-count-to>
<text class="grid-text">销售总金额</text>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalAlreadyEarn + shopInfo.totalPayAmount"></u-count-to>
<view class="grid-text">今日实收</view>
</u-grid-item>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalAlreadyEarn + shopInfo.totalPayAmount"></u-count-to>
<uni-tooltip :content="'订单实收:' + shopInfo.totalAlreadyEarn +'回款:'+ shopInfo.totalPayAmount" placement="left">
<view class="grid-text" style="display: flex;">
<text>今日实收</text>
<u-icon name="question-circle" size="16"></u-icon>
</view>
</uni-tooltip>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="type==0?shopInfo.totalProfit:0" :decimals="2"></u-count-to>
<view class="grid-text">今日利润</view>
@ -505,6 +513,9 @@
.status-bar {
height: 42px !important;
}
.u-icon{
padding: 0 0 0 8px !important;
}
.cmd-nav-bar {
height: 90rpx !important;
@ -535,5 +546,8 @@
width: 100%;
height: 15rpx;
background: #eee;
}
.uni-tooltip-popup{
width: 180rpx;
}
</style>

18
pages/index/orderDetail.vue

@ -234,7 +234,7 @@
</u-popup>
<view class="tui-tabbar">
<view class="tui-btn-mr" v-if="sales.status != 6 && sales.status != 2">
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint">贴包单</kk-printer>
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint"></kk-printer>
</view>
<view class="tui-btn-mr" v-if="sales.status == 0 || sales.status == 1" @click="cancelOrder">取消订单</view>
<view class="tui-btn-mr" v-if="sales.status == 4" @click="returnGoods">{{ !isReturn ? '退货' : '确认退货'}}</view>
@ -256,7 +256,11 @@
<script>
import util from '@/components/kk-printer/utils/util.js';
import * as blesdk from '@/components/kk-printer/utils/bluetoolth.js';
import kkPrinter from '@/components/kk-printer/index.vue';
import kkPrinter from '@/components/kk-printer/index.vue';
import {
maskShopName,
maskPhone
} from '@/utils/global.js'
export default {
data() {
return {
@ -405,9 +409,9 @@
strCmd += blesdk.addCPCLText('40', '30', '24', '0', 0, '沧州明珠商贸城--快衣店')
strCmd += blesdk.addCPCLSETMAG(3, 3)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('50', '120', '24', '0', 0, '收:' + this.sales.userName)
strCmd += blesdk.addCPCLText('50', '120', '24', '0', 0, '收:' + maskShopName(this.sales.userName))
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('50', '250', '24', '0', 0, this.order.phone)
strCmd += blesdk.addCPCLText('50', '250', '24', '0', 0, maskPhone(this.order.phone))
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('50', '330', '24', '0', 0, this.sales.province + '/' + this.sales.city + '/' +
@ -417,11 +421,11 @@
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('0', '490', '24', '0', 0, '——————————————————————————————')
strCmd += blesdk.addCPCLText('50', '570', '24', '0', 0, '发货方式:' + this.sales.companyName)
strCmd += blesdk.addCPCLText('50', '570', '24', '0', 0, '发货方式:' + this.sales.companyName?this.sales.companyName:'')
strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLText('0', '650', '24', '0', 0, '——————————————————————————————')
strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:' + this.sales.shopName)
strCmd += blesdk.addCPCLText('50', '810', '24', '0', 0, this.sales.createByPhone)
strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:' + maskShopName(this.sales.shopName))
strCmd += blesdk.addCPCLText('50', '810', '24', '0', 0, maskPhone(this.sales.createByPhone))
strCmd += blesdk.addCPCLText('50', '890', '24', '0', 0, '地址:' + this.shopData.shopAddress)
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint();

35
pages/inventory/addGoods.vue

@ -15,6 +15,10 @@
</uni-forms-item>
<uni-forms-item label="货号" name="productSn" required>
<uni-easyinput type="text" v-model="formData.productSn" placeholder="请输入货号" trim="all" />
</uni-forms-item>
<uni-forms-item label="商品条码" name="barcode">
<uni-easyinput type="text" v-model="formData.barcode" placeholder="可以扫码商品条码添加" trim="all" />
<u-icon name="camera" size="36" @tap.stop='scanCodeAdd'></u-icon>
</uni-forms-item>
<uni-forms-item label="批发价" name="wholesalePrice" required>
<uni-easyinput type="digit" v-model="formData.wholesalePrice" placeholder="请输入批发价" trim="all" />
@ -69,7 +73,8 @@
productIntro: '',
categoryId: '',
salesWeek: '',
tailWarn: ''
tailWarn: '',
barcode:''
},
categoryList: [],
productId:'',
@ -135,6 +140,7 @@
if(option.dataList){
this.dataList = JSON.parse(option.dataList)
this.formData.productName = this.dataList.productName
this.formData.barcode = this.dataList.barcode
this.formData.price = this.dataList.price
this.formData.productSn = this.dataList.productSn
this.formData.wholesalePrice = this.dataList.wholesalePrice
@ -247,6 +253,33 @@
uni.navigateTo({
url: '/pages/inventory/gategory'
})
},
scanCodeAdd() {
let that = this;
uni.scanCode({
scanType: ['barCode'],
success: (res) => {
console.log(res)
that.tui.request('/app/product/getByBarcode', "post", {
barcode:res.result
}, false, true).then((res1) => {
if (res1.code == 200) {
if(res1.result != ''){
that.tui.toast('当前条码已被商品:“'+res1.result[0].productName+'”占用,请重新输入')
}else{
that.formData.barcode = res.result;
}
}
})
},
fail: (res) => {
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
}
}
}

83
pages/inventory/goodsList1.vue

@ -82,10 +82,9 @@
<view>单价:{{value[1].discountAmount}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}</view>
<view v-if="value[1].supplierName !=undefined">供应商:{{value[1].supplierName}}</view>
</view>
<view
style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;"
@tap.stop="clickPrice(value[0])">
改价
<view @tap.stop="clickPrice(value[0])" style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;">改价</view>
<view @tap.stop="getHistoryPrice(value[1].productId,value[0])" v-if="khName !=''" style="position: absolute;top: 126rpx;right: 120rpx;">
<u-icon name="clock" size="20"></u-icon>
</view>
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[0])">
<uni-icons color="red" type="trash" size="26"></uni-icons>
@ -125,10 +124,6 @@
</view>
</view>
<view class="content-box">
<!-- <view class="price-box-title">
<text>商品数量:5 </text>
<text style="text-align: left;padding-left: 40rpx;color: red;">金额:500.00</text>
</view> -->
<view class="price-box-list">
<view class="content-list">
<view class="list-name">总金额</view>
@ -324,7 +319,26 @@
</view>
</view>
</uni-popup>
</view>
</view>
<!-- 历史价格弹出层 -->
<uni-popup ref="historyPopup" background-color="#fff">
<view class="popup-content">
<view class="popup-title">
<text>拿货历史价格</text>
<uni-icons @tap='this.$refs.historyPopup.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="popup-container">
<view style="height: 60rpx;line-height: 60rpx;">上次拿货时间:</view>
<view style="height: 60rpx;line-height: 60rpx;">{{historyList.createTime}}</view>
<view style="height: 60rpx;line-height: 60rpx;">上次拿货数:{{historyList.productCount}}</view>
<view style="height: 60rpx;line-height: 60rpx;font-size: 36rpx;font-weight: bold;">上次拿货价:{{historyList.price}}</view>
</view>
<view class="popup-bottom">
<view class="popup-btn" @tap="checkPay(historyList.price)">一键使用历史价格</view>
</view>
</view>
</uni-popup>
<!-- 打印弹出 -->
<uni-popup ref="printerPopup" background-color="#fff">
<view style="width: 500rpx;height: 300rpx;font-size: 36rpx;">
@ -454,6 +468,7 @@
multiple:1,
productId:'',
productNum:0,
historyList:{},
afterPrice:0 //第二次选择商品的时候,先计算这个价格,实收金额= 已经存在的实收金额 + afterPrice
}
},
@ -713,6 +728,22 @@
},
getImg(key) {
return this.carList.get(key).productPicture
},
//获取客户拿货历史
getHistoryPrice(id,index){
this.index = index
this.tui.request("/app/product/getByUserIdAndProductId", "POST", {
userId: this.khName.id,
productId: id
}, false, true).then((res1) => {
if (res1.code == 200) {
this.historyList = res1.result
this.$refs.historyPopup.open()
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//切换销售员
categoryChange(e) {
@ -1645,7 +1676,6 @@
font-size: 28rpx;
border-radius: 0;
}
.bottom-btn:first-child {
background: linear-gradient(90deg, #FF9797, #FFC1E0);
border-top-left-radius: 70rpx;
@ -1770,8 +1800,39 @@
.shop-checkList-box {
height: 50rpx;
width: 60%;
}
.popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: 500rpx;
background-color: #fff;
}
.popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-container {
margin-top: 20rpx;
margin-top: 20rpx;
font-size: 32rpx;
}
.popup-bottom {
height: 80rpx;
color: #fff;
line-height: 80rpx;
margin-top: 50rpx;
}
.popup-btn {
text-align: center;
background: linear-gradient(90deg, #60F3FF, #088FEB);
}
.shop-popup-bottom {
width: 95%;
height: 100rpx;

12
pages/inventory/inventory.vue

@ -105,7 +105,8 @@
shopId: '', //店铺id,
type:'',
warnMsg:[],
searchName:''
searchName:'',
categoryIndex:0
}
},
onShow() {
@ -122,14 +123,14 @@
if (res.code == 200) {
this.indexList = res.result;
for (var i = 0; i < this.indexList.length; i++) {
if (i == 0) {
if (i == this.categoryIndex) {
this.indexList[i].parentId = true
} else {
this.indexList[i].parentId = false
}
}
this.categoryId = this.indexList[0].id
this.getShareList(this.indexList[0].id);
this.categoryId = this.indexList[this.categoryIndex].id
this.getShareList(this.indexList[this.categoryIndex].id);
} else {
this.tui.toast(res.message)
}
@ -146,7 +147,8 @@
}).catch((res) => {})
},
//点击左侧菜单切换
clickLeftBtn(index) {
clickLeftBtn(index) {
this.categoryIndex = index
for (var i = 0; i < this.indexList.length; i++) {
if (i == index) {
this.indexList[i].parentId = true

Loading…
Cancel
Save