Browse Source

挂单、开单

master
tianyi@bogon 3 years ago
parent
commit
629e5af8a6
  1. 51
      pages/billing/changeGoods1.vue
  2. 4
      pages/index/addHangOrder.vue
  3. 47
      pages/index/orderDetail.vue
  4. 9
      pages/index/peopleList.vue
  5. 96
      pages/index/shareStyle.vue
  6. 36
      pages/inventory/addGoods.vue
  7. 155
      pages/inventory/addinventory.vue
  8. 6
      pages/inventory/inventory.vue

51
pages/billing/changeGoods1.vue

@ -38,11 +38,6 @@
</view>
</view>
</view>
<!-- <checkbox-group @change="checkboxChange">
<label>
<checkbox :value="item.id" class="checkbox" />
</label>
</checkbox-group> -->
</view>
</view>
</view>
@ -303,13 +298,6 @@
}
},
// //底部左侧购物车按钮
// onClick(e) {
// uni.showToast({
// title: `点击${e.content.text}`,
// icon: 'none'
// })
// },
//选择商品查询商品规格
checkGoods(item) {
this.goodsDetail = item
@ -342,16 +330,6 @@
}
},
//底部右侧两个分享按钮
buttonClick(e) {
if (e == 'all') {
console.log("全部")
} else {
console.log("单个")
}
this.options[0].info++
},
//顶部搜索框
search(res) {
this.searchName = res.value
@ -371,35 +349,6 @@
}
this.getShareList(this.indexList[index].id)
},
//选中商品
checkboxChange(e) {
var items = this.shopList,
values = e.detail.value;
for (var i = 0, lenI = items.length; i < lenI; ++i) {
const item = items[i]
if (values.includes(item.id)) {
this.$set(item, 'checked', true)
} else {
this.$set(item, 'checked', false)
}
}
},
//点击分享按钮
clickShareBtn(e) {
if (e == 'all') {
console.log("全部");
} else {
console.log("单个")
}
this.info++
},
//分享功能(path中带着一个id,用户点击后拿着id跳转到一个客户商品选择页)
onShareAppMessage() {
return {
title: '商品分类',
path: '/pages/login/login?id=123',
}
},
inputDialogToggle() {
this.$refs.inputDialog.open()
},

4
pages/index/addHangOrder.vue

@ -19,7 +19,9 @@
</view>
<view class="order-collapse-item" v-if="isCollapse">
<view class="collapse-1">
<text>单价</text>
<view class="order-notes">
备注:
</view>
</view>
</view>
<!-- 语音识别弹出层 -->

47
pages/index/orderDetail.vue

@ -59,20 +59,23 @@
<view class="tui-price-flex tui-size32" v-if="editNoPrice">
<view class="tui-flex-shrink">还款金额</view>
<view class="tui-goods-price">
<view class="tui-price-large"><uni-easyinput v-model="newEarn" trim="all" @change="getNoPay" /></view>
<view class="tui-price-large"><uni-easyinput v-model="newEarn" trim="all" @change="getNoPay" />
</view>
</view>
</view>
<view class="tui-price-flex tui-size32" v-if="isReturn">
<view class="tui-flex-shrink">平台取货</view>
<view class="tui-goods-price">
<uni-data-checkbox v-model="radio1" :localdata="sex" @change="checkBoxChange"></uni-data-checkbox>
<uni-data-checkbox v-model="radio1" :localdata="sex"
@change="checkBoxChange"></uni-data-checkbox>
</view>
</view>
<!-- && orderByWorkerCandidates.length > 0 -->
<view class="tui-price-flex tui-size32" v-if="isReturn && radio1 == 0">
<view class="tui-flex-shrink">配送人员</view>
<view class="tui-goods-price">
<uni-combox :candidates="orderByWorkerCandidates" placeholder="请选择配送人员" v-model="orderByWorker"></uni-combox>
<uni-combox :candidates="orderByWorkerCandidates" placeholder="请选择配送人员"
v-model="orderByWorker"></uni-combox>
</view>
</view>
</view>
@ -83,7 +86,8 @@
</view>
<view class="tui-order-content">
<u-collapse :value="[shopList[0].saleId]">
<u-collapse-item v-for="(item,index) in shopList" :key="index" :title="item.productName" :name="item.saleId">
<u-collapse-item v-for="(item,index) in shopList" :key="index" :title="item.productName"
:name="item.saleId">
<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="#999" size="20" v-if="isReturn"></u-icon> -->
@ -106,8 +110,11 @@
<view class="tui-item-content">{{ sales.id }}</view>
</view>
<view class="tui-order-flex">
<view class="tui-item-title">物流单号:</view>
<view class="tui-item-content">{{ order.kdOrderId }}</view>
<view class="tui-item-title">物流单:</view>
<!-- <view class="tui-item-content">{{ order.kdOrderId }}</view> -->
<image show-menu-by-longpress
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/f02827ca8a7b4decadca812cb2f83110.jpg"
@tap="showImage"></image>
</view>
<view class="tui-order-flex">
<view class="tui-item-title">创建时间:</view>
@ -135,10 +142,12 @@
<u-button type="error" :plain="true" shape="circle" @click="cancelOrder">取消订单</u-button>
</view>
<view class="tui-btn-mr" v-if="sales.status == 5">
<u-button type="error" :plain="true" shape="circle" @click="returnGoods" >{{ !isReturn ? '退货' : '确认退货'}}</u-button>
<u-button type="error" :plain="true" shape="circle"
@click="returnGoods">{{ !isReturn ? '退货' : '确认退货'}}</u-button>
</view>
<view class="tui-btn-mr">
<u-button type="error" :plain="true" shape="circle" @click="editnoEarn" v-if="!editNoPrice">汇款</u-button>
<u-button type="error" :plain="true" shape="circle" @click="editnoEarn"
v-if="!editNoPrice">汇款</u-button>
<u-button type="error" :plain="true" shape="circle" @click="sureNpPay" v-else>确认</u-button>
</view>
@ -251,7 +260,8 @@
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.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)
@ -277,13 +287,19 @@
strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd;
},
//点击图片放大
showImage() {
uni.previewImage({
urls: ["https://jewel-shop.oss-cn-beijing.aliyuncs.com/f02827ca8a7b4decadca812cb2f83110.jpg"],
current: "https://jewel-shop.oss-cn-beijing.aliyuncs.com/f02827ca8a7b4decadca812cb2f83110.jpg"
})
},
sureNpPay() {
this.sales.alreadyEarn = (this.sales.alreadyEarn * 1) + (this.newEarn * 1);
this.tui
.request(
'/app/sale/edit',
'post',
{
'post', {
sale: this.sales,
customer: this.order,
saleDetailDTOList: this.list
@ -325,8 +341,10 @@
if (res.code == 200 && res.result != null && res.result != undefined) {
this.inventoryList = res.result
this.inventoryList.forEach(item => {
this.tui.request("/app/return/get/" + item.id, "GET", null, false, false).then((res) => {
if (res.code == 200 && res.result != null && res.result != undefined) {
this.tui.request("/app/return/get/" + item.id, "GET", null, false, false).then(
(res) => {
if (res.code == 200 && res.result != null && res.result !=
undefined) {
this.shopList.push(...res.result.saleDetailDTOList);
console.log(this.shopList);
}
@ -381,7 +399,8 @@
if (this.orderByWorker) {
console.log(this.orderByWorker);
for (let key in this.orderByWorkerList) {
console.log(this.orderByWorker,this.orderByWorkerList[key].workerName, this.orderByWorker == this.orderByWorkerList[key].workerName);
console.log(this.orderByWorker, this.orderByWorkerList[key].workerName, this.orderByWorker == this
.orderByWorkerList[key].workerName);
if (this.orderByWorker == this.orderByWorkerList[key].workerName) {
worderId = this.orderByWorkerList[key].workerId
}

9
pages/index/peopleList.vue

@ -1,7 +1,7 @@
<template>
<view class="">
<view class="">
<view class="" v-if="popleType== 'khName'" @tap="">
<view class="" v-if="popleType== 'khName' || 'gysName'" @tap="">
<!-- 供应商、客户走这一套 -->
<view>
<button size="default" type="default" @tap="" hover-class="is-hover">新增人员</button>
@ -66,7 +66,7 @@
this.companyType = options.companyType || ''
console.log(options.companyType)
// this.radioType = options.radioType
if (options.popleType == ('khName' || 'gysName')) { //供应商或者客户
if (options.popleType == 'khName' || options.popleType == 'gysName') { //供应商或者客户
this.khOrGysList(options.popleType);
} else if (options.popleType == 'wlName' || options.popleType == 'kdName') { //物流快递
this.wlOrKdList(options.popleType)
@ -109,10 +109,9 @@
clickList(item) {
let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
let prevPage = pages[pages.length - 2]; //上一页页面实例
if (this.popleType == 'khName') {
//客户和供应商用一个名字
if (this.popleType == 'khName' || this.popleType == 'gysName') {
prevPage.$vm.khName = item
} else if (this.popleType == 'gysName') {
prevPage.$vm.gysName = item
} else if (this.popleType == 'kdName' || this.popleType == 'wlName' || this.popleType == 'fcName') {
prevPage.$vm.wlName = item
} else if (this.popleType == 'lbgName') {

96
pages/index/shareStyle.vue

@ -37,7 +37,7 @@
</view>
</view>
</view>
<checkbox-group @change="checkboxChange">
<checkbox-group @tap="checkboxChange(item)">
<label>
<checkbox :value="item.id" class="checkbox" />
</label>
@ -49,31 +49,26 @@
<view class="bottom-left">
<view class="bottom-left-box">
<uni-icons type="cart" size="20" color="#646566"></uni-icons>
<text class="uni-tab__text">购物车</text>
<text class="uni-tab__text">已选择</text>
</view>
<text style="background-color:#ff0000;color:#fff;position: absolute;top: 0;right: 10rpx;"
class="uni-tab__dot">{{ info }}</text>
</view>
<view class="bottom-right">
<button class="bottom-btn" open-type="share" @tap="clickShareBtn('all')">分享全部</button>
<button class="bottom-btn" open-type="share" @tap="clickShareBtn">分享选中</button>
<button class="bottom-btn" @tap="clickShareBtn('all')">分享全部</button>
<button class="bottom-btn" @tap="clickShareBtn">分享选中</button>
</view>
</view>
<!-- 分享弹出层 -->
<uni-popup ref="share" type="share" @select='select' safeArea backgroundColor="#fff">
<uni-popup-share></uni-popup-share>
</uni-popup>
</view>
</template>
<script>
export default {
components: {},
onShareAppMessage(res) {
if (res.from === 'button') {// 来自页面内分享按钮
console.log(res.target)
}
return {
title: '自定义分享标题',
path: '/pages/test/test?id=123'
}
},
data() {
return {
indexList: [],
@ -83,10 +78,17 @@
categoryId: '', //分类id
searchName: '', //搜索框输入值
shopId: '', //店铺id,
checkbox: '' //需要分享的商品id
checkbox: '', //需要分享的商品id
id: '',
}
},
onLoad() {
onLoad(options) {
console.log(options.khid)
if(options.khid != undefined){
uni.navigateTo({
url: "/pages/index/downStearmList?khid=" + options.khid
})
}
this.getGategoryList()
},
methods: {
@ -153,32 +155,37 @@
},
//选中商品
checkboxChange(e) {
console.log(e);
var items = this.shopList,
values = e.detail.value;
for (var i = 0, lenI = items.length; i < lenI; ++i) {
const item = items[i]
if (values.includes(item.id)) {
this.$set(item, 'checked', true)
} else {
this.$set(item, 'checked', false)
values = e.id;
for (var i = 0; i < items.length; ++i) {
if (values.includes(items[i].id)) {
items[i].checked = !items[i].checked
}
}
},
//点击分享按钮
clickShareBtn(e) {
let data = {}
this.checkbox = ''
if (e == 'all') {
data = {
shopId: '002',
shareType: '1', //1 分享全部
}
} else {
var items = this.shopList;
console.log(this.shopList)
for (var i = 0; i < items.length; ++i) {
if (items[i].checked == true) {
if (this.checkbox == '') {
this.checkbox = items[i].id
} else {
this.checkbox = this.checkbox + ',' + items[i].id
}
}
}
data = {
shopId: '002',
shareType: '2', //2 分享勾选商品
@ -187,33 +194,32 @@
}
this.tui.request("/app/productShare/save", "POST", data, false, true).then((res) => {
if (res.code == 200) {
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 1,
summary: "我正在使用HBuilderX开发uni-app,赶紧跟我一起来体验!",
miniProgram: {
id: 'gh_dc54e7aacd12', //微信小程序原始id
path: 'pages/index/index',
type: 1 //0-正式版; 1-测试版; 2-体验版
},
success: function(res) {
uni.showToast({
title: '分享成功',
icon: 'success'
})
},
fail: function(err) {
uni.showToast({
title: err,
icon: 'error'
})
}
});
this.khid = res.result.id
this.$refs.share.open()
} else {}
}).catch((res) => {})
// this.info++
},
//点击的是转发朋友圈还是微信好友
select(index){
if(index== 0){
this.onShareAppMessage()
}else{
this.onShareTimeline()
}
},
onShareTimeline() {
return {
title: '查看我的推荐',
query: 'khid=' + this.khid
}
},
onShareAppMessage() {
return {
title: '查看我的推荐',
path: '/pages/index/shareStyle?khid=' + this.khid
}
},
}
}
</script>

36
pages/inventory/addGoods.vue

@ -9,9 +9,10 @@
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="10"></u-upload>
</uni-forms-item>
<!-- <uni-forms-item label=" 供应商" required name="supplierId">
<uni-forms-item label=" 供应商" required name="supplierId">
<uni-easyinput type="text" v-model="formData.supplierId" placeholder="请输入供应商" trim="all" />
</uni-forms-item> -->
<!-- <uni-easyinput type="text" v-model="formData.name" /> -->
</uni-forms-item>
<uni-forms-item label="货号" name="productSn" required>
<uni-easyinput type="text" v-model="formData.productSn" placeholder="请输入货号" trim="all" />
</uni-forms-item>
@ -71,12 +72,16 @@
</uni-forms>
<u-button type="primary" @tap.stop="submit(ret)">保存</u-button>
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint"></kk-printer>
</view>
<!-- <u-modal v-model="show" :content="content"></u-modal> -->
</view>
</template>
<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 {
data() {
return {
@ -95,6 +100,7 @@
categoryList: [],
arrtList: [],
arrtChange: [],
bufferData: '',
attributeList: {},
rules: {
// 对name字段进行必填验证
@ -150,6 +156,9 @@
}
}
},
components:{
kkPrinter
},
onShow() {
let that = this
uni.$on('classForm', function(data) {
@ -315,7 +324,28 @@
}).catch(err => {
console.log('表单错误信息:', err);
})
}
},
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(440,320,1,0);
strCmd += blesdk.addCPCLText('0', '30','24', '0',0,'商品名:女装小西裤')
strCmd += blesdk.addCPCLText('0', '80','24', '0',0,'货 号:NK20231012001')
strCmd += blesdk.addCPCLText('0', '130','24', '0',0,'供应商:杭州春雨服饰')
strCmd += blesdk.addCPCLText('0', '180','24', '0',0,'批发价:56.00')
strCmd += blesdk.addCPCLText('0', '230','24', '0',0,'零售价:99.00')
strCmd += blesdk.addCPCLQRCode(260,170,'H','1',6,'1694621564429623297') //二维码
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd;
},
}
}
</script>

155
pages/inventory/addinventory.vue

@ -28,7 +28,7 @@
<view class="list-name">供应商</view>
<view class="list-val">
<input type="text" placeholder="请选择供应商" disabled
style="border-bottom: 1px solid #fff;text-align: center;" @tap="goPopleList('kh')">
style="border-bottom: 1px solid #fff;text-align: center;" :value="khName.name" @tap="goPopleList('gysName')">
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view>
</view>
@ -51,53 +51,22 @@
</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;">
<view class="shop-box" style="border-top:5px solid #eee;" v-for="item in carList" :key="item">
<view class="shop-name">
创意小众手提包(QS20121101001)
<uni-icons type="compose" size="16"></uni-icons>
<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>黑色</text>
<text>均码</text>
<!-- <text style="color: red;">¥0.00</text> -->
<text>数量:2</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='0'>
</view>
<view class="collapse-1">
<text>折扣(100%)</text>
<input class="input" type="text" value='0'>
<text>{{item.saleDetailQueryDTO.attributeList}}</text>
<text style="color: red;">¥{{item.price * item.num}}</text>
<text>{{item.num}}</text>
</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>
@ -147,7 +116,7 @@
<text style="color: #ffa200;">¥20.00</text>
</view>
<view class="bottom-right">
<button class="bottom-btn">入库</button>
<button class="bottom-btn" @tap='inventorySubmit'>入库</button>
</view>
</view>
</view>
@ -168,10 +137,18 @@
price: '',
single: ''
},
khName:[],
carList:[]
}
},
methods: {
onShow(){
this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
this.carList = this.carList || ''
},
onLoad(){
},
methods: {
scanCodeAdd() {
uni.scanCode({
success: (res) => {
@ -190,24 +167,54 @@
},
goodsAdd() {
uni.navigateTo({
url:"/pages/inventory/goodsList?type=" + 'inventory'
url:"/pages/billing/changeGoods1?type=" + 'inventory'
})
},
/**
* 复写 binddata 方法,如果只是为了校验,无复杂自定义操作,可忽略此方法
* @param {String} name 字段名称
* @param {String} value 表单域的值
*/
// binddata(name,value){
// 通过 input 事件设置表单指定 name 的值
// this.$refs.form.setValue(name, value)
// },
// 触发提交表单
submit() {
this.$refs.form.validate().then(res => {
console.log('表单数据信息:', res);
}).catch(err => {
console.log('表单错误信息:', err);
//跳转选择供应商
goPopleList(popleType) {
uni.navigateTo({
url: '/pages/index/peopleList?popleType=' + popleType
})
},
inventorySubmit() {
console.log(this.khName)
console.log(this.carList)
let purchase = {
alreadyPay:0, //已付金额
discount: 10, //折扣
noPay:1111, //未支付金额
realAmount:1111, //实际金额
shopId:'002',
shouldPay: 1111, //应付金额
totalAmount: 1111, //总数量
}
let purchaseDetails = [{
allPrice: 1111,
attributeList:'["颜色":["s"],"尺码":["m"]}',
price: 1111,
productCount:1,
productId:"1695314088038633472",
purchasePrice: 800, //进货价
wholesalePrice: 1000, //批发价
}]
this.tui.request("/app/stock/putIn", "post", {
purchase: purchase,
purchaseDetails: purchaseDetails
}, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "入库成功",
icon: 'none'
})
uni.navigateBack({
delta: 2
})
} else {
uni.showToast({
title: "入库失败",
icon: 'none'
})
}
})
}
}
@ -299,12 +306,13 @@
.shop-name {
width: 100%;
height: 80rpx;
height: 200rpx;
line-height: 80rpx;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
font-size: 28rpx;
font-weight: bold;
display: flex;
}
.shop-name {
@ -312,6 +320,16 @@
color: #088FEB !important;
}
}
.shop-productName {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 20rpx;
}
.shop-productName view {
height: 55rpx;
}
.shop-collapse {
border-radius: 1px solid #eee;
@ -323,19 +341,6 @@
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;

6
pages/inventory/inventory.vue

@ -179,10 +179,8 @@
getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", {
shopId: '002',
// categoryId:id || '1695090289036890112',
categoryId: '1695090289036890112',
// supplierName:this.searchName || '测试',
supplierName: '测试',
categoryId:id,
supplierName:this.keyword,
pageNum: this.pageNum,
pageSize: '10'
}, false, true).then((res) => {

Loading…
Cancel
Save