You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
595 lines
15 KiB
595 lines
15 KiB
<!-- 销售商品 -->
|
|
<template>
|
|
<view class="page1">
|
|
<view class="content">
|
|
<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;" :value="khName.name"
|
|
@tap="goPopleList('khName')">
|
|
<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="value"
|
|
placeholder="请选择销售员" @change="categoryChange"></uni-data-select>
|
|
</view>
|
|
</view>
|
|
<view class="content-box">
|
|
<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="content-list">
|
|
<view class="list-name">折扣类型</view>
|
|
<view class="list-val">
|
|
<radio-group @change="radioChange" style="display: flex;">
|
|
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in items"
|
|
:key="item.value">
|
|
<view>
|
|
<radio :value="item.value" :checked="index === current" />
|
|
</view>
|
|
<view>{{item.name}}</view>
|
|
</label>
|
|
</radio-group>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="shop-box" style="border-top:5px solid #eee;" v-for="item in carList" :key="item">
|
|
<view class="shop-name">
|
|
<img :src="item.productPicture" alt=""
|
|
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;">
|
|
<view class="shop-productName">
|
|
<view style="color:#FF5809;">品名:{{item.productName}}</view>
|
|
<view>货号:{{item.barcode}}</view>
|
|
<view>供应商:{{item.supplierName}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="shop-type">
|
|
<view class="shop-collapse" @tap="clickCollapse">
|
|
<text>{{item.saleDetailQueryDTO.attributeList}}</text>
|
|
<text style="color: red;">¥{{item.price * item.num}}</text>
|
|
<text>{{item.num}}</text>
|
|
<uni-icons type="bottom" size="16"
|
|
style="margin-left: 112rpx;line-height: 80rpx;"></uni-icons>
|
|
</view>
|
|
<view class="shop-collapse-item" v-if="isCollapse">
|
|
<view class="collapse-1">
|
|
<text>单价</text>
|
|
<input class="input" type="text" :value='item.price'>
|
|
</view>
|
|
<view class="collapse-1">
|
|
<text>折扣(100%)</text>
|
|
<input class="input" type="text" value='0'>
|
|
</view>
|
|
<view class="collapse-1">
|
|
<text>折后价</text>
|
|
<input class="input" type="text" value='0'>
|
|
</view>
|
|
<view class="collapse-1">
|
|
<text>数量</text>
|
|
<input class="input" type="text" value='0'>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="content-box">
|
|
<!-- <view class="price-box-title">
|
|
<text>商品数量:5 </text>
|
|
<text style="text-align: left;padding-left: 40rpx;color: red;">金额:500.00</text>
|
|
</view> -->
|
|
<view class="price-box-list">
|
|
<view class="content-list">
|
|
<view class="list-name">总金额</view>
|
|
<view class="list-val">
|
|
<input type="text" :value="price">
|
|
</view>
|
|
</view>
|
|
<view class="content-list">
|
|
<view class="list-name">实收金额</view>
|
|
<view class="list-val">
|
|
<input type="text" :value="relPrice">
|
|
</view>
|
|
</view>
|
|
<view class="content-list">
|
|
<view class="list-name">已收金额</view>
|
|
<view class="list-val">
|
|
<input type="text" :value="priceOk">
|
|
</view>
|
|
</view>
|
|
<view class="content-list">
|
|
<view class="list-name">欠款</view>
|
|
<view class="list-val">
|
|
<input type="text" :value="priceNo">
|
|
</view>
|
|
</view>
|
|
<view class="content-list">
|
|
<view class="list-name">其他费用</view>
|
|
<view class="list-val">
|
|
<input type="text" :value="otherExpense">
|
|
</view>
|
|
</view>
|
|
<view class="content-list">
|
|
<view class="list-name">备注</view>
|
|
<view class="">
|
|
<textarea />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="content-box" style="margin-bottom: 130rpx;">
|
|
<view class="shop-box">
|
|
<view class="" style="border-bottom: 1px solid #eee;">
|
|
<view class="list-name" style="width: 100%;">发货方式</view>
|
|
<view class="list-val" style="display: flex;width: 100%;">
|
|
<radio-group @change="radioChange" style="display: flex;">
|
|
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in logisticsType"
|
|
:key="item.value">
|
|
<view>
|
|
<radio :value="item.value" :checked="index === current" />
|
|
</view>
|
|
<view>{{item.name}}</view>
|
|
</label>
|
|
</radio-group>
|
|
</view>
|
|
</view>
|
|
<view class="">
|
|
<view class="content-list" v-if="radioType == '0' || radioType == '1'">
|
|
<view class="list-name" style="width:150rpx;">{{radioType == '0'? '选择快递' :'选择物流'}}</view>
|
|
<view class="list-val">
|
|
<input type="text" placeholder="请选择" disabled :value="wlName.companyName"
|
|
style="border-bottom: 1px solid #fff;text-align: center;"
|
|
@tap="goPopleList(radioType == '0'? 'kdName' :'wlName')">
|
|
<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'">
|
|
<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 != '4' && radioType !=''">
|
|
<view class="list-name" style="width:150rpx;">{{radioType == '0'? '快递员' :'拉包工'}}</view>
|
|
<view class="list-val">
|
|
<input type="text" placeholder="请选择" disabled
|
|
:value="radioType == '0'? kdyName.workerName : lbgName.workerName"
|
|
style="border-bottom: 1px solid #fff;text-align: center;"
|
|
@tap="goPopleList(radioType == '0'? 'kdyName' :'lbgName')">
|
|
<uni-icons type="right" size="16"
|
|
style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
|
|
</view>
|
|
</view>
|
|
<view class="content-list" v-if="radioType == '3'">
|
|
<view class="list-name">拼包地址</view>
|
|
<view class="">
|
|
<textarea />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="bottom-box">
|
|
<view class="bottom-left">
|
|
<text>合计:2</text>
|
|
<text style="color: #ffa200;">¥20.00</text>
|
|
</view>
|
|
<view class="bottom-right">
|
|
<button class="bottom-btn" @tap="goSell">开单</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
components: {},
|
|
data() {
|
|
return {
|
|
price: '0', //总金额
|
|
relPrice: '0', //已付金额
|
|
otherExpense: '0', // 其他费用
|
|
priceNo: '0', //未付金额
|
|
value: '',
|
|
isCollapse: false,
|
|
items: [{
|
|
value: '0',
|
|
name: '单品折扣'
|
|
},
|
|
{
|
|
value: '1',
|
|
name: '整体折扣'
|
|
}
|
|
],
|
|
logisticsType: [{
|
|
value: '0',
|
|
name: '快递'
|
|
},
|
|
{
|
|
value: '1',
|
|
name: '物流'
|
|
},
|
|
{
|
|
value: '2',
|
|
name: '发车'
|
|
},
|
|
{
|
|
value: '3',
|
|
name: '拼包'
|
|
},
|
|
{
|
|
value: '4',
|
|
name: '自送'
|
|
},
|
|
],
|
|
discCurrent: '', //折扣
|
|
logisticsCurrent: '', //物流
|
|
categoryList: '', //销售员
|
|
radioType: '', //发货方式按钮选择
|
|
khName: [], //客户
|
|
gysName: [], //供应商
|
|
wlName: [], //物流公司/物流/发车
|
|
kdyName: [], //快递员
|
|
lbgName: [], //拉包工姓名
|
|
carList: [], //添加商品页传回来的商品信息
|
|
xsyId: ''
|
|
}
|
|
},
|
|
onShow() {
|
|
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.carList = this.carList || ''
|
|
console.log(this.carList)
|
|
|
|
// for (var i= 0;i<) {
|
|
|
|
// }
|
|
},
|
|
onLoad() {
|
|
this.xsyList();
|
|
},
|
|
methods: {
|
|
//销售员列表
|
|
xsyList() {
|
|
this.tui.request('/app/common/user/findAllUserByShopId', 'get', {
|
|
|
|
}, false, false, true).then((res) => {
|
|
if (res.code !== 200) return
|
|
this.categoryList = res.result.map(item => {
|
|
return {
|
|
value: item.id,
|
|
text: item.nickname
|
|
}
|
|
})
|
|
})
|
|
},
|
|
//切换销售员
|
|
categoryChange(e) {
|
|
for (i=0;i<this.categoryList.length;i++) {
|
|
if(this.categoryList[i].value== e){
|
|
this.xsyId = e;
|
|
this.createByName = this.categoryList[i].text
|
|
}
|
|
}
|
|
},
|
|
//点击切换折叠状态
|
|
clickCollapse() {
|
|
this.isCollapse = !this.isCollapse
|
|
},
|
|
radioChange(e) {
|
|
this.khName = ''
|
|
this.gysName = ''
|
|
this.wlName = ''
|
|
this.kdyName = ''
|
|
this.lbgName = ''
|
|
//快递0 物流1 发车2 拼包3 自送4
|
|
this.radioType = e.detail.value;
|
|
for (let i = 0; i < this.items.length; i++) {
|
|
if (this.items[i].value === e.detail.value) {
|
|
this.current = i;
|
|
break;
|
|
}
|
|
}
|
|
},
|
|
goPopleList(popleType) {
|
|
if (popleType == 'kdyName' && this.wlName == '') {
|
|
uni.showToast({
|
|
title: "先选择快递公司",
|
|
icon: 'error'
|
|
})
|
|
return
|
|
}
|
|
let companyType = this.radioType == 0 ? this.wlName.id : ''
|
|
console.log(companyType)
|
|
uni.navigateTo({
|
|
url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType
|
|
})
|
|
},
|
|
goodsAdd() {
|
|
uni.navigateTo({
|
|
url: '/pages/billing/changeGoods1'
|
|
})
|
|
},
|
|
goSell() {
|
|
// console.log(this.khName)
|
|
// console.log(this.lbgName)
|
|
// console.log(this.wlName)
|
|
let obj = {
|
|
orderByWorker: this.lbgName.workerId,
|
|
sale: {
|
|
alreadyEarn: 100,
|
|
realAmount: 100,
|
|
noEarn: 0,
|
|
area: "丰台区",
|
|
city: "北京",
|
|
province: "北京",
|
|
payStatus: 1,
|
|
shopId: '002',
|
|
receiveAddress: "测试地址1",
|
|
totalAmount: 100, //应付金额
|
|
transportType: 0, //this.radioType
|
|
discount: 10,
|
|
createBy: this.xsyId,
|
|
createByName:this.createByName,
|
|
userId: "1704126992443641856",
|
|
remark: '123'
|
|
},
|
|
saleDetailList: [{
|
|
discount: 10,
|
|
discountAmount: 1111,
|
|
productCount: 1,
|
|
productId: "1695314088038633472",
|
|
realPrice: 1111,
|
|
saleDetailQueryDTO: [{
|
|
attributeList: '{"颜色":"s","尺码":"m"}',
|
|
productCount: 2
|
|
}]
|
|
}],
|
|
transCompany: this.wlName.id,
|
|
}
|
|
this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => {
|
|
if (res.code == 200) {
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
})
|
|
setTimeout(res => {
|
|
uni.navigateTo({
|
|
url: "/pages/index/order"
|
|
})
|
|
}, 500)
|
|
|
|
}else{
|
|
this.tui.toast(res.message)
|
|
}
|
|
})
|
|
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
page,
|
|
.page1 {
|
|
height: 100%;
|
|
}
|
|
|
|
.content {
|
|
border-top: 1px solid #eee;
|
|
overflow-y: scroll;
|
|
max-height: 100vh;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.shop-productName {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding-left: 20rpx;
|
|
}
|
|
|
|
.shop-productName view {
|
|
height: 55rpx;
|
|
}
|
|
|
|
// .shop-name {
|
|
// .uni-icons {
|
|
// color: #088FEB !important;
|
|
// }
|
|
// }
|
|
|
|
.shop-collapse {
|
|
border-radius: 1px solid #eee;
|
|
}
|
|
|
|
.shop-collapse text {
|
|
text-align: right;
|
|
padding-right: 40rpx;
|
|
border-right: 1px solid #eee;
|
|
}
|
|
|
|
.shop-collapse-item {
|
|
display: flex;
|
|
text-align: center;
|
|
background: #eee;
|
|
height: 110rpx;
|
|
|
|
.input {
|
|
border: 1px solid #eee;
|
|
background: #fff;
|
|
height: 60rpx;
|
|
}
|
|
}
|
|
|
|
.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;
|
|
}
|
|
</style>
|