wangfukang 3 years ago
parent
commit
01f86efe53
  1. 88
      pages/billing/changeGoods1.vue
  2. 8
      pages/index/addHangOrder.vue
  3. 7
      pages/index/order.vue
  4. 144
      pages/index/orderDetail.vue
  5. 3
      pages/index/shareStyle.vue
  6. 62
      pages/inventory/addinventory.vue
  7. 60
      pages/inventory/changeGoods1.vue
  8. 58
      pages/inventory/goodsList1.vue
  9. 271
      pages/inventory/inventoryConfirm.vue

88
pages/billing/changeGoods1.vue

@ -89,7 +89,14 @@
</view>
</li>
</ul>
<view style="padding-bottom:160rpx;">
<view style="padding-bottom:160rpx;">
<view class="checkList" v-if="temporaryList != ''">
<view class="checkList-box" style="width: 67%;">
<text style="width: 300rpx;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;">规格</text>
<text style="font-size: 30rpx;color: #000;font-weight: bold;width: 110rpx;display: inline-block;text-align: right;">库存</text>
</view>
<uni-number-box max='1000000' @minus='minusNum' @plus="plusNum" v-model="allChangeNum" @blur="allChange"/>
</view>
<view class="checkList" v-for="(item,index) in temporaryList" :key="index">
<view @tap.stop="delCarData(index)" style="margin-right: 20rpx">
<uni-icons color="red" type="minus" size="26"></uni-icons>
@ -174,10 +181,12 @@
searchName: '', //搜索框输入值
shopId: '', //店铺id,
checkbox: [], //需要分享的商品id
temporaryNum: 0,
temporaryNum: 0,
allChangeNum:0,
goodsDetail: [],
attrNameList: [],
temporaryList: [],
temporaryList: [],
isPlusAndMinus:false,
carList: [],
columns: [],
keyList: [],
@ -270,6 +279,36 @@
this.goodsDetail.attributeList[i].value[m].isChecked = false
}
}
},
allChange(e){
//监听到输入框改变,给所有的都赋值
if(this.isPlusAndMinus == false){
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount = Number(e.detail.value)
}
}
this.isPlusAndMinus == false
this.temporaryChange()
},
plusNum(){
this.isPlusAndMinus == true
//监听到点击+的操作,给所有的都+1
for(var i=0;i<this.temporaryList.length;i++){
if(this.temporaryList[i].productCount == undefined){
this.temporaryList[i].productCount = 1
}else{
this.temporaryList[i].productCount++
}
}
this.temporaryChange()
},
minusNum(){
this.isPlusAndMinus == true
//监听到点击-的操作,给所有的都-1
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount--
}
this.temporaryChange()
},
attrNameChange(index, data1,index1) {
this.goodsDetail.attributeList[index].isChecked = !this.goodsDetail.attributeList[index].isChecked;
@ -455,7 +494,9 @@
this.$refs.carPopup.open('bottom')
this.carType = this.carList.length
} else {
this.productId = item.id
this.productId = item.id
this.goodsList = []
this.allChangeNum = 0
this.checkGoods(item);
this.$refs.popup.open('bottom')
}
@ -511,7 +552,7 @@
}
valueObj.push({
value: newObj[val][i],
isChecked: isTrue
isChecked: false
})
that.dataObj.set(newObj[val][i],val)
isTrue = false
@ -1073,23 +1114,26 @@
}
}
.attrs {
text {
display: inline-block;
border: 1px solid #5fd9ee;
margin: 20rpx;
background-color: #fff;
color: #5fd9ee;
width: 100rpx;
line-height: 70rpx;
height: 70rpx;
text-align: center;
}
.checkedText {
background-color: $u-primary;
color: #fff;
}
.attrs {
text {
display: inline-block;
border: 1px solid #5fd9ee;
margin: 20rpx;
background-color: #fff;
color: #5fd9ee;
padding: 0 10px;
min-width: 100rpx;
line-height: 35px;
height: 70rpx;
text-align: center;
border-radius: 20rpx;
}
.checkedText {
background-color: #5fd9ee;
color: #fff;
border-radius: 20rpx;
}
}
.shop-mask {

8
pages/index/addHangOrder.vue

@ -122,8 +122,12 @@
</li>
</ul>
<view style="padding-bottom: 100rpx;">
<view style="width: 130px;margin-left: 460rpx;">
<uni-number-box max='1000000' v-if="temporaryList != ''" @minus='minusNum' @plus="plusNum" v-model="allChangeNum" @blur="allChange" />
<view class="shop-checkList" v-if="temporaryList != ''">
<view class="shop-checkList-box" style="width:67%;">
<text style="width: 300rpx;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;">规格</text>
<text style="font-size: 30rpx;color: #000;font-weight: bold;width: 110rpx;display: inline-block;text-align: right;">库存</text>
</view>
<uni-number-box max='1000000' @minus='minusNum' @plus="plusNum" v-model="allChangeNum" @blur="allChange" />
</view>
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index">
<view @tap.stop="delCarData(index)" style="margin-right: 20rpx">

7
pages/index/order.vue

@ -26,7 +26,7 @@
{{'&nbsp;&nbsp;&nbsp;&nbsp; 欠款: '}} </text> <text class="priceText">{{item.noEarn == null ?'暂无':item.noEarn}}
</text></view>
<view class="uni-body"> <text class="cardText">
订单状态:</text>{{item.status == 0 ?'待抢单' :item.status == 1 ?'待取货':item.status == 2 ?'作废' :item.status == 3 ?'待送达' :item.status == 4 ?'已完成' :item.status == 5 ?'下游客户待退货' :item.status == 00 ?'退货待抢单' :item.status == 01 ?'退货待取货' :item.status == 03 ?'退货待送达' :item.status == 04 ?'待确认退货' :item.status == 6 ?'待配货' :'挂单'}}
订单状态:</text>{{item.status == '0' ?'待抢单' :item.status == '1' ?'待取货':item.status == '2' ?'作废' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货' :'挂单'}}
</view>
<view class="floatRight" v-if="item.status == 6" @tap.stop="goSaleGoods(item)">去开单</view>
<view class="floatRight" style="color: red;width: 150rpx;" @tap.stop="delItemModal(item)" v-if="item.status == 6">删除订单</view>
@ -39,10 +39,7 @@
</ul>
</view>
<u-empty v-else mode="order" margin-top="200"></u-empty>
<!-- <view class="order-bottom" v-if="btnStatus==false">
<button>批量打印商品码</button>
</view> -->
<u-empty v-else mode="order" margin-top="200"></u-empty>
</view>
</template>

144
pages/index/orderDetail.vue

@ -230,7 +230,7 @@
<view class="tui-order-flex">
<view class="tui-item-title">配送状态:</view>
<view class="tui-item-content">
{{ sales.status == 0 ?'待抢单' :sales.status == 1 ?'待取货' :sales.status == 2 ?'作废':sales.status == 3 ?'待送达' :sales.status == 4 ?'已完成' :sales.status == 5 ?'下游客户待退货' :sales.status == 00 ?'退货待抢单' :sales.status == 01 ?'退货待取货' :sales.status == 03 ?'退货待送达' :sales.status == 04 ?'待确认退货' :sales.status == 6 ?'待配货' :'挂单'}}
{{ sales.status == '0' ?'待抢单' :sales.status == '1' ?'待取货' :sales.status == '2' ?'作废':sales.status == '3' ?'待送达' :sales.status == '4' ?'已完成' :sales.status == '5' ?'下游客户待退货' :sales.status == '00' ?'退货待抢单' :sales.status == '01' ?'退货待取货' :sales.status == '03' ?'退货待送达' :sales.status == '04' ?'待确认退货' :sales.status == '6' ?'待配货' :'挂单'}}
</view>
</view>
</view>
@ -246,7 +246,8 @@
<view class="tui-btn-mr" v-if="sales.status != 6 && sales.status != 2">
<kk-printer ref="kkprinter" :bufferData="bufferData" :defaultText="'打印小票'" @onPrintSmall="onPrintSmall"></kk-printer>
</view>
<view class="tui-btn-mr" v-if="sales.status == 0 || sales.status == 1" @click="cancelOrder">取消订单</view>
<view class="tui-btn-mr" v-if="sales.status == 0 || sales.status == 1" @click="cancelOrder('qxdd')">取消订单</view>
<view class="tui-btn-mr" v-if="sales.status == '0' || sales.status == '1' || sales.status == '00' || sales.status == '01'" @click="cancelOrder('qxps')">取消配送</view>
<view class="tui-btn-mr" v-if="sales.status == 4" @click="returnGoods">{{ !isReturn ? '退货' : '确认退货'}}</view>
<view class="tui-btn-mr" @tap="inputDialogToggle()" v-if="sales.status != 6 && !editNoPrice && sales.status != 2 && sales.noEarn >0">回款</view>
</view>
@ -356,7 +357,12 @@
},
onShow() {
this.lbgName = JSON.parse(JSON.stringify(this.lbgName))
this.type = uni.getStorageSync('type')
this.type = uni.getStorageSync('type')
// 初始化蓝牙模块
wx.openBluetoothAdapter({ //111
mode: 'central',
success: (res2) => {}
})
},
onLoad(option) {
if (option.id != null && option.id != undefined && option.id != "") {
@ -428,6 +434,7 @@
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:' + this.order.name)
strCmd += blesdk.addCPCLText('280', '100', '24', '0', 0, this.sales.id)
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:' + this.sales.createByName)
strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:' + this.sales.createTime)
strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0,
@ -513,51 +520,58 @@
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.sales.otherExpense))
}
if(Math.ceil(Number(this.sales.remark.length) / 20 ) *30 + this.yNum < this.printTotal){
if(this.sales.remark.length >20){
let position = 20;
let part1 = this.sales.remark.substring(0, position);
let part2 = this.sales.remark.substring(position);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1)
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2)
}else{
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark)
}
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
}else{
this.yNum = 0
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
if(this.sales.remark.length >20){
let position = 20;
let part1 = this.sales.remark.substring(0, position);
let part2 = this.sales.remark.substring(position);
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
if(this.sales.remark){
if(Math.ceil(Number(this.sales.remark.length) / 20 ) *30 + this.yNum < this.printTotal){
if(this.sales.remark.length >20){
let position = 20;
let part1 = this.sales.remark.substring(0, position);
let part2 = this.sales.remark.substring(position);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1)
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2)
}else{
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark)
}
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1)
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2)
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
}else{
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
this.yNum = 0
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
strCmd = ''
if(this.sales.remark.length >20){
let position = 20;
let part1 = this.sales.remark.substring(0, position);
let part2 = this.sales.remark.substring(position);
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + part1)
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, part2)
}else{
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark)
}
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', this.countPrint(), '24', '0', 0, '备注:' + this.sales.remark)
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
}
}else{
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
}
console.log("传值之前",this.bufferData)
this.$nextTick(()=>{
uni.redirectTo({
url: "/pages/index/order"
uni.hideLoading();
that.$nextTick(()=>{
uni.navigateBack({
delta: 1
})
})
console.log("传值之前",this.bufferData)
},
//打印贴包单
onPrint(opt) {
@ -596,7 +610,8 @@
strCmd += blesdk.addCPCLText('50', '890', '24', '0', 0, '地址:' + this.shopData.shopAddress)
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
this.bufferData.push(strCmd);
uni.hideLoading();
},
//计算打印机当前行高度
countPrint(){
@ -774,7 +789,8 @@
},
close() {
this.popupShow = false
},
},
//调用退货接口
sureReturn() {
if (this.radio1 == 0 && this.changeA == '') {
this.tui.toast("请输入取货地址")
@ -795,7 +811,11 @@
}
}
}
for (var i = 0; i < this.list.length; i++) {
for (var i = 0; i < this.list.length; i++) {
if(this.list[i].stockLogList.length == 0){
this.tui.toast("请选择退货商品")
return;
}
for (var m = 0; m < this.list[i].stockLogList.length; m++) {
if(this.list[i].stockLogList[m].returnCount <= 0){
this.tui.toast("退货数量不能为零")
@ -873,23 +893,39 @@
},
logistics() {
this.tui.href("/pages/my/logistics/logistics")
},
cancelOrder() {
// 撤销订单
},
// 取消订单
cancelOrder(type) {
this.tui.modal("提示", "您确定要取消该订单吗?", true, (res) => {
if (res) {
var status;
if (this.sales.status == 0 || this.sales.status == 1) {
status = 2
} else if (this.sales.status == '00' || this.sales.status == '01') {
status = '02'
var data={},url
if (type == 'qxdd') {
data = {
status: 2,
orderId: this.sales.id
}
url = '/app/sale/status'
}else{
if(this.sales.status == '0' || this.sales.status == '1'){
//开单取消配送
data = {
status: 4,
orderId: this.sales.id
}
url = '/app/sale/status'
}else{
data = {
orderId: this.inventoryList[0].id
}
url = '/app/return/cancelOrder'
}
}
this.tui.request("/app/sale/status", "POST", {
orderId: this.sales.id,
status: status
}, true, true).then((res1) => {
this.tui.request(url, "POST", data, true, true).then((res1) => {
if (res1.code == 200) {
this.tui.toast("取消订单成功")
this.tui.toast("取消成功")
uni.navigateBack()
} else {
this.tui.toast(res.message)

3
pages/index/shareStyle.vue

@ -448,7 +448,8 @@
.content-left {
width: 170rpx;
background: #eee;
height: 100%;
height: 100%;
overflow: scroll;
}
.left-box {

62
pages/inventory/addinventory.vue

@ -47,7 +47,7 @@
<!-- <text style="color: red;">单价:¥{{item.price}}</text> -->
<view style="text-align: left;padding-left: 5px;width:50%;display: flex;">数量:<uni-number-box
max="100000" style="margin-top:16rpx;" v-model="values[1].productCount"
@change="GoodsNumChange($event,value,values)" /></view>
@change="GoodsNumChange($event,value,values[0])" /></view>
</view>
<view
style="position: absolute;top: 130rpx;right: 40rpx;color: blue;text-decoration: underline;"
@ -139,8 +139,12 @@
</li>
</ul>
<view style="padding-bottom: 100rpx;">
<view style="width: 130px;margin-left: 460rpx;">
<uni-number-box max='1000000' v-if="temporaryList != ''" @minus='minusNum' @plus="plusNum" v-model="allChangeNum" @blur="allChange" />
<view class="shop-checkList" v-if="temporaryList != ''">
<view class="shop-checkList-box" style="width:67%;">
<text style="width: 300rpx;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;">规格</text>
<text style="font-size: 30rpx;color: #000;font-weight: bold;width: 110rpx;display: inline-block;text-align: right;">库存</text>
</view>
<uni-number-box max='1000000' @minus='minusNum' @plus="plusNum" v-model="allChangeNum" @blur="allChange" />
</view>
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index">
<view @tap.stop="delCarData(index)" style="margin-right: 20rpx">
@ -148,7 +152,7 @@
</view>
<view class="shop-checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text
style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
style="color:#777;font-size: 12px;">{{item.productNum}}</text>
</view>
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" />
</view>
@ -561,7 +565,8 @@
},
//弹出商品规格选择
toggle(type, id) {
if (type == 'bottom') {
if (type == 'bottom') {
this.allChangeNum = 0
this.getById(id);
}
},
@ -612,7 +617,7 @@
that.zNum = 0
that.$nextTick(() => {
that.carList.forEach(function(value, key) {
if (that.carList.has(id) == true) {
if (value.productId == id) {
that.zNum = value.productCount
that.temporaryList = value.stockLogList1
that.pageOldTemList = value.stockLogList1
@ -967,40 +972,15 @@
return;
}
let obj = {
productCount: values,
productCount: values.productCount,
attributeList: keys
}
value.stockLogList1.push(obj)
})
purchaseDetails.push(value)
})
uni.showModal({
title: "提示",
content: "请再次确认供应商、商品库存、规格是否正确,入库后不可修改。确认入库吗?",
success: function(res) {
if (res.confirm) {
that.tui.request("/app/stock/putInOfProduct", "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'
})
}
})
}
that.$forceUpdate()
}
uni.navigateTo({
url: '/pages/inventory/inventoryConfirm?purchase=' + JSON.stringify(purchase) + '&purchaseDetails=' + JSON.stringify(purchaseDetails)
})
},
//编辑每一个的单价
@ -1032,13 +1012,13 @@
//修改已选规格的数量
GoodsNumChange(e, index, index1) {
let that = this;
this.carList.get(index).stockLogList.set(index1, e)
this.carList.get(index).productCount = 0
this.carList.get(index).stockLogList.forEach(function(value, key) {
that.carList.get(index).productCount = that.carList.get(index).productCount + value
that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index).purchasePrice
})
this.getAllPrice();
this.carList.get(index[0]).stockLogList.get(index1).productCount = e
this.carList.get(index[0]).productCount = 0
this.carList.get(index[0]).stockLogList.forEach(function(value, key) {
that.carList.get(index[0]).productCount = that.carList.get(index[0]).productCount + value.productCount
that.carList.get(index[0]).price = that.carList.get(index[0]).productCount * that.carList.get(index[0]).purchasePrice
})
that.getAllPrice()
}
}
}

60
pages/inventory/changeGoods1.vue

@ -99,14 +99,21 @@
</view>
</li>
</ul>
<view style="padding-bottom: 100rpx;">
<view style="padding-bottom: 100rpx;">
<view class="checkList" v-if="temporaryList != ''">
<view class="checkList-box" style="width: 67%;">
<text style="width: 300rpx;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;">规格</text>
<text style="font-size: 30rpx;color: #000;font-weight: bold;width: 110rpx;display: inline-block;text-align: right;">库存</text>
</view>
<uni-number-box max='1000000' @minus='minusNum' @plus="plusNum" v-model="allChangeNum" @blur="allChange" />
</view>
<view class="checkList" v-for="(item,index) in temporaryList" :key="index">
<view @tap.stop="delCarData(index)" style="margin-right: 20rpx">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text
style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
style="color:#777;font-size: 12px;">{{item.productNum}}</text>
</view>
<uni-number-box max="100000" v-model="item.productCount" @change="temporaryChange" />
</view>
@ -187,7 +194,8 @@
searchName: '', //搜索框输入值
shopId: '', //店铺id,
checkbox: [], //需要分享的商品id
temporaryNum: 0,
temporaryNum: 0,
allChangeNum:0,
goodsDetail: [],
attrNameList: [],
temporaryList: [],
@ -203,7 +211,8 @@
carNum: 0,
carType: 0,
productId: '',
productNum: 0,
productNum: 0,
isPlusAndMinus:false,
height: 0,
oldTemList:[],
pageOldTemList:[],
@ -286,6 +295,36 @@
this.goodsDetail.attributeList[i].value[m].isChecked = false
}
}
},
allChange(e){
//监听到输入框改变,给所有的都赋值
if(this.isPlusAndMinus == false){
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount = Number(e.detail.value)
}
}
this.isPlusAndMinus == false
this.temporaryChange()
},
plusNum(){
this.isPlusAndMinus == true
//监听到点击+的操作,给所有的都+1
for(var i=0;i<this.temporaryList.length;i++){
if(this.temporaryList[i].productCount == undefined){
this.temporaryList[i].productCount = 1
}else{
this.temporaryList[i].productCount++
}
}
this.temporaryChange()
},
minusNum(){
this.isPlusAndMinus == true
//监听到点击-的操作,给所有的都-1
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount--
}
this.temporaryChange()
},
attrNameChange(index, data1,index1) {
this.goodsDetail.attributeList[index].isChecked = !this.goodsDetail.attributeList[index].isChecked;
@ -477,7 +516,8 @@
this.$refs.carPopup.open('bottom')
} else {
this.productId = item.id
this.goodsList = []
this.goodsList = []
this.allChangeNum = 0
this.checkGoods(item);
this.$refs.popup.open('bottom')
}
@ -488,8 +528,6 @@
let that = this;
this.goodsDetail = item;
this.temporaryList = []
this.columns = []
this.keyList = []
if (this.carList != '') {
this.zNum = 0
for (let i = 0; i < this.carList.length; i++) {
@ -534,7 +572,7 @@
}
valueObj.push({
value: newObj[val][i],
isChecked: isTrue
isChecked: false
})
that.dataObj.set(newObj[val][i],val)
isTrue = false
@ -545,11 +583,7 @@
})
}
console.log(that.dataObj)
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
})
this.goodsDetail.attributeList = newArr;
console.log('看看看看',this.goodsDetail.attributeList)
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
let oldCheck = false

58
pages/inventory/goodsList1.vue

@ -88,7 +88,7 @@
<text>{{values[0] | sliceMsg}}</text>
<view style="text-align: left;padding-left: 5px;width:50%;display: flex;">
数量:<uni-number-box max="100000" style="margin-top:16rpx;" v-model="values[1].productCount"
@change="GoodsNumChange($event,value,values)" /></view>
@change="GoodsNumChange($event,value,values[0])" /></view>
</view>
</view>
</view>
@ -313,8 +313,12 @@
</li>
</ul>
<view style="padding-bottom:100rpx;">
<view style="width: 130px;margin-left: 460rpx;">
<uni-number-box max='1000000' v-if="temporaryList != ''" @minus='minusNum' @plus="plusNum" v-model="allChangeNum" @blur="allChange" />
<view class="shop-checkList" v-if="temporaryList != ''">
<view class="shop-checkList-box" style="width: 67%;">
<text style="width: 300rpx;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;">规格</text>
<text style="font-size: 30rpx;color: #000;font-weight: bold;width: 110rpx;display: inline-block;text-align: right;">库存</text>
</view>
<uni-number-box max='1000000' @minus='minusNum' @plus="plusNum" v-model="allChangeNum" @blur="allChange" />
</view>
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index">
<view @tap.stop="delCarData(index)" style="margin-right: 20rpx">
@ -322,7 +326,7 @@
</view>
<view class="shop-checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text
style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
style="color:#777;font-size: 12px;">{{item.productNum}}</text>
</view>
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" />
</view>
@ -499,7 +503,8 @@
customPrice: 0, //选择自定义金额
remark: '',
pbAddress: '',
carList1: [],
carList1: [],
isPlusAndMinus:false,
radioType1: 0,
saleId: '',
saleDetailList: [],
@ -1004,7 +1009,8 @@
//弹出商品规格选择
toggle(type, id) {
this.type = type
if (type == 'bottom') {
if (type == 'bottom') {
this.allChangeNum = 0
this.getById(id);
}
},
@ -1115,7 +1121,9 @@
that.zNum = 0
that.$nextTick(() => {
that.carList.forEach(function(value, key) {
if (that.carList.has(id) == true) {
console.log('是否相同',value)
console.log(id)
if (value.productId == id) {
that.zNum = value.productCount
that.temporaryList = value.stockLogList1
that.pageOldTemList = value.stockLogList1
@ -1286,7 +1294,6 @@
this.wlName = ''
this.kdyName = ''
this.lbgName = ''
//快递0 物流1 发车2 拼包3 自送4
this.radioType = e.detail.value;
for (let i = 0; i < this.logisticsType.length; i++) {
if (this.logisticsType[i].value === e.detail.value) {
@ -1555,7 +1562,7 @@
return;
}
let obj = {
productCount: values,
productCount: values.productCount,
attributeList: keys
}
value.stockLogList1.push(obj)
@ -1638,11 +1645,11 @@
value.stockLogList.forEach(function(value1, key1) {
if (that.countPrint() < that.printTotal) {
strCmd += blesdk.addCPCLText('0', that.yNum, '24', '0', 0, (that.slicePrint(
key1)) + '*' + value1)
key1)) + '*' + value1.productCount)
strCmd += blesdk.addCPCLText('280', that.yNum, '24', '0', 0, '单价:' + value
.discountAmount)
strCmd += blesdk.addCPCLText('440', that.yNum, '24', '0', 0, '总价:' + (value
.discountAmount * value1))
.discountAmount * value1.productCount))
} else {
that.yNum = 0
strCmd += blesdk.addCPCLPrint();
@ -1652,11 +1659,11 @@
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLText('0', (that.yNum += 30), '24', '0', 0, (that
.slicePrint(
key1)) + '*' + value1)
key1)) + '*' + value1.productCount)
strCmd += blesdk.addCPCLText('280', that.yNum, '24', '0', 0, '单价:' + value
.discountAmount)
strCmd += blesdk.addCPCLText('440', that.yNum, '24', '0', 0, '总价:' + (value
.discountAmount * value1))
.discountAmount * value1.productCount))
}
})
})
@ -1746,7 +1753,7 @@
this.bufferData.push(strCmd);
}
uni.hideLoading();
this.$nextTick(() => {
this.$refs.showPopup.close()
that.clearAll1()
@ -1902,18 +1909,21 @@
},
//修改已选规格的数量
GoodsNumChange(e, index, index1) {
let that = this;
this.carList.get(index).stockLogList.set(index1, e)
this.carList.get(index).productCount = 0
this.carList.get(index).stockLogList.forEach(function(value, key) {
that.carList.get(index).productCount = that.carList.get(index).productCount + value
let that = this;
console.log(index[0])
console.log(index1)
console.log(this.carList)
this.carList.get(index[0]).stockLogList.get(index1).productCount = e
this.carList.get(index[0]).productCount = 0
this.carList.get(index[0]).stockLogList.forEach(function(value, key) {
that.carList.get(index[0]).productCount = that.carList.get(index[0]).productCount + value.productCount
if (that.discountType == 0) { //单品折扣
that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(
index)
.discountAmount * that.carList.get(index).discount / 10
that.carList.get(index[0]).price = that.carList.get(index[0]).productCount * that.carList.get(
index[0])
.discountAmount * that.carList.get(index[0]).discount / 10
} else {
that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(
index)
that.carList.get(index[0]).price = that.carList.get(index[0]).productCount * that.carList.get(
index[0])
.unitPrice
}
})

271
pages/inventory/inventoryConfirm.vue

@ -0,0 +1,271 @@
<template>
<view class="container">
<uni-card :title="(purchase.supplierName == null ?'暂无':purchase.supplierName)" thumbnail="/static/images/dingdan/dd0.png">
<!-- <view class="uni-body" v-if="supplier.province">{{supplier.province + supplier.area + supplier.city + supplier.address}} </view> -->
</uni-card>
<view class="tui-order-item boxbg">
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(item,index) in purchaseDetails" :key="index">
<view class="shop-name">
<img class="img-radius" :src="item.productPicture" alt="" style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
<view class="shop-productName">
<view style="color:#FF5809;">{{item.productName == null ?'暂无':item.productName}}</view>
<view>货号:{{item.productSn == null ?'暂无':item.productSn}}</view>
<view><text v-if="type==0">单价:{{item.purchasePrice == null ?'暂无':item.purchasePrice}} </text><text style="padding: 0 5rpx;">数量:{{item.productCount == null ?'暂无':item.productCount}} </text><text v-if="type==0">总价:{{item.price == null ?'暂无':item.price}}</text></view>
</view>
</view>
<view class="shop-type">
<view class="shop-collapse" v-for="(items,index) in item.stockLogList1" :key='index'>
<text>{{items.attributeList | sliceMsg}}</text>
<!-- <text style="color: red;">单价:¥{{item.price}}</text> -->
<text>数量:{{items.productCount == null ?'暂无':items.productCount}}</text>
</view>
</view>
</view>
<view class="tui-goods-info" style="width: 95%;margin: 0 auto;">
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">应付金额</view>
<view class="tui-goods-price">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ purchase.shouldPay == null ?'暂无':purchase.shouldPay }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">已付金额</view>
<view class="tui-goods-price">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ purchase.alreadyPay == null ?'暂无':purchase.alreadyPay }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">欠款</view>
<view class="tui-goods-price tui-primary-color">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ purchase.noPay == null ?'暂无':purchase.noPay}}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">其他费用</view>
<view class="tui-goods-price tui-primary-color">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ purchase.otherPay == null ?'暂无':purchase.otherPay}}</view>
</view>
</view>
<view class="tui-price-flex tui-size32">
<view class="tui-flex-shrink">备注</view>
<view class="tui-goods-price">
<uni-tooltip :content="purchase.remark == null ?'暂无':purchase.remark" placement="left">
<view style="font-size: 13px;width: 200px;height: 40rpx;overflow: hidden;text-align: right;">{{ sales.remark == null ?'':sales.remark}}</view>
<text style="color: blue;">查看更多</text>
</uni-tooltip>
</view>
</view>
</view>
</view>
<view class="tui-tabbar">
<view class="tui-btn-mr" @click="inventorySubmit">确认提交</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
purchase:'',
purchaseDetails:''
}
},
filters: {
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
}
},
onLoad(option) {
this.purchaseDetails = JSON.parse(option.purchaseDetails)
this.purchase = JSON.parse(option.purchase)
console.log(this.purchaseDetails)
console.log(this.purchase)
},
methods: {
inventorySubmit() {
this.tui.request("/app/stock/putInOfProduct", "post", {
purchase: this.purchase,
purchaseDetails: this.purchaseDetails
}, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "入库成功",
icon: 'none'
})
setTimeout(res => {
uni.switchTab({
url: '/pages/index/index'
});
}, 1000)
} else {
uni.showToast({
title: "入库失败",
icon: 'none'
})
}
})
}
},
}
</script>
<style lang="scss">
.container {
padding-bottom: 118rpx;
.boxbg {
background-color: #fff;
margin: 30upx;
padding: 20upx;
border-radius: 10upx;
box-shadow: 0px 1px 10px 2px #e2e2e2;
}
.tui-order-item {
.u-collapse-content {
display: flex;
justify-content: space-between;
line-height: 30px;
}
.tui-goods-info {
width: 100%;
box-sizing: border-box;
background: #fff;
line-height: 26px;
border-top: 10px solid #eee;
.tui-price-flex {
display: flex;
align-items: center;
justify-content: space-between;
}
.tui-size32 {
font-size: 32rpx;
font-weight: 500;
}
.tui-size-24 {
font-size: 24rpx;
}
.tui-price-large {
font-size: 32rpx;
}
.tui-flex-shrink {
flex-shrink: 0;
}
.tui-goods-price {
width: 100%;
display: flex;
align-items: flex-end;
justify-content: flex-end;
font-size: 24rpx;
}
.tui-primary-color {
color: #EB0909;
}
}
}
}
.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;
}
.tui-btn-mr {
width:130rpx;
height: 60rpx;
background: #088FEB;
color: #fff;
border-radius: 10px;
line-height: 60rpx;
text-align: center;
margin-right: 30rpx;
}
.shop-box {
width: 95%;
margin: 0 auto;
position: relative;
}
.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;
.uni-icons {
color: #088FEB !important;
}
}
.shop-productName {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 20rpx;
}
.shop-productName view {
height: 55rpx;
}
.shop-collapse {
display: flex;
height: 80rpx;
font-size: 26rpx;
line-height: 80rpx;
}
.shop-collapse text {
flex: 1;
text-align: center;
padding-right: 40rpx;
border-right: 1px solid #eee;
}
.noPic{
border-radius: 10px;
width: 140rpx;
height: 140rpx;
text-align: center;
line-height: 140rpx;
color: #777;
background: #eee;
}
.uni-tooltip {
display: flex !important;
}
</style>
Loading…
Cancel
Save