wangfukang 3 years ago
parent
commit
edabf49987
  1. 17
      pages/index/addStock.vue
  2. 79
      pages/index/orderDetail.vue
  3. 265
      pages/index/shopInfo.vue
  4. 9
      pages/inventory/goodsList1.vue

17
pages/index/addStock.vue

@ -217,11 +217,18 @@
}).catch((res) => {}) }).catch((res) => {})
}, },
//点击底部选好了,返回上一页 //点击底部选好了,返回上一页
backPrevPage() { backPrevPage() {
let pages = getCurrentPages(); var data = []
let prevPage = pages[pages.length - 2]; this.carList.forEach(item => {
prevPage.$vm.carList1 = this.carList console.log(item)
prevPage.$vm.clearMsg = '1' data.push(item)
item.stockLogList1 = []
item.stockLogList.forEach(item1 => {
item.stockLogList1.push(item1)
})
})
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })

79
pages/index/orderDetail.vue

@ -234,7 +234,10 @@
</u-popup> </u-popup>
<view class="tui-tabbar"> <view class="tui-tabbar">
<view class="tui-btn-mr" v-if="sales.status != 6 && sales.status != 2"> <view class="tui-btn-mr" v-if="sales.status != 6 && sales.status != 2">
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint"></kk-printer> <kk-printer ref="kkprinter" :bufferData="bufferData" :defaultText="'贴包单'" @onPrint="onPrint"></kk-printer>
</view>
<view class="tui-btn-mr" v-if="sales.status != 6 && sales.status != 2">
<kk-printer ref="kkprinter" :bufferData="bufferData" :defaultText="'打印小票'" @onPrint="onPrintSmall"></kk-printer>
</view> </view>
<view class="tui-btn-mr" v-if="sales.status == 0 || sales.status == 1" @click="cancelOrder">取消订单</view> <view class="tui-btn-mr" v-if="sales.status == 0 || sales.status == 1" @click="cancelOrder">取消订单</view>
<view class="tui-btn-mr" v-if="sales.status == 4" @click="returnGoods">{{ !isReturn ? '退货' : '确认退货'}}</view> <view class="tui-btn-mr" v-if="sales.status == 4" @click="returnGoods">{{ !isReturn ? '退货' : '确认退货'}}</view>
@ -263,7 +266,8 @@
} from '@/utils/global.js' } from '@/utils/global.js'
export default { export default {
data() { data() {
return { return {
defaultText:'贴包单',
radio1: 0, radio1: 0,
sex: [{ sex: [{
text: '是', text: '是',
@ -401,7 +405,76 @@
}, false, true).then(res => { }, false, true).then(res => {
this.collection = res.result this.collection = res.result
}).catch(res => {}); }).catch(res => {});
}, },
//打印小票
onPrintSmall(){
// this.sales = res.result.sale
// this.list = res.result.saleDetailDTOList
// this.order = res.result.customer
// this.orderXd = res.result.orderXd
// this.shopData = res.result.shop
let that = this;
that.yNum = 150
let heightNum = 300
heightNum += this.carList.length * 40
for(var i=0;i<this.list.length;i++){
heightNum += this.list[i].stockLogList.length * 30
}
let strCmd = blesdk.CreatCPCLPage(600, heightNum, 1, 0);
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(2);
strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, uni.getStorageSync('shopName'))
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:' + this.order.name)
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:' + this.sales.createByName)
strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:' + this.sales.createTime) //+
strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0,
'=========================================================')
this.carList.forEach(function(value, key) {
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, value.productName + '(' +
value.productSn + ')')
value.stockLogList.forEach(function(value1, key1) {
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, (that.slicePrint(
key1)) + '*' + value1)
strCmd += blesdk.addCPCLText('280', that.yNum, '24', '0', 0, '单价:' + value.discountAmount)
strCmd += blesdk.addCPCLText('440', that.yNum, '24', '0', 0, '总价:' + (value
.discountAmount * value1))
})
})
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,
'===============================================================')
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '总数量:' + this.totalAmount)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额' + this.shouldPay)
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice)
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('400', this.yNum, '24', '0', 0, '其他费用:' + (this.otherExpense == '' ? 0 : this.otherExpense))
if(this.remark.length >20){
let position = 20;
let part1 = this.remark.substring(0, position);
let part2 = this.remark.substring(position);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1)
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2)
}else{
strCmd += blesdk.addCPCLText('0', 3000, '24', '0', 0, '备注:' + this.remark)
}
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd;
this.$nextTick(()=>{
uni.redirectTo({
url: "/pages/index/order"
})
})
},
//打印贴包单
onPrint(opt) { onPrint(opt) {
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 1); let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 1);
strCmd += blesdk.addCPCLSETMAG(2, 2) strCmd += blesdk.addCPCLSETMAG(2, 2)

265
pages/index/shopInfo.vue

@ -1,136 +1,151 @@
<template> <template>
<view> <view>
<view class="formBox"> <view class="formBox">
<uni-forms :modelValue="addForm" ref="addForm" validateTrigger="bind" :rules="rules" label-width="160rpx" label-align="right"> <uni-forms :modelValue="addForm" ref="addForm" validateTrigger="bind" :rules="rules" label-width="160rpx"
<uni-forms-item label="手机号" required name="mobile"> label-align="right">
<uni-easyinput type="text" v-model="addForm.mobile" placeholder="请输入登录手机号" /> <uni-forms-item label="手机号" required name="mobile">
</uni-forms-item> <uni-easyinput type="text" v-model="addForm.mobile" placeholder="请输入登录手机号" />
<uni-forms-item label="原密码" required name="password"> </uni-forms-item>
<uni-easyinput type="password" v-model="addForm.password" placeholder="请输入原登录密码" /> <uni-forms-item label="原密码" required name="password">
</uni-forms-item> <uni-easyinput type="password" v-model="addForm.password" placeholder="请输入原登录密码" />
<uni-forms-item label="新密码" required name="password"> </uni-forms-item>
<uni-easyinput type="password" v-model="addForm.newPass" placeholder="请输入新登录密码" /> <uni-forms-item label="新密码" required name="password">
</uni-forms-item> <uni-easyinput type="password" v-model="addForm.newPass" placeholder="请输入新登录密码" />
<uni-forms-item label="密码确认" required name="confirm"> </uni-forms-item>
<uni-easyinput type="password" v-model="addForm.confirm" placeholder="请输入新登录密码" /> <uni-forms-item label="密码确认" required name="confirm">
</uni-forms-item> <uni-easyinput type="password" v-model="addForm.confirm" placeholder="请输入新登录密码" />
</uni-forms> </uni-forms-item>
<view class="tui-tabbar"> </uni-forms>
<u-button type="primary" shape="circle" @tap.stop="onFormSubmit">确定</u-button> <view class="tui-tabbar">
</view> <u-button type="primary" shape="circle" @tap.stop="onFormSubmit">确定</u-button>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
import { import {
mapState mapState
} from 'vuex'; } from 'vuex';
export default { export default {
name:"shopInfo", name: "shopInfo",
computed: mapState([ 'userId','mobile' ]), computed: mapState(['userId', 'mobile']),
data() { data() {
return { return {
addForm: { addForm: {
mobile: '', mobile: '',
password: '', password: '',
confirm:'', confirm: '',
newPass:'' newPass: ''
}, },
userId:'', userId: '',
shopList:[], shopList: [],
rules:{ rules: {
mobile:{ mobile: {
rules:[{required:true,errorMessage:'手机号不能为空'}] rules: [{
}, required: true,
password:{ errorMessage: '手机号不能为空'
rules:[{required:true,errorMessage:'密码不能为空'}] }]
}, },
confirm:{ password: {
rules:[{required:true,errorMessage:'确认密码不能为空'}] rules: [{
}, required: true,
} errorMessage: '密码不能为空'
} }]
}, },
onLoad(options) { confirm: {
this.userId = uni.getStorageSync('id') rules: [{
this.addForm.mobile = this.mobile required: true,
}, errorMessage: '确认密码不能为空'
methods:{ }]
onFormSubmit() { },
if (this.addForm.confirm !== this.addForm.newPass)return this.tui.toast('两次密码不一致', 2000,) }
this.$refs.addForm.validate().then(async () => { }
this.tui.request("/user/modifyPassAndMobile", "post", { },
mobile: this.addForm.mobile, onLoad(options) {
password:this.addForm.password, this.userId = uni.getStorageSync('id')
newPass:this.addForm.newPass, this.addForm.mobile = this.mobile
userId:this.userId },
}, false, true).then((res) => { methods: {
if (res.code == 200) { onFormSubmit() {
this.tui.toast("修改手机号密码成功!") if(this.addForm.mobile == '' &&this.addForm.newPass == ''){
setTimeout(() => { this.tui.toast("不能为空")
uni.reLaunch({ return;
url: '/pages/index/index' }
}) if (this.addForm.confirm !== this.addForm.newPass) return this.tui.toast('两次密码不一致', 2000, )
}, 200) // this.$refs.addForm.validate().then(async () => {
}else { this.tui.request("/user/modifyPassAndMobile", "post", {
this.tui.toast(res.message) mobile: this.addForm.mobile,
} password: this.addForm.password,
}) newPass: this.addForm.newPass,
}) userId: this.userId
} }, false, true).then((res) => {
} if (res.code == 200) {
} this.tui.toast("修改成功!")
setTimeout(() => {
uni.reLaunch({
url: '/pages/login/login'
})
}, 200)
} else {
this.tui.toast(res.message)
}
})
// })
}
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.popup-height { .popup-height {
padding: 0 25upx; padding: 0 25upx;
background-color: #fff; background-color: #fff;
} }
.formBox {
margin: 20rpx;
padding: 20rpx 26rpx;
border-radius: 14rpx;
box-shadow: 0px 1px 10px 2px #e2e2e2;
background-color: #fff;
.uni-data-select { .formBox {
width: 100%; margin: 20rpx;
} padding: 20rpx 26rpx;
border-radius: 14rpx;
box-shadow: 0px 1px 10px 2px #e2e2e2;
background-color: #fff;
.tui-order-title { .uni-data-select {
position: relative; width: 100%;
font-size: 28upx; }
line-height: 28upx;
padding-left: 16upx;
box-sizing: border-box;
}
.tui-order-title::before { .tui-order-title {
content: ''; position: relative;
position: absolute; font-size: 28upx;
left: 0; line-height: 28upx;
top: 0; padding-left: 16upx;
border-left: 8upx solid $u-primary; box-sizing: border-box;
height: 120%; }
border-radius: 4upx;
}
}
.tui-tabbar { .tui-order-title::before {
width: 100%; content: '';
height: 98rpx; position: absolute;
background: #fff; left: 0;
position: fixed; top: 0;
left: 0; border-left: 8upx solid $u-primary;
bottom: 0; height: 120%;
display: flex; border-radius: 4upx;
align-items: center; }
justify-content: flex-end; }
font-size: 26rpx;
box-shadow: 0 0 1px rgba(0, 0, 0, .3); .tui-tabbar {
padding-bottom: env(safe-area-inset-bottom); width: 100%;
z-index: 996; height: 98rpx;
} background: #fff;
</style> position: fixed;
left: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 26rpx;
box-shadow: 0 0 1px rgba(0, 0, 0, .3);
padding-bottom: env(safe-area-inset-bottom);
z-index: 996;
}
</style>

9
pages/inventory/goodsList1.vue

@ -1105,7 +1105,8 @@
}, },
//点击底部开单按钮 //点击底部开单按钮
goSell() { goSell() {
let that = this; let that = this;
console.log(this.carList)
if (this.khName == '') { if (this.khName == '') {
this.tui.toast('请选择客户!') this.tui.toast('请选择客户!')
return return
@ -1230,7 +1231,7 @@
heightNum += value.stockLogList.size * 30 heightNum += value.stockLogList.size * 30
}) })
let strCmd = blesdk.CreatCPCLPage(600, 5000, 1, 0); let strCmd = blesdk.CreatCPCLPage(600, heightNum, 1, 0);
strCmd += blesdk.addCPCLSETMAG(2, 2) strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold') blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(2); strCmd += blesdk.addCPCLLocation(2);
@ -1251,9 +1252,9 @@
value.stockLogList.forEach(function(value1, key1) { value.stockLogList.forEach(function(value1, key1) {
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, (that.slicePrint( strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, (that.slicePrint(
key1)) + '*' + value1) key1)) + '*' + value1)
strCmd += blesdk.addCPCLText('280', that.yNum, '24', '0', 0, '单价:' + value.lsprice) 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
.lsprice * value1)) .discountAmount * value1))
}) })
}) })
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0,

Loading…
Cancel
Save