wangfukang 3 years ago
parent
commit
47f0f16a6d
  1. 76
      pages/index/addStock.vue
  2. 14
      pages/index/orderDetail.vue
  3. 4
      pages/index/peopleList.vue
  4. 55
      pages/inventory/addGoods.vue
  5. 46
      pages/inventory/goodsList1.vue
  6. 6
      pages/inventory/inventory.vue

76
pages/index/addStock.vue

@ -55,7 +55,7 @@
<text class="uni-tab__text">已选择</text>
</view>
<text style="background-color:#ff0000;color:#fff;position: absolute;top: 0;right: 10rpx;"
class="uni-tab__dot">{{carList.length}}</text>
class="uni-tab__dot">{{carList.size}}</text>
</view>
<view class="bottom-right">
<view class="bottom-btn" @tap="backPrevPage">选好了</view>
@ -64,33 +64,36 @@
<!-- 购物车弹出层 -->
<uni-popup ref="carPopup" background-color="#fff">
<view class="popup-content">
<view v-for="(item,index) in carList" :key="index" style="position: relative;">
<view v-for="(value,key) in Array.from(carList)" :key="key" style="position: relative;">
<view class="popup-title">
<view class="popup-title-left">
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture">
<img class="img-radius" :src="value[1].productPicture" alt="" v-if="value[1].productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view>
<view class="popup-title-right-box">{{item.productSn}}</view>
<view class="popup-title-right-box" style="color: #088FEB;">{{value[1].productName}}</view>
<view class="popup-title-right-box">{{value[1].productSn}}</view>
<view class="popup-title-right-box">
<text style="margin-right:20rpx;">供应商:{{item.supplierName}}</text>
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item)">
<text style="margin-right:20rpx;">供应商:{{value[1].supplierName}}</text>
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[1])">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
</view>
</view>
</view>
<view class="popup-container" v-for="(item1,index1) in item.saleDetailQueryDTO" :key="index1">
<view class="popup-container" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="keys">
<view class="checkList" style="padding-bottom:160rpx;">
<!-- <view style="margin-right:5%;" @tap="delShopSpec(item.id,item1.attributeList)">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view> -->
<view class="checkList-box">
{{item1.attributeList | sliceMsg}}
{{values[0] | sliceMsg}}
</view>
<view class="checkList-box">
{{values[1].stockCount}}
</view>
<uni-number-box max="100000" v-model="item1.pdNum" />
<uni-number-box max="100000" v-model="values[1].pdNum" />
</view>
</view>
</view>
@ -120,7 +123,7 @@
categoryId: '', //分类id
searchName: '', //搜索框输入值
shopId: '', //店铺id,
carList: [],
carList: new Map(),
attributeList: [],
purchasePrice: 0,
storageType: '',
@ -152,28 +155,41 @@
onShow(){
let that = this;
this.pdList = this.pdList
console.log('你好',this.pdList)
if(this.carList.length == 0){ //carList没有数据
this.carList.push(this.pdList)
}else{ //carList有数据
for(let i=0;i<this.carList.length;i++){
if(this.pdList.id == this.carList[i].id){ //相拼相同
for(let z=0;z<this.carList[i].saleDetailQueryDTO.length;z++){
for(let j=0;j<this.pdList.saleDetailQueryDTO.length;j++){
if(this.carList[i].saleDetailQueryDTO[z].attributeList == this.pdList.saleDetailQueryDTO[j].attributeList){ //规格相同
this.carList[i].saleDetailQueryDTO[z] = this.pdList.saleDetailQueryDTO[j]
}else{ //规格不同
this.carList[i].saleDetailQueryDTO.push(this.pdList.saleDetailQueryDTO[j])
}
}
if(this.pdList.saleDetailQueryDTO){
if (this.carList.size == 0) { //当前页没有数据
let obj = {
id: this.pdList.id,
productName: this.pdList.productName,
productPicture: this.pdList.productPicture,
productSn: this.pdList.productSn,
supplierName:this.pdList.supplierName,
stockLogList: new Map(),
}
for (let m = 0; m < this.pdList.saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.pdList.saleDetailQueryDTO[m].attributeList, this.pdList.saleDetailQueryDTO[m])
}
this.carList.set(this.pdList.id, obj)
} else { //当前页有数据
if (this.carList.has(this.pdList.id) == true) { //商品相同
for (let m = 0; m < this.pdList.saleDetailQueryDTO.length; m++) {
this.carList.get(this.pdList.id).stockLogList.set(this.pdList.saleDetailQueryDTO[m].attributeList,this.pdList.saleDetailQueryDTO[m])
}
}else{ //商品不同
this.carList.push(this.pdList)
} else { //商品不同
let obj = {
id: this.pdList.id,
productName: this.pdList.productName,
productPicture: this.pdList.productPicture,
productSn: this.pdList.productSn,
supplierName:this.pdList.supplierName,
stockLogList: new Map(),
}
for (let m = 0; m < this.pdList.saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.pdList.saleDetailQueryDTO[m].attributeList, this.pdList.saleDetailQueryDTO[m])
}
this.carList.set(this.pdList.id, obj)
}
}
}
console.log(this.carList)
},
onLoad() {
@ -230,7 +246,7 @@
toggle(type, item) {
if (type == 'carPopup') {
this.$refs.carPopup.open('bottom')
this.carType = this.carList.length
this.carType = this.carList.size
} else {
this.productId = item.id

14
pages/index/orderDetail.vue

@ -76,7 +76,7 @@
<view class="tui-flex-shrink">备注</view>
<view class="tui-goods-price">
<uni-tooltip :content="sales.remark == null ?'暂无':sales.remark" placement="left">
<view style="font-size: 13px;width: 200px;height: 40rpx;overflow: hidden;">{{ sales.remark == null ?'':sales.remark}}</view>
<view style="font-size: 13px;width: 200px;height: 40rpx;overflow: hidden;text-align: right;">{{ sales.remark == null ?'':sales.remark}}</view>
</uni-tooltip>
</view>
</view>
@ -590,7 +590,7 @@
this.tui.toast("请输入取货地址")
return
}
if(this.$refs.returnClose.val == ''){
if(this.$refs.returnClose.val == '' || this.$refs.returnClose.val <= 0){
this.tui.toast("金额不能为空")
return
}
@ -606,8 +606,16 @@
}
}
console.log(this.list)
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("退货数量不能为零")
return;
}
this.list[i].stockLogList[m].productCount = this.list[i].stockLogList[m].returnCount
if(this.list[i].stockLogList.length >0){
if (m == 0) {

4
pages/index/peopleList.vue

@ -276,14 +276,14 @@
},
//查询拉包工和快递人员的列表
kdyOrlbgList() {
this.tui.request("/worker/getWXByCondition", "post", {
this.tui.request("/worker/getByCondition", "post", {
ownerCompany: this.companyType, //公司id,如果是快递公司,才需要传
searchStr:this.searchName,
pageNum: 1,
pageSize: 10
}, false, false).then((res) => {
if (res.code == 200) {
this.popleList = res.result;
this.popleList = res.result.content;
}else{
this.tui.toast(res.message)
}

55
pages/inventory/addGoods.vue

@ -204,32 +204,39 @@
// 触发提交表单
submit() {
let that = this;
let url = ''
this.$refs.form.validate().then(res => {
if(that.dataList !=''){
url = '/app/product/edit'
res.id = that.dataList.id
}else{
url = '/app/product/save'
that.tui.request('/app/product/getByProductSn', "post", {
productSn:this.formData.productSn
}, false, true).then((res1) => {
if (res1.code == 200) {
}
if(res.productPicture == ''){
res.productPicture = ''
}
that.tui.request(url, "post", res, false, false).then((res1) => {
if (res1.code == 200) {
uni.navigateBack({
delta: 1
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
}).catch(err => {
})
// let url = ''
// this.$refs.form.validate().then(res => {
// if(that.dataList !=''){
// url = '/app/product/edit'
// res.id = that.dataList.id
// }else{
// url = '/app/product/save'
// }
// if(res.productPicture == ''){
// res.productPicture = ''
// }
// that.tui.request(url, "post", res, false, false).then((res1) => {
// if (res1.code == 200) {
// uni.navigateBack({
// delta: 1
// })
// } else {
// uni.showToast({
// title: "添加失败",
// icon: 'none'
// })
// }
// })
// }).catch(err => {
})
// })
},
//跳转分类页
goGategoryLow() {

46
pages/inventory/goodsList1.vue

@ -776,10 +776,10 @@
num.unitPrice = price;
num.price = price * num.productCount;
this.$refs.inputDialog.close()
this.getAllPrice()
num.discountAmount = num.unitPrice * num.discount / 10
num.price = num.unitPrice * num.discount / 10 * num.productCount
that.relPrice = that.shouldPay
this.getAllPrice()
},
//整体选择时使用批发价、零售价,选择整体折扣的方法
getAmountAndWho(){
@ -1157,25 +1157,25 @@
this.saleDetailList = purchaseDetails;
obj.saleDetailList = purchaseDetails;
let url = ''
// if (this.saleId != '') {
// url = '/app/sale/shareToBuyNew'
// } else {
// url = '/app/sale/buyNew'
// }
// this.tui.request(url, "post", obj, false, false).then((res) => {
// if (res.code == 200) {
// uni.showToast({
// title: "开单成功",
// icon: 'none'
// })
// setTimeout(res => {
// this.$refs.printerPopup.open('center')
// }, 1000)
// } else {
// this.tui.toast(res.message)
// }
// })
if (this.saleId != '') {
url = '/app/sale/shareToBuyNew'
} else {
url = '/app/sale/buyNew'
}
this.tui.request(url, "post", obj, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "开单成功",
icon: 'none'
})
setTimeout(res => {
this.$refs.printerPopup.open('center')
}, 1000)
} else {
this.tui.toast(res.message)
}
})
},
//打印取消按钮
@ -1194,7 +1194,7 @@
heightNum += value.stockLogList.size * 30
})
let strCmd = blesdk.CreatCPCLPage(600, heightNum, 1, 0);
let strCmd = blesdk.CreatCPCLPage(600, 5000, 1, 0);
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(2);
@ -1211,7 +1211,7 @@
this.carList.forEach(function(value, key) {
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, value.productName + '(' +
value.productSn + ')' + '折扣:' + (value.discount < 10 ? value.discount : '无折扣'))
value.productSn + ')')
value.stockLogList.forEach(function(value1, key1) {
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, (that.slicePrint(
key1)) + '*' + value1)
@ -1235,7 +1235,7 @@
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.remark)
strCmd += blesdk.addCPCLText('0', 3000, '24', '0', 0, '备注:' + this.remark)
}
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLPrint();

6
pages/inventory/inventory.vue

@ -312,13 +312,15 @@
.content-box {
background: #fff;
flex: 1;
display: flex;
display: flex;
overflow: scroll;
}
.content-left {
width: 170rpx;
background: #eee;
height: 100%;
height: 100%;
overflow: scroll;
}
.left-box {

Loading…
Cancel
Save