wangfukang 3 years ago
parent
commit
1ad982e825
  1. 30
      pages/billing/changeGoods1.vue
  2. 2
      pages/index/index.vue
  3. 4
      pages/index/order.vue
  4. 24
      pages/index/orderDetail.vue
  5. 253
      pages/inventory/AIInventory.vue
  6. 38
      pages/inventory/addinventory.vue
  7. 36
      pages/inventory/changeGoods1.vue
  8. 262
      pages/inventory/goodsList1.vue
  9. 28
      pages/inventory/inventoryDetail.vue

30
pages/billing/changeGoods1.vue

@ -318,6 +318,16 @@
if(this.isPlusAndMinus == false){
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount = Number(e.detail.value)
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
}
this.isPlusAndMinus == false
@ -332,6 +342,16 @@
}else{
this.temporaryList[i].productCount++
}
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
this.temporaryChange()
},
@ -340,6 +360,16 @@
//监听到点击-的操作,给所有的都-1
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount--
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
this.temporaryChange()
},

2
pages/index/index.vue

@ -86,7 +86,7 @@
{{ item.createTime }}
</view>
<view class="uni-body"> <text class="cardText">
订单状态:</text>{{item.status == '0' ?'待抢单' :item.status == '2' ?'作废' :item.status == '1' ?'待取货' :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 == '2' ?'作废' :item.status == '1' ?'待取货' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货':item.status == '8' ?'待物流上门':item.status == '9' ?'已完成' :'挂单'}}
</view>
</uni-card>
</li>

4
pages/index/order.vue

@ -13,7 +13,7 @@
</view>
<view class="ulList" v-if="inventoryList.length > 0" style="overflow: scroll;margin-top:300rpx;">
<ul :style="{'margin-bottom':btnStatus==false?'160rpx':''}">
<li v-for="item in inventoryList">
<li v-for="(item,index) in inventoryList" :key="index">
<checkbox-group @change="checkboxChange">
<label class="uni-list-cell uni-list-cell-pd" >
<checkbox v-if="btnStatus==false" :value="item" style="float: left;width: 60rpx;line-height: 300rpx;margin: 0 20rpx;" />
@ -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 == '2' ?'作废' :item.status == '1' ?'待取货' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货':item.status == '8' ?'待物流上门':item.status == '9' ?'已完成' :'挂单'}}
</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>

24
pages/index/orderDetail.vue

@ -240,7 +240,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 == '2' ?'作废' :sales.status == '1' ?'待取货' :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 == '8' ?'待物流上门':sales.status == '9' ?'已完成' :'挂单'}}
</view>
</view>
</view>
@ -440,8 +440,9 @@
//打印小票
onPrintSmall(){
let that = this;
let strCmd = ''
that.yNum = 150
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(2);
@ -580,18 +581,16 @@
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
}
uni.hideLoading();
that.$nextTick(()=>{
uni.navigateBack({
delta: 1
})
this.$nextTick(() => {
that.bufferData = []
uni.hideLoading();
})
console.log("传值之前",this.bufferData)
},
//打印贴包单
onPrint(opt) {
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 1);
onPrint(opt) {
let strCmd = ''
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 1);
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLText('40', '30', '24', '0', 0, '沧州明珠商贸城--快衣店')
@ -627,7 +626,10 @@
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint();
this.bufferData.push(strCmd);
uni.hideLoading();
this.$nextTick(() => {
this.bufferData = []
uni.hideLoading();
})
},
//计算打印机当前行高度
countPrint(){

253
pages/inventory/AIInventory.vue

@ -1,7 +1,7 @@
<!-- 新增库存页 -->
<template>
<view class="page1">
<view class="content">
<!-- <view class="content"> -->
<view class="content-box" style="position: fixed;top:0;z-index: 99;width: 100%;">
<view class="content-list" @tap="goPopleList('gysName')">
<view class="list-name">供应商</view>
@ -23,8 +23,9 @@
</u-grid-item>
</u-grid>
</view>
</view>
<view class="content-box" style="margin-top: 212rpx;">
</view>
<scroll-view class="scroll-content" scroll-y="true" :scroll-into-view="currentAnchor" scroll-top="0">
<view class="content-box">
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(value,key) in Array.from(carList)"
:key="key">
<view class="shop-name">
@ -72,7 +73,7 @@
</view>
<view class="shop-type">
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)"
:key="keys">
:key="keys" :id="values[1].uuid">
<view @tap.stop="delShopSpec(value[0],values[0])">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
@ -125,8 +126,9 @@
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
<!-- </view> -->
<view class="bottom-box">
<view class="bottom-left">
<text>合计:{{totalAmount}}</text>
@ -300,7 +302,8 @@
<script>
import {
mapState
} from 'vuex';
} from 'vuex';
import { generateUUID } from '@/utils/global.js'
export default {
computed: mapState(['shopName']),
data() {
@ -337,6 +340,7 @@
indexList:[],
attributeValue:[],
specifications:'',
currentAnchor: '',
temporary:[] //修改单个规格值临时存放要修改的对象
}
},
@ -448,7 +452,8 @@
}
var data1 = {
productCount: productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
name: this.carList1[i].saleDetailQueryDTO[m].name,
uuid:'A'+generateUUID()
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
@ -471,7 +476,8 @@
var data1 = {
productCount: this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount + this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
name: this.carList1[i].saleDetailQueryDTO[m].name,
uuid:'A'+generateUUID()
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
@ -480,7 +486,8 @@
} else { //规格不同
var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
name: this.carList1[i].saleDetailQueryDTO[m].name,
uuid:'A'+generateUUID()
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, data1)
@ -512,7 +519,8 @@
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
name: this.carList1[i].saleDetailQueryDTO[m].name,
uuid:'A'+generateUUID()
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
@ -613,11 +621,46 @@
}
let data = this.temporary
let specMap = new Map() //新的临时存放值那个更改过的值的数组
let similar = ''
this.carList.get(data[0]).stockLogList.forEach(function(value, key) {
if(key == data[1]){
let stringKey = key.replace(data[3],item) //拿到了更改过的key
specMap.set(stringKey,value) //name的值没有改,所有的数组都放在这个下面
that.carList.get(data[0]).stockLogList.delete(data[1])
that.tui.request("/app/stock/productCount", "post", {
productId: that.carList.get(data[0]).productId,
attributeList: stringKey
}, false, true).then((res) => {
if (res.code == 200) {
value.productNum = res.result
if(specMap.has(stringKey) == true){ //当前的数据中有相同的值
similar = specMap.get(stringKey).uuid
specMap.get(stringKey).productCount += value.productCount
}else{
value.uuid = 'A'+generateUUID();
specMap.set(stringKey,value) //name的值没有改,所有的数组都放在这个下面
}
that.$forceUpdate()
that.carList.get(data[0]).stockLogList.delete(data[1])
} else {
that.tui.toast(res.message)
}
}).catch((res) => {})
that.$nextTick(()=>{
setTimeout(res => {
if(similar != ''){
that.currentAnchor = '#'+similar;
}else{
that.currentAnchor = '#'+value.uuid;
}
console.log(that.currentAnchor)
}, 200)
})
that.$nextTick(()=>{
setTimeout(res => {
that.currentAnchor = ""
similar = ''
console.log(that.currentAnchor)
}, 1000)
})
}
})
if(this.carList.get(data[0]).stockLogList.size > 0){
@ -626,8 +669,11 @@
})
}
this.carList.get(data[0]).stockLogList = specMap
this.$forceUpdate()
this.$refs.getaPopup.close()
setTimeout(res => {
this.$forceUpdate()
this.$refs.getaPopup.close()
}, 200)
},
inputDialogToggle(item) {
this.inputVal = '';
@ -833,6 +879,16 @@
if(this.isPlusAndMinus == false){
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount = Number(e.detail.value)
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
}
this.isPlusAndMinus == false
@ -847,6 +903,16 @@
}else{
this.temporaryList[i].productCount++
}
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
this.temporaryChange()
},
@ -855,6 +921,16 @@
//监听到点击-的操作,给所有的都-1
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount--
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
this.temporaryChange()
},
@ -1048,6 +1124,9 @@
//通过商品id查询商品详细信息
getById(id,current) {
let that = this;
uni.showLoading({
title: '加载中...'
})
console.log(id)
if(current == 1){
that.goodsDetail = id;
@ -1064,7 +1143,62 @@
this.tui.toast(res.message)
}
}).catch((res) => {})
}
}
this.$nextTick(()=>{
setTimeout(res => {
that.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: that.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
that.goodsList = []
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
let dataArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
that.dataObj.set(newObj[val][i], val)
// isTrue = false
}
newArr.push({
name: val,
value: valueObj
})
}
that.goodsDetail.attributeList = newArr;
for (var i = 0; i < that.goodsDetail.attributeList.length; i++) {
let oldCheck = false
let oldValue = []
for (var m = 0; m < that.goodsDetail.attributeList[i].value
.length; m++) {
if (that.goodsDetail.attributeList[i].value[m].isChecked == true) {
oldCheck = true
oldValue.push(that.goodsDetail.attributeList[i].value[m].value)
}
}
let specs1 = {
specs: []
}
that.goodsList.push(specs1)
oldCheck = false
oldValue = []
}
} else {
that.tui.toast('失败了')
}
} else {
that.tui.toast(res1.message)
}
}).catch((res) => {})
}, 300)
})
this.pageOldTemList = []
that.temporaryList = []
@ -1113,62 +1247,14 @@
})
}
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
this.goodsList = []
this.$refs.shopPopup.open('bottom')
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
let dataArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
this.dataObj.set(newObj[val][i], val)
// isTrue = false
}
newArr.push({
name: val,
value: valueObj
})
}
this.goodsDetail.attributeList = newArr;
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
let oldCheck = false
let oldValue = []
for (var m = 0; m < this.goodsDetail.attributeList[i].value
.length; m++) {
if (this.goodsDetail.attributeList[i].value[m].isChecked == true) {
oldCheck = true
oldValue.push(this.goodsDetail.attributeList[i].value[m].value)
}
}
let specs1 = {
specs: []
}
this.goodsList.push(specs1)
oldCheck = false
oldValue = []
}
} else {
this.tui.toast('失败了')
}
} else {
this.tui.toast(res1.message)
}
}).catch((res) => {})
this.getKCList(current == 1?id.id:id);
setTimeout(res => {
this.getKCList(current == 1?id.id:id);
}, 300)
},
//库存商品详情
getKCList(id) {
getKCList(id) {
let that = this
this.tui.request("/app/stock/productCount", "GET", {
productId: id
}, false, true).then((res) => {
@ -1179,8 +1265,10 @@
}
}).catch((res) => {})
setTimeout(res => {
that.$forceUpdate()
uni.hideLoading();
}, 200)
this.$refs.shopPopup.open('bottom')
}, 1000)
},
temporaryChange(val) {
this.zNum = 0
@ -1197,10 +1285,10 @@
let that = this,
carList1 = []
let data = {
id: this.goodsDetail.id,
id: this.goodsDetail.productId?this.goodsDetail.productId:this.goodsDetail.id,
price: 0,
num: this.zNum,
productId:this.goodsDetail.id,
productId:this.goodsDetail.productId,
productName: this.goodsDetail.productName,
wholesalePrice: this.goodsDetail.wholesalePrice,
purchasePrice:this.goodsDetail.purchasePrice,
@ -1248,7 +1336,8 @@
var data1 = {
productCount: carList1[i].saleDetailQueryDTO[m].productCount,
name: carList1[i].saleDetailQueryDTO[m].name
name: carList1[i].saleDetailQueryDTO[m].name,
uuid:'A'+generateUUID()
}
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount
@ -1279,7 +1368,8 @@
} else { //规格不同
var data1 = {
productCount: carList1[i].saleDetailQueryDTO[m].productCount,
name: carList1[i].saleDetailQueryDTO[m].name
name: carList1[i].saleDetailQueryDTO[m].name,
uuid:'A'+generateUUID()
}
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[
m].attributeList, data1)
@ -1310,7 +1400,8 @@
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
var data1 = {
productCount: carList1[i].saleDetailQueryDTO[m].productCount,
name: carList1[i].saleDetailQueryDTO[m].name
name: carList1[i].saleDetailQueryDTO[m].name,
uuid:'A'+generateUUID()
}
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount
@ -1508,8 +1599,10 @@
<style lang="scss">
page,
.page1 {
height: 100%;
.page1 {
height: 1280rpx;
overflow-y: scroll;
min-height: 100vh;
}
.u-upload{
position: absolute;
@ -1936,5 +2029,9 @@
text-align: center;
color: #777;
margin: 20rpx 0 0 20rpx;
}
.scroll-content{
margin: 212rpx 0 150rpx 0;
height: 90%;
}
</style>

38
pages/inventory/addinventory.vue

@ -223,7 +223,8 @@
newTemList: [],
pecsList: [],
dataObj: new Map(),
isPlusAndMinus:false
isPlusAndMinus:false,
temporaryNum:0
}
},
filters: {
@ -434,6 +435,16 @@
if(this.isPlusAndMinus == false){
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount = Number(e.detail.value)
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
}
this.isPlusAndMinus == false
@ -448,6 +459,16 @@
}else{
this.temporaryList[i].productCount++
}
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
this.temporaryChange()
},
@ -456,6 +477,16 @@
//监听到点击-的操作,给所有的都-1
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount--
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
this.temporaryChange()
},
@ -838,8 +869,9 @@
} else { //当前页有数据
for (let i = 0; i < carList1.length; i++) {
this.carList.get(carList1[i].id).productCount = 0
if (this.carList.has(carList1[i].id) == true) { //商品相同
if (this.carList.has(carList1[i].id) == true) { //商品相同
this.carList.get(carList1[i].id).productCount = 0
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
if (this.carList.get(carList1[i].id).stockLogList.has(carList1[i]
.saleDetailQueryDTO[

36
pages/inventory/changeGoods1.vue

@ -144,7 +144,7 @@
</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==null?'无库存':item.productNum}}</text>
</view>
<uni-number-box max="100000" v-model="item.productCount" @change="temporaryChange" />
</view>
@ -332,6 +332,16 @@
if(this.isPlusAndMinus == false){
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount = Number(e.detail.value)
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
}
this.isPlusAndMinus == false
@ -346,6 +356,16 @@
}else{
this.temporaryList[i].productCount++
}
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
this.temporaryChange()
},
@ -354,6 +374,16 @@
//监听到点击-的操作,给所有的都-1
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount--
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
this.temporaryChange()
},
@ -407,7 +437,7 @@
this.attributeList = {
attributeList: value[i],
productCount: this.temporaryNum,
productNum:this.productNum,
productNum:null,
name: evalue[i],
price: this.purchasePrice
}
@ -425,7 +455,7 @@
this.attributeList = {
attributeList: value[i],
productCount: newProductCount,
productNum:this.productNum,
productNum:null,
name: evalue[i],
price: this.purchasePrice
}

262
pages/inventory/goodsList1.vue

@ -1,7 +1,7 @@
<!-- 销售商品 -->
<template>
<view class="page1">
<view class="content">
<!-- <view class="content"> -->
<view style="position: fixed;top:0;z-index: 99;width: 100%;">
<!-- <view class="notice">
<u-notice-bar mode='horizontal' bgColor="#088FEB" color="#eee" :text="noticeData"></u-notice-bar>
@ -11,7 +11,8 @@
<view class="list-name">客户</view>
<view class="list-val">
<input type="text" placeholder="请选择客户" disabled
style="border-bottom: 1px solid #fff;text-align: center;" v-model="khName.name">
:value="khName.name"
style="border-bottom: 1px solid #fff;text-align: center;">
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view>
</view>
@ -42,8 +43,9 @@
</view>
</view>
</view>
</view>
<view class="content-box" style="margin-top: 388rpx;">
</view>
<scroll-view class="scroll-content" scroll-y="true" :scroll-into-view="currentAnchor" scroll-top="0">
<view class="content-box">
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(value,key) in Array.from(carList)"
:key="key">
<view class="shop-name" style="position: relative;">
@ -104,7 +106,7 @@
<view style="font-size: 30rpx;color: #000;font-weight: bold;width: 152rpx;display: inline-block;text-align: right;">数量</view>
</view>
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)"
:key='keys'>
:key='keys' :id="values[1].uuid">
<view @tap.stop="delShopSpec(value[0],values[0])">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
@ -130,7 +132,7 @@
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in priceItems"
:key="item.value" style="margin-right:0">
<view>
<radio v-model="item.value" @tap.stop="priceChange(item.value)"
<radio :value="item.value" @tap.stop="priceChange(item.value,index)"
:checked="index === priceCurrent" />
</view>
<view style="width: 100rpx;">{{item.name}}</view>
@ -160,11 +162,12 @@
</view>
</view>
</view>
</view>
</view>
<view class="content-box">
<view class="price-box-list">
<view class="content-list">
<view class="list-name">总金额</view>
<view class="list-name" id="idss">总金额</view>
<view class="list-val">
<input type="number" v-model="shouldPay" disabled>
</view>
@ -277,8 +280,9 @@
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
<!-- </view> -->
<view class="bottom-box">
<view class="bottom-left">
<text>合计:{{totalAmount}}</text>
@ -301,10 +305,10 @@
<view class="popup-pay-container" @tap.stop="checkPay(wholesalePrice)">
<text style="display: inline-block">批发价:¥{{wholesalePrice}}</text>
</view>
<view class="popup-pay-container" style="background: #fff;display: flex;">
<input type="number" style="height: 100rpx;line-height: 100rpx;color:#000;" placeholder="请输入价格"
<view class="popup-pay-container" style="background: #fff;display: flex;width: 100%;">
<input type="number" style="height: 100rpx;line-height: 100rpx;color:#000;width: 296rpx;" placeholder="请输入价格"
@input="changePay">
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;"
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;width: 144rpx;"
@tap.stop="checkPay(customPrice)">确定</view>
</view>
</view>
@ -356,7 +360,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==null?'无库存':item.productNum}}</text>
</view>
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" />
</view>
@ -453,7 +457,7 @@
<view class="popup-pay-container" style="display: flex;">
<view @tap='goSell'
style="width:50%;line-height: 100rpx;text-align: center;border-right: 1px solid #eee;">
只开单
仅开单
</view>
<view style="position:relative;width:50%;line-height: 100rpx;text-align: center;border-right: 1px solid #eee;">
<kk-printer style="width: 100%;color:#fff;position: absolute;top: 0;left: 0;" ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" :defaultText="'开单并打印'"></kk-printer>
@ -490,6 +494,7 @@
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';
import { generateUUID } from '@/utils/global.js'
var plugin = requirePlugin("WechatSI")
let manager = plugin.getRecordRecognitionManager()
export default {
@ -508,7 +513,8 @@
goodsDetail: [],
noticeData: ['您每发出一个包,使用拉包工和物流公司送货时,我们将从中拿出XX元,捐入快拾帮帮公益基金中,帮助那些贫困儿童!我们的付出将让世界充满爱!'],
columns: [],
keyList: [],
keyList: [],
index:'',
temporaryList: [],
zNum: 0,
bufferData: [],
@ -608,7 +614,9 @@
pecsList: [],
dataObj: new Map(),
allChangeNum:0,
recordState:false
recordState:false,
currentAnchor: '',
temporaryNum:0
}
},
components: {
@ -617,6 +625,7 @@
onShow() {
// 初始化蓝牙模块
wx.openBluetoothAdapter({mode: 'central'})
console.log(Math.floor(Math.random() * 256))
uni.showLoading({
title: '加载中...'
})
@ -629,12 +638,18 @@
if (uni.getStorageSync('hangOrder') == true) {
this.carList.clear()
this.remark = ''
this.createByName = ''
this.xsyId = ''
this.khName = []
this.saleId = ''
uni.removeStorageSync('hangOrder');
}
this.sex = [{
text: '平台配送',
value: 0
}, {
text: '自送',
value: 1
}]
if(this.wlName !='' && this.wlName.canToDoor == 1){
let data = {
text: '物流自取',
@ -660,7 +675,9 @@
this.createByName = this.carList1[0].createByName
} else {
this.carList1 = this.carList1
}
}
// const uuid = generateUUID();
// console.log('uuid',uuid);
this.handleData()
},
filters: {
@ -711,7 +728,8 @@
var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name,
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum || this.carList1[i].saleDetailQueryDTO[m].stockCount
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum || this.carList1[i].saleDetailQueryDTO[m].stockCount,
uuid:'A'+generateUUID()
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
@ -726,7 +744,9 @@
var data1 = {
productCount: this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount + this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
name: this.carList1[i].saleDetailQueryDTO[m].name,
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum || this.carList1[i].saleDetailQueryDTO[m].stockCount,
uuid:'A'+generateUUID()
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
@ -747,7 +767,9 @@
var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
name: this.carList1[i].saleDetailQueryDTO[m].name,
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum || this.carList1[i].saleDetailQueryDTO[m].stockCount,
uuid:'A'+generateUUID()
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, data1)
@ -781,7 +803,8 @@
var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name,
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum,
uuid:'A'+generateUUID()
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
@ -840,6 +863,7 @@
purchasePrice: this.carList1[i].purchasePrice, //采购价
price: 0, //总价
discount: 10, //折扣
productId:this.carList1[i].productId,
categoryId:this.carList1[i].categoryId,
unitPrice: this.carList1[i].price || 0, //单价
discountAmount: this.carList1[i].unitPrice || 0, //折后价
@ -858,7 +882,8 @@
var data1 = {
productCount: this.carList1[i].stockLogList1[m].productCount,
name: this.carList1[i].stockLogList1[m].name,
productNum:this.carList1[i].stockLogList1[m].productNum
productNum:this.carList1[i].stockLogList1[m].productNum,
uuid:'A'+generateUUID()
}
obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1)
obj.productCount += this.carList1[i].stockLogList1[m].productCount
@ -867,13 +892,16 @@
} else { //当前页有数据
if (this.carList.has(this.carList1[i].productId) == true) { //商品相同
for (let m = 0; m < this.carList1[i].stockLogList1.length; m++) {
console.log('stockLogList1',this.carList1[i].stockLogList1[m])
if (this.carList.get(this.carList1[i].productId).stockLogList.has(this.carList1[i]
.stockLogList1[
m].attributeList) == true) { //规格相同
var data1 = {
productCount: this.carList.get(this.carList1[i].productId).stockLogList.get(this.carList1[i].stockLogList1[m].attributeList).productCount + this.carList1[i].stockLogList1[m].productCount,
name: this.carList1[i].stockLogList1[m].name
name: this.carList1[i].stockLogList1[m].name,
productNum:this.carList1[i].stockLogList1[m].productNum,
uuid:'A'+generateUUID()
}
this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1)
@ -881,7 +909,9 @@
var data1 = {
productCount: this.carList1[i].stockLogList1[m].productCount,
name: this.carList1[i].stockLogList1[m].name
name: this.carList1[i].stockLogList1[m].name,
productNum:this.carList1[i].stockLogList1[m].productNum,
uuid:'A'+generateUUID()
}
this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i].stockLogList1[
m].attributeList, data1)
@ -895,6 +925,7 @@
price: 0, //总价
discount: 10, //折扣
categoryId:this.carList1[i].categoryId,
productId:this.carList1[i].productId,
unitPrice: this.carList1[i].price || 0, //单价
discountAmount: this.carList1[i].unitPrice || 0, //折后价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
@ -915,7 +946,8 @@
var data1 = {
productCount: this.carList1[i].stockLogList1[m].productCount,
name: this.carList1[i].stockLogList1[m].name,
productNum:this.carList1[i].stockLogList1[m].productNum
productNum:this.carList1[i].stockLogList1[m].productNum,
uuid:'A'+generateUUID()
}
obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1)
@ -1030,11 +1062,46 @@
}
let data = this.temporary
let specMap = new Map() //新的临时存放值那个更改过的值的数组
let similar = ''
this.carList.get(data[0]).stockLogList.forEach(function(value, key) {
if(key == data[1]){
let stringKey = key.replace(data[3],item) //拿到了更改过的key
specMap.set(stringKey,value) //name的值没有改,所有的数组都放在这个下面
that.carList.get(data[0]).stockLogList.delete(data[1])
that.tui.request("/app/stock/productCount", "post", {
productId: that.carList.get(data[0]).productId,
attributeList: stringKey
}, false, true).then((res) => {
if (res.code == 200) {
value.productNum = res.result
if(specMap.has(stringKey) == true){ //当前的数据中有相同的值
similar = specMap.get(stringKey).uuid
specMap.get(stringKey).productCount += value.productCount
}else{
value.uuid = 'A'+generateUUID();
specMap.set(stringKey,value) //name的值没有改,所有的数组都放在这个下面
}
that.$forceUpdate()
that.carList.get(data[0]).stockLogList.delete(data[1])
} else {
that.tui.toast(res.message)
}
}).catch((res) => {})
that.$nextTick(()=>{
setTimeout(res => {
if(similar != ''){
that.currentAnchor = '#'+similar;
}else{
that.currentAnchor = '#'+value.uuid;
}
console.log(that.currentAnchor)
}, 200)
})
that.$nextTick(()=>{
setTimeout(res => {
that.currentAnchor = ""
similar = ''
console.log(that.currentAnchor)
}, 1000)
})
}
})
if(this.carList.get(data[0]).stockLogList.size > 0){
@ -1043,8 +1110,12 @@
})
}
this.carList.get(data[0]).stockLogList = specMap
this.$forceUpdate()
this.$refs.getaPopup.close()
setTimeout(res => {
this.$forceUpdate()
this.$refs.getaPopup.close()
}, 200)
},
//销售员列表
xsyList() {
@ -1065,7 +1136,18 @@
if(this.isPlusAndMinus == false){
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount = Number(e.detail.value)
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
}
this.isPlusAndMinus == false
this.temporaryChange()
@ -1079,6 +1161,17 @@
}else{
this.temporaryList[i].productCount++
}
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
this.temporaryChange()
},
@ -1086,8 +1179,19 @@
this.isPlusAndMinus == true
//监听到点击-的操作,给所有的都-1
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount--
this.temporaryList[i].productCount --
for(var m=0;m<this.pageOldTemList.length;m++){
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount
}
}
for(var j=0;j<this.oldTemList.length;j++){
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){
this.oldTemList[j].productCount = this.temporaryList[i].productCount
}
}
}
this.temporaryChange()
},
attrNameChange(index, data1, index1) {
@ -1141,7 +1245,7 @@
this.attributeList = {
attributeList: value[i],
productCount: this.temporaryNum,
productNum: this.productNum,
productNum: null,
name: evalue[i],
price: this.purchasePrice
}
@ -1159,7 +1263,7 @@
this.attributeList = {
attributeList: value[i],
productCount: newProductCount,
productNum: this.productNum,
productNum: null,
name: evalue[i],
price: this.purchasePrice
}
@ -1375,16 +1479,19 @@
}
},
//整体选择是批发价还是零售价
priceChange(e) {
priceChange(e,index) {
uni.showLoading({
title: '加载中...',
mask:true
})
let that = this;
this.priceType = e
this.priceType = e
that.priceCurrent = index
this.carList.forEach(function(value, key) {
console.log('麻烦',value)
that.index = value.productId || value.id
console.log('麻烦',value)
that.index = value.productId || value.id
if (e == 0) { //零售
that.checkPay(value.lsprice)
} else { //批发
@ -1396,7 +1503,7 @@
uni.hideLoading();
}, 500)
})
this.$forceUpdate()
},
//商品上选择是零售价还是批发价
checkPay(price) {
@ -1422,14 +1529,19 @@
getAmountAndWho() {
let that = this;
let price = 0
this.carList.forEach(function(value, key) {
if (that.priceType == '') {
price = value.unitPrice
} else if (that.priceType == 0) { //零售
price = value.lsprice
} else if (that.priceType == 1) { //批发
price = value.wholesalePrice
this.carList.forEach(function(value, key) {
if(value.discountAmount > 0){
price = value.discountAmount
}else{
if (that.priceType == '') {
price = value.unitPrice
} else if (that.priceType == 0) { //零售
price = value.lsprice
} else if (that.priceType == 1) { //批发
price = value.wholesalePrice
}
}
value.unitPrice = price;
if (that.discountType == 1) { //整体折扣
value.discountAmount = value.unitPrice * 10000 * that.discountNum / 10 / 10000
@ -1472,7 +1584,7 @@
productCount: values.productCount,
name: values.name,
attributeList: keys,
productNum: that.productNum
productNum: values.productNum
}
value.stockLogList1.push(obj)
}else{
@ -1483,7 +1595,7 @@
productCount: values.productCount,
name: values.name,
attributeList: keys,
productNum: that.productNum
productNum: values.productNum
}
value.stockLogList1.push(obj)
}
@ -1717,6 +1829,7 @@
id: this.goodsDetail.id,
price: this.zPrice,
num: this.zNum,
categoryId:this.goodsDetail.categoryId,
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture,
@ -1762,7 +1875,8 @@
var data1 = {
productCount: carList1[i].saleDetailQueryDTO[m].productCount,
name: carList1[i].saleDetailQueryDTO[m].name,
productNum:carList1[i].saleDetailQueryDTO[m].productNum
productNum:carList1[i].saleDetailQueryDTO[m].productNum,
uuid:'A'+generateUUID()
}
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount
@ -1790,7 +1904,9 @@
var data1 = {
productCount: carList1[i].saleDetailQueryDTO[m].productCount,
name: carList1[i].saleDetailQueryDTO[m].name
name: carList1[i].saleDetailQueryDTO[m].name,
productNum:carList1[i].saleDetailQueryDTO[m].productNum,
uuid:'A'+generateUUID()
}
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[
m].attributeList, data1)
@ -1803,7 +1919,9 @@
} else { //规格不同
var data1 = {
productCount: carList1[i].saleDetailQueryDTO[m].productCount,
name: carList1[i].saleDetailQueryDTO[m].name
name: carList1[i].saleDetailQueryDTO[m].name,
productNum:carList1[i].saleDetailQueryDTO[m].productNum,
uuid:'A'+generateUUID()
}
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[
m].attributeList, data1)
@ -1837,7 +1955,8 @@
var data1 = {
productCount: carList1[i].saleDetailQueryDTO[m].productCount,
name: carList1[i].saleDetailQueryDTO[m].name,
productNum:carList1[i].saleDetailQueryDTO[m].productNum
productNum:carList1[i].saleDetailQueryDTO[m].productNum,
uuid:'A'+generateUUID()
}
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount
@ -2064,9 +2183,9 @@
onPrint(opt) {
let that = this;
this.goSell('print')
let strCmd = ''
that.yNum = 150
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(2);
@ -2210,7 +2329,8 @@
uni.hideLoading();
this.$nextTick(() => {
this.$refs.showPopup.close()
that.$refs.showPopup.close()
that.bufferData = []
that.clearAll1()
uni.switchTab({
url: '/pages/index/index'
@ -2384,14 +2504,17 @@
let that = this;
that.carList.clear()
that.remark = ''
that.index = ''
that.priceCurrent = ''
that.current = ''
that.discountType = ''
that.discountCurrent = ''
that.temporaryList = []
that.purchasePrice = 0
that.zPrice = 0
that.zNum = 0
that.shouldPay = 0
that.khName = []
that.gysName = []
that.wlName = []
that.kdyName = []
@ -2401,9 +2524,8 @@
that.noPay = 0
that.otherExpense = 0
that.totalAmount = 0
that.createByName = ''
that.xsyId = ''
this.saleId = ''
that.saleId = ''
that.$forceUpdate()
},
//清空全部数据
clearAll() {
@ -2412,17 +2534,21 @@
title: "提示",
content: "确定清空全部已选商品吗?",
success: function(res) {
if (res.confirm) {
if (res.confirm) {
console.log(that.priceCurrent)
that.carList.clear()
that.remark = ''
that.priceCurrent = ''
that.current = ''
that.discountCurrent = ''
that.index = ''
that.priceType = ''
that.current = null
that.discountType = ''
that.discountCurrent = null
that.temporaryList = []
that.purchasePrice = 0
that.zPrice = 0
that.zNum = 0
that.shouldPay = 0
that.shouldPay = 0
that.khName = []
that.gysName = []
that.wlName = []
that.kdyName = []
@ -2432,9 +2558,9 @@
that.noPay = 0
that.otherExpense = 0
that.totalAmount = 0
that.createByName = ''
that.xsyId = ''
this.saleId = ''
that.saleId = ''
that.priceCurrent = null
that.$forceUpdate()
}
}
})
@ -3037,5 +3163,9 @@
text-align: center;
color: #777;
margin: 20rpx 0 0 20rpx;
}
.scroll-content{
margin: 388rpx 0 120rpx 0;
height: 90%;
}
</style>

28
pages/inventory/inventoryDetail.vue

@ -69,28 +69,28 @@
<text style="display:inline-block;width:100rpx;font-size:22rpx;">
供应商:
</text>
<input v-if="isShow" v-model="dataList.supplierName" @change="changeText" type="text" placeholder="请输入供应商名称" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
<input v-model="dataList.supplierName" @change="changeText" type="text" placeholder="请输入供应商名称" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
</view>
<view v-if="list[1].checked" style="display: flex;height: 80rpx;width: 100%;line-height: 80rpx;margin-top: 20rpx;">
<text style="display:inline-block;width:100rpx;font-size:22rpx;">
货号:
</text>
<input v-if="isShow" v-model="dataList.productSn" @change="changeText" type="text" placeholder="请输入货号" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
<input v-model="dataList.productSn" @change="changeText" type="text" placeholder="请输入货号" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
</view>
<view v-if="list[2].checked" style="display: flex;height: 80rpx;width: 100%;line-height: 80rpx;margin-top: 20rpx;">
<text style="display:inline-block;width:100rpx;font-size:22rpx;">
零售价:
</text>
<input v-if="isShow" v-model="dataList.price" @change="changeText" type="number" placeholder="请输入零售价" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
<input v-model="dataList.price" @change="changeText" type="number" placeholder="请输入零售价" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
</view>
<view v-if="list[3].checked" style="display: flex;height: 80rpx;width: 100%;line-height: 80rpx;margin-top: 20rpx;">
<text style="display:inline-block;width:100rpx;font-size:22rpx;">
批发价:
</text>
<input v-if="isShow" v-model="dataList.wholesalePrice" @change="changeText" type="number" placeholder="请输入批发价" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
<input v-model="dataList.wholesalePrice" @change="changeText" type="number" placeholder="请输入批发价" style="display: flex;height: 80rpx;width: 300rpx;line-height: 80rpx;padding-left: 20rpx;border: 1px solid #eee;">
</view>
<view class="popup-pay-container">
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" :printNum="printNum" :defaultText="'打印'"></kk-printer>
<view class="popup-pay-container" @tap="clickPrint">
确认
</view>
</view>
</uni-popup>
@ -99,7 +99,9 @@
<uni-popup-dialog ref="inputClose" mode="input" title="采购价" placeholder="请输入采购价"
@confirm="changePrice"></uni-popup-dialog>
</uni-popup>
<view v-if="isPrint" @tap="clickPrint" class="bottom-btn">确认打印</view>
<view v-if="isPrint" class="bottom-btn">
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" :printNum="printNum" :defaultText="'打印'"></kk-printer>
</view>
<!-- 右下角悬浮按钮 -->
<uni-fab v-if="!isPrint" ref="fab" :content="content" :horizontal="horizontal"
@trigger="trigger" />
@ -157,8 +159,7 @@
active: false
}],
printList:new Map(),
yNum: 10,
isShow:true
yNum: 10,
}
},
filters: {
@ -209,9 +210,6 @@
changeText(){
console.log(this.dataList)
},
clickShow(){
this.isShow = false
},
changeNumBtn(item){
if(this.printList.has(item.attributeList) == true){ // map中已经有当前值
if(item.productCount == 0){
@ -225,11 +223,13 @@
console.log('打印的数组',this.printList)
},
printBtn(){
this.isPrint = !this.isPrint
this.$refs.payDialog.open('center')
},
//点击打印按钮
clickPrint() {
this.$refs.payDialog.open('center')
this.$refs.payDialog.close()
this.isPrint = !this.isPrint
},
//选择多个规格保存
addMultipleType(item1){

Loading…
Cancel
Save