wangfukang 3 years ago
parent
commit
01e70becc6
  1. 386
      pages/billing/addUser.vue
  2. 2
      pages/billing/changeGoods1.vue
  3. 20
      pages/index/addHangOrder.vue
  4. 8
      pages/index/dataStatistics.vue
  5. 14
      pages/index/index.vue
  6. 5
      pages/index/orderDetail.vue
  7. 36
      pages/index/peopleList.vue
  8. 36
      pages/inventory/addinventory.vue
  9. 2
      pages/inventory/changeGoods1.vue
  10. 40
      pages/inventory/goodsList1.vue
  11. 2
      pages/inventory/inventoryDetail.vue
  12. 15
      pages/login/login.vue

386
pages/billing/addUser.vue

@ -31,6 +31,9 @@
</template>
<script>
import {
getArea
} from '@/utils/global.js'
import {
mapState
} from 'vuex';
@ -40,9 +43,9 @@
userInfo: '',
show: false,
delShow: false,
addressObj: {},
type:'',
popleType:'',
addressObj: {},
type: '',
popleType: '',
formData: {
consigneeMobile: '',
consigneeName: '',
@ -64,10 +67,9 @@
rules: {
consigneeName: {
rules: [{
required: true,
errorMessage: '请输入姓名',
}
]
required: true,
errorMessage: '请输入姓名',
}]
},
consigneeMobile: {
rules: [{
@ -101,9 +103,9 @@
// 需要在onReady中设置规则
this.$refs.form.setRules(this.rules)
},
onLoad(option) {
this.popleType = option.popleType
this.type=option.type
onLoad(option) {
this.popleType = option.popleType
this.type = option.type
let data = JSON.parse(option.data)
if (option.type = "edit") {
this.formData.address1 = data.province + data.city + data.area
@ -121,185 +123,211 @@
this.delShow = true;
},
delItemModal() {
this.delShow = false;
if(this.popleType=="khName"){
this.tui.request("/app/customer/delById", "post", {
id: this.formData.id,
}, false, true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "删除成功",
icon: 'none'
})
uni.navigateBack()
} else {
uni.showToast({
title: "删除失败",
icon: 'none'
})
}
})
}else{
this.tui.request("/app/supplier/delByIds", "post", {
ids: this.formData.id,
}, false, true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "删除成功",
icon: 'none'
})
uni.navigateBack()
} else {
uni.showToast({
title: "删除失败",
icon: 'none'
})
}
})
this.delShow = false;
if (this.popleType == "khName") {
this.tui.request("/app/customer/delById", "post", {
id: this.formData.id,
}, false, true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "删除成功",
icon: 'none'
})
uni.navigateBack()
} else {
uni.showToast({
title: "删除失败",
icon: 'none'
})
}
})
} else {
this.tui.request("/app/supplier/delByIds", "post", {
ids: this.formData.id,
}, false, true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "删除成功",
icon: 'none'
})
uni.navigateBack()
} else {
uni.showToast({
title: "删除失败",
icon: 'none'
})
}
})
}
},
nameBlur() {
this.formData.username = this.formData.phone;
},
openPicker() {
this.show = true
authVerification() {
uni.getSetting({
success: (res) => {
if (res.authSetting['scope.userLocation']) {
/* 用户授权成功时走这里 */
this.openPicker()
} else if (res.authSetting['scope.userLocation'] === undefined) {
/* 用户未授权时走这里 */
console.log('没有授权')
this.handleOpenSetting()
} else {
/* 用户拒绝了授权后走这里 */
console.log('拒绝了授权 false')
this.handleOpenSetting()
}
},
})
},
onhideShow() {
this.show = false
handleOpenSetting() {
wx.openSetting({
success: (res) => {
console.log('定位 openSetting', res)
if (res.authSetting["scope.userLocation"]) {
this.openPicker()
}
}
})
},
//选中省市区
onsetCity(e) {
let data = e.detail.target.dataset;
let address = data.province + data.city + data.area;
this.show = false
this.formData.address1 = address;
this.addressObj = {
province: data.province,
city: data.city,
area: data.area,
}
openPicker() {
let that = this;
uni.chooseLocation({
success: function(res) {
if(res.name != ''){
let aaa = getArea(res.address)
that.formData.province = aaa.province
that.formData.city = aaa.city
that.formData.area = aaa.country
that.formData.address = aaa.address + '-' + res.name
that.formData.address1 = aaa.province + aaa.city + aaa.country
}else{
that.tui.toast("微信地址选择器调用失败,请重新选择!")
}
},
fail: function(res) {
console.log(res)
}
});
},
// 触发提交表单
submit() {
submit() {
let that = this;
this.$refs.form.validate().then(res => {
if(this.popleType == 'khName'){
if(that.type=='edit'){
that.tui.request("/app/customer/edit", "post", {
name:this.formData.consigneeName,
phone:this.formData.consigneeMobile,
address:this.formData.address,
province:this.addressObj.province,
city:this.addressObj.city,
area:this.addressObj.area,
id:this.formData.id,
userName:this.formData.consigneeMobile
}, false,true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "添加成功",
icon: 'none'
})
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.popleType = 'khName'
uni.navigateBack({
delta: 1
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
}else{
that.tui.request("/app/customer/save", "post", {
name:this.formData.consigneeName,
phone:this.formData.consigneeMobile,
address:this.formData.address,
province:this.addressObj.province,
city:this.addressObj.city,
area:this.addressObj.area,
userName:this.formData.consigneeMobile
}, false,true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "添加成功",
icon: 'none'
})
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.popleType = 'khName'
uni.navigateBack({
delta: 1
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
}
}else{
if(that.type=='edit'){
this.formData.city = this.addressObj.city
this.formData.area = this.addressObj.area
this.formData.province = this.addressObj.province
that.tui.request("/app/supplier/edit", "post", this.formData, false,
true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "修改成功",
icon: 'none'
})
uni.navigateBack()
} else {
uni.showToast({
title: "修改失败",
icon: 'none'
})
}
})
}else{
that.tui.request("/app/supplier/save", "post", Object.assign(that.addressObj, res), false,
true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "添加成功",
icon: 'none'
})
let pages =
getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.popleType = 'gysName'
uni.navigateBack({
delta: 1
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
}
this.$refs.form.validate().then(res => {
if (this.popleType == 'khName') {
if (that.type == 'edit') {
that.tui.request("/app/customer/edit", "post", {
name: this.formData.consigneeName,
phone: this.formData.consigneeMobile,
address: this.formData.address,
province: this.formData.province,
city: this.formData.city,
area: this.formData.area,
id: this.formData.id,
userName: this.formData.consigneeMobile
}, false, true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "添加成功",
icon: 'none'
})
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.popleType = 'khName'
uni.navigateBack({
delta: 1
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
} else {
that.tui.request("/app/customer/save", "post", {
name: this.formData.consigneeName,
phone: this.formData.consigneeMobile,
address: this.formData.address,
province: this.formData.province,
city: this.formData.city,
area: this.formData.area,
userName: this.formData.consigneeMobile
}, false, true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "添加成功",
icon: 'none'
})
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.popleType = 'khName'
uni.navigateBack({
delta: 1
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
}
} else {
if (that.type == 'edit') {
that.tui.request("/app/supplier/edit", "post", this.formData, false,
true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "修改成功",
icon: 'none'
})
uni.navigateBack()
} else {
uni.showToast({
title: "修改失败",
icon: 'none'
})
}
})
} else {
that.tui.request("/app/supplier/save", "post", this.formData, false,
true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "添加成功",
icon: 'none'
})
let pages =
getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.popleType = 'gysName'
uni.navigateBack({
delta: 1
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
}
}
}).catch(err => {
})
}).catch(err => {})
}
}
}
</script>
<style lang="scss">
.cc_area_view{
z-index: 997 !important;
<style lang="scss">
.cc_area_view {
z-index: 997 !important;
}
.formBox {
margin: 20rpx;
padding: 20rpx;
@ -323,13 +351,13 @@
padding: 0 20rpx;
.tui-btn-mr {
width:130rpx;
height: 60rpx;
background: #088FEB;
color: #fff;
border-radius: 10px;
line-height: 60rpx;
text-align: center;
width: 130rpx;
height: 60rpx;
background: #088FEB;
color: #fff;
border-radius: 10px;
line-height: 60rpx;
text-align: center;
margin-right: 30rpx;
}
}

2
pages/billing/changeGoods1.vue

@ -25,7 +25,7 @@
<view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price">
<view class="price-box" v-if="storageType== 0">
<text>{{item.purchasePrice}}</text>
<text>{{item.inStorageStatus==0?'待入库':item.purchasePrice == null ?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">

20
pages/index/addHangOrder.vue

@ -316,14 +316,20 @@
scanCodeAdd(item) {
uni.scanCode({
success: (res) => {
this.productId = res.result
this.hangId = item.id
if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
this.carList.push(item.saleDetailDTOList[i])
}
this.hangId = item.id
let shopId = res.result.split(',')[1]
if(shopId == uni.getStorageSync('shopId')){
this.productId = res.result.split(',')[0]
this.toggle('bottom', res.result.split(',')[0]);
if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
this.carList.push(item.saleDetailDTOList[i])
}
}
this.toggle('bottom', res.result);
}else{
this.tui.toast('您的店铺中暂无该商品!')
}
this.toggle('bottom', res.result);
},
fail: (res) => {

8
pages/index/dataStatistics.vue

@ -1,6 +1,6 @@
<template>
<view>
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" type="daterange" />
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" type="daterange" @change="searchList" />
<view class="IndexContent">
<view class="contentPadding">
<u-grid :col="2">
@ -107,7 +107,11 @@
let end = year + '-' + month + '-' + da //当天
let beg = year + '-' + month + '-01' //当月第一天
this.range = [beg,end]
}
},
searchList() {
this.priceList = [];
this.getList()
},
}
}
</script>

14
pages/index/index.vue

@ -221,12 +221,13 @@
this.getSaleInfo()
},
onLoad() {
if(uni.getStorageSync('publicize')){
//宣传页
// if(uni.getStorageSync('publicize')){
}else{
uni.setStorageSync("publicize", true)
this.$refs.publicizepopup.open('center')
}
// }else{
// uni.setStorageSync("publicize", true)
// this.$refs.publicizepopup.open('center')
// }
},
onTabItemTap(e){
@ -298,7 +299,8 @@
that.tui.request("/oauth2/logout", "POST", {}, false, false).then((res) => {
if (res.code == 200) {
that.tui.toast("退出登录成功")
uni.clearStorage();
// uni.clearStorage();
uni.removeStorage({key: 'hiver_token'});
uni.navigateTo({
url: '/pages/login/login'
})

5
pages/index/orderDetail.vue

@ -247,7 +247,7 @@
</uni-popup>
<!-- 退货确认输入框 -->
<uni-popup ref="returnDialog" type="dialog">
<uni-popup-dialog ref="returnClose" v-model="returnAmount" mode="input" title="请再次确认退货金额"
<uni-popup-dialog ref="returnClose" mode="input" title="请再次确认退货金额"
placeholder="请输入退货金额" @confirm="sureReturn"></uni-popup-dialog>
</uni-popup>
</view>
@ -650,7 +650,8 @@
// }
if (this.isReturn) {
this.returnAmount = this.sAmout
// this.returnAmount = this.sAmout
this.$refs.returnClose.val = this.returnAmount
this.$refs.returnDialog.open()
// this.sureReturn()
} else {

36
pages/index/peopleList.vue

@ -8,7 +8,7 @@
<view class="" v-if="popleType== 'khName' || popleType== 'gysName'" @tap="">
<!-- 供应商、客户走这一套 -->
<view>
<button size="default" type="default" @tap="goAddPeople" hover-class="is-hover">新增人员</button>
<button size="default" type="default" @tap="goAddPeople" hover-class="is-hover">{{popleType=='khName'?'新增客户':'新增供应商'}}</button>
</view>
<view class="list-1" v-for="item in popleList" :key="item" @tap="clickList(item)"
style="display: flex;flex-direction: column;height: auto;padding-bottom: 20rpx;">
@ -22,7 +22,7 @@
</view>
<view class="name-tel" style="width: 100%;display: flex;flex-direction: column;height:auto;font-size: 30rpx;">
<text>{{item.name == '散客'?'-':item.province + item.city + item.area}}</text>
<text style="font-size: 26rpx;color:#747474;height: 30rpx;line-height: 30rpx;">{{item.name == '散客'?'-':item.address}}</text>
<text style="font-size: 26rpx;color:#747474;height: auto;line-height: 30rpx;">{{item.name == '散客'?'-':item.address}}</text>
</view>
<view v-if="item.name != '散客'" class="name-edit" @tap.stop="goAddPeople('edit',item)" style="top: 25rpx;">
编辑
@ -138,6 +138,15 @@
this.companyType = options.companyType || ''
if(options.khName){
this.khName = JSON.parse(options.khName) || ''
}
if(options.popleType == 'khName'){
uni.setNavigationBarTitle({
title: '客户列表'
});
}else if(options.popleType == 'gysName'){
uni.setNavigationBarTitle({
title: '供应商列表'
});
}
if (options.popleType == 'khName' || options.popleType == 'gysName') { //供应商或者客户
this.khOrGysList();
@ -317,20 +326,23 @@
}
.list-1 {
display: flex;
height: 150rpx;
border-bottom: 1px solid #eee;
background: #fff;
font-size: 32rpx;
margin-top: 20rpx;
display: flex;
height: 150rpx;
border-bottom: 1px solid #eee;
background: #fff;
font-size: 32rpx;
margin: 20rpx auto 0;
width: 95%;
padding-left: 10rpx;
position: relative;
}
.name-tel {
width: 70%;
height: 75rpx;
line-height: 75rpx;
padding-left: 40rpx;
width: 75%;
display: flex;
flex-direction: column;
height: auto;
font-size: 15px;
}
.name-edit{
width: 120rpx;

36
pages/inventory/addinventory.vue

@ -283,20 +283,30 @@
onLoad() {
this.storageType = uni.getStorageSync('type')
},
methods: {
scanCodeAdd() {
uni.scanCode({
methods: {
//扫一扫功能
scanCodeAdd() {
uni.scanCode({
// scanType: ['barCode'],
onlyFromCamera: true,
success: (res) => {
this.productId = res.result
this.toggle('bottom', res.result);
},
fail: (res) => {
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
// this.productId = res.result
// this.toggle('bottom', res.result);
let shopId = res.result.split(',')[1]
if(shopId == uni.getStorageSync('shopId')){
this.productId = res.result.split(',')[0]
this.toggle('bottom', res.result.split(',')[0]);
}else{
this.tui.toast('您的店铺中暂无该商品!')
}
},
fail: (res) => {
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
},
goodsAdd() {
uni.navigateTo({

2
pages/inventory/changeGoods1.vue

@ -27,7 +27,7 @@
<view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price">
<view class="price-box" v-if="storageType == 0">
<text>{{item.purchasePrice == null ?'待入库':item.purchasePrice}}</text>
<text>{{item.inStorageStatus==0?'待入库':item.purchasePrice == null ?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">

40
pages/inventory/goodsList1.vue

@ -199,7 +199,7 @@
<view class="content-list" v-if="radioType == '4'">
<view class="list-name" style="width:150rpx;padding-left:0;">选择车号</view>
<view class="list-val">
<input type="text" placeholder="请选择" disabled :value="wlName.shippingMethod"
<input type="text" placeholder="请选择" disabled :value="wlName.companyName"
style="border-bottom: 1px solid #fff;text-align: center;"
@tap.stop="goPopleList('fcName')">
<uni-icons type="right" size="16"
@ -209,7 +209,7 @@
<view class="content-list" v-if="radioType == '5'">
<view class="list-name" style="width:150rpx;padding-left:0;">选择车号</view>
<view class="list-val">
<input type="text" placeholder="请选择" disabled :value="wlName.shippingMethod"
<input type="text" placeholder="请选择" disabled :value="wlName.companyName"
style="border-bottom: 1px solid #fff;text-align: center;"
@tap.stop="goPopleList('dbName')">
<uni-icons type="right" size="16"
@ -453,7 +453,8 @@
priceType:'',
multiple:1,
productId:'',
productNum:0,
productNum:0,
afterPrice:0 //第二次选择商品的时候,先计算这个价格,实收金额= 已经存在的实收金额 + afterPrice
}
},
components: {
@ -465,7 +466,8 @@
this.gysName = JSON.parse(JSON.stringify(this.gysName))
this.wlName = JSON.parse(JSON.stringify(this.wlName))
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)
if (uni.getStorageSync('carList1') != '') {
this.carList.clear()
this.carList1 = JSON.parse(uni.getStorageSync('carList1'))
@ -487,6 +489,15 @@
this.saleId = ''
}
for (let i = 0; i < this.carList1.length; i++) {
// if(that.priceType == 0){ //零售
// this.afterPrice += this.carList1[i].lsprice
// }else if(that.priceType == 1){ //批发
// this.afterPrice += this.carList1[i].wholesalePrice
// }
// if (that.discountType == 1) { //整体折扣
// this.afterPrice = this.afterPrice * 10000 * that.discountNum / 10 / 10000
// }
if(this.carList1[i].saleDetailQueryDTO){
if (this.carList.size == 0) { //当前页没有数据
@ -715,10 +726,19 @@
//扫一扫功能
scanCodeAdd() {
uni.setStorageSync('saoma','1')
uni.scanCode({
uni.scanCode({
// scanType: ['barCode'],
onlyFromCamera: true,
success: (res) => {
this.productId = res.result
this.toggle('bottom', res.result);
// this.productId = res.result
// this.toggle('bottom', res.result);
let shopId = res.result.split(',')[1]
if(shopId == uni.getStorageSync('shopId')){
this.productId = res.result.split(',')[0]
this.toggle('bottom', res.result.split(',')[0]);
}else{
this.tui.toast('您的店铺中暂无该商品!')
}
},
fail: (res) => {
uni.showToast({
@ -1339,11 +1359,9 @@
that.shouldPay = that.shouldPay + value.price
that.totalAmount = that.totalAmount + value.productCount
})
if(this.relPrice == ''){
this.relPrice = this.shouldPay
}
this.relPrice = this.shouldPay
that.noPay = this.relPrice - this.priceOk
that.noPay = this.relPrice - (this.priceOk==''? 0 : this.priceOk)
},
//修改已选规格的数量
GoodsNumChange(e, index, index1) {

2
pages/inventory/inventoryDetail.vue

@ -139,7 +139,7 @@
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '供应商:'+this.dataList.supplierName)
strCmd += blesdk.addCPCLText('0', '180', '24', '0', 0, '批发价:'+this.dataList.wholesalePrice)
strCmd += blesdk.addCPCLText('0', '230', '24', '0', 0, '零售价:'+this.dataList.price)
strCmd += blesdk.addCPCLQRCode(260, 170, 'H', '1', 6, this.dataList.id) //二维码
strCmd += blesdk.addCPCLQRCode(200, 140, 'H', '1', 6, [this.dataList.id,uni.getStorageSync('shopId')]) //二维码
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd;

15
pages/login/login.vue

@ -109,8 +109,8 @@
computed: mapState(['type']),
onLoad() {
this.getCaptchaImg();
// this.username = uni.getStorageSync('username')
// this.password = uni.getStorageSync('password')
this.username = uni.getStorageSync('username')
this.password = uni.getStorageSync('password')
},
methods: {
...mapMutations(['login']),
@ -188,6 +188,8 @@
uni.setStorageSync("wayValue", this.wayValue)
uni.setStorageSync("nickname", res.result.user.nickname)
uni.setStorageSync("id", res.result.user.id)
uni.setStorageSync('username',this.username)
uni.setStorageSync('password',this.password)
if(this.wayValue == 2){ //下游客户登录
setTimeout(() => {
uni.reLaunch({
@ -199,14 +201,7 @@
this.shopList = res.result.shopList;
this.toggle("center");
}else{
uni.setStorageSync('type',res.result.shopList[0].type)
this.checkShop(res.result.shopList[0])
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
}
} else {
this.tui.toast(res.message)
@ -225,8 +220,6 @@
deviceId:res1.deviceId
}, false, true).then((res) => {
if (res.code == 200) {
// uni.setStorageSync('username',this.username)
// uni.setStorageSync('password',this.password)
uni.setStorageSync('type',item.type)
uni.setStorageSync('shopId',item.shopId)
uni.setStorageSync('shopName',item.shopName)

Loading…
Cancel
Save