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

14
pages/index/dataStatistics.vue

@ -10,8 +10,14 @@
<text class="grid-text">销售总金额</text> <text class="grid-text">销售总金额</text>
</u-grid-item> </u-grid-item>
<u-grid-item> <u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalAlreadyEarn + shopInfo.totalPayAmount"></u-count-to> <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-grid-item> <u-grid-item>
<u-count-to :start-val="0" :end-val="type==0?shopInfo.totalProfit:0" :decimals="2"></u-count-to> <u-count-to :start-val="0" :end-val="type==0?shopInfo.totalProfit:0" :decimals="2"></u-count-to>
@ -194,4 +200,10 @@
.uni-date{ .uni-date{
background: #fff; background: #fff;
} }
.uni-tooltip-popup{
width: 180rpx;
}
.u-icon{
padding: 0 0 0 8px !important;
}
</style> </style>

24
pages/index/index.vue

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

18
pages/index/orderDetail.vue

@ -234,7 +234,7 @@
</u-popup> </u-popup>
<view class="tui-tabbar"> <view class="tui-tabbar">
<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" @onPrint="onPrint">贴包单</kk-printer> <kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint"></kk-printer>
</view> </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 == 0 || sales.status == 1" @click="cancelOrder">取消订单</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>
@ -256,7 +256,11 @@
<script> <script>
import util from '@/components/kk-printer/utils/util.js'; import util from '@/components/kk-printer/utils/util.js';
import * as blesdk from '@/components/kk-printer/utils/bluetoolth.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 { export default {
data() { data() {
return { return {
@ -405,9 +409,9 @@
strCmd += blesdk.addCPCLText('40', '30', '24', '0', 0, '沧州明珠商贸城--快衣店') strCmd += blesdk.addCPCLText('40', '30', '24', '0', 0, '沧州明珠商贸城--快衣店')
strCmd += blesdk.addCPCLSETMAG(3, 3) strCmd += blesdk.addCPCLSETMAG(3, 3)
blesdk.addCPCLSETBOLD('bold') 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.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) strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold') blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('50', '330', '24', '0', 0, this.sales.province + '/' + this.sales.city + '/' + strCmd += blesdk.addCPCLText('50', '330', '24', '0', 0, this.sales.province + '/' + this.sales.city + '/' +
@ -417,11 +421,11 @@
strCmd += blesdk.addCPCLSETMAG(2, 2) strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold') blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('0', '490', '24', '0', 0, '——————————————————————————————') 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.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLText('0', '650', '24', '0', 0, '——————————————————————————————') strCmd += blesdk.addCPCLText('0', '650', '24', '0', 0, '——————————————————————————————')
strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:' + this.sales.shopName) strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:' + maskShopName(this.sales.shopName))
strCmd += blesdk.addCPCLText('50', '810', '24', '0', 0, this.sales.createByPhone) 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.addCPCLText('50', '890', '24', '0', 0, '地址:' + this.shopData.shopAddress)
strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();

35
pages/inventory/addGoods.vue

@ -15,6 +15,10 @@
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="货号" name="productSn" required> <uni-forms-item label="货号" name="productSn" required>
<uni-easyinput type="text" v-model="formData.productSn" placeholder="请输入货号" trim="all" /> <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>
<uni-forms-item label="批发价" name="wholesalePrice" required> <uni-forms-item label="批发价" name="wholesalePrice" required>
<uni-easyinput type="digit" v-model="formData.wholesalePrice" placeholder="请输入批发价" trim="all" /> <uni-easyinput type="digit" v-model="formData.wholesalePrice" placeholder="请输入批发价" trim="all" />
@ -69,7 +73,8 @@
productIntro: '', productIntro: '',
categoryId: '', categoryId: '',
salesWeek: '', salesWeek: '',
tailWarn: '' tailWarn: '',
barcode:''
}, },
categoryList: [], categoryList: [],
productId:'', productId:'',
@ -135,6 +140,7 @@
if(option.dataList){ if(option.dataList){
this.dataList = JSON.parse(option.dataList) this.dataList = JSON.parse(option.dataList)
this.formData.productName = this.dataList.productName this.formData.productName = this.dataList.productName
this.formData.barcode = this.dataList.barcode
this.formData.price = this.dataList.price this.formData.price = this.dataList.price
this.formData.productSn = this.dataList.productSn this.formData.productSn = this.dataList.productSn
this.formData.wholesalePrice = this.dataList.wholesalePrice this.formData.wholesalePrice = this.dataList.wholesalePrice
@ -247,6 +253,33 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/inventory/gategory' 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>单价:{{value[1].discountAmount}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}</view>
<view v-if="value[1].supplierName !=undefined">供应商:{{value[1].supplierName}}</view> <view v-if="value[1].supplierName !=undefined">供应商:{{value[1].supplierName}}</view>
</view> </view>
<view <view @tap.stop="clickPrice(value[0])" style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;">改价</view>
style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;" <view @tap.stop="getHistoryPrice(value[1].productId,value[0])" v-if="khName !=''" style="position: absolute;top: 126rpx;right: 120rpx;">
@tap.stop="clickPrice(value[0])"> <u-icon name="clock" size="20"></u-icon>
改价
</view> </view>
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[0])"> <view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[0])">
<uni-icons color="red" type="trash" size="26"></uni-icons> <uni-icons color="red" type="trash" size="26"></uni-icons>
@ -125,10 +124,6 @@
</view> </view>
</view> </view>
<view class="content-box"> <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="price-box-list">
<view class="content-list"> <view class="content-list">
<view class="list-name">总金额</view> <view class="list-name">总金额</view>
@ -324,7 +319,26 @@
</view> </view>
</view> </view>
</uni-popup> </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"> <uni-popup ref="printerPopup" background-color="#fff">
<view style="width: 500rpx;height: 300rpx;font-size: 36rpx;"> <view style="width: 500rpx;height: 300rpx;font-size: 36rpx;">
@ -454,6 +468,7 @@
multiple:1, multiple:1,
productId:'', productId:'',
productNum:0, productNum:0,
historyList:{},
afterPrice:0 //第二次选择商品的时候,先计算这个价格,实收金额= 已经存在的实收金额 + afterPrice afterPrice:0 //第二次选择商品的时候,先计算这个价格,实收金额= 已经存在的实收金额 + afterPrice
} }
}, },
@ -713,6 +728,22 @@
}, },
getImg(key) { getImg(key) {
return this.carList.get(key).productPicture 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) { categoryChange(e) {
@ -1645,7 +1676,6 @@
font-size: 28rpx; font-size: 28rpx;
border-radius: 0; border-radius: 0;
} }
.bottom-btn:first-child { .bottom-btn:first-child {
background: linear-gradient(90deg, #FF9797, #FFC1E0); background: linear-gradient(90deg, #FF9797, #FFC1E0);
border-top-left-radius: 70rpx; border-top-left-radius: 70rpx;
@ -1770,8 +1800,39 @@
.shop-checkList-box { .shop-checkList-box {
height: 50rpx; height: 50rpx;
width: 60%; 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 { .shop-popup-bottom {
width: 95%; width: 95%;
height: 100rpx; height: 100rpx;

12
pages/inventory/inventory.vue

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

Loading…
Cancel
Save