Browse Source

挂单、开单

master
tianyi@bogon 3 years ago
parent
commit
629e5af8a6
  1. 51
      pages/billing/changeGoods1.vue
  2. 4
      pages/index/addHangOrder.vue
  3. 199
      pages/index/orderDetail.vue
  4. 11
      pages/index/peopleList.vue
  5. 106
      pages/index/shareStyle.vue
  6. 44
      pages/inventory/addGoods.vue
  7. 159
      pages/inventory/addinventory.vue
  8. 6
      pages/inventory/inventory.vue

51
pages/billing/changeGoods1.vue

@ -38,11 +38,6 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <checkbox-group @change="checkboxChange">
<label>
<checkbox :value="item.id" class="checkbox" />
</label>
</checkbox-group> -->
</view> </view>
</view> </view>
</view> </view>
@ -303,13 +298,6 @@
} }
}, },
// //底部左侧购物车按钮
// onClick(e) {
// uni.showToast({
// title: `点击${e.content.text}`,
// icon: 'none'
// })
// },
//选择商品查询商品规格 //选择商品查询商品规格
checkGoods(item) { checkGoods(item) {
this.goodsDetail = item this.goodsDetail = item
@ -342,16 +330,6 @@
} }
}, },
//底部右侧两个分享按钮
buttonClick(e) {
if (e == 'all') {
console.log("全部")
} else {
console.log("单个")
}
this.options[0].info++
},
//顶部搜索框 //顶部搜索框
search(res) { search(res) {
this.searchName = res.value this.searchName = res.value
@ -371,35 +349,6 @@
} }
this.getShareList(this.indexList[index].id) 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() { inputDialogToggle() {
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
}, },

4
pages/index/addHangOrder.vue

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

199
pages/index/orderDetail.vue

@ -13,7 +13,7 @@
<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>
@ -59,20 +59,23 @@
<view class="tui-price-flex tui-size32" v-if="editNoPrice"> <view class="tui-price-flex tui-size32" v-if="editNoPrice">
<view class="tui-flex-shrink">还款金额</view> <view class="tui-flex-shrink">还款金额</view>
<view class="tui-goods-price"> <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> </view>
<view class="tui-price-flex tui-size32" v-if="isReturn"> <view class="tui-price-flex tui-size32" v-if="isReturn">
<view class="tui-flex-shrink">平台取货</view> <view class="tui-flex-shrink">平台取货</view>
<view class="tui-goods-price"> <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>
</view> </view>
<!-- && orderByWorkerCandidates.length > 0 --> <!-- && orderByWorkerCandidates.length > 0 -->
<view class="tui-price-flex tui-size32" v-if="isReturn && radio1 == 0" > <view class="tui-price-flex tui-size32" v-if="isReturn && radio1 == 0">
<view class="tui-flex-shrink">配送人员</view> <view class="tui-flex-shrink">配送人员</view>
<view class="tui-goods-price"> <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> </view>
</view> </view>
@ -82,19 +85,20 @@
退款历史信息 退款历史信息
</view> </view>
<view class="tui-order-content"> <view class="tui-order-content">
<u-collapse :value="[shopList[0].saleId]"> <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"
<view class="u-collapse-content" v-for="(val, index2) in item.saleDetailQueryDTO" :key="index2"> :name="item.saleId">
<!-- <u-icon name="checkmark-circle" color="#5fd9ee" size="20" v-if="isReturn"></u-icon> <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> --> <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>
</u-collapse> </u-collapse>
</view> </view>
</view> </view>
<view class="tui-order-info boxbg"> <view class="tui-order-info boxbg">
<view class="tui-order-title"> <view class="tui-order-title">
@ -106,8 +110,11 @@
<view class="tui-item-content">{{ sales.id }}</view> <view class="tui-item-content">{{ sales.id }}</view>
</view> </view>
<view class="tui-order-flex"> <view class="tui-order-flex">
<view class="tui-item-title">物流单号:</view> <view class="tui-item-title">物流单:</view>
<view class="tui-item-content">{{ order.kdOrderId }}</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>
<view class="tui-order-flex"> <view class="tui-order-flex">
<view class="tui-item-title">创建时间:</view> <view class="tui-item-title">创建时间:</view>
@ -135,10 +142,12 @@
<u-button type="error" :plain="true" shape="circle" @click="cancelOrder">取消订单</u-button> <u-button type="error" :plain="true" shape="circle" @click="cancelOrder">取消订单</u-button>
</view> </view>
<view class="tui-btn-mr" v-if="sales.status == 5"> <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>
<view class="tui-btn-mr"> <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> <u-button type="error" :plain="true" shape="circle" @click="sureNpPay" v-else>确认</u-button>
</view> </view>
@ -161,8 +170,8 @@
text: '否', text: '否',
value: 1 value: 1
}], }],
orderByWorkerCandidates:[], orderByWorkerCandidates: [],
orderByWorker:'', orderByWorker: '',
bufferData: '', bufferData: '',
show: false, show: false,
popupShow: false, popupShow: false,
@ -170,30 +179,30 @@
order: {}, order: {},
list: [], list: [],
isReturn: false, isReturn: false,
orderByWorkerList:[], orderByWorkerList: [],
inventoryList:[], inventoryList: [],
shopList:[], shopList: [],
editNoPrice: false, editNoPrice: false,
newEarn: 0, newEarn: 0,
qrcodeData:'' qrcodeData: ''
} }
}, },
components:{ components: {
kkPrinter kkPrinter
}, },
computed: { computed: {
returnAmount() { returnAmount() {
if (this.changeAmount) { if (this.changeAmount) {
console.log(this.changeAmount,'this.changeAmount'); console.log(this.changeAmount, 'this.changeAmount');
if(this.sales.noEarn >= this.changeAmount) { if (this.sales.noEarn >= this.changeAmount) {
this.sales.newNoEarn = (this.sales.noEarn - this.changeAmount).toFixed(2); this.sales.newNoEarn = (this.sales.noEarn - this.changeAmount).toFixed(2);
console.log(this.sales.newNoEarn); console.log(this.sales.newNoEarn);
return 0 return 0
} else { } else {
this.sales.newNoEarn = 0 this.sales.newNoEarn = 0
return (this.changeAmount - this.sales.noEarn).toFixed(2) return (this.changeAmount - this.sales.noEarn).toFixed(2)
}
} }
}
}, },
changeAmount() { changeAmount() {
if (this.isReturn) { if (this.isReturn) {
@ -230,39 +239,40 @@
} }
}, },
methods: { methods: {
onPrint(opt){ onPrint(opt) {
/** /**
* 打印文字 addCPCLText * 打印文字 addCPCLText
* x: 文字方块左上角X座标,单位dot * x: 文字方块左上角X座标,单位dot
* y: 文字方块左上角Y座标,单位dot * y: 文字方块左上角Y座标,单位dot
* fontName,fontSize: 字体,取值: 參考文檔 * fontName,fontSize: 字体,取值: 參考文檔
* rotation: 旋转 1-90度 2-180度 3-270度 其他-不旋转 * rotation: 旋转 1-90度 2-180度 3-270度 其他-不旋转
* content: 文字内容 * content: 文字内容
*/ */
//快递单600*1040 入库单440*320 //快递单600*1040 入库单440*320
let strCmd =blesdk.CreatCPCLPage(600,1040,1,1); let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 1);
strCmd += blesdk.addCPCLSETMAG(2,2) strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold') blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('40', '30','24', '0',0,'沧州明珠商贸城--快衣店') strCmd += blesdk.addCPCLText('40', '30', '24', '0', 0, '沧州明珠商贸城--快衣店')
strCmd += blesdk.addCPCLSETMAG(3,3) 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') blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('50', '120','24', '0',0,'收:'+this.order.name) strCmd += blesdk.addCPCLText('50', '330', '24', '0', 0, this.order.province + '/' + this.order.city + '/' +
strCmd += blesdk.addCPCLSETMAG(1,1) this.order.area)
strCmd += blesdk.addCPCLText('50', '250','24', '0',0,this.order.phone) strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLSETMAG(2,2) strCmd += blesdk.addCPCLText('50', '410', '24', '0', 0, this.order.address)
blesdk.addCPCLSETBOLD('bold') strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLText('50', '330','24', '0',0,this.order.province+'/'+this.order.city+'/'+this.order.area) blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLSETMAG(1,1) strCmd += blesdk.addCPCLText('0', '490', '24', '0', 0, '——————————————————————————————')
strCmd += blesdk.addCPCLText('50', '410','24', '0',0,this.order.address) strCmd += blesdk.addCPCLText('50', '570', '24', '0', 0, '发货方式:虚拟物流')
strCmd += blesdk.addCPCLSETMAG(2,2) strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold') strCmd += blesdk.addCPCLText('0', '650', '24', '0', 0, '——————————————————————————————')
strCmd += blesdk.addCPCLText('0', '490','24', '0',0,'——————————————————————————————') strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:张三的店')
strCmd += blesdk.addCPCLText('50', '570','24', '0',0,'发货方式:虚拟物流') strCmd += blesdk.addCPCLText('50', '810', '24', '0', 0, '13521030702')
strCmd += blesdk.addCPCLSETMAG(2,2) strCmd += blesdk.addCPCLText('50', '890', '24', '0', 0, '地址:早市10059')
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,'收件联');// 文字 // strCmd += blesdk.addCPCLText(200,0,'24','5',0,'收件联');// 文字
// for (let item in this.list) { // for (let item in this.list) {
// console.log(item, this.list,this.list[item] ); // console.log(item, this.list,this.list[item] );
@ -271,19 +281,25 @@
// strCmd += blesdk.addCPCLText('', '', val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") + '*'+ val.productCount, '', '', '') // 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.addCPCLText('', '', '已付款:',this.sales.alreadyEarn,'', '')
// strCmd += blesdk.addCPCLQRCode(400,0,'H','1',5,'2348902384932843290') //二维码 // strCmd += blesdk.addCPCLQRCode(400,0,'H','1',5,'2348902384932843290') //二维码
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd; 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() { 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
.request( .request(
'/app/sale/edit', '/app/sale/edit',
'post', 'post', {
{
sale: this.sales, sale: this.sales,
customer: this.order, customer: this.order,
saleDetailDTOList: this.list saleDetailDTOList: this.list
@ -293,8 +309,8 @@
) )
.then(res => { .then(res => {
uni.showToast({ uni.showToast({
title:res.message, title: res.message,
icon:'none' icon: 'none'
}) })
uni.navigateBack(); uni.navigateBack();
}) })
@ -306,12 +322,12 @@
getNoPay(en) { getNoPay(en) {
console.log(en, 'en'); console.log(en, 'en');
if (en != undefined) { if (en != undefined) {
if( 0 < en && en <= this.sales.noEarn) { if (0 < en && en <= this.sales.noEarn) {
this.sales.noEarn = this.sales.newEarn - en; this.sales.noEarn = this.sales.newEarn - en;
} else { } else {
uni.showToast({ uni.showToast({
title: '请输入正确金额', title: '请输入正确金额',
icon:"none" icon: "none"
}); });
} }
} }
@ -319,24 +335,26 @@
getReturnOrder(id) { getReturnOrder(id) {
this.tui.request("/app/return/list", "post", { this.tui.request("/app/return/list", "post", {
shopId: 1, shopId: 1,
remark:3, remark: 3,
saleId:id saleId: id
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200 && res.result != null && res.result != undefined) { if (res.code == 200 && res.result != null && res.result != undefined) {
this.inventoryList = res.result this.inventoryList = res.result
this.inventoryList.forEach(item => { this.inventoryList.forEach(item => {
this.tui.request("/app/return/get/" + item.id, "GET", null, false, false).then((res) => { this.tui.request("/app/return/get/" + item.id, "GET", null, false, false).then(
if (res.code == 200 && res.result != null && res.result != undefined) { (res) => {
this.shopList.push(...res.result.saleDetailDTOList); if (res.code == 200 && res.result != null && res.result !=
console.log(this.shopList); undefined) {
} this.shopList.push(...res.result.saleDetailDTOList);
}).catch((res) => {}) console.log(this.shopList);
}
}).catch((res) => {})
}) })
} }
}).catch((res) => {}) }).catch((res) => {})
}, },
checkBoxChange() { checkBoxChange() {
if(this.radio1 == 0 && this.orderByWorkerList.length == 0) { if (this.radio1 == 0 && this.orderByWorkerList.length == 0) {
this.transCompanyInput() this.transCompanyInput()
} }
}, },
@ -378,11 +396,12 @@
}) })
}) })
let worderId = '' let worderId = ''
if(this.orderByWorker) { if (this.orderByWorker) {
console.log(this.orderByWorker); console.log(this.orderByWorker);
for (let key in this.orderByWorkerList) { 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
if(this.orderByWorker == this.orderByWorkerList[key].workerName) { .orderByWorkerList[key].workerName);
if (this.orderByWorker == this.orderByWorkerList[key].workerName) {
worderId = this.orderByWorkerList[key].workerId worderId = this.orderByWorkerList[key].workerId
} }
} }
@ -390,7 +409,7 @@
this.sales.noEarn = this.sales.newNoEarn; this.sales.noEarn = this.sales.newNoEarn;
this.sales.saleId = this.sales.id; this.sales.saleId = this.sales.id;
this.sales.totalAomount = this.returnAmount; this.sales.totalAomount = this.returnAmount;
console.log(this.sales,this.list ,this.orderByWorker); console.log(this.sales, this.list, this.orderByWorker);
this.tui.request("/app/return/rtg", "post", { this.tui.request("/app/return/rtg", "post", {
returnSale: this.sales, returnSale: this.sales,
returnSaleDetailList: this.list, returnSaleDetailList: this.list,
@ -400,13 +419,13 @@
uni.showToast({ uni.showToast({
title: res.message title: res.message
}); });
if(res.code == 200) { if (res.code == 200) {
uni.navigateBack() uni.navigateBack()
} }
}).catch((res) => {}) }).catch((res) => {})
}, },
returnGoods() { returnGoods() {
if(this.isReturn) { if (this.isReturn) {
this.sureReturn() this.sureReturn()
} else { } else {
this.isReturn = true; this.isReturn = true;

11
pages/index/peopleList.vue

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

106
pages/index/shareStyle.vue

@ -37,7 +37,7 @@
</view> </view>
</view> </view>
</view> </view>
<checkbox-group @change="checkboxChange"> <checkbox-group @tap="checkboxChange(item)">
<label> <label>
<checkbox :value="item.id" class="checkbox" /> <checkbox :value="item.id" class="checkbox" />
</label> </label>
@ -49,31 +49,26 @@
<view class="bottom-left"> <view class="bottom-left">
<view class="bottom-left-box"> <view class="bottom-left-box">
<uni-icons type="cart" size="20" color="#646566"></uni-icons> <uni-icons type="cart" size="20" color="#646566"></uni-icons>
<text class="uni-tab__text">购物车</text> <text class="uni-tab__text">已选择</text>
</view> </view>
<text style="background-color:#ff0000;color:#fff;position: absolute;top: 0;right: 10rpx;" <text style="background-color:#ff0000;color:#fff;position: absolute;top: 0;right: 10rpx;"
class="uni-tab__dot">{{ info }}</text> class="uni-tab__dot">{{ info }}</text>
</view> </view>
<view class="bottom-right"> <view class="bottom-right">
<button class="bottom-btn" open-type="share" @tap="clickShareBtn('all')">分享全部</button> <button class="bottom-btn" @tap="clickShareBtn('all')">分享全部</button>
<button class="bottom-btn" open-type="share" @tap="clickShareBtn">分享选中</button> <button class="bottom-btn" @tap="clickShareBtn">分享选中</button>
</view> </view>
</view> </view>
<!-- 分享弹出层 -->
<uni-popup ref="share" type="share" @select='select' safeArea backgroundColor="#fff">
<uni-popup-share></uni-popup-share>
</uni-popup>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
components: {}, components: {},
onShareAppMessage(res) {
if (res.from === 'button') {// 来自页面内分享按钮
console.log(res.target)
}
return {
title: '自定义分享标题',
path: '/pages/test/test?id=123'
}
},
data() { data() {
return { return {
indexList: [], indexList: [],
@ -83,10 +78,17 @@
categoryId: '', //分类id categoryId: '', //分类id
searchName: '', //搜索框输入值 searchName: '', //搜索框输入值
shopId: '', //店铺id, 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() this.getGategoryList()
}, },
methods: { methods: {
@ -153,30 +155,35 @@
}, },
//选中商品 //选中商品
checkboxChange(e) { checkboxChange(e) {
console.log(e);
var items = this.shopList, var items = this.shopList,
values = e.detail.value; values = e.id;
for (var i = 0, lenI = items.length; i < lenI; ++i) { for (var i = 0; i < items.length; ++i) {
const item = items[i] if (values.includes(items[i].id)) {
if (values.includes(item.id)) { items[i].checked = !items[i].checked
this.$set(item, 'checked', true)
} else {
this.$set(item, 'checked', false)
} }
} }
}, },
//点击分享按钮 //点击分享按钮
clickShareBtn(e) { clickShareBtn(e) {
let data = {} let data = {}
this.checkbox = ''
if (e == 'all') { if (e == 'all') {
data = { data = {
shopId: '002', shopId: '002',
shareType: '1', //1 分享全部 shareType: '1', //1 分享全部
} }
} else { } else {
var items = this.shopList; var items = this.shopList;
console.log(this.shopList)
for (var i = 0; i < items.length; ++i) { for (var i = 0; i < items.length; ++i) {
if (items[i].checked == true) { if (items[i].checked == true) {
this.checkbox = this.checkbox + ',' + items[i].id if (this.checkbox == '') {
this.checkbox = items[i].id
} else {
this.checkbox = this.checkbox + ',' + items[i].id
}
} }
} }
data = { data = {
@ -187,32 +194,31 @@
} }
this.tui.request("/app/productShare/save", "POST", data, false, true).then((res) => { this.tui.request("/app/productShare/save", "POST", data, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.share({ this.khid = res.result.id
provider: "weixin", this.$refs.share.open()
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'
})
}
});
} else {} } else {}
}).catch((res) => {}) }).catch((res) => {})
// this.info++ // 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
}
}, },
} }
} }
@ -264,8 +270,8 @@
width: 85%; width: 85%;
display: flex; display: flex;
.bottom-btn { .bottom-btn {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 45%; width: 45%;
line-height: 35px; line-height: 35px;

44
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">
@ -9,9 +9,10 @@
<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>
<!-- <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-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-forms-item label="货号" name="productSn" required>
<uni-easyinput type="text" v-model="formData.productSn" placeholder="请输入货号" trim="all" /> <uni-easyinput type="text" v-model="formData.productSn" placeholder="请输入货号" trim="all" />
</uni-forms-item> </uni-forms-item>
@ -70,13 +71,17 @@
</uni-forms-item> --> </uni-forms-item> -->
</uni-forms> </uni-forms>
<u-button type="primary" @tap.stop="submit(ret)">保存</u-button> <u-button type="primary" @tap.stop="submit(ret)">保存</u-button>
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint"></kk-printer>
</view> </view>
<!-- <u-modal v-model="show" :content="content"></u-modal> --> <!-- <u-modal v-model="show" :content="content"></u-modal> -->
</view> </view>
</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 {
@ -94,7 +99,8 @@
}, },
categoryList: [], categoryList: [],
arrtList: [], arrtList: [],
arrtChange: [], arrtChange: [],
bufferData: '',
attributeList: {}, attributeList: {},
rules: { rules: {
// 对name字段进行必填验证 // 对name字段进行必填验证
@ -149,6 +155,9 @@
fileList1: [], fileList1: [],
} }
} }
},
components:{
kkPrinter
}, },
onShow() { onShow() {
let that = this let that = this
@ -315,7 +324,28 @@
}).catch(err => { }).catch(err => {
console.log('表单错误信息:', 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> </script>

159
pages/inventory/addinventory.vue

@ -28,7 +28,7 @@
<view class="list-name">供应商</view> <view class="list-name">供应商</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请选择供应商" disabled <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> <uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view> </view>
</view> </view>
@ -51,53 +51,22 @@
</u-grid-item> </u-grid-item>
</u-grid> </u-grid>
</view> </view>
<!-- <view class="shop-box"> <view class="shop-box" style="border-top:5px solid #eee;" v-for="item in carList" :key="item">
<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-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" style="margin-left: 112rpx;line-height: 80rpx;"></uni-icons> -->
</view> </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'>
</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>
</view> </view>
@ -147,7 +116,7 @@
<text style="color: #ffa200;">¥20.00</text> <text style="color: #ffa200;">¥20.00</text>
</view> </view>
<view class="bottom-right"> <view class="bottom-right">
<button class="bottom-btn">入库</button> <button class="bottom-btn" @tap='inventorySubmit'>入库</button>
</view> </view>
</view> </view>
</view> </view>
@ -167,11 +136,19 @@
manufacturer: '', manufacturer: '',
price: '', price: '',
single: '' single: ''
}, },
khName:[],
carList:[]
} }
},
onShow(){
this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
this.carList = this.carList || ''
},
onLoad(){
}, },
methods: { methods: {
scanCodeAdd() { scanCodeAdd() {
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
@ -190,24 +167,54 @@
}, },
goodsAdd() { goodsAdd() {
uni.navigateTo({ uni.navigateTo({
url:"/pages/inventory/goodsList?type=" + 'inventory' url:"/pages/billing/changeGoods1?type=" + 'inventory'
}) })
},
//跳转选择供应商
goPopleList(popleType) {
uni.navigateTo({
url: '/pages/index/peopleList?popleType=' + popleType
})
}, },
/** inventorySubmit() {
* 复写 binddata 方法,如果只是为了校验,无复杂自定义操作,可忽略此方法 console.log(this.khName)
* @param {String} name 字段名称 console.log(this.carList)
* @param {String} value 表单域的值 let purchase = {
*/ alreadyPay:0, //已付金额
// binddata(name,value){ discount: 10, //折扣
// 通过 input 事件设置表单指定 name 的值 noPay:1111, //未支付金额
// this.$refs.form.setValue(name, value) realAmount:1111, //实际金额
// }, shopId:'002',
// 触发提交表单 shouldPay: 1111, //应付金额
submit() { totalAmount: 1111, //总数量
this.$refs.form.validate().then(res => { }
console.log('表单数据信息:', res); let purchaseDetails = [{
}).catch(err => { allPrice: 1111,
console.log('表单错误信息:', err); 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 { .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-name {
@ -312,6 +320,16 @@
color: #088FEB !important; color: #088FEB !important;
} }
} }
.shop-productName {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 20rpx;
}
.shop-productName view {
height: 55rpx;
}
.shop-collapse { .shop-collapse {
border-radius: 1px solid #eee; border-radius: 1px solid #eee;
@ -323,19 +341,6 @@
border-right: 1px solid #eee; 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 { .price-box-title {
width: 95%; width: 95%;
height: 80rpx; height: 80rpx;

6
pages/inventory/inventory.vue

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

Loading…
Cancel
Save