Browse Source

开单逻辑、打印、刘岩给的新页面

master
tianyi@bogon 3 years ago
parent
commit
e61b93cf3b
  1. 262
      pages/billing/addUser.vue
  2. 12
      pages/billing/changeGoods.vue
  3. 60
      pages/billing/changeGoods1.vue
  4. 64
      pages/index/orderDetail.vue
  5. 64
      pages/inventory/addGoods.vue
  6. 4
      pages/inventory/goodsList.vue
  7. 148
      pages/inventory/goodsList1.vue

262
pages/billing/addUser.vue

@ -1,15 +1,267 @@
<template> <template>
<div> <view>
<view class="formBox">
</div> <uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="85px">
<!-- <uni-forms-item label="店铺名称" name="name">
<uni-easyinput type="text" v-model="shopName" disabled />
</uni-forms-item> -->
<uni-forms-item label="收货人" name="name">
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入收货人" @blur="nameBlur" />
</uni-forms-item>
<uni-forms-item label="手机号码" name="phone">
<uni-easyinput type="number" v-model="formData.phone" placeholder="请输入手机号码" />
</uni-forms-item>
<uni-forms-item label="收货人账号" name="username" v-if="!userInfo">
<uni-easyinput type="text" v-model="formData.username" placeholder="账号名为字母或数字" />
</uni-forms-item>
<uni-forms-item label="性别" name="sex" v-if="!userInfo">
<uni-data-checkbox v-model="formData.sex" :localdata="sexs" />
</uni-forms-item>
<uni-forms-item label="地址" name="address1">
<view class="input selectcity" @tap="openPicker">
<input placeholder="请选择省市区" disabled type="text" v-model="formData.address1"></input>
</view>
</uni-forms-item>
<uni-forms-item label="详细地址" name="address">
<uni-easyinput type="textarea" v-model="formData.address" />
</uni-forms-item>
</uni-forms>
<view class="tui-tabbar">
<view class="tui-btn-mr">
<u-button type="error" :plain="true" shape="circle" @tap.stop="del()">删除用户</u-button>
</view>
<view class="tui-btn-mr">
<u-button type="primary" :plain="true" shape="circle" @tap.stop="submit()">提交</u-button>
</view>
</view>
<!-- 省市区选择 show:是否显示 @sureSelectArea:确认事件 @hideShow:隐藏事件-->
<cc-selectDity :show="show" @sureSelectArea="onsetCity" @hideShow="onhideShow"></cc-selectDity>
</view>
<u-modal :show="delShow" :title="'删除'" :content="'是否确认删除此用户?'" showCancelButton="true" @cancel="delShow = false"
@confirm="delItemModal"></u-modal>
</view>
</template> </template>
<script> <script>
import {
mapState
} from 'vuex';
export default { export default {
data() {
return {
userInfo: '',
show: false,
delShow: false,
addressObj: {},
formData: {
phone: '',
name: '',
address1: '',
address: '',
province: '',
city: '',
area: '',
username: '',
},
// 单选数据源
sexs: [{
text: '男',
value: '男'
}, {
text: '女',
value: '女'
}],
rules: {
name: {
rules: [{
required: true,
errorMessage: '请输入收货人姓名',
},
{
minLength: 2,
maxLength: 5,
errorMessage: '姓名长度在 {minLength} 到 {maxLength} 个字符',
}
]
},
phone: {
rules: [{
required: true,
errorMessage: '请输入收货人手机号',
}, {
minLength: 11,
maxLength: 11,
errorMessage: '手机号为11个字符',
}]
},
username: {
rules: [{
required: true,
errorMessage: '请输入收货人帐号名',
}, {
validateFunction: function(rule, value, data, callback) {
let ret = /[^\w\.\/]/ig
if (!ret.test(ret)) {
callback('帐号名不正确')
}
return true
}
}]
},
address1: {
rules: [{
required: true,
errorMessage: '请选择地址',
}]
},
address: {
rules: [{
required: true,
errorMessage: '请输入详细地址',
}]
},
},
};
},
computed: {
...mapState(['shopName', 'shopIndex'])
},
onReady() {
// 需要在onReady中设置规则
this.$refs.form.setRules(this.rules)
},
onLoad(option) {
if (option.info) {
this.userInfo = JSON.parse(decodeURIComponent(option.info))
this.formData = this.userInfo
console.log(this.userInfo, this.formData);
}
},
methods: {
del() {
this.delShow = true;
},
delItemModal() {
this.delShow = false;
this.tui.request("/app/customer/delById", "post", {
id: this.userInfo.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() {
console.log('执行打开地址选择器')
this.show = true
},
onhideShow() {
this.show = false
console.log('执行了关闭地址选择器')
},
//选中省市区
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,
}
console.log(this.formData, this.addressObj);
},
// 触发提交表单
submit() {
this.$refs.form.validate().then(res => {
// res.shopId = this.shopIndex;
res.shopId = 1;
if (this.userInfo) {
res.id = this.userInfo.id
this.tui.request("/app/customer/edit", "post", Object.assign(this.addressObj, res), 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/customer/save", "post", Object.assign(this.addressObj, res), false,
true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "添加成功",
icon: 'none'
})
uni.navigateBack({
delta: 1
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
}
}).catch(err => {
console.log('表单错误信息:', err);
})
}
}
} }
</script> </script>
<style scoped> <style lang="scss" scoped>
.formBox {
margin: 20rpx;
padding: 20rpx;
background-color: #fff;
}
.tui-tabbar {
width: 100%;
height: 98rpx;
background: #fff;
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;
padding: 0 20rpx;
.tui-btn-mr {
margin-right: 30rpx;
}
}
</style> </style>

12
pages/billing/changeGoods.vue

@ -142,11 +142,14 @@
} }
}) })
if (isTrue) { if (isTrue) {
var obj = {}; var obj = {};
console.log(this.keyList)//颜色尺码
this.keyList.map((item, index) => { this.keyList.map((item, index) => {
obj[item] = e.value[index] obj[item] = e.value[index]
}) })
this.shopList.push(obj); console.log("打印出来");
this.shopList.push(obj);
console.log(this.shopList);
this.showList.push(e.value) this.showList.push(e.value)
this.numList.push(1) this.numList.push(1)
this.show = false; this.show = false;
@ -167,7 +170,8 @@
this.listDetail.discountAmount = this.realPrice * 1; this.listDetail.discountAmount = this.realPrice * 1;
this.listDetail.realPrice = this.numAll * this.goodsDetail.wholesalePrice; this.listDetail.realPrice = this.numAll * this.goodsDetail.wholesalePrice;
this.listDetail.productCount = this.numAll; this.listDetail.productCount = this.numAll;
this.listDetail.productId = this.goodsDetail.id; this.listDetail.productId = this.goodsDetail.id;
console.log(this.shopList)
this.shopList.map((item, index) => { this.shopList.map((item, index) => {
this.attributeList[index] = { this.attributeList[index] = {
attributeList: JSON.stringify(item), attributeList: JSON.stringify(item),

60
pages/billing/changeGoods1.vue

@ -56,7 +56,7 @@
class="uni-tab__dot">{{carList.length}}</text> class="uni-tab__dot">{{carList.length}}</text>
</view> </view>
<view class="bottom-right"> <view class="bottom-right">
<view class="bottom-btn" open-type="share" @tap="toggle('bottom')">选好了</view> <view class="bottom-btn" @tap="backPrevPage">选好了</view>
</view> </view>
</view> </view>
<!-- 弹出层 --> <!-- 弹出层 -->
@ -185,7 +185,12 @@
goodsDetail: [], goodsDetail: [],
attrNameList: [], attrNameList: [],
temporaryList: [], temporaryList: [],
carList: [] carList: [],
columns: [],
keyList: [],
specsList:[],
evalue:[],
attributeList:[]
} }
}, },
onLoad() { onLoad() {
@ -217,15 +222,18 @@
this.goodsDetail.attributeList[index].isChecked = true; this.goodsDetail.attributeList[index].isChecked = true;
this.goodsDetail.attributeList[index].value[index1].isChecked = true; this.goodsDetail.attributeList[index].value[index1].isChecked = true;
console.log(this.goodsDetail) console.log(this.goodsDetail)
var name = ''; var name = '',
evalue = []
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) { for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) {
console.log(Ien[m]) console.log(Ien[m])
if (Ien[m].isChecked == true) { if (Ien[m].isChecked == true) {
evalue.push(Ien[m].value)
name += Ien[m].value name += Ien[m].value
} }
} }
} }
this.evalue = evalue;
this.temporaryList = [{ this.temporaryList = [{
id: this.goodsDetail.id, id: this.goodsDetail.id,
barcode: this.goodsDetail.barcode, barcode: this.goodsDetail.barcode,
@ -233,13 +241,33 @@
name: name, name: name,
num: this.temporaryNum, num: this.temporaryNum,
productName: this.goodsDetail.productName, productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn productSn: this.goodsDetail.productSn,
productPicture:this.goodsDetail.productPicture,
supplierName:this.goodsDetail.supplierName
}] }]
}, },
temporaryChange(val) { temporaryChange(val) {
console.log(val) console.log(val)
this.temporaryList[0].num = val this.temporaryList[0].num = val
},
//点击底部选好了,返回上一页
backPrevPage(){
this.specsList.map((item, index) => {
this.attributeList[index] = {
attributeList: JSON.stringify(item),
productCount: this.carList[index].num
}
})
for (var i=0;i<this.carList.length;i++) {
this.carList[i].saleDetailQueryDTO = this.attributeList[i]
}
let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
let prevPage = pages[pages.length - 2]; //上一页页面实例
prevPage.$vm.carList = this.carList
uni.navigateBack({
delta: 1
})
}, },
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {
@ -306,7 +334,11 @@
value: valueObj value: valueObj
}) })
} }
this.goodsDetail.attributeList = newArr; this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
})
} }
}, },
@ -378,7 +410,19 @@
//弹窗选择规格后,点击弹窗中选好了按钮 //弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() { temporaryCheck() {
this.carList.push(this.temporaryList[0]); this.carList.push(this.temporaryList[0]);
this.$refs.popup.close() this.$refs.popup.close()
var obj = {};
this.keyList.map((item, index) => {
obj[item] = this.evalue[index]
})
this.specsList.push(obj);
console.log(this.specsList);
// this.specsList.map((item, index) => {
// this.attributeList[index] = {
// attributeList: JSON.stringify(item),
// productCount: this.numList[index]
// }
// })
// for (var i =0;i<this.shopList.length;i++) { // for (var i =0;i<this.shopList.length;i++) {
// if(this.shopList[i].id == this.temporaryList[0].id){ // if(this.shopList[i].id == this.temporaryList[0].id){
// this.shopList[i].temporaryList = this.temporaryList[0] // this.shopList[i].temporaryList = this.temporaryList[0]

64
pages/index/orderDetail.vue

@ -11,9 +11,9 @@
<view class="u-collapse-content" v-for="(val, index2) in item.saleDetailQueryDTO" :key="index2"> <view class="u-collapse-content" v-for="(val, index2) in item.saleDetailQueryDTO" :key="index2">
<!-- <u-icon name="checkmark-circle" color="#5fd9ee" size="20" v-if="isReturn"></u-icon> <!-- <u-icon name="checkmark-circle" color="#5fd9ee" size="20" v-if="isReturn"></u-icon>
<u-icon name="checkmark-circle" color="#999" size="20" v-if="isReturn"></u-icon> --> <u-icon name="checkmark-circle" color="#999" size="20" v-if="isReturn"></u-icon> -->
单价:{{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }} {{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }}
* {{val.productCount}} * {{val.productCount}}
<u-number-box integer v-if="isReturn" :max="val.productCount" :min="0" <u-number-box integer v-if="isReturn" :max="val.productCount" :min="0"
v-model="val.returnCount"></u-number-box> v-model="val.returnCount"></u-number-box>
</view> </view>
</u-collapse-item> </u-collapse-item>
@ -127,7 +127,9 @@
</u-popup> </u-popup>
<view class="tui-tabbar"> <view class="tui-tabbar">
<view class="tui-btn-mr"> <view class="tui-btn-mr">
<u-button type="primary" :plain="true" shape="circle">打印</u-button> <view class="btn-wrap">
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint"></kk-printer>
</view>
</view> </view>
<view class="tui-btn-mr"> <view class="tui-btn-mr">
<u-button type="error" :plain="true" shape="circle" @click="cancelOrder">取消订单</u-button> <u-button type="error" :plain="true" shape="circle" @click="cancelOrder">取消订单</u-button>
@ -145,6 +147,9 @@
</template> </template>
<script> <script>
import util from '@/components/kk-printer/utils/util.js';
import * as blesdk from '@/components/kk-printer/utils/bluetoolth.js';
import kkPrinter from '@/components/kk-printer/index.vue';
export default { export default {
data() { data() {
return { return {
@ -169,9 +174,13 @@
inventoryList:[], inventoryList:[],
shopList:[], shopList:[],
editNoPrice: false, editNoPrice: false,
newEarn: 0 newEarn: 0,
qrcodeData:''
} }
}, },
components:{
kkPrinter
},
computed: { computed: {
returnAmount() { returnAmount() {
if (this.changeAmount) { if (this.changeAmount) {
@ -221,6 +230,53 @@
} }
}, },
methods: { methods: {
onPrint(opt){
/**
* 打印文字 addCPCLText
* x: 文字方块左上角X座标,单位dot
* y: 文字方块左上角Y座标,单位dot
* fontName,fontSize: 字体,取值: 參考文檔
* rotation: 旋转 1-90度 2-180度 3-270度 其他-不旋转
* content: 文字内容
*/
//快递单600*1040 入库单440*320
let strCmd =blesdk.CreatCPCLPage(600,1040,1,1);
strCmd += blesdk.addCPCLSETMAG(2,2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('40', '30','24', '0',0,'沧州明珠商贸城--快衣店')
strCmd += blesdk.addCPCLSETMAG(3,3)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('50', '120','24', '0',0,'收:'+this.order.name)
strCmd += blesdk.addCPCLSETMAG(1,1)
strCmd += blesdk.addCPCLText('50', '250','24', '0',0,this.order.phone)
strCmd += blesdk.addCPCLSETMAG(2,2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('50', '330','24', '0',0,this.order.province+'/'+this.order.city+'/'+this.order.area)
strCmd += blesdk.addCPCLSETMAG(1,1)
strCmd += blesdk.addCPCLText('50', '410','24', '0',0,this.order.address)
strCmd += blesdk.addCPCLSETMAG(2,2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('0', '490','24', '0',0,'——————————————————————————————')
strCmd += blesdk.addCPCLText('50', '570','24', '0',0,'发货方式:虚拟物流')
strCmd += blesdk.addCPCLSETMAG(2,2)
strCmd += blesdk.addCPCLText('0', '650','24', '0',0,'——————————————————————————————')
strCmd += blesdk.addCPCLText('50', '730','24', '0',0,'店铺:张三的店')
strCmd += blesdk.addCPCLText('50', '810','24', '0',0,'13521030702')
strCmd += blesdk.addCPCLText('50', '890','24', '0',0,'地址:早市10059')
// strCmd += blesdk.addCPCLText(200,0,'24','5',0,'收件联');// 文字
// for (let item in this.list) {
// console.log(item, this.list,this.list[item] );
// strCmd += blesdk.addCPCLText('50', '', this.list[item].productName + ' ¥' + this.list[item].wholesalePrice + ' * ' + (this.sales.discount < 10 ? this.sales.discount : this.list[item].discount),'', '', '')
// this.list[item].saleDetailQueryDTO.forEach(val => {
// strCmd += blesdk.addCPCLText('', '', val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") + '*'+ val.productCount, '', '', '')
// })
// }
// strCmd += blesdk.addCPCLText('', '', '已付款:',this.sales.alreadyEarn,'', '')
// strCmd += blesdk.addCPCLQRCode(400,0,'H','1',5,'2348902384932843290') //二维码
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd;
},
sureNpPay() { sureNpPay() {
this.sales.alreadyEarn =( this.sales.alreadyEarn * 1) + (this.newEarn * 1); this.sales.alreadyEarn =( this.sales.alreadyEarn * 1) + (this.newEarn * 1);
this.tui this.tui

64
pages/inventory/addGoods.vue

@ -1,4 +1,4 @@
<template> <template>
<view> <view>
<view class="formBox"> <view class="formBox">
<uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="85px"> <uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="85px">
@ -6,10 +6,6 @@
<uni-easyinput type="text" v-model="formData.productName" placeholder="请输入商品名称" trim="all" /> <uni-easyinput type="text" v-model="formData.productName" placeholder="请输入商品名称" trim="all" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="商品图片" name="productPicture"> <uni-forms-item label="商品图片" name="productPicture">
<!-- <uni-file-picker limit="9" title="最多选择9张图片" ref="files" :auto-upload="false" v-model="productPicture" mode="grid"
@select="select"
@delete="delIMG"></uni-file-picker>
<button @click="upload">上传文件</button> -->
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="10"></u-upload> :maxCount="10"></u-upload>
</uni-forms-item> </uni-forms-item>
@ -84,7 +80,7 @@
export default { export default {
data() { data() {
return { return {
action: 'http://www.example.com/upload', fileList1: [],
// 表单数据 // 表单数据
formData: { formData: {
name: '', name: '',
@ -210,55 +206,29 @@
console.log(url); console.log(url);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let a = uni.uploadFile({ let a = uni.uploadFile({
url: 'http://154.8.162.157:8888/hiver/upload/file', // 仅为示例,非真实的接口地址 url: 'https://storage.xenjoyou.com/hiver/upload/file', // 仅为示例,非真实的接口地址
// https://unidemo.dcloud.net.cn/upload
filePath: url, filePath: url,
name: 'file', name: 'file',
header: {
"content-type": "multipart/form-data",
'accessToken': this.tui.getToken()
},
formData: { formData: {
user: 'test'
}, },
success: (res) => { success: (uploadFileRes) => {
setTimeout(() => { console.log('uploadFileRes', JSON.parse(uploadFileRes.data));
resolve(res.data.data) let path = JSON.parse(uploadFileRes.data)
}, 1000) //后端返回的地址,存入图片地址
this.imageValue.push({
url: this.imgURL + path.imgUrl,
name: ''
})
console.log('imageValue', this.imageValue)
} }
}); });
}) })
}, },
upload() {
this.$refs.files.upload()
},
//图片上传
select(e) {
const tempFilePaths = e.tempFilePaths;
const imgUrl = tempFilePaths[0]
uni.uploadFile({
url: 'http://154.8.162.157:8888/hiver/upload/file?categoryId=' + this.formData.categoryId,
filePath: imgUrl,
name: 'imgUrl',
header: {
"Content-Type": "multipart/form-data"
},
success: (uploadFileRes) => {
console.log('uploadFileRes', JSON.parse(uploadFileRes.data));
let path = JSON.parse(uploadFileRes.data)
//后端返回的地址,存入图片地址
this.imageValue.push({
url: this.imgURL + path.imgUrl,
name: ''
})
console.log('imageValue', this.imageValue)
}
});
},
//图片删除
delIMG(e) {
console.log('456', e)
const num = this.imageValue.findIndex(v => v.url === e.tempFilePath);
this.imageValue.splice(num, 1);
},
upload() {
this.$refs.files.upload()
},
attrNameChange(index, index1) { attrNameChange(index, index1) {
if (!this.arrtList[index].attrNameRange[index1].isChecked) this.arrtList[index].attrNameRange[index1] if (!this.arrtList[index].attrNameRange[index1].isChecked) this.arrtList[index].attrNameRange[index1]
.isChecked = false .isChecked = false

4
pages/inventory/goodsList.vue

@ -95,7 +95,9 @@
}, },
onShow() { onShow() {
this.getProductInfoList() this.getProductInfoList()
this.purchaseDetails = JSON.parse(JSON.stringify(this.purchaseDetails)) this.purchaseDetails = JSON.parse(JSON.stringify(this.purchaseDetails))
console.log("1111")
console.log(this.purchaseDetails)
this.purchase.shouldPay = this.purchase.totalAmount = this.shouldPay; this.purchase.shouldPay = this.purchase.totalAmount = this.shouldPay;
if( this.purchaseDetails.length > 0 && this.purchase.radio1 == 1) { if( this.purchaseDetails.length > 0 && this.purchase.radio1 == 1) {
this.checkBoxData = [{ this.checkBoxData = [{

148
pages/inventory/goodsList1.vue

@ -46,24 +46,28 @@
</view> </view>
</view> </view>
</view> </view>
<view class="shop-box" style="border-top:5px solid #eee;"> <view class="shop-box" style="border-top:5px solid #eee;" v-for="item in carList" :key="item">
<view class="shop-name"> <view class="shop-name">
创意小众手提包(QS20121101001) <img :src="item.productPicture" alt=""
<uni-icons type="compose" size="16"></uni-icons> 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>
<view class="shop-type"> <view class="shop-type">
<view class="shop-collapse" @tap="clickCollapse"> <view class="shop-collapse" @tap="clickCollapse">
<text>黑色</text> <text>{{item.saleDetailQueryDTO.attributeList}}</text>
<text>均码</text> <text style="color: red;">¥{{item.price * item.num}}</text>
<text style="color: red;">¥0.00</text> <text>{{item.num}}</text>
<text>2</text>
<uni-icons type="bottom" size="16" <uni-icons type="bottom" size="16"
style="margin-left: 112rpx;line-height: 80rpx;"></uni-icons> style="margin-left: 112rpx;line-height: 80rpx;"></uni-icons>
</view> </view>
<view class="shop-collapse-item" v-if="isCollapse"> <view class="shop-collapse-item" v-if="isCollapse">
<view class="collapse-1"> <view class="collapse-1">
<text>单价</text> <text>单价</text>
<input class="input" type="text" value='0'> <input class="input" type="text" :value='item.price'>
</view> </view>
<view class="collapse-1"> <view class="collapse-1">
<text>折扣(100%)</text> <text>折扣(100%)</text>
@ -88,27 +92,33 @@
</view> --> </view> -->
<view class="price-box-list"> <view class="price-box-list">
<view class="content-list"> <view class="content-list">
<view class="list-name">实付金额</view> <view class="list-name">总金额</view>
<view class="list-val"> <view class="list-val">
<input type="text" value="0"> <input type="text" :value="price">
</view> </view>
</view> </view>
<view class="content-list"> <view class="content-list">
<view class="list-name">未付金额</view> <view class="list-name">实收金额</view>
<view class="list-val"> <view class="list-val">
<input type="text" value="0"> <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> </view>
<view class="content-list"> <view class="content-list">
<view class="list-name">欠款</view> <view class="list-name">欠款</view>
<view class="list-val"> <view class="list-val">
<input type="text" value="0"> <input type="text" :value="priceNo">
</view> </view>
</view> </view>
<view class="content-list"> <view class="content-list">
<view class="list-name">其他费用</view> <view class="list-name">其他费用</view>
<view class="list-val"> <view class="list-val">
<input type="text" value="0"> <input type="text" :value="otherExpense">
</view> </view>
</view> </view>
<view class="content-list"> <view class="content-list">
@ -159,7 +169,8 @@
<view class="content-list" v-if="radioType != '4' && radioType !=''"> <view class="content-list" v-if="radioType != '4' && radioType !=''">
<view class="list-name" style="width:150rpx;">{{radioType == '0'? '快递员' :'拉包工'}}</view> <view class="list-name" style="width:150rpx;">{{radioType == '0'? '快递员' :'拉包工'}}</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请选择" disabled :value="radioType == '0'? kdyName.workerName : lbgName.workerName" <input type="text" placeholder="请选择" disabled
:value="radioType == '0'? kdyName.workerName : lbgName.workerName"
style="border-bottom: 1px solid #fff;text-align: center;" style="border-bottom: 1px solid #fff;text-align: center;"
@tap="goPopleList(radioType == '0'? 'kdyName' :'lbgName')"> @tap="goPopleList(radioType == '0'? 'kdyName' :'lbgName')">
<uni-icons type="right" size="16" <uni-icons type="right" size="16"
@ -193,6 +204,10 @@
components: {}, components: {},
data() { data() {
return { return {
price: '0', //总金额
relPrice: '0', //已付金额
otherExpense: '0', // 其他费用
priceNo: '0', //未付金额
value: '', value: '',
isCollapse: false, isCollapse: false,
items: [{ items: [{
@ -234,6 +249,8 @@
wlName: [], //物流公司/物流/发车 wlName: [], //物流公司/物流/发车
kdyName: [], //快递员 kdyName: [], //快递员
lbgName: [], //拉包工姓名 lbgName: [], //拉包工姓名
carList: [], //添加商品页传回来的商品信息
xsyId: ''
} }
}, },
onShow() { onShow() {
@ -242,6 +259,12 @@
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)) || ''
this.carList = this.carList || ''
console.log(this.carList)
// for (var i= 0;i<) {
// }
}, },
onLoad() { onLoad() {
this.xsyList(); this.xsyList();
@ -263,17 +286,17 @@
}, },
//切换销售员 //切换销售员
categoryChange(e) { categoryChange(e) {
console.log(e) this.xsyId = e
}, },
//点击切换折叠状态 //点击切换折叠状态
clickCollapse() { clickCollapse() {
this.isCollapse = !this.isCollapse this.isCollapse = !this.isCollapse
}, },
radioChange(e) { radioChange(e) {
this.khName = '' this.khName = ''
this.gysName = '' this.gysName = ''
this.wlName = '' this.wlName = ''
this.kdyName = '' this.kdyName = ''
this.lbgName = '' this.lbgName = ''
//快递0 物流1 发车2 拼包3 自送4 //快递0 物流1 发车2 拼包3 自送4
this.radioType = e.detail.value; this.radioType = e.detail.value;
@ -291,8 +314,8 @@
icon: 'error' icon: 'error'
}) })
return return
} }
let companyType = this.radioType == 0 ? this.wlName.id : '' let companyType = this.radioType == 0 ? this.wlName.id : ''
console.log(companyType) console.log(companyType)
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType
@ -304,15 +327,56 @@
}) })
}, },
goSell() { goSell() {
uni.showToast({ // console.log(this.khName)
title: "开单成功", // console.log(this.lbgName)
icon: 'success' // 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,
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)
}
}) })
setTimeout(res => {
uni.navigateTo({
url: "/pages/index/order"
})
}, 2000)
} }
} }
} }
@ -405,20 +469,32 @@
.shop-name { .shop-name {
width: 100%; width: 100%;
height: 80rpx; height: 200rpx;
line-height: 80rpx; line-height: 80rpx;
border-top: 1px solid #eee; border-top: 1px solid #eee;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
display: flex;
} }
.shop-name { .shop-productName {
.uni-icons { flex: 1;
color: #088FEB !important; display: flex;
} flex-direction: column;
padding-left: 20rpx;
} }
.shop-productName view {
height: 55rpx;
}
// .shop-name {
// .uni-icons {
// color: #088FEB !important;
// }
// }
.shop-collapse { .shop-collapse {
border-radius: 1px solid #eee; border-radius: 1px solid #eee;
} }

Loading…
Cancel
Save