Browse Source

开单

master
tianyi@bogon 3 years ago
parent
commit
8a57bdd0dc
  1. 45
      pages/index/addHangOrder.vue
  2. 11
      pages/index/index.vue
  3. 113
      pages/inventory/goodsList1.vue

45
pages/index/addHangOrder.vue

@ -14,7 +14,7 @@
<view class="bj-btn" @tap.stop="inputDialogToggle('edit', item)">编辑</view>
<view class="bj-btn" @tap.stop="toggle('center',item)">语音备注</view>
<view class="bj-btn" @tap.stop="scanCodeAdd(item)">扫码选货</view>
<view class="bj-btn" @tap.stop="goSaleGoods()">开单</view>
<view class="bj-btn" @tap.stop="goSaleGoods(item)">开单</view>
</view>
</view>
<view class="name-date">
@ -602,8 +602,36 @@
this.$refs.payDialog.close()
},
//带参数跳转到开单页
goSaleGoods() {
uni.navigateTo({
goSaleGoods(item) {
console.log('哈哈之前',item)
let obj = {
id:'',
lsprice:0,
num:0,
price:0,
productName:'',
producticture:'',
productSn:'',
saleDetailQueryDTO:[],
supplierName:'',
wholesalePrice:0,
remark:item.remark
},
dataList = []
for (let i=0;i<item.saleDetailDTOList.length;i++) {
obj.saleDetailQueryDTO = item.saleDetailDTOList[i].stockLogList1
obj.id = item.saleDetailDTOList[i].productId
obj.lsprice = item.saleDetailDTOList[i].price
obj.num = item.saleDetailDTOList[i].productCount
obj.price = item.saleDetailDTOList[i].discountAmount
obj.productName = item.saleDetailDTOList[i].productName
obj.producticture = item.saleDetailDTOList[i].productPicture
obj.productSn = item.saleDetailDTOList[i].productSn
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
dataList.push(obj)
}
uni.setStorageSync('carList1',dataList)
uni.switchTab({
url: '/pages/inventory/goodsList1'
})
}
@ -638,7 +666,8 @@
font-size: 37rpx;
border-bottom: 0.5px solid #eee;
margin: 0 auto;
position: relative;
position: relative;
background: #ECF5FF;
}
.name {
@ -655,8 +684,8 @@
.shop-list {
margin: 10rpx 0;
border-top: 1px solid #fff;
border-bottom: 1px solid #fff;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
position: relative;
}
@ -673,7 +702,7 @@
width: auto;
/* height: 60rpx; */
font-size: 26rpx;
background: #fff;
background: #ECF5FF;
margin: 0;
float: left;
padding-right: 20rpx;
@ -692,7 +721,7 @@
}
.order-collapse-item {
background: #eee;
background: #fff;
height: auto;
margin: 0 auto;
padding: 20rpx;

11
pages/index/index.vue

@ -193,17 +193,6 @@
this.shopName = uni.getStorageSync('shopName')
},
methods: {
// changeMall(e) {
// this.tui.request("/app/mall/get/"+e.value, "GET", null, true, true).then((res) => {
// if (res.code == 200 && res.result != null && res.result != undefined) {
// this.$store.commit('setShopIndex', {
// shopIndex: res.result.id,
// shopName: res.result.shopName,
// region: res.result.region
// })
// }
// }).catch((res) => {})
// },
getSaleInfo() {
this.tui.request("/app/sale/getShopAll", "POST", {
shopId: this.shopIndex

113
pages/inventory/goodsList1.vue

@ -178,18 +178,25 @@
<uni-icons type="right" size="16"
style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view>
</view>
<view class="content-list" v-if="radioType == '4'">
<view class="list-name" style="width:150rpx;">选择车号</view>
<view class="list-val">
<input type="text" placeholder="请选择" disabled
style="border-bottom: 1px solid #fff;text-align: center;"
@tap="goPopleList('fcName')">
<uni-icons type="right" size="16"
style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view>
</view>
<view class="content-list" v-if="radioType !=''">
<view class="tui-flex-shrink">配送方式</view>
<view class="tui-goods-price">
<uni-data-checkbox v-model="radio1" :localdata="sex"
@change="checkBoxChange"></uni-data-checkbox>
</view>
</view>
<view class="content-list" v-if="radioType == '4'">
<view class="list-name" style="width:150rpx;">选择车号</view>
<view class="list-val">
<input type="text" placeholder="请选择" disabled
style="border-bottom: 1px solid #fff;text-align: center;"
@tap="goPopleList('fcName')">
<uni-icons type="right" size="16"
style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view>
</view>
<view class="content-list" v-if="radioType != '2' && radioType !=''">
<view class="content-list" v-if="radioType1 != '1' && radioType !=''">
<view class="list-name" style="width:150rpx;">{{radioType == '1'? '快递员' :'拉包工'}}</view>
<view class="list-val">
<input type="text" placeholder="请选择" disabled
@ -255,6 +262,13 @@
priceCurrent:'',
priceOk:'', //已收金额
value: '',
sex: [{
text: '平台配送',
value: 0
}, {
text: '自送',
value: 1
}],
priceItems:[{
value: '0',
name: '零售价'
@ -281,10 +295,10 @@
value: '1',
name: '快递'
},
{
value: '2',
name: '自送'
},
// {
// value: '2',
// name: '自送'
// },
{
value: '3',
name: '拼包'
@ -312,16 +326,27 @@
totalAmount: 0,
customPrice:0,//选择自定义金额
remark:'',
pbAddress:''
pbAddress:'',
carList1:[],
radioType1:''
}
},
onShow() {
let that = this;
this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
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.khName = JSON.parse(JSON.stringify(this.khName))
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))
if(uni.getStorageSync('carList1')){
this.carList1 = uni.getStorageSync('carList1')
this.remark = this.carList1[0].remark
}else{
this.carList1 = this.carList1
}
this.totalAmount = 0;
this.shouldPay = 0
console.log('哈哈哈',this.carList1)
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < this.carList1.length; i++) {
let obj = {
@ -348,6 +373,7 @@
}
this.carList.set(this.carList1[i].id, obj)
}
uni.removeStorageSync('carList1')
this.carList1 = []
} else { //当前页有数据
for (let i = 0; i < this.carList1.length; i++) {
@ -392,7 +418,6 @@
this.carList1 = []
}
that.shouldPay = 0
this.carList.forEach(function(value, key) {
if(that.priceType == 0){ //零售
value.unitPrice = value.lsprice
@ -423,13 +448,18 @@
return 10
}else if(val < 0){
return 0
}
}
}
},
onLoad() {
this.xsyList();
},
methods: {
methods: {
//页面初始化信息处理
pageMessage(){
},
//销售员列表
xsyList() {
this.tui.request('/app/common/user/findAllUserByShopId', 'get', {
@ -454,7 +484,7 @@
},
//切换销售员
categoryChange(e) {
for (i=0;i<this.categoryList.length;i++) {
for (let i=0;i<this.categoryList.length;i++) {
if(this.categoryList[i].value== e){
this.xsyId = e;
this.createByName = this.categoryList[i].text
@ -494,7 +524,6 @@
},
//点击发货方式按钮
radioChange(e) {
this.khName = ''
this.gysName = ''
this.wlName = ''
this.kdyName = ''
@ -523,6 +552,10 @@
url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType
})
},
//是否平台取货
checkBoxChange(e){
this.radioType1 = e.detail.value
},
//点击加号手动添加商品
goodsAdd() {
uni.navigateTo({
@ -531,32 +564,34 @@
},
//点击底部开单按钮
goSell() {
// console.log(this.khName)
// console.log(this.lbgName)
// console.log(this.wlName)
console.log(this.khName)
console.log(this.lbgName)
console.log(this.wlName)
let obj = {
orderByWorker: this.lbgName.workerId,
transCompany: this.wlName.id,
sale: {
relPrice:this.relPrice, //实收金额
// relPrice:,
alreadyEarn: this.priceOk, //已付金额
realAmount: this.shouldPay, //总金额
realAmount: this.relPrice, //实收金额
noEarn: this.noPay, //欠款
totalAmount: this.totalAmount, //总数量
totalAmount: this.shouldPay, //总金额
area: this.khName.area,
city: this.khName.city,
province: this.khName.province,
payStatus: 1,
receiveAddress: this.khName.address,
transportType: this.radioType, //this.radioType
receiveAddress: this.khName.address,
userId:this.khName.userId,
userName:this.khName.name,
transportType: this.radioType1 == 1?2:this.radioType, //this.radioType
discount: this.discountNum,
createBy: this.xsyId,
createByName:this.createByName,
remark: this.remark,
otherExpense:this.otherExpense, //其他费用
pbAddress:this.pbAddress
},
pbAddress:this.pbAddress,
transCompany: this.wlName.id,
companyName:this.wlName.companyName,
orderByWorker: this.lbgName.workerId,
},
saleDetailList: []
}
let purchaseDetails = [];

Loading…
Cancel
Save