wangfukang 3 years ago
parent
commit
101edab6ce
  1. BIN
      pages/.DS_Store
  2. 1
      pages/billing/changeGoods1.vue
  3. 7
      pages/index/addStock.vue
  4. 707
      pages/index/addStockList.vue
  5. 27
      pages/index/dataStatistics.vue
  6. 61
      pages/index/goodsStock.vue
  7. 3
      pages/index/orderDetail.vue
  8. 36
      pages/index/peopleList.vue
  9. 102
      pages/index/shopInfo.vue
  10. 31
      pages/index/stockDetail.vue
  11. 11
      pages/inventory/addinventory.vue
  12. 1
      pages/inventory/changeGoods1.vue
  13. 3
      pages/inventory/gategory.vue
  14. 458
      pages/inventory/goodsList1.vue
  15. 26
      pages/inventory/inventory.vue
  16. BIN
      pages/staff/.DS_Store
  17. 107
      pages/staff/addStaff/addStaff.vue
  18. 144
      pages/staff/clock/clock.vue
  19. 92
      pages/staff/performance/performance.vue
  20. 141
      pages/staff/signRule/signRule.vue
  21. 8
      pages/staff/staff.vue

BIN
pages/.DS_Store

Binary file not shown.

1
pages/billing/changeGoods1.vue

@ -732,6 +732,7 @@
width: 170rpx; width: 170rpx;
background: #eee; background: #eee;
height: 100%; height: 100%;
overflow: scroll;
} }
.left-box { .left-box {

7
pages/index/addStock.vue

@ -1,12 +1,9 @@
<template> <template>
<view class="page1"> <view class="page1">
<view style="height: 150rpx;background: #fff;padding-top: 20rpx;"> <view class="title-box">
<button size="default" type="default" @tap="scanCode" hover-class="is-hover">扫码盘点</button>
</view>
<!-- <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" />
</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="index" <view class="left-box" v-for="(item, index) in indexList" :key="index"

707
pages/index/addStockList.vue

@ -0,0 +1,707 @@
<!-- 新增库存页 -->
<template>
<view class="page1">
<view class="content">
<view class="content-box">
<view class="shop-box" style="position: fixed;top:0;z-index: 99;width:100%;border-bottom: 1px solid #eee;margin-bottom: 20rpx;">
<u-grid :col="2" border>
<u-grid-item index="add" @tap.stop="scanCodeAdd">
<u-icon name="scan" size="36"></u-icon>
<text>扫一扫</text>
</u-grid-item>
<u-grid-item @tap.stop="goodsAdd">
<u-icon name="plus" size="28"></u-icon>
<text>添加商品</text>
</u-grid-item>
</u-grid>
</view>
<view class="shop-box" style="border-top:5px solid #eee;margin-top: 132rpx;" v-for="(value,key) in Array.from(carList)"
:key="key">
<view class="shop-name">
<img class="img-radius" :src="value[1].productPicture" alt=""
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;">
<view class="shop-productName">
<view style="color:#FF5809;">品名:{{value[1].productName}} ({{value[1].productSn}})</view>
<view>单价:{{value[1].purchasePrice || 0}} 数量:{{value[1].productCount}}</view>
<view>总价:{{value[1].price}}</view>
</view>
</view>
<view class="tui-order-content">
<u-collapse>
<u-collapse-item v-for="(item,index) in returnList" :key="index" :title="item.returnSale.createTime"
:name="item.returnSale.saleId">
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;">
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;">商品规格</view>
<view style="width: 50%;text-align: center;">总数量</view>
</view>
<view v-for="(items,index1) in item.purchaseDetails">
<view v-for="(data,index2) in items.stockLogList1" style='height: 50rpx;line-height: 50rpx;'>
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;float: left;">
{{data.attributeList | sliceMsg}}
</view>
<view style="width: 50%;text-align: center;float: left;">
{{data.productCount}}
</view>
</view>
</view>
</u-collapse-item>
</u-collapse>
</view>
</view>
</view>
<view class="content-box" style="margin-bottom:110rpx;" :style="{'margin-top':(carList.size>0?0:132) + 'rpx' }">
<!-- 账号权限是否可以维护成本价格(主账号和被授权的账号可以维护),参数名:shop_admin_cost,维护在用户表中,存在前后端缓存里,把备注栏挪出来,谁都可以备注 -->
<view class="price-box-list">
<view class="content-list">
<view class="list-name">备注</view>
<view class="">
<textarea v-model="remark" />
</view>
</view>
</view>
</view>
</view>
<view class="bottom-box">
<view class="bottom-left">
<text>合计:{{totalAmount}}</text>
<text style="color: #ffa200;">¥{{shouldPay}}</text>
</view>
<view class="bottom-right">
<button class="bottom-btn" @tap='inventorySubmit'>入库</button>
</view>
</view>
<!-- 弹出层 -->
<view>
<uni-popup ref="shopPopup" background-color="#fff">
<view class="shop-popup-content">
<view class="shop-popup-title">
<view class="shop-popup-title-left">
<img class="img-radius" :src="goodsDetail.productPicture" alt="" v-if="goodsDetail.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="shop-popup-title-right">
<view class="shop-popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
</view>
<view class="shop-popup-title-right-box">{{goodsDetail.productSn}}</view>
</view>
</view>
<view class="shop-popup-container">
<ul style="border-top:20rpx;">
<li v-for="(items,index) in goodsDetail.attributeList" :key="index">
<view class="shop-title-fur">
<view class="shop-title-name">{{items.name}}</view>
</view>
<view class="shop-attrs">
<uni-data-checkbox v-model="value" :localdata="range"></uni-data-checkbox>
<text v-for="(itemTag, index1) in items.value" :key="index1"
@tap.stop="attrNameChange(index,index1) "
:class="itemTag.isChecked ? 'checkedText' : '' "> {{itemTag.value}}</text>
</view>
</li>
</ul>
<view style="padding-bottom: 100rpx;">
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index">
<view @tap.stop="delCarData(index)" style="margin-right: 20rpx">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="shop-checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
</view>
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" />
</view>
</view>
</view>
</view>
<view class="shop-popup-bottom" v-for="(item,index) in temporaryList" :key="index">
<view class="shop-popup-bottom-left">
<text>数量:{{zNum}} 件</text>
</view>
<view class="shop-popup-bottom-right">
<view class="bottom-btn" @tap="temporaryCheck">选好了</view>
</view>
</view>
</uni-popup>
</view>
<!-- 弹出输入框 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="采购价" placeholder="请输入采购价"
@confirm="changePrice"></uni-popup-dialog>
</uni-popup>
</view>
</template>
<script>
import {
mapState
} from 'vuex';
export default {
computed: mapState(['shopName']),
data() {
return {
// 表单数据
formData: {
name: '',
manufacturer: '',
price: '',
single: ''
},
khName: [],
carList: new Map(),
remark: '',
otherPay: '',
noPay: 0,
alreadyPay: '',
realAmount: 0,
shouldPay: '',
totalAmount: 0,
index: '',
index1: '',
goodsDetail: [],
columns: [],
keyList: [],
temporaryList: [],
zNum: 0,
storageType:'',
productNum:0,
productId:''
}
},
filters: {
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
}
},
onShow() {
let that = this;
this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < this.carList1.length; i++) {
let obj = {
purchasePrice: "", //进货价
price: 0,
productCount: 0,
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
stockLogList: new Map(),
stockLogList1: []
}
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
}
this.carList1 = []
} else { //当前页有数据
for (let i = 0; i < this.carList1.length; i++) {
if (this.carList.has(this.carList1[i].id) == true) { //商品相同
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[
m].attributeList) == true) { //规格相同
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, this.carList.get(this.carList1[i].id).stockLogList.get(this
.carList1[i].saleDetailQueryDTO[m].attributeList) + this.carList1[i]
.saleDetailQueryDTO[m].productCount)
} else { //规格不同
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount)
}
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[
m].productCount
}
} else { //商品不同
let obj = {
purchasePrice: "", //进货价
price: 0,
productCount: 0,
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
name: ''
}
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
.saleDetailQueryDTO[m].productCount)
obj.name = this.carList1[i].saleDetailQueryDTO[m].name
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
}
this.carList.get(this.carList1[i].id).price = this.carList.get(this.carList1[i].id).purchasePrice * this.carList.get(this.carList1[i].id).productCount;
}
this.carList1 = []
}
this.getAllPrice()
},
onLoad() {
this.storageType = uni.getStorageSync('type')
},
methods: {
//扫一扫功能
scanCodeAdd() {
uni.scanCode({
success: (res) => {
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.tui.request("/app/product/getByBarcode", "POST", {
barcode:res.result
}, false, true).then((res1) => {
if (res1.code == 200) {
if(res1.result == ''){
this.tui.toast('您的店铺中暂无该商品!')
}else{
this.toggle('bottom', res1.result[0].id);
if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
this.carList.push(item.saleDetailDTOList[i])
}
}
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {
this.tui.toast(res)
})
}
},
fail: (res) => {
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
},
goodsAdd() {
uni.navigateTo({
url: "/pages/index/addStock"
})
},
//删除整条商品
delShop(id) {
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if(res.confirm){
that.tui.request("/app/checkStockDetail/deleteCheckStockDetail", "POST", {
categoryId: id
}, false, true).then((res1) => {
if (res1.code == 200) {
that.tui.toast("删除成功")
} else {
that.tui.toast(res.message)
}
}).catch((res) => {})
}
}
})
},
//确认盘点
inventorySubmit() {
uni.showModal({
title: "提示",
content: "请再次确认盘点信息是否正确。确认完成盘点吗?",
success: function(res) {
if(res.confirm){
that.tui.request("/app/checkStock/submitToStock", "post", {}, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "盘点成功",
icon: 'none'
})
setTimeout(res=> {
uni.navigateBack({
delta: 1
})
},2000)
} else {
uni.showToast({
title: "盘点失败",
icon: 'none'
})
}
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
page,
.page1 {
height: 100%;
}
.content {
border-top: 1px solid #eee;
overflow-y: scroll;
max-height: 100vh;
margin-bottom: 100rpx;
}
.content-box {
width: 100%;
height: auto;
background: #fff;
margin-bottom: 20rpx;
}
.content-list {
width: 95%;
margin: 0 auto;
display: flex;
height: 80rpx;
border-bottom: 1px solid #eee;
}
.content-list:last-child {
border-bottom: none;
height: auto;
}
.list-name {
width: 200rpx;
text-align: left;
line-height: 40px;
height: 80rpx;
padding-left: 20rpx;
}
.list-val {
width: 560rpx;
height: 80rpx;
line-height: 80rpx;
}
.list-val input {
width: 400rpx;
height: 60rpx;
display: inline-block;
line-height: 60rpx;
float: left;
margin-top: 10rpx;
padding-left: 20rpx;
border-bottom: 1px solid #088FEB;
}
.uni-data-select {
width: 80%;
text-align: center;
}
.uni-select {
border: none !important;
border-radius: 0 !important;
}
.uni-select__input-placeholder {
color: #6a6a6a;
font-size: 28rpx !important;
width: 400rpx;
}
.uni-select__input-box {
.uni-icons {
margin-left: 100rpx;
}
}
.shop-box {
width: 95%;
margin: 0 auto;
position: relative;
background: #fff;
}
.shop-name {
width: 100%;
height: 200rpx;
line-height: 80rpx;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
font-size: 28rpx;
font-weight: bold;
display: flex;
.uni-icons {
color: #088FEB !important;
}
}
.shop-productName {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 20rpx;
}
.shop-productName view {
height: 55rpx;
}
.shop-collapse {
display: flex;
height: 80rpx;
font-size: 26rpx;
line-height: 80rpx;
}
.shop-collapse text {
width: 40%;
text-align: center;
padding-right: 40rpx;
border-right: 1px solid #eee;
}
.price-box-title {
width: 95%;
height: 80rpx;
line-height: 80rpx;
margin: 0 auto;
display: flex;
text-align: center;
border-bottom: 1px solid #eee;
}
.price-box-title text {
flex: 1;
}
.uni-list-cell {
display: flex;
margin-right: 20rpx;
}
.bottom-box {
width: 100%;
position: absolute;
bottom: 0rpx;
display: flex;
background: #fff;
border-top: 1px solid #eee;
height: 110rpx;
}
.bottom-left {
flex: 1;
height: 110rpx;
line-height: 110rpx;
}
.bottom-right {
flex: 1;
height: 110rpx;
line-height: 110rpx;
}
.bottom-left text {
line-height: 84rpx;
display: inline-block;
padding-left: 20rpx;
}
.bottom-btn {
width: 320rpx;
background: linear-gradient(90deg, #60F3FF, #088FEB);
color: #fff;
border-radius: 50rpx;
height: 85rpx;
margin-top: 15rpx;
}
textarea {
margin: 20rpx;
border: 1px solid #eee;
height: 150rpx;
width: 500rpx;
}
.shop-popup-content {
align-items: center;
justify-content: center;
padding: 15px;
height: 1200rpx;
background-color: #fff;
margin-bottom: 30rpx;
overflow: scroll;
}
.shop-popup-title {
display: flex;
height: 180rpx;
border-bottom: 1px solid #eee;
margin-top: 20rpx;
}
.shop-popup-title-left {
width: 150rpx;
height: 150rpx;
}
.shop-popup-title-left img {
width: 150rpx;
height: 150rpx;
}
.shop-popup-title-right {
width: 400rpx;
margin-left: 30rpx;
}
.shop-popup-title-right-box {
height: 50rpx;
line-height: 50rpx;
}
.shop-popup-container {
width: 100%;
background: #fff;
height: 50rpx;
}
.shop-title-fur {
width: 95%;
height: 70rpx;
margin: 0 auto;
}
.shop-title-name {
font-size: 30rpx;
width: 50%;
float: left;
height: 70rpx;
line-height: 70rpx;
}
.shop-attrs {
text {
display: inline-block;
border: 1px solid #5fd9ee;
margin: 20rpx;
background-color: #fff;
color: #5fd9ee;
width: 100rpx;
line-height: 70rpx;
height: 70rpx;
text-align: center;
}
.checkedText {
background-color: $u-primary;
color: #fff;
}
}
.shop-checkList {
display: flex;
height: 50rpx;
font-size: 28rpx;
line-height: 50rpx;
margin: 20rpx 0;
}
.shop-checkList-box {
height: 50rpx;
width: 60%;
}
.shop-popup-bottom {
width: 95%;
height: 100rpx;
position: fixed;
bottom: 0;
left: 2.5%;
display: flex;
z-index: 99;
background: #fff;
}
.shop-popup-bottom-left {
width: 50%;
line-height: 80rpx;
}
.shop-popup-bottom-right {
width: 50%;
line-height: 100rpx;
.bottom-btn {
width: 70%;
line-height: 35px;
height: 70rpx;
text-align: center;
color: #fff;
font-size: 28rpx;
margin: 0 auto;
background: linear-gradient(90deg, #60F3FF, #088FEB);
border-radius: 70rpx;
}
}
.noPic{
border-radius: 10px;
width: 150rpx;
height: 150rpx;
// margin: 30rpx 0 0 30rpx;
text-align: center;
line-height: 140rpx;
color: #777;
background: #eee;
}
.tui-order-content {
width: 100%;
padding: 24rpx 30rpx;
box-sizing: border-box;
background: #fff;
font-size: 24rpx;
line-height: 30rpx;
}
.u-collapse-content {
display: flex;
justify-content: space-between;
line-height: 30px;
}
</style>

27
pages/index/dataStatistics.vue

@ -9,14 +9,12 @@
<u-count-to :start-val="0" :end-val="shopInfo.totalAmount"></u-count-to> <u-count-to :start-val="0" :end-val="shopInfo.totalAmount"></u-count-to>
<text class="grid-text">销售总金额</text> <text class="grid-text">销售总金额</text>
</u-grid-item> </u-grid-item>
<u-grid-item> <u-grid-item @tap="maskPrice">
<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>
<uni-tooltip :content="'订单实收:' + shopInfo.totalAlreadyEarn +'回款:'+ shopInfo.totalPayAmount" placement="left"> <view class="grid-text" style="display: flex;">
<view class="grid-text" style="display: flex;"> <text>实收总额</text>
<text>实收总额</text> <u-icon name="question-circle" size="16"></u-icon>
<u-icon name="question-circle" size="16"></u-icon> </view>
</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>
@ -74,6 +72,9 @@
this.type = uni.getStorageSync('type') this.type = uni.getStorageSync('type')
}, },
methods: { methods: {
maskPrice(){
this.tui.toast('订单实收:' + this.shopInfo.totalAlreadyEarn +'回款:'+ this.shopInfo.totalPayAmount)
},
getSaleInfo() { getSaleInfo() {
this.tui.request("/app/sale/getShopAll", "POST", { this.tui.request("/app/sale/getShopAll", "POST", {
pageVo: { pageVo: {
@ -84,17 +85,7 @@
endTime:this.range[1] endTime:this.range[1]
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.shopInfo = { this.shopInfo = res.result
totalAmount:res.result.totalAmount,
totalAlreadyEarn:res.result.totalAlreadyEarn,
totalPayAmount:res.result.totalPayAmount,
totalCCount:res.result.totalCCount,
totalCount:res.result.totalCount,
totalJCount:res.result.totalJCount,
totalProfit:res.result.totalProfit,
returnTotalAmount:res.result.returnTotalAmount,
returnTotalCount:res.result.returnTotalCount,
}
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }

61
pages/index/goodsStock.vue

@ -1,12 +1,13 @@
<template> <template>
<view> <view>
<view style="height: 150rpx;background: #fff;padding-top: 20rpx;"> <view class="search" style="position: fixed;top: 0;z-index: 99;">
<button size="default" type="default" @tap="addStock" hover-class="is-hover">新增盘点</button> <button size="default" type="default" @tap="addStock" hover-class="is-hover">新增盘点</button>
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" @change="searchList" type="daterange" />
</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 stockList" :key="index">
<view class="swipe-action__content__left"> <view class="swipe-action__content__left">
<view class="swipe-action__content__text">{{ item.nickname == null ?'暂无':item.nickname}}</view> <view class="swipe-action__content__text">{{ item.nickname == null ?'暂无':item.nickname}}</view>
</view> </view>
@ -18,6 +19,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-loadmore :status="status" />
</view> </view>
</template> </template>
@ -38,28 +40,62 @@
} }
}], }],
popupShow: false, popupShow: false,
status: 'loadmore',
shopName: '', shopName: '',
list: [] list: [],
pages: 1,
totalPages: 0,
range:[],
} }
}, },
onShow() { onShow() {
this.getList() this.getList()
}, },
onReachBottom() {
if (this.pages >= this.totalPages) return;
this.status = 'loading';
this.pages = ++this.pages;
this.getOrderInfoList();
},
methods: { methods: {
getList() { getList() {
this.tui.request("/app/customer/debt", "POST", {}, false, true).then((res) => { this.status = 'loading';
this.tui.request("/app/checkStock/getCheckStockList", "POST", {
startDate:this.range[0],
endDate:this.range[1],
pageNum:this.pages,
pageSize:10
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) { if (res.code == 200) {
this.list = res.result.records if (this.pages == 1) {
this.stockList = res.result.records
} else {
this.stockList = [...this.stockList, ...res.result.records]
}
this.totalPages = res.result.pages
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}) })
}, },
searchList(res) {
this.pages = 1;
this.stockList = [];
this.getList()
},
addStock(){ addStock(){
uni.navigateTo({ // this.tui.request("/app/checkStock/addCheckStock", "POST", {}, false, false).then((res) => {
url: '/pages/index/addStock' // if (res.code == 200) {
}) // uni.setStorageSync('stockId',res.result.stockId);
uni.navigateTo({
url: '/pages/index/addStockList'
})
// } else {
// this.tui.toast(res.message)
// }
// })
}, },
onItemClick(target) { onItemClick(target) {
uni.navigateTo({ uni.navigateTo({
@ -185,7 +221,8 @@
button { button {
color: #ffffff; color: #ffffff;
background: #5fd9ee; background: #5fd9ee;
width: 90%; width: 100%;
margin-bottom: 20rpx;
// margin-top: 20upx; // margin-top: 20upx;
} }
</style> </style>
@ -193,4 +230,10 @@
.u-radio { .u-radio {
margin: 15 upx 0; margin: 15 upx 0;
} }
.search {
padding: 20upx;
background-color: #fff;
width: 100%;
background-color: #fff;
}
</style> </style>

3
pages/index/orderDetail.vue

@ -549,8 +549,9 @@
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd); this.bufferData.push(strCmd);
}
}
console.log("传值之前",this.bufferData)
this.$nextTick(()=>{ this.$nextTick(()=>{
uni.redirectTo({ uni.redirectTo({

36
pages/index/peopleList.vue

@ -9,7 +9,7 @@
@confirm="search" /> @confirm="search" />
</view> </view>
</view> </view>
<view style="margin-top: 230rpx;overflow:scroll;"> <view style="overflow:scroll;" :style="{'margin-top':popleType == 'khName' || popleType == 'gysName'?'230rpx':'110rpx'}">
<view v-if="popleType== 'khName' || popleType== 'gysName'" style="overflow:scroll;"> <view v-if="popleType== 'khName' || popleType== 'gysName'" style="overflow:scroll;">
<!-- 供应商、客户走这一套 --> <!-- 供应商、客户走这一套 -->
<view class="list-1" v-for="item in popleList" :key="item" @tap="clickList(item)" <view class="list-1" v-for="item in popleList" :key="item" @tap="clickList(item)"
@ -40,15 +40,15 @@
<!-- 物流、发车、大巴走这一套 --> <!-- 物流、发车、大巴走这一套 -->
<view class="" v-if="popleType== 'wlName' || popleType== 'fcName' || popleType== 'dbName'"> <view class="" v-if="popleType== 'wlName' || popleType== 'fcName' || popleType== 'dbName'">
<view class="list-1" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)" v-for="(item,index) in popleList[0]" :key="index"> <view class="list-1" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)" v-for="(item,index) in popleList[0]" :key="index">
<view class="shop-mask" v-if="item.isOnLine == 0" @tap.stop="clickMask(item)"> <!-- <view class="shop-mask" v-if="item.isOnLine == 0" @tap.stop="clickMask(item)">
<view style="width: 100%;height: 100%;line-height: 120rpx;text-align: center;color: red;" @tap.stop="clickPhone(item.mobile)"> <view style="width: 100%;height: 100%;line-height: 120rpx;text-align: center;color: red;" @tap.stop="clickPhone(item.mobile)">
此{{popleType== 'wlName'?'物流公司': popleType== 'fcName'?'厢货车': popleType== 'dbName'?'大巴车':'公司'}}已下线,点击可拨打电话 此{{popleType== 'wlName'?'物流公司': popleType== 'fcName'?'厢货车': popleType== 'dbName'?'大巴车':'公司'}}已下线,点击可拨打电话
</view> </view>
</view> </view> -->
<view class="name-tel"> <view class="name-tel">
<text style="line-height: 75rpx;">{{item.companyName}}</text> <text style="line-height: 75rpx;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;">{{item.shippingMethod}}</text> <text style="line-height: 75rpx;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;">{{item.workerName}}</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="">
@ -66,15 +66,15 @@
<view>↓↓下方为区域内所有物流公司↓↓</view> <view>↓↓下方为区域内所有物流公司↓↓</view>
</view> </view>
<view class="list-1" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)" v-for="item in popleList[1]" :key="item"> <view class="list-1" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)" v-for="item in popleList[1]" :key="item">
<view class="shop-mask" v-if="item.isOnLine == 0" @tap.stop="clickMask(item)"> <!-- <view class="shop-mask" v-if="item.isOnLine == 0" @tap.stop="clickMask(item)">
<view style="width: 100%;height: 100%;line-height: 120rpx;text-align: center;color: red;" @tap.stop="clickPhone(item.mobile)"> <view style="width: 100%;height: 100%;line-height: 120rpx;text-align: center;color: red;" @tap.stop="clickPhone(item.mobile)">
此{{popleType== 'wlName'?'物流公司': popleType== 'fcName'?'厢货车': popleType== 'dbName'?'大巴车':'公司'}}已下线,点击可拨打电话 此{{popleType== 'wlName'?'物流公司': popleType== 'fcName'?'厢货车': popleType== 'dbName'?'大巴车':'公司'}}已下线,点击可拨打电话
</view> </view>
</view> </view> -->
<view class="name-tel"> <view class="name-tel">
<text style="line-height: 75rpx;">{{item.companyName}}</text> <text style="line-height: 75rpx;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;">{{item.shippingMethod}}</text> <text style="line-height: 75rpx;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;">{{item.workerName}}</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="">
@ -91,15 +91,15 @@
<!--快递、拉包工 --> <!--快递、拉包工 -->
<view class="" v-if="popleType== 'kdName' || popleType== 'lbgName' || popleType== 'kdyName'"> <view class="" v-if="popleType== 'kdName' || popleType== 'lbgName' || popleType== 'kdyName'">
<view class="list-1" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)" v-for="item in popleList" :key="item"> <view class="list-1" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)" v-for="item in popleList" :key="item">
<view class="shop-mask" v-if="item.isOnLine == 0" @tap.stop="clickMask(item)"> <!-- <view class="shop-mask" v-if="item.isOnLine == 0" @tap.stop="clickMask(item)">
<view style="width: 100%;height: 100%;line-height: 120rpx;text-align: center;color: red;" @tap.stop="clickPhone(item.mobile)"> <view style="width: 100%;height: 100%;line-height: 120rpx;text-align: center;color: red;" @tap.stop="clickPhone(item.mobile)">
此{{popleType== 'wlName'?'物流公司': popleType== 'fcName'?'厢货车': popleType== 'dbName'?'大巴车':'公司'}}已下线,点击可拨打电话 此{{popleType== 'wlName'?'物流公司': popleType== 'fcName'?'厢货车': popleType== 'dbName'?'大巴车':'公司'}}已下线,点击可拨打电话
</view> </view>
</view> </view> -->
<view class="name-tel"> <view class="name-tel">
<text style="line-height: 75rpx;">{{item.companyName}}</text> <text style="line-height: 75rpx;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;">{{item.shippingMethod}}</text> <text style="line-height: 75rpx;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;">{{item.workerName}}</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="">
@ -306,6 +306,10 @@
}, },
//点击选择列表,带参数 返回上一页 //点击选择列表,带参数 返回上一页
clickList(item) { clickList(item) {
if(item.isOnLine ==0){
this.tui.toast(this.popleType== 'wlName'?'物流公司已下线': this.popleType== 'fcName'?'厢货车已下线': this.popleType== 'dbName'?'大巴车已下线':this.popleType== 'lbgName'?'拉包工已下线':this.popleType== 'kdyName'?'快递员已下线':'公司已下线')
return
}
if(this.noClick == 0){ if(this.noClick == 0){
let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。 let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
let prevPage = pages[pages.length - 2]; //上一页页面实例 let prevPage = pages[pages.length - 2]; //上一页页面实例

102
pages/index/shopInfo.vue

@ -3,21 +3,22 @@
<view class="formBox"> <view class="formBox">
<uni-forms :modelValue="addForm" ref="addForm" validateTrigger="bind" :rules="rules" label-width="160rpx" <uni-forms :modelValue="addForm" ref="addForm" validateTrigger="bind" :rules="rules" label-width="160rpx"
label-align="right"> label-align="right">
<uni-forms-item label="手机号" required name="mobile"> <uni-forms-item label="手机号" name="mobile">
<uni-easyinput type="text" v-model="addForm.mobile" placeholder="请输入登录手机号" /> <uni-easyinput type="text" v-model="addForm.mobile" placeholder="请输入登录手机号" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="原密码" required name="password"> <view class="line"></view>
<uni-forms-item label="原密码" name="password">
<uni-easyinput type="password" v-model="addForm.password" placeholder="请输入原登录密码" /> <uni-easyinput type="password" v-model="addForm.password" placeholder="请输入原登录密码" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="新密码" required name="password"> <uni-forms-item label="新密码" name="password">
<uni-easyinput type="password" v-model="addForm.newPass" placeholder="请输入新登录密码" /> <uni-easyinput type="password" v-model="addForm.newPass" placeholder="请输入新登录密码" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="密码确认" required name="confirm"> <uni-forms-item label="密码确认" name="confirm">
<uni-easyinput type="password" v-model="addForm.confirm" placeholder="请输入新登录密码" /> <uni-easyinput type="password" v-model="addForm.confirm" placeholder="请输入新登录密码" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<view class="tui-tabbar"> <view class="bottom">
<u-button type="primary" shape="circle" @tap.stop="onFormSubmit">确定</u-button> <button @tap.stop="onFormSubmit">确定</button>
</view> </view>
</view> </view>
</view> </view>
@ -39,27 +40,7 @@
newPass: '' newPass: ''
}, },
userId: '', userId: '',
shopList: [], shopList: []
rules: {
mobile: {
rules: [{
required: true,
errorMessage: '手机号不能为空'
}]
},
password: {
rules: [{
required: true,
errorMessage: '密码不能为空'
}]
},
confirm: {
rules: [{
required: true,
errorMessage: '确认密码不能为空'
}]
},
}
} }
}, },
onLoad(options) { onLoad(options) {
@ -68,30 +49,28 @@
}, },
methods: { methods: {
onFormSubmit() { onFormSubmit() {
if(this.addForm.mobile == '' &&this.addForm.newPass == ''){ if (this.addForm.mobile == '' && this.addForm.newPass == '') {
this.tui.toast("不能为空") this.tui.toast("不能为空")
return; return;
} }
if (this.addForm.confirm !== this.addForm.newPass) return this.tui.toast('两次密码不一致', 2000, ) if (this.addForm.confirm !== this.addForm.newPass) return this.tui.toast('两次密码不一致', 2000, )
// this.$refs.addForm.validate().then(async () => { this.tui.request("/user/modifyPassAndMobile", "post", {
this.tui.request("/user/modifyPassAndMobile", "post", { mobile: this.addForm.mobile,
mobile: this.addForm.mobile, password: this.addForm.password,
password: this.addForm.password, newPass: this.addForm.newPass,
newPass: this.addForm.newPass, userId: this.userId
userId: this.userId }, false, true).then((res) => {
}, false, true).then((res) => { if (res.code == 200) {
if (res.code == 200) { this.tui.toast("修改成功!")
this.tui.toast("修改成功!") setTimeout(() => {
setTimeout(() => { uni.reLaunch({
uni.reLaunch({ url: '/pages/login/login'
url: '/pages/login/login' })
}) }, 200)
}, 200) } else {
} else { this.tui.toast(res.message)
this.tui.toast(res.message) }
} })
})
// })
} }
} }
} }
@ -105,7 +84,7 @@
.formBox { .formBox {
margin: 20rpx; margin: 20rpx;
padding: 20rpx 26rpx; padding: 40rpx 26rpx 20rpx;
border-radius: 14rpx; border-radius: 14rpx;
box-shadow: 0px 1px 10px 2px #e2e2e2; box-shadow: 0px 1px 10px 2px #e2e2e2;
background-color: #fff; background-color: #fff;
@ -132,20 +111,25 @@
border-radius: 4upx; border-radius: 4upx;
} }
} }
.line{
.tui-tabbar { height: 10rpx;
width: 100%;
background: #eee;
margin-bottom: 44rpx;
}
.bottom{
width: 100%; width: 100%;
height: 98rpx; height: 150rpx;
background: #fff; background: #fff;
position: fixed; position: fixed;
left: 0;
bottom: 0; bottom: 0;
display: flex; left: 0;
align-items: center; }
justify-content: flex-end; button{
font-size: 26rpx; background: #5fd9ee;
box-shadow: 0 0 1px rgba(0, 0, 0, .3); width: 95%;
padding-bottom: env(safe-area-inset-bottom); border-radius: 10px;
z-index: 996; margin: 10px auto 0;
color: #fff;
} }
</style> </style>

31
pages/index/stockDetail.vue

@ -106,14 +106,31 @@
} }
} }
console.log('第一个',data) console.log('第一个',data)
this.dataList.saleDetailQueryDTO = data this.dataList.checkStockAttributeVos = data
console.log('二个',this.dataList) console.log('二个',this.dataList)
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; this.tui.request("/app/checkStockDetail/addCheckStockDetail", "POST", {
prevPage.$vm.pdList = this.dataList productId: this.dataList.id,
uni.navigateBack({ checkStockId:uni.getStorageSync('stockId'),
delta: 1 productName:this.dataList.productName,
}) productPicture:this.dataList.productPicture,
productSn:this.dataList.productSn,
checkStockAttributeVos:this.dataList.checkStockAttributeVos
}, false, true).then((res) => {
if (res.code == 200) {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.pdList = this.dataList
uni.navigateBack({
delta: 1
})
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}, },
} }
} }

11
pages/inventory/addinventory.vue

@ -2,18 +2,15 @@
<template> <template>
<view class="page1"> <view class="page1">
<view class="content"> <view class="content">
<view class="content-box"> <view class="content-box" style="position: fixed;top:0;z-index: 99;width: 100%;">
<view class="content-list"> <view class="content-list" @tap="goPopleList('gysName')">
<view class="list-name">供应商</view> <view class="list-name">供应商</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请选择供应商" disabled <input type="text" placeholder="请选择供应商" disabled
style="border-bottom: 1px solid #fff;text-align: center;" :value="khName.consigneeName" style="border-bottom: 1px solid #fff;text-align: center;" :value="khName.consigneeName">
@tap="goPopleList('gysName')">
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> <uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view> </view>
</view> </view>
</view>
<view class="content-box">
<view class="shop-box" style="border-bottom: 1px solid #eee;margin-bottom: 20rpx;"> <view class="shop-box" style="border-bottom: 1px solid #eee;margin-bottom: 20rpx;">
<u-grid :col="2" border> <u-grid :col="2" border>
<u-grid-item index="add" @tap.stop="scanCodeAdd"> <u-grid-item index="add" @tap.stop="scanCodeAdd">
@ -26,6 +23,8 @@
</u-grid-item> </u-grid-item>
</u-grid> </u-grid>
</view> </view>
</view>
<view class="content-box" style="margin-top: 212rpx;">
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(value,key) in Array.from(carList)" <view class="shop-box" style="border-top:5px solid #eee;" v-for="(value,key) in Array.from(carList)"
:key="key"> :key="key">
<view class="shop-name"> <view class="shop-name">

1
pages/inventory/changeGoods1.vue

@ -726,6 +726,7 @@
width: 170rpx; width: 170rpx;
background: #eee; background: #eee;
height: 100%; height: 100%;
overflow: scroll;
} }
.left-box { .left-box {

3
pages/inventory/gategory.vue

@ -295,6 +295,9 @@
} }
}, },
close(){
this.$refs.addTypeDialog.close()
},
//查询分类下有没有库存 //查询分类下有没有库存
getTypeToNum(id) { getTypeToNum(id) {
let that = this; let that = this;

458
pages/inventory/goodsList1.vue

@ -2,38 +2,39 @@
<template> <template>
<view class="page1"> <view class="page1">
<view class="content"> <view class="content">
<view class="notice"> <view style="position: fixed;top:0;z-index: 99;width: 100%;">
<u-notice-bar mode='horizontal' bgColor="#088FEB" color="#eee" :text="noticeData"></u-notice-bar> <view class="notice">
</view> <u-notice-bar mode='horizontal' bgColor="#088FEB" color="#eee" :text="noticeData"></u-notice-bar>
<view class="content-box">
<view class="content-list">
<view class="list-name">客户</view>
<view class="list-val">
<input type="text" placeholder="请选择客户" disabled
style="border-bottom: 1px solid #fff;text-align: center;" v-model="khName.name"
@tap.stop="goPopleList('khName')">
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view>
</view> </view>
<view class="content-list"> <view class="content-box">
<view class="list-name">销售员</view> <view class="content-list" @tap.stop="goPopleList('khName')">
<uni-data-select class="uni-data-select" :localdata="categoryList" v-model="xsyId" <view class="list-name">客户</view>
placeholder="请选择销售员" @change="categoryChange"></uni-data-select> <view class="list-val">
<input type="text" placeholder="请选择客户" disabled
style="border-bottom: 1px solid #fff;text-align: center;" v-model="khName.name">
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view>
</view>
<view class="content-list">
<view class="list-name">销售员</view>
<uni-data-select class="uni-data-select" :localdata="categoryList" v-model="xsyId"
placeholder="请选择销售员" @change="categoryChange"></uni-data-select>
</view>
<view class="shop-box" style="border-bottom: 1px solid #eee;margin-bottom: 20rpx;">
<u-grid :col="2" border>
<u-grid-item index="add" @tap.stop="scanCodeAdd">
<u-icon name="scan" size="36"></u-icon>
<text>扫一扫</text>
</u-grid-item>
<u-grid-item @tap.stop="goodsAdd">
<u-icon name="plus" size="28"></u-icon>
<text>添加商品</text>
</u-grid-item>
</u-grid>
</view>
</view> </view>
</view> </view>
<view class="content-box"> <view class="content-box" style="margin-top: 364rpx;">
<view class="shop-box" style="border-bottom: 1px solid #eee;margin-bottom: 20rpx;">
<u-grid :col="2" border>
<u-grid-item index="add" @tap.stop="scanCodeAdd">
<u-icon name="scan" size="36"></u-icon>
<text>扫一扫</text>
</u-grid-item>
<u-grid-item @tap.stop="goodsAdd">
<u-icon name="plus" size="28"></u-icon>
<text>添加商品</text>
</u-grid-item>
</u-grid>
</view>
<view class="shop-box"> <view class="shop-box">
<view class="content-list"> <view class="content-list">
<view class="list-name" style="width:150rpx;padding-left:0;">选择价格</view> <view class="list-name" style="width:150rpx;padding-left:0;">选择价格</view>
@ -65,7 +66,8 @@
</label> </label>
</radio-group> </radio-group>
<view class="discount-num" v-if="discountType == '1'"> <view class="discount-num" v-if="discountType == '1'">
<input type="digit" style="width:150rpx;padding:0;text-align: center;" v-model="discountNum" @blur="change($event)"> <input type="digit" style="width:150rpx;padding:0;text-align: center;"
v-model="discountNum" @blur="change($event)">
</view> </view>
</view> </view>
@ -75,15 +77,21 @@
:key="key"> :key="key">
<view class="shop-name" style="position: relative;"> <view class="shop-name" style="position: relative;">
<img class="img-radius" :src="value[1].productPicture" alt="" <img class="img-radius" :src="value[1].productPicture" alt=""
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;" v-if="value[1].productPicture"> style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;"
v-if="value[1].productPicture">
<view class="noPic" v-else>暂无图片</view> <view class="noPic" v-else>暂无图片</view>
<view class="shop-productName"> <view class="shop-productName">
<view style="color:#FF5809;">{{value[1].productName}} ({{value[1].productSn}})</view> <view style="color:#FF5809;">{{value[1].productName}} ({{value[1].productSn}})</view>
<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 @tap.stop="clickPrice(value[0])" style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;">改价</view> <view @tap.stop="clickPrice(value[0])"
<view @tap.stop="getHistoryPrice(value[1].productId,value[0])" v-if="khName !=''&&khName.name !='散客'" style="position: absolute;top: 126rpx;right: 120rpx;"> 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 !=''&&khName.name !='散客'"
style="position: absolute;top: 126rpx;right: 120rpx;">
<u-icon name="clock" size="20"></u-icon> <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])">
@ -179,34 +187,34 @@
</radio-group> </radio-group>
</view> </view>
</view> </view>
<view class="" v-if="radioType != '2'"> <view class="" v-if="radioType != '2'">
<view class="content-list" v-if="radioType == '0' || radioType == '1'"> <view class="content-list" v-if="radioType == '0' || radioType == '1'"
@tap.stop="goPopleList(radioType == '0'? 'wlName' :'kdName')">
<view class="list-name" style="width:150rpx;padding-left: 0;"> <view class="list-name" style="width:150rpx;padding-left: 0;">
{{radioType == '0'? '选择物流' :'选择快递'}}</view> {{radioType == '0'? '选择物流' :'选择快递'}}
</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请选择" disabled :value="wlName.companyName || wlName.shippingMethod" <input type="text" placeholder="请选择" disabled
style="border-bottom: 1px solid #fff;text-align: center;padding-right: 54rpx;" :value="wlName.companyName || wlName.shippingMethod"
@tap.stop="goPopleList(radioType == '0'? 'wlName' :'kdName')"> style="border-bottom: 1px solid #fff;text-align: center;padding-right: 54rpx;">
<uni-icons type="right" size="16" <uni-icons type="right" size="16"
style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view> </view>
</view> </view>
<view class="content-list" v-if="radioType == '4'"> <view class="content-list" v-if="radioType == '4'" @tap.stop="goPopleList('fcName')">
<view class="list-name" style="width:150rpx;padding-left:0;">选择车号</view> <view class="list-name" style="width:150rpx;padding-left:0;">选择车号</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请选择" disabled :value="wlName.companyName" <input type="text" placeholder="请选择" disabled :value="wlName.companyName"
style="border-bottom: 1px solid #fff;text-align: center;" style="border-bottom: 1px solid #fff;text-align: center;">
@tap.stop="goPopleList('fcName')">
<uni-icons type="right" size="16" <uni-icons type="right" size="16"
style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view> </view>
</view> </view>
<view class="content-list" v-if="radioType == '5'"> <view class="content-list" v-if="radioType == '5'" @tap.stop="goPopleList('dbName')">
<view class="list-name" style="width:150rpx;padding-left:0;">选择车号</view> <view class="list-name" style="width:150rpx;padding-left:0;">选择车号</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请选择" disabled :value="wlName.companyName" <input type="text" placeholder="请选择" disabled :value="wlName.companyName"
style="border-bottom: 1px solid #fff;text-align: center;" style="border-bottom: 1px solid #fff;text-align: center;">
@tap.stop="goPopleList('dbName')">
<uni-icons type="right" size="16" <uni-icons type="right" size="16"
style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view> </view>
@ -218,14 +226,15 @@
@change="checkBoxChange"></uni-data-checkbox> @change="checkBoxChange"></uni-data-checkbox>
</view> </view>
</view> </view>
<view class="content-list" v-if="radioType1 != '1' && radioType !=''"> <view class="content-list" v-if="radioType1 != '1' && radioType !=''"
@tap.stop="goPopleList(radioType == '1'? 'kdyName' :'lbgName')">
<view class="list-name" style="width:150rpx;padding-left:0;"> <view class="list-name" style="width:150rpx;padding-left:0;">
{{radioType == '1'? '快递员' :'拉包工'}}</view> {{radioType == '1'? '快递员' :'拉包工'}}
</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="可指定人员" disabled <input type="text" placeholder="可指定人员" disabled
:value="radioType == '1'? kdyName.workerName : lbgName.workerName" :value="radioType == '1'? kdyName.workerName : lbgName.workerName"
style="border-bottom: 1px solid #fff;text-align: center;" style="border-bottom: 1px solid #fff;text-align: center;">
@tap.stop="goPopleList(radioType == '1'? 'kdyName' :'lbgName')">
<uni-icons type="right" size="16" <uni-icons type="right" size="16"
style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view> </view>
@ -276,7 +285,8 @@
<view class="shop-popup-content"> <view class="shop-popup-content">
<view class="shop-popup-title"> <view class="shop-popup-title">
<view class="shop-popup-title-left"> <view class="shop-popup-title-left">
<img class="img-radius" :src="goodsDetail.productPicture" alt="" v-if="goodsDetail.productPicture"> <img class="img-radius" :src="goodsDetail.productPicture" alt=""
v-if="goodsDetail.productPicture">
<view class="noPic" style="margin: 0;" v-else>暂无图片</view> <view class="noPic" style="margin: 0;" v-else>暂无图片</view>
</view> </view>
<view class="shop-popup-title-right"> <view class="shop-popup-title-right">
@ -305,7 +315,8 @@
<uni-icons color="red" type="minus" size="26"></uni-icons> <uni-icons color="red" type="minus" size="26"></uni-icons>
</view> </view>
<view class="shop-checkList-box"> <view class="shop-checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text> <text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text
style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
</view> </view>
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" /> <uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" />
</view> </view>
@ -335,7 +346,8 @@
<view style="height: 60rpx;line-height: 60rpx;">上次拿货时间:</view> <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.createTime}}</view>
<view style="height: 60rpx;line-height: 60rpx;">上次拿货数:{{historyList.productCount}}</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.discountAmount}}</view> <view style="height: 60rpx;line-height: 60rpx;font-size: 36rpx;font-weight: bold;">
上次拿货价:{{historyList.discountAmount}}</view>
</view> </view>
<view class="popup-container" v-else> <view class="popup-container" v-else>
<view style="height: 150rpx;line-height: 150rpx;text-align: center;">暂无拿货历史</view> <view style="height: 150rpx;line-height: 150rpx;text-align: center;">暂无拿货历史</view>
@ -384,7 +396,7 @@
discountNum: 10, //整体折扣 discountNum: 10, //整体折扣
priceCurrent: '', priceCurrent: '',
goodsDetail: [], goodsDetail: [],
noticeData:['您每发出一个包,使用拉包工和物流公司送货时,我们将从中拿出XX元,捐入快拾帮帮公益基金中,帮助那些贫困儿童!我们的付出将让世界充满爱!'], noticeData: ['您每发出一个包,使用拉包工和物流公司送货时,我们将从中拿出XX元,捐入快拾帮帮公益基金中,帮助那些贫困儿童!我们的付出将让世界充满爱!'],
columns: [], columns: [],
keyList: [], keyList: [],
temporaryList: [], temporaryList: [],
@ -469,14 +481,14 @@
saleId: '', saleId: '',
saleDetailList: [], saleDetailList: [],
yNum: 150, yNum: 150,
clearMsg:'', clearMsg: '',
priceType:'', priceType: '',
multiple:1, multiple: 1,
productId:'', productId: '',
productNum:0, productNum: 0,
historyList:{}, historyList: {},
printTotal:1040, printTotal: 1040,
afterPrice:0 //第二次选择商品的时候,先计算这个价格,实收金额= 已经存在的实收金额 + afterPrice afterPrice: 0 //第二次选择商品的时候,先计算这个价格,实收金额= 已经存在的实收金额 + afterPrice
} }
}, },
components: { components: {
@ -489,7 +501,7 @@
this.wlName = JSON.parse(JSON.stringify(this.wlName)) this.wlName = JSON.parse(JSON.stringify(this.wlName))
this.kdyName = JSON.parse(JSON.stringify(this.kdyName)) this.kdyName = JSON.parse(JSON.stringify(this.kdyName))
this.lbgName = JSON.parse(JSON.stringify(this.lbgName)) this.lbgName = JSON.parse(JSON.stringify(this.lbgName))
console.log('商品',this.carList1) console.log('商品', this.carList1)
if (uni.getStorageSync('carList1') != '') { if (uni.getStorageSync('carList1') != '') {
this.carList.clear() this.carList.clear()
this.carList1 = JSON.parse(uni.getStorageSync('carList1')) this.carList1 = JSON.parse(uni.getStorageSync('carList1'))
@ -520,25 +532,73 @@
// this.afterPrice = this.afterPrice * 10000 * that.discountNum / 10 / 10000 // this.afterPrice = this.afterPrice * 10000 * that.discountNum / 10 / 10000
// } // }
if(this.carList1[i].saleDetailQueryDTO){ if (this.carList1[i].saleDetailQueryDTO) {
if (this.carList.size == 0) { //当前页没有数据 if (this.carList.size == 0) { //当前页没有数据
let obj = {
purchasePrice: this.carList1[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: this.carList1[i].unitPrice || 0, //单价
discountAmount: this.carList1[i].unitPrice || 0, //折后价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].lsprice, //零售价
productCount: 0, //总数量
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
supplierName: this.carList1[i].supplierName //供应商
}
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
} else { //当前页有数据
if (this.carList.has(this.carList1[i].id) == true) { //商品相同
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[
m].attributeList) == true) { //规格相同
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
.saleDetailQueryDTO[
m].attributeList, this.carList.get(this.carList1[i].id).stockLogList.get(
this
.carList1[i].saleDetailQueryDTO[m].attributeList) + this.carList1[i]
.saleDetailQueryDTO[m].productCount)
this.carList.get(this.carList1[i].id).productCount += this.carList1[i]
.saleDetailQueryDTO[
m].productCount
} else { //规格不同
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
.saleDetailQueryDTO[
m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount)
this.carList.get(this.carList1[i].id).productCount += this.carList1[i]
.saleDetailQueryDTO[
m].productCount
}
}
} else { //商品不同
let obj = { let obj = {
purchasePrice: this.carList1[i].price, //采购价 purchasePrice: this.carList1[i].price, //采购价
price: 0, //总价 price: 0,
discount: 10, //折扣 discount: 10,
discountAmount: this.carList1[i].unitPrice || 0,
unitPrice: this.carList1[i].unitPrice || 0, //单价 unitPrice: this.carList1[i].unitPrice || 0, //单价
discountAmount: this.carList1[i].unitPrice || 0, //折后价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].lsprice, //零售价 lsprice: this.carList1[i].lsprice, //零售价
productCount: 0, //总数量 productCount: 0,
productId: this.carList1[i].id, productId: this.carList1[i].id,
productName: this.carList1[i].productName, productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture, productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
stockLogList: new Map(), stockLogList: new Map(),
stockLogList1: [], stockLogList1: [],
supplierName: this.carList1[i].supplierName //供应商 productSn: this.carList1[i].productSn,
supplierName: this.carList1[i].supplierName
} }
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i] obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
@ -546,49 +606,7 @@
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
} }
this.carList.set(this.carList1[i].id, obj) this.carList.set(this.carList1[i].id, obj)
} else { //当前页有数据 }
if (this.carList.has(this.carList1[i].id) == true) { //商品相同
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[
m].attributeList) == true) { //规格相同
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, this.carList.get(this.carList1[i].id).stockLogList.get(this
.carList1[i].saleDetailQueryDTO[m].attributeList) + this.carList1[i]
.saleDetailQueryDTO[m].productCount)
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[
m].productCount
} else { //规格不同
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount)
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[
m].productCount
}
}
} else { //商品不同
let obj = {
purchasePrice: this.carList1[i].price, //采购价
price: 0,
discount: 10,
discountAmount: this.carList1[i].unitPrice || 0,
unitPrice: this.carList1[i].unitPrice || 0, //单价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].lsprice, //零售价
productCount: 0,
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
stockLogList: new Map(),
stockLogList1: [],
productSn: this.carList1[i].productSn,
supplierName: this.carList1[i].supplierName
}
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
}
} }
} }
@ -598,9 +616,9 @@
uni.removeStorageSync('saoma') uni.removeStorageSync('saoma')
this.carList1 = [] this.carList1 = []
this.carList.forEach(function(value, key) { this.carList.forEach(function(value, key) {
if(that.priceType == ''){ if (that.priceType == '') {
// value.unitPrice = value.unitPrice // value.unitPrice = value.unitPrice
}else if (that.priceType == 0) { //零售 } else if (that.priceType == 0) { //零售
value.unitPrice = value.lsprice value.unitPrice = value.lsprice
} else if (that.priceType == 1) { //批发 } else if (that.priceType == 1) { //批发
value.unitPrice = value.wholesalePrice value.unitPrice = value.wholesalePrice
@ -612,7 +630,7 @@
this.getAllPrice() this.getAllPrice()
this.getAmountAndWho() this.getAmountAndWho()
// this.noPay = this.shouldPay // this.noPay = this.shouldPay
if(this.xsyId == ''){ if (this.xsyId == '') {
this.xsyId = uni.getStorageSync('id') this.xsyId = uni.getStorageSync('id')
this.createByName = uni.getStorageSync('nickname') this.createByName = uni.getStorageSync('nickname')
} }
@ -689,7 +707,7 @@
this.attributeList = { this.attributeList = {
attributeList: JSON.stringify(obj), attributeList: JSON.stringify(obj),
productCount: 0, productCount: 0,
productNum:this.productNum, productNum: this.productNum,
name: name, name: name,
price: this.purchasePrice price: this.purchasePrice
} }
@ -704,7 +722,8 @@
this.temporaryList.push(this.attributeList); this.temporaryList.push(this.attributeList);
} else { } else {
for (var i = 0; i < this.temporaryList.length; i++) { for (var i = 0; i < this.temporaryList.length; i++) {
if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this.temporaryList[i].name.indexOf(this.attributeList.name) == 1) { if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this
.temporaryList[i].name.indexOf(this.attributeList.name) == 1) {
if (this.temporaryList.length == (i + 1)) { if (this.temporaryList.length == (i + 1)) {
this.temporaryList.push(this.attributeList); this.temporaryList.push(this.attributeList);
return return
@ -731,14 +750,14 @@
this.noPay = this.relPrice - this.priceOk; this.noPay = this.relPrice - this.priceOk;
}, },
changePrice(e) { changePrice(e) {
this.priceOk = e.target.value >this.relPrice ?this.relPrice :e.target.value this.priceOk = e.target.value > this.relPrice ? this.relPrice : e.target.value
this.noPay = this.relPrice - this.priceOk; this.noPay = this.relPrice - this.priceOk;
}, },
getImg(key) { getImg(key) {
return this.carList.get(key).productPicture return this.carList.get(key).productPicture
}, },
//获取客户拿货历史 //获取客户拿货历史
getHistoryPrice(id,index){ getHistoryPrice(id, index) {
this.index = index this.index = index
this.tui.request("/app/product/getByUserIdAndProductId", "POST", { this.tui.request("/app/product/getByUserIdAndProductId", "POST", {
userId: this.khName.id, userId: this.khName.id,
@ -764,13 +783,13 @@
}, },
//扫一扫功能 //扫一扫功能
scanCodeAdd() { scanCodeAdd() {
uni.setStorageSync('saoma','1') uni.setStorageSync('saoma', '1')
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
if(res.scanType == "QR_CODE"){ //二维码 if (res.scanType == "QR_CODE") { //二维码
let shopId = res.result.split(',')[1] let shopId = res.result.split(',')[1]
if(shopId == uni.getStorageSync('shopId')){ if (shopId == uni.getStorageSync('shopId')) {
this.productId = res.result.split(',')[0] this.productId = res.result.split(',')[0]
this.toggle('bottom', res.result.split(',')[0]); this.toggle('bottom', res.result.split(',')[0]);
if (item.saleDetailDTOList) { if (item.saleDetailDTOList) {
@ -778,18 +797,18 @@
this.carList.push(item.saleDetailDTOList[i]) this.carList.push(item.saleDetailDTOList[i])
} }
} }
}else{ } else {
this.tui.toast('您的店铺中暂无该商品!') this.tui.toast('您的店铺中暂无该商品!')
} }
}else{ } else {
this.productId = res.result this.productId = res.result
this.tui.request("/app/product/getByBarcode", "POST", { this.tui.request("/app/product/getByBarcode", "POST", {
barcode:res.result barcode: res.result
}, false, true).then((res1) => { }, false, true).then((res1) => {
if (res1.code == 200) { if (res1.code == 200) {
if(res1.result == ''){ if (res1.result == '') {
this.tui.toast('您的店铺中暂无该商品!') this.tui.toast('您的店铺中暂无该商品!')
}else{ } else {
this.toggle('bottom', res1.result[0].id); this.toggle('bottom', res1.result[0].id);
if (item.saleDetailDTOList) { if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) { for (let i = 0; i < item.saleDetailDTOList.length; i++) {
@ -837,7 +856,7 @@
}, },
//商品上选择是零售价还是批发价 //商品上选择是零售价还是批发价
checkPay(price) { checkPay(price) {
if(price == undefined || price == null){ if (price == undefined || price == null) {
this.tui.toast("暂无拿货记录") this.tui.toast("暂无拿货记录")
return return
} }
@ -854,30 +873,30 @@
this.getAllPrice() this.getAllPrice()
}, },
//整体选择时使用批发价、零售价,选择整体折扣的方法 //整体选择时使用批发价、零售价,选择整体折扣的方法
getAmountAndWho(){ getAmountAndWho() {
let that = this; let that = this;
let price = 0 let price = 0
this.carList.forEach(function(value, key) { this.carList.forEach(function(value, key) {
if(that.priceType == ''){ if (that.priceType == '') {
price = value.unitPrice price = value.unitPrice
}else if(that.priceType == 0){ //零售 } else if (that.priceType == 0) { //零售
price = value.lsprice price = value.lsprice
}else if(that.priceType == 1){ //批发 } else if (that.priceType == 1) { //批发
price = value.wholesalePrice price = value.wholesalePrice
} }
value.unitPrice = price; value.unitPrice = price;
if (that.discountType == 1) { //整体折扣 if (that.discountType == 1) { //整体折扣
value.discountAmount = value.unitPrice * 10000 * that.discountNum / 10 / 10000 value.discountAmount = value.unitPrice * 10000 * that.discountNum / 10 / 10000
value.price = value.discountAmount * value.productCount value.price = value.discountAmount * value.productCount
}else if(that.discountType == 0){//单品折扣 } else if (that.discountType == 0) { //单品折扣
value.discountAmount = value.unitPrice * value.discount / 10 value.discountAmount = value.unitPrice * value.discount / 10
value.price = value.unitPrice * value.discount / 10 * value.productCount value.price = value.unitPrice * value.discount / 10 * value.productCount
} }
}) })
this.getAllPrice(); this.getAllPrice();
if(this.relPrice == '' || this.relPrice == 0){ if (this.relPrice == '' || this.relPrice == 0) {
that.noPay = that.shouldPay that.noPay = that.shouldPay
}else if(this.relPrice != '' && this.priceOk != ''){ } else if (this.relPrice != '' && this.priceOk != '') {
that.noPay = this.relPrice - this.priceOk that.noPay = this.relPrice - this.priceOk
} }
}, },
@ -886,7 +905,8 @@
getById(id) { getById(id) {
this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => { this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.result.delFlag ==0 || res.result.purchasePrice==null || res.result.inStorageStatus == 0) { if (res.result.delFlag == 0 || res.result.purchasePrice == null || res.result
.inStorageStatus == 0) {
this.tui.toast("请将商品上架或入库后再操作!") this.tui.toast("请将商品上架或入库后再操作!")
return return
} }
@ -962,11 +982,11 @@
}, },
//整体折扣数字框改变 //整体折扣数字框改变
change(e) { change(e) {
if(e.detail.value > 10){ if (e.detail.value > 10) {
this.discountNum = 10 this.discountNum = 10
}else if(e.detail.value < 0){ } else if (e.detail.value < 0) {
this.discountNum = 0 this.discountNum = 0
}else{ } else {
this.discountNum = e.detail.value this.discountNum = e.detail.value
} }
this.getAmountAndWho() this.getAmountAndWho()
@ -996,7 +1016,7 @@
}) })
return return
} }
if((popleType == 'wlName' || popleType == 'fcName') && this.khName == ''){ if ((popleType == 'wlName' || popleType == 'fcName') && this.khName == '') {
uni.showToast({ uni.showToast({
title: "先选择客户", title: "先选择客户",
icon: 'error' icon: 'error'
@ -1006,7 +1026,8 @@
let companyType = this.radioType == 1 ? this.wlName.id : '' let companyType = this.radioType == 1 ? this.wlName.id : ''
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType + '&khName=' + JSON.stringify(this.khName) url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType +
'&khName=' + JSON.stringify(this.khName)
}) })
}, },
//弹窗选择规格后,点击弹窗中选好了按钮 //弹窗选择规格后,点击弹窗中选好了按钮
@ -1207,14 +1228,14 @@
shareAddress: this.pbAddress, shareAddress: this.pbAddress,
transCompany: this.wlName.shippingMethodId || this.wlName.id, transCompany: this.wlName.shippingMethodId || this.wlName.id,
companyName: this.wlName.shippingMethod || this.wlName.companyName, companyName: this.wlName.shippingMethod || this.wlName.companyName,
companyPhone:this.wlName.mobile companyPhone: this.wlName.mobile
}, },
saleDetailList: [] saleDetailList: []
} }
let purchaseDetails = []; let purchaseDetails = [];
this.carList.forEach(function(value, key) { this.carList.forEach(function(value, key) {
value.stockLogList.forEach(function(values, keys) { value.stockLogList.forEach(function(values, keys) {
if(values <= 0){ if (values <= 0) {
that.tui.toast("商品数量不能为零!") that.tui.toast("商品数量不能为零!")
return; return;
} }
@ -1254,7 +1275,7 @@
//打印取消按钮 //打印取消按钮
printChenel() { printChenel() {
uni.redirectTo({ uni.redirectTo({
url: "/pages/index/order" url: "/pages/index/index"
}) })
}, },
//打印小票 //打印小票
@ -1277,45 +1298,49 @@
'=========================================================') '=========================================================')
this.carList.forEach(function(value, key) { this.carList.forEach(function(value, key) {
if(that.countPrint() < that.printTotal){ if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, value.productName + '(' + strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, value.productName + '(' +
value.productSn + ')') value.productSn + ')')
}else{ } else {
that.yNum = 0 that.yNum = 0
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd); that.bufferData.push(strCmd);
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, value.productName + '(' + strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, value.productName +
'(' +
value.productSn + ')') value.productSn + ')')
} }
value.stockLogList.forEach(function(value1, key1) { value.stockLogList.forEach(function(value1, key1) {
if(that.countPrint() < that.printTotal){ if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, (that.slicePrint( strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, (that.slicePrint(
key1)) + '*' + value1) key1)) + '*' + value1)
strCmd += blesdk.addCPCLText('280', that.yNum, '24', '0', 0, '单价:' + value.discountAmount) strCmd += blesdk.addCPCLText('280', that.yNum, '24', '0', 0, '单价:' + value
.discountAmount)
strCmd += blesdk.addCPCLText('440', that.yNum, '24', '0', 0, '总价:' + (value strCmd += blesdk.addCPCLText('440', that.yNum, '24', '0', 0, '总价:' + (value
.discountAmount * value1)) .discountAmount * value1))
}else{ } else {
that.yNum = 0 that.yNum = 0
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd); that.bufferData.push(strCmd);
strCmd = '' strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, (that.slicePrint( strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, (that
key1)) + '*' + value1) .slicePrint(
strCmd += blesdk.addCPCLText('280', that.yNum, '24', '0', 0, '单价:' + value.discountAmount) key1)) + '*' + value1)
strCmd += blesdk.addCPCLText('280', that.yNum, '24', '0', 0, '单价:' + value
.discountAmount)
strCmd += blesdk.addCPCLText('440', that.yNum, '24', '0', 0, '总价:' + (value strCmd += blesdk.addCPCLText('440', that.yNum, '24', '0', 0, '总价:' + (value
.discountAmount * value1)) .discountAmount * value1))
} }
}) })
}) })
if(that.countPrint() < this.printTotal){ if (that.countPrint() < this.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,
'===============================================================') '===============================================================')
}else{ } else {
this.yNum = 0 this.yNum = 0
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd); this.bufferData.push(strCmd);
@ -1326,11 +1351,11 @@
'===============================================================') '===============================================================')
} }
if(that.countPrint() < this.printTotal){ if (that.countPrint() < this.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '总数量:' + this.totalAmount) 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('200', this.yNum, '24', '0', 0, '总金额' + this.shouldPay)
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice) strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice)
}else{ } else {
this.yNum = 0 this.yNum = 0
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd); this.bufferData.push(strCmd);
@ -1342,11 +1367,12 @@
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice) strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice)
} }
if(that.countPrint() < this.printTotal){ if (that.countPrint() < this.printTotal) {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '实收:' + this.priceOk) strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '实收:' + this.priceOk)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.relPrice - this.priceOk)) strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.relPrice - this.priceOk))
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.otherExpense == '' ? 0 : this.otherExpense)) strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.otherExpense == '' ? 0 :
}else{ this.otherExpense))
} else {
this.yNum = 0 this.yNum = 0
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd); this.bufferData.push(strCmd);
@ -1355,29 +1381,30 @@
strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (this.yNum += 30), '24', '0', 0, '实收:' + this.priceOk) 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)) strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.relPrice - this.priceOk))
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.otherExpense == '' ? 0 : this.otherExpense)) 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 < this.printTotal){ if (Math.ceil(Number(this.remark.length) / 20) * 30 + this.yNum < this.printTotal) {
if(this.remark.length >20){ if (this.remark.length > 20) {
let position = 20; let position = 20;
let part1 = this.remark.substring(0, position); let part1 = this.remark.substring(0, position);
let part2 = this.remark.substring(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, '备注:' + part1)
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2)
}else{ } else {
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.remark) strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.remark)
} }
strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd); this.bufferData.push(strCmd);
}else{ } else {
this.yNum = 0 this.yNum = 0
strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd); this.bufferData.push(strCmd);
strCmd = '' strCmd = ''
if(this.remark.length >20){ if (this.remark.length > 20) {
let position = 20; let position = 20;
let part1 = this.remark.substring(0, position); let part1 = this.remark.substring(0, position);
let part2 = this.remark.substring(position); let part2 = this.remark.substring(position);
@ -1385,7 +1412,7 @@
strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1) strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1)
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2) strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2)
}else{ } else {
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.remark) strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.remark)
@ -1397,17 +1424,17 @@
} }
this.$nextTick(()=>{ this.$nextTick(() => {
uni.redirectTo({ uni.redirectTo({
url: "/pages/index/order" url: "/pages/index/index"
}) })
}) })
}, },
//计算打印机当前行高度 //计算打印机当前行高度
countPrint(){ countPrint() {
if((this.yNum + 50) >= 1040){ if ((this.yNum + 50) >= 1040) {
return this.yNum +=50 return this.yNum += 50
}else{ } else {
return this.yNum += 30 return this.yNum += 30
} }
}, },
@ -1454,11 +1481,11 @@
changeDis(e, id) { changeDis(e, id) {
let that = this; let that = this;
let carlist = this.carList.get(id) let carlist = this.carList.get(id)
if(e.detail.value > 10){ if (e.detail.value > 10) {
carlist.discount = 10; carlist.discount = 10;
}else if(e.detail.value < 0){ } else if (e.detail.value < 0) {
carlist.discount = 0; carlist.discount = 0;
}else{ } else {
carlist.discount = e.detail.value; carlist.discount = e.detail.value;
} }
@ -1518,7 +1545,8 @@
if (res.confirm) { if (res.confirm) {
that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name); that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name);
that.carList.get(id).stockLogList.delete(name); that.carList.get(id).stockLogList.delete(name);
that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).unitPrice that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(
id).unitPrice
if (that.carList.get(id).stockLogList.size == 0) { if (that.carList.get(id).stockLogList.size == 0) {
that.carList.delete(id) that.carList.delete(id)
} }
@ -1531,7 +1559,7 @@
}, },
//计算总金额和总数量 //计算总金额和总数量
getAllPrice(){ getAllPrice() {
let that = this; let that = this;
this.shouldPay = 0 this.shouldPay = 0
this.totalAmount = 0 this.totalAmount = 0
@ -1542,7 +1570,7 @@
}) })
this.relPrice = this.shouldPay this.relPrice = this.shouldPay
that.noPay = this.relPrice - (this.priceOk==''? 0 : this.priceOk) that.noPay = this.relPrice - (this.priceOk == '' ? 0 : this.priceOk)
}, },
//修改已选规格的数量 //修改已选规格的数量
GoodsNumChange(e, index, index1) { GoodsNumChange(e, index, index1) {
@ -1552,10 +1580,12 @@
this.carList.get(index).stockLogList.forEach(function(value, key) { this.carList.get(index).stockLogList.forEach(function(value, key) {
that.carList.get(index).productCount = that.carList.get(index).productCount + value that.carList.get(index).productCount = that.carList.get(index).productCount + value
if (that.discountType == 0) { //单品折扣 if (that.discountType == 0) { //单品折扣
that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index) that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(
index)
.discountAmount * that.carList.get(index).discount / 10 .discountAmount * that.carList.get(index).discount / 10
}else{ } else {
that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index) that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(
index)
.unitPrice .unitPrice
} }
}) })
@ -1570,25 +1600,25 @@
content: "确定清空全部已选商品吗?", content: "确定清空全部已选商品吗?",
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
that.carList.clear() that.carList.clear()
that.remark = '' that.remark = ''
that.temporaryList = [] that.temporaryList = []
that.purchasePrice = 0 that.purchasePrice = 0
that.zPrice = 0 that.zPrice = 0
that.zNum = 0 that.zNum = 0
that.shouldPay = 0 that.shouldPay = 0
that.gysName = [] that.gysName = []
that.wlName = [] that.wlName = []
that.kdyName = [] that.kdyName = []
that.lbgName = [] that.lbgName = []
that.relPrice = 0 that.relPrice = 0
that.priceOk = 0 that.priceOk = 0
that.noPay = 0 that.noPay = 0
that.otherExpense = 0 that.otherExpense = 0
that.totalAmount = 0 that.totalAmount = 0
that.createByName = '' that.createByName = ''
that.xsyId = '' that.xsyId = ''
this.saleId = '' this.saleId = ''
} }
} }
}) })
@ -1600,7 +1630,9 @@
<style lang="scss"> <style lang="scss">
page, page,
.page1 { .page1 {
height: 100%; height: 1280rpx;
overflow-y: scroll;
min-height: 100vh;
} }
.popup-pay-content { .popup-pay-content {
@ -1614,8 +1646,7 @@
.content { .content {
border-top: 1px solid #eee; border-top: 1px solid #eee;
overflow-y: scroll;
max-height: 100vh;
} }
.content-box { .content-box {
@ -1786,6 +1817,7 @@
display: flex; display: flex;
float: left; float: left;
} }
.bottom-box { .bottom-box {
width: 100%; width: 100%;
position: absolute; position: absolute;
@ -1802,10 +1834,12 @@
height: 110rpx; height: 110rpx;
line-height: 110rpx; line-height: 110rpx;
} }
.notice{
.notice {
width: 100%; width: 100%;
height: 56rpx; height: 56rpx;
} }
.bottom-right { .bottom-right {
width: 60%; width: 60%;
display: flex; display: flex;
@ -1822,6 +1856,7 @@
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;
@ -1947,6 +1982,7 @@
height: 50rpx; height: 50rpx;
width: 60%; width: 60%;
} }
.popup-content { .popup-content {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -1968,6 +2004,7 @@
margin-top: 20rpx; margin-top: 20rpx;
font-size: 32rpx; font-size: 32rpx;
} }
.popup-bottom { .popup-bottom {
height: 80rpx; height: 80rpx;
color: #fff; color: #fff;
@ -1979,6 +2016,7 @@
text-align: center; text-align: center;
background: linear-gradient(90deg, #60F3FF, #088FEB); background: linear-gradient(90deg, #60F3FF, #088FEB);
} }
.shop-popup-bottom { .shop-popup-bottom {
width: 95%; width: 95%;
height: 100rpx; height: 100rpx;
@ -2011,6 +2049,7 @@
border-radius: 70rpx; border-radius: 70rpx;
} }
} }
.uni-data-checklist { .uni-data-checklist {
.checklist-box { .checklist-box {
margin-left: 100rpx !important; margin-left: 100rpx !important;
@ -2020,15 +2059,18 @@
margin-left: 46rpx !important; margin-left: 46rpx !important;
} }
} }
.uni-data-checklist .checklist-group .checklist-box { .uni-data-checklist .checklist-group .checklist-box {
margin-right: 0 !important; margin-right: 0 !important;
} }
.uni-numbox { .uni-numbox {
input { input {
padding-left: 0; padding-left: 0;
} }
} }
.noPic{
.noPic {
border-radius: 10px; border-radius: 10px;
width: 140rpx; width: 140rpx;
height: 140rpx; height: 140rpx;

26
pages/inventory/inventory.vue

@ -1,6 +1,6 @@
<!-- 库存列表页 --> <!-- 库存列表页 -->
<template> <template>
<view style="display: flex;flex-direction: column;height: 1280rpx;"> <view style="display: flex;flex-direction: column;" :style="{height: windowHeight + 'px'}">
<view class="" style="display: flex;border-top: 1px solid #eee;border-bottom: 1px solid #eee;"> <view class="" style="display: flex;border-top: 1px solid #eee;border-bottom: 1px solid #eee;">
<view class="title-left"> <view class="title-left">
<view class="title-left-box"> <view class="title-left-box">
@ -27,18 +27,6 @@
</view> </view>
</view> </view>
<!-- <view class="title-right" @tap.stop="onGridClick('0')">
<view class="title-right-top title-btn">
分类管理
</view>
<view class="title-right-bottom title-btn" @tap.stop="onGridClick('2')">
新增商品
</view>
<view class="title-right-bottom title-btn"
@tap.stop="onGridClick('1')">
新增入库
</view>
</view> -->
<view class="title-right"> <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('1')">
新增入库 新增入库
@ -129,9 +117,19 @@
type:'', type:'',
warnMsg:[], warnMsg:[],
searchName:'', searchName:'',
categoryIndex:0 categoryIndex:0,
windowHeight:0
} }
}, },
onLoad(){
let that = this
uni.getSystemInfo({
success: function (info) {
console.log(info.windowHeight)
that.windowHeight = info.windowHeight
}
});
},
onShow() { onShow() {
this.getGategoryList() this.getGategoryList()
this.getWarnMsg() this.getWarnMsg()

BIN
pages/staff/.DS_Store

Binary file not shown.

107
pages/staff/addStaff/addStaff.vue

@ -1,107 +0,0 @@
<template>
<view>
<view class="popup-height">
<uni-forms :modelValue="addForm" ref="addForm" validateTrigger="bind" :rules="rules" label-width="160rpx"
label-align="right">
<uni-forms-item label="员工姓名" required name="nickname">
<uni-easyinput type="text" v-model="addForm.nickname" placeholder="请输入员工姓名" />
</uni-forms-item>
<uni-forms-item label="手机号" required name="mobile">
<uni-easyinput type="text" v-model="addForm.mobile" placeholder="请输入员工手机号" />
</uni-forms-item>
<uni-forms-item label="权限" required name="type">
<uni-data-select style="width: 100%" v-model="addForm.type" :localdata="typeList"></uni-data-select>
</uni-forms-item>
</uni-forms>
<u-button type="primary" @click="onFormSubmit">保存</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
addForm: {
nickname: '',
mobile: '',
type: '',
password:'123456'
},
id: '',
typeList: [{
value: 0,
text: "管理员"
},
{
value: 1,
text: "员工"
},
],
rules: {
nickname: {
rules: [{
required: true,
errorMessage: '不能为空'
}]
},
mobile: {
rules: [{
required: true,
errorMessage: '不能为空'
}]
},
type: {
rules: [{
required: true,
errorMessage: '不能为空'
}]
},
}
}
},
onLoad(options) {
const type = options.type
const item = JSON.parse(options.item)
this.type = options.type
if (type === 'edit') {
this.addForm.nickname = item.nickname
this.addForm.mobile = item.mobile
this.addForm.type = Number(item.type)
this.id = item.id
}
uni.setNavigationBarTitle({
title: type === 'add' ? '新增员工' : '编辑信息'
});
},
methods: {
onFormSubmit() {
this.$refs.addForm.validate().then(async () => {
let url;
if(this.type=='edit'){
url = '/app/common/user/edit'
this.addForm.id = this.id
}else{
url = '/app/common/user/add'
}
const res = await this.tui.request(url, 'post', this.addForm, false,
true, false)
if (res.code == 200) {
uni.navigateBack()
} else {
this.tui.toast(res.message)
}
}, (reason) => {
})
}
}
}
</script>
<style lang="scss" scoped>
.popup-height {
padding: 0 25upx;
background-color: #fff;
}
</style>

144
pages/staff/clock/clock.vue

@ -1,144 +0,0 @@
<template>
<view>
<view class="" v-if="peopleType=='1'">
<view class="status">当前状态:{{value}}</view>
<view class="clock-button" :class="{isClock:isClock}" type="success" @click="onClock">打卡</view>
</view>
<view class="" v-else>
<uni-section class="mb-10" title="时间选择" type="line">
<uni-datetime-picker v-model="range" type="daterange" />
</uni-section>
<uni-card title="打卡情况">
<uni-list>
<uni-list-item direction="row" v-for="(item , index) in staffList" :key="index">
<template #body>
<view class="tag-wrap">
<view v-if="item.departmentTitle">
<u-tag :text="item.departmentTitle" size="12" />
</view>
</view>
</template>
<template #header>
<view class="avatar-wrap">
<!-- <u-avatar :src="item.avatar" size="24">
</u-avatar> -->
<text class="staff-name">{{ item.nickname }}</text>
</view>
</template>
<template #footer>
<view style="font-size: 24rpx;">
<text style="margin-right: 10px;">正常:20</text>
<text style="margin-right: 10px;">迟到:<text style="color: red;">2</text></text>
<text>早退:<text style="color: red;">3</text></text>
</view>
</template>
</uni-list-item>
</uni-list>
</uni-card>
</view>
</view>
</template>
<script>
import {
mapState
} from 'vuex'
export default {
data() {
return {
value: '未打卡',
isClock: false,
peopleType: '0',
staffList:[]
}
},
computed: mapState(['userId']),
onLoad() {
//明珠A 116.805796,38.335286
//明珠D 116.806408,38.338111
//明珠B 116.806913,38.336937
//明珠C 116.80562,38.337177
//明珠早市精品二合一给一个大的范围 116.810029,38.335321
this.peopleType = uni.getStorageSync('type')
if(this.peopleType == 0){
this.getStaffList()
}
},
methods: {
getStaffList() {
this.tui.request('/app/common/user/findAllUserByShopId', 'get', {}, false, false, true).then((res) => {
if (res.code !== 200) return
this.staffList = res.result
})
},
onClock() {
uni.getLocation({
type: 'wgs84',
isHighAccuracy:true,
accuracy:'best',
success: function (res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
}
});
// if (!this.isClock) {
// this.tui.request("/app/clockIn/", "get", {
// userId: this.userId
// }, false, true).then((res) => {
// if (res.code == 200) {
// this.tui.toast('打卡成功', 2000, true)
// this.value = '已打卡'
// this.isClock = true
// } else {
// this.tui.toast(res.message)
// }
// })
// }
}
}
}
</script>
<style lang="scss">
.status {
font-size: 40upx;
color: #333333;
text-align: center;
padding: 80upx;
}
.clock-button {
width: 200upx;
height: 200upx;
line-height: 200upx;
border-radius: 200upx;
text-align: center;
background-color: #5fd9ee;
color: #fef0f0;
font-size: 56upx;
margin: 50upx auto;
}
.isClock {
background: grey;
}
.tag-wrap {
width: 100rpx;
flex: 1;
display: flex;
view {
margin: 0 2upx;
}
}
.avatar-wrap {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24upx;
}
</style>

92
pages/staff/performance/performance.vue

@ -1,92 +0,0 @@
<template>
<view>
<uni-section class="mb-10" title="业绩查看范围" type="line">
<uni-datetime-picker v-model="range" type="daterange" @change="change" />
</uni-section>
<view class="">
<uni-card title="业绩排名">
<uni-list>
<uni-list-item direction="row" v-for="(item , index) in staffList" :key="index">
<template #header>
<view class="avatar-wrap">
<text class="staff-name">{{ item.createByName?item.createByName:'暂无' }}</text>
</view>
</template>
<template #footer>
<view style="font-size: 24rpx;display: flex;flex-direction: column;width: 250rpx;">
<text style="display: inline-block;width: auto;">单数:{{item.totalCount?item.totalCount:'暂无'}}单</text>
<text style="display: inline-block;width: auto;">总金额:{{item.totalPrice?item.totalPrice:'暂无'}}元</text>
</view>
</template>
</uni-list-item>
</uni-list>
</uni-card>
</view>
</view>
</template>
<script>
export default {
data() {
return {
range: [],
name: '',
staffList:[]
}
},
onLoad() {
this.getMonth();
this.getStaffList()
},
methods: {
//改变时间选择
change(e){
var start = e[0]
var end = e[1]
this.range = [start,end]
this.getStaffList();
},
//获取业绩列表
getStaffList() {
this.tui.request('/app/sale/getSalesRankingByShopId', 'post', {
startTime:this.range[0],
endTime:this.range[1],
}, false, false, true).then((res) => {
if (res.code !== 200) return
this.staffList = res.result
})
},
//获取当月1日到当前时间
getMonth() {
let date = new Date()
let year = date.getFullYear().toString()
let month = date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1).toString():(date.getMonth()+1).toString() //'月'
let da = date.getDate() < 10 ? '0'+date.getDate().toString():date.getDate().toString() //'日'
let end = year + '-' + month + '-' + da
let beg = year + '-' + month + '-01'
this.range = [beg,end]
}
}
}
</script>
<style lang="scss" scoped>
.example-body {}
.tag-wrap {
width: 100rpx;
flex: 1;
display: flex;
view {
margin: 0 2upx;
}
}
.avatar-wrap {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24upx;
}
</style>

141
pages/staff/signRule/signRule.vue

@ -1,141 +0,0 @@
<template>
<view>
<view class="popup-height">
<uni-forms :modelValue="addForm" ref="addForm" validateTrigger="bind" :rules="rules" label-width="160rpx"
label-align="right">
<uni-forms-item label="上班时间" required>
<picker mode="time" :value="addForm.startTime" start="00:00" end="23:59" @change="start">
<view class="uni-input">{{addForm.startTime}}</view>
</picker>
</uni-forms-item>
<uni-forms-item label="下班时间" required>
<picker mode="time" :value="addForm.endTime" start="00:00" end="23:59" @change="end">
<view class="uni-input">{{addForm.endTime}}</view>
</picker>
</uni-forms-item>
<uni-forms-item label="定位" name="latitude" required>
<input type="text" v-model="addForm.latitude + ','+addForm.longitude" style="text-align:center;width:70%;border: 1px solid #eee;height: 72rpx;line-height: 72rpx !important;" disabled placeholder="获取位置用于员工打卡">
<view class="dw-btn" @tap="clockPosi">一键定位</view>
</uni-forms-item>
<uni-forms-item label="打卡范围" name="categoryId" required>
<uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId"
placeholder="请选择打卡范围"></uni-data-select>
</uni-forms-item>
</uni-forms>
<u-button type="primary" @click="onFormSubmit">保存</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
addForm: {
startTime: '06:00',
endTime: '14:00',
latitude:'',
longitude:'',
categoryId: '',
},
categoryList: [{
value: 1,
text: '100米'
},{
value: 2,
text: '200米'
},{
value: 3,
text: '500米'
}],
rules: {
categoryId: {
rules: [{
required: true,
errorMessage: '请选择打卡范围',
}],
},
latitude: {
rules: [{
required: true,
errorMessage: '请定位店铺位置',
}],
}
}
}
},
onLoad() {
},
methods: {
bindTimeChange(e) {
this.time = e.detail.value;
},
clockPosi(){
let that = this;
uni.getLocation({
type: 'wgs84',
isHighAccuracy:true,
accuracy:'best',
success: function (res) {
that.addForm.latitude = res.latitude
that.addForm.longitude = res.longitude
}
});
},
onFormSubmit() {
this.$refs.addForm.validate().then(async () => {
let url;
if (this.type == 'edit') {
url = '/app/common/user/edit'
this.addForm.id = this.id
} else {
url = '/app/common/user/add'
}
const res = await this.tui.request(url, 'post', this.addForm, false,
true, false)
if (res.code == 200) {
uni.navigateBack()
} else {
this.tui.toast(res.message)
}
}, (reason) => {
})
},
start(e) {
this.addForm.startTime = e.detail.value
},
end(e) {
this.addForm.endTime = e.detail.value
}
}
}
</script>
<style lang="scss" scoped>
.popup-height {
padding: 0 25upx;
background-color: #fff;
}
.uni-date__input {
height: 40px;
width: 100%;
line-height: 40px;
font-size: 14px;
}
.text-center {
text-align: center;
}
.dw-btn{
width: 30%;
line-height: 72rpx;
text-align: center;
background: #088FEB;
color: #fff;
}
.uni-data-select {
width: 100%;
}
</style>

8
pages/staff/staff.vue

@ -71,7 +71,7 @@
onDotClick(type,item) { onDotClick(type,item) {
if(this.type == 0){ if(this.type == 0){
uni.navigateTo({ uni.navigateTo({
url: `/pages/staff/addStaff/addStaff?type=${type}&item=`+ JSON.stringify(item) url: `/package1/staff/addStaff?type=${type}&item=`+ JSON.stringify(item)
}) })
}else{ }else{
this.tui.toast("暂无添加权限") this.tui.toast("暂无添加权限")
@ -85,18 +85,18 @@
}, },
gotoPerformancePage() { gotoPerformancePage() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/staff/performance/performance' url: '/package1/staff/performance'
}) })
}, },
gotoClockPage() { gotoClockPage() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/staff/clock/clock' url: '/package1/staff/clock'
}) })
}, },
goGuide(){ goGuide(){
if(this.type == 0){ if(this.type == 0){
uni.navigateTo({ uni.navigateTo({
url: '/pages/staff/signRule/signRule' url: '/package1/staff/signRule'
}) })
}else{ }else{
this.tui.toast("暂无编辑权限") this.tui.toast("暂无编辑权限")

Loading…
Cancel
Save