wangfukang 3 years ago
parent
commit
21175c385a
  1. 4
      pages/index/addHangOrder.vue
  2. 2
      pages/index/downarrears.vue
  3. 20
      pages/index/index.vue
  4. 4
      pages/index/order.vue
  5. 2
      pages/index/uparrears.vue
  6. 2
      pages/index/waitStorage.vue
  7. 14
      pages/index/waitStorageDetail.vue
  8. 36
      pages/inventory/addGoods.vue
  9. 70
      pages/inventory/addinventory.vue
  10. 355
      pages/inventory/goodsList1.vue
  11. 2
      pages/inventory/inventory.vue
  12. 7
      pages/inventory/inventoryDetail.vue

4
pages/index/addHangOrder.vue

@ -633,9 +633,13 @@
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
obj.saleId = item.saleDetailDTOList[i].saleId obj.saleId = item.saleDetailDTOList[i].saleId
obj.remark = item.remark obj.remark = item.remark
obj.xsyId = item.createBy
obj.createByName = item.createByName
dataList.push(obj) dataList.push(obj)
} }
console.log(dataList)
uni.setStorageSync('carList1', JSON.stringify(dataList)) uni.setStorageSync('carList1', JSON.stringify(dataList))
uni.setStorageSync('khName', '')
} }
uni.switchTab({ uni.switchTab({
url: '/pages/inventory/goodsList1' url: '/pages/inventory/goodsList1'

2
pages/index/downarrears.vue

@ -14,7 +14,7 @@
<view class="uni-body"> <text class="cardText"> <view class="uni-body"> <text class="cardText">
订单状态:</text>{{item.status == 0 ?'待抢单' :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 == 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 ?'待配货' :'挂单'}}
</view> </view>
<view class="return-price" @tap="returnPrice(item)">回款</view> <view class="return-price" @tap.stop="returnPrice(item)">回款</view>
</uni-card> </uni-card>
</li> </li>
</ul> </ul>

20
pages/index/index.vue

@ -49,7 +49,7 @@
<view class="grid-text">销售笔数</view> <view class="grid-text">销售笔数</view>
</u-grid-item> </u-grid-item>
<u-grid-item> <u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalProfit" :decimals="2"></u-count-to> <u-count-to :start-val="0" :end-val="type==0?shopInfo.totalProfit:0" :decimals="2"></u-count-to>
<view class="grid-text">今日利润</view> <view class="grid-text">今日利润</view>
</u-grid-item> </u-grid-item>
<u-grid-item> <u-grid-item>
@ -58,7 +58,7 @@
</u-grid-item> </u-grid-item>
</u-grid> </u-grid>
</view> </view>
<view class="contentPadding"> <view class="contentPadding" v-if="type == 0">
<view class="title"> <view class="title">
<i class="iconfont icon-huaban"> 本周营收统计 <i class="iconfont icon-huaban"> 本周营收统计
<view class="btn" @tap="gotoSearchData"> <view class="btn" @tap="gotoSearchData">
@ -257,7 +257,7 @@
this.tui.request("/app/sale/getShopWeek", "POST", {}, false, false).then((res) => { this.tui.request("/app/sale/getShopWeek", "POST", {}, false, false).then((res) => {
if(res.code == 200){ if(res.code == 200){
let dataList = { let dataList = {
categories: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"], categories: this.getWeek(),
series: [{ series: [{
name: "周销售额", name: "周销售额",
linearColor: [ linearColor: [
@ -277,6 +277,20 @@
} }
}) })
}, },
getWeek() {
// var date = new Date();
// var day = date.getDay();
// var names = ["周日","周一","周二","周三","周四","周五","周六"];
// return names[day];
let days = 7
let week = ["周日","周一","周二","周三","周四","周五","周六"];
let dateList = Array.from({length:days},(v,i)=> i).map(day =>{
let date = new Date();
date.setDate(date.getDate() - day);
return week[date.getDay()]
})
return dateList.reverse()
},
//跳转订单详情 //跳转订单详情
gotoDetail(id) { gotoDetail(id) {
uni.navigateTo({ uni.navigateTo({

4
pages/index/order.vue

@ -8,7 +8,7 @@
<ul> <ul>
<li v-for="item in inventoryList" @tap="gotoDetail(item.id)"> <li v-for="item in inventoryList" @tap="gotoDetail(item.id)">
<uni-card :title="item.userName == null ?'暂无':item.userName" :sub-title="item.createTime == null ?'暂无':item.createTime" :extra="'数量:'+(item.productCount == null ?'暂无':item.productCount)" <uni-card :title="item.userName == null ?'暂无':item.userName" :sub-title="item.createTime == null ?'暂无':item.createTime" :extra="'数量:'+(item.productCount == null ?'暂无':item.productCount)"
thumbnail="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png"> :thumbnail="item.saleDetailDTOList[0].productPicture">
<view class="uni-body"><text class="cardText">销售员:</text> {{item.createByName == null ?'暂无':item.createByName}}</view> <view class="uni-body"><text class="cardText">销售员:</text> {{item.createByName == null ?'暂无':item.createByName}}</view>
<view class="uni-body"> <text class="cardText"> 营业额:</text> <text class="priceText"> <view class="uni-body"> <text class="cardText"> 营业额:</text> <text class="priceText">
{{item.realAmount == null ?'暂无':item.realAmount}} </text> <text decode class="cardText"> {{item.realAmount == null ?'暂无':item.realAmount}} </text> <text decode class="cardText">
@ -114,6 +114,8 @@
obj.remark = item.remark obj.remark = item.remark
dataList.push(obj) dataList.push(obj)
} }
item.name = item.userName;
uni.setStorageSync('khName',JSON.stringify(item))
uni.setStorageSync('carList1',JSON.stringify(dataList)) uni.setStorageSync('carList1',JSON.stringify(dataList))
uni.switchTab({ uni.switchTab({
url: '/pages/inventory/goodsList1' url: '/pages/inventory/goodsList1'

2
pages/index/uparrears.vue

@ -14,7 +14,7 @@
<view class="uni-body"> <text class="cardText"> <view class="uni-body"> <text class="cardText">
订单状态:</text>{{item.inStorageStatus == 0 ?'未入库' :'已入库'}} 订单状态:</text>{{item.inStorageStatus == 0 ?'未入库' :'已入库'}}
</view> </view>
<view class="return-price" @tap="returnPrice(item)">回款</view> <view class="return-price" @tap.stop="returnPrice(item)">回款</view>
</uni-card> </uni-card>
</li> </li>
</ul> </ul>

2
pages/index/waitStorage.vue

@ -24,7 +24,7 @@
<view class="uni-body"> <view class="uni-body">
<text class="cardText">订单状态:</text>{{item.inStorageStatus == 0 ?'未入库' :'已入库'}} <text class="cardText">订单状态:</text>{{item.inStorageStatus == 0 ?'未入库' :'已入库'}}
</view> </view>
<view v-if="item.inStorageStatus== 0 && type==0" class="return-price" @tap="returnPrice(item)">更新</view> <view v-if="item.inStorageStatus== 0 && type==0" class="return-price" @tap.stop="returnPrice(item)">更新</view>
</uni-card> </uni-card>
</li> </li>
</ul> </ul>

14
pages/index/waitStorageDetail.vue

@ -99,7 +99,7 @@
</view> </view>
</view> </view>
<view class="tui-tabbar"> <view class="tui-tabbar">
<view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 1 && noPay >0" @tap="inputDialogToggle">回款</view> <view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 1 && sales.noPay >0" @tap="inputDialogToggle">回款</view>
<view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 0" @click="inventorySubmit">确认提交</view> <view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 0" @click="inventorySubmit">确认提交</view>
</view> </view>
<!-- 弹出输入框 --> <!-- 弹出输入框 -->
@ -156,6 +156,7 @@
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.sales = res.result.purchase this.sales = res.result.purchase
this.noPay = res.result.purchase.noPay
this.supplier = res.result.supplier this.supplier = res.result.supplier
this.remark = res.result.purchase.remark this.remark = res.result.purchase.remark
this.goodsList = res.result.purchaseDetails this.goodsList = res.result.purchaseDetails
@ -194,11 +195,18 @@
}, },
inventorySubmit() { inventorySubmit() {
if (this.noPay == 0 || this.alreadyPay == 0 || this.shouldPay == 0) { if(this.shouldPay == 0){
uni.showToast({ uni.showToast({
title: "信息填写完成后入库!", title: "请维护商品价格后入库!",
icon: 'none' icon: 'none'
}) })
return
}else if(this.alreadyPay == 0){
uni.showToast({
title: "管理员必须维护价格后入库!",
icon: 'none'
})
return
} }
let that = this; let that = this;
let purchase = { let purchase = {

36
pages/inventory/addGoods.vue

@ -39,7 +39,7 @@
</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()">保存</u-button>
</view> </view>
<!-- <u-modal v-model="show" :content="content"></u-modal> --> <!-- <u-modal v-model="show" :content="content"></u-modal> -->
@ -65,6 +65,7 @@
tailWarn: '' tailWarn: ''
}, },
categoryList: [], categoryList: [],
productId:'',
arrtList: [], arrtList: [],
arrtChange: [], arrtChange: [],
rules: { rules: {
@ -114,12 +115,24 @@
} }
}, },
onShow() { onShow() {
let that = this // let that = this
uni.$on('classForm', function(data) { // uni.$on('classForm', function(data) {
that.formData.classification = data // that.formData.classification = data
}) // })
}, },
onLoad() { onLoad(option) {
console.log(JSON.parse(option.dataList))
this.dataList = JSON.parse(option.dataList)
this.formData.productName = this.dataList.productName
this.formData.price = this.dataList.price
this.formData.productSn = this.dataList.productSn
this.formData.wholesalePrice = this.dataList.wholesalePrice
this.formData.productPicture = this.dataList.productPicture
this.formData.productIntro = this.dataList.productIntro
this.formData.categoryId = this.dataList.categoryId
this.formData.salesWeek = this.dataList.salesWeek
this.formData.tailWarn = this.dataList.tailWarn
this.tui.request("/app/productCategory/list", "get", { this.tui.request("/app/productCategory/list", "get", {
// shopId: 1, // shopId: 1,
}, false, true).then((res) => { }, false, true).then((res) => {
@ -193,11 +206,18 @@
}, },
// 触发提交表单 // 触发提交表单
submit() { submit() {
let url = ''
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
this.tui.request("/app/product/save", "post", res, false, false).then((res1) => { if(this.dataList.id !=''){
url = '/app/product/edit'
res.id = this.dataList.id
}else{
url = '/app/product/save'
}
this.tui.request(url, "post", res, false, false).then((res1) => {
if (res1.code == 200) { if (res1.code == 200) {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 2
}) })
} else { } else {
uni.showToast({ uni.showToast({

70
pages/inventory/addinventory.vue

@ -39,16 +39,22 @@
</view> </view>
<view class="shop-type"> <view class="shop-type">
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)"> <view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="key">
<view @tap.stop="delShopSpec(value[0],values[0])">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<text>{{values[0] | sliceMsg}}</text> <text>{{values[0] | sliceMsg}}</text>
<!-- <text style="color: red;">单价:¥{{item.price}}</text> --> <!-- <text style="color: red;">单价:¥{{item.price}}</text> -->
<text>数量:{{values[1]}}</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]" @change="GoodsNumChange($event,value[0],values[0])" /></view>
</view> </view>
<view <view
style="position: absolute;top: 130rpx;right: 40rpx;color: blue;text-decoration: underline;" style="position: absolute;top: 130rpx;right: 40rpx;color: blue;text-decoration: underline;"
@tap="clickCollapse(value[0])" v-if='storageType==0'> @tap="clickCollapse(value[0])" v-if='storageType==0'>
维护采购价 维护采购价
</view> </view>
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[0])">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -133,14 +139,14 @@
</view> </view>
</li> </li>
</ul> </ul>
<view class="shop-checkList" v-for="item in temporaryList"> <view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index">
<view class="shop-checkList-box"> <view class="shop-checkList-box">
{{item.name}} {{item.name}}
</view> </view>
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" /> <uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" />
</view> </view>
</view> </view>
<view class="shop-popup-bottom" v-for="item in temporaryList"> <view class="shop-popup-bottom" v-for="(item,index) in temporaryList" :key="index">
<view class="shop-popup-bottom-left"> <view class="shop-popup-bottom-left">
<text>数量:{{zNum}} 件</text> <text>数量:{{zNum}} 件</text>
</view> </view>
@ -519,6 +525,41 @@
url: '/pages/index/peopleList?popleType=' + popleType url: '/pages/index/peopleList?popleType=' + popleType
}) })
}, },
//删除整条商品
delShop(id) {
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if(res.confirm){
if(that.carList.has(id) == true){
that.carList.delete(id)
}
that.$forceUpdate()
}
}
})
},
//删除商品下的某一个规格
delShopSpec(id,name) {
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if(res.confirm){
that.carList.get(id).stockLogList.delete(name)
if(that.carList.get(id).stockLogList.size == 0){
that.carList.delete(id)
}
}
that.$forceUpdate()
}
})
},
inventorySubmit() { inventorySubmit() {
if (this.khName == '' || this.carList == '') { if (this.khName == '' || this.carList == '') {
uni.showToast({ uni.showToast({
@ -591,7 +632,24 @@
that.carList.forEach(function(value, key) { that.carList.forEach(function(value, key) {
that.shouldPay += value.price that.shouldPay += value.price
}) })
},
//修改已选规格的数量
GoodsNumChange(e,index,index1){
console.log(this.carList)
let that = this;
this.carList.get(index).stockLogList.set(index1,e)
this.carList.get(index).productCount = 0
this.shouldPay = 0
this.totalAmount = 0
this.carList.get(index).stockLogList.forEach(function(value, key) {
console.log(that.carList.get(index))
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.carList.forEach(function(value, key) {
that.shouldPay = that.shouldPay + value.price
that.totalAmount = that.totalAmount+ value.productCount
})
} }
} }
} }
@ -718,7 +776,7 @@
} }
.shop-collapse text { .shop-collapse text {
flex: 1; width: 40%;
text-align: center; text-align: center;
padding-right: 40rpx; padding-right: 40rpx;
border-right: 1px solid #eee; border-right: 1px solid #eee;

355
pages/inventory/goodsList1.vue

@ -7,14 +7,14 @@
<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;" :value="khName.name" style="border-bottom: 1px solid #fff;text-align: center;" v-model="khName.name"
@tap.stop="goPopleList('khName')"> @tap.stop="goPopleList('khName')">
<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>
<view class="content-list"> <view class="content-list">
<view class="list-name">销售员</view> <view class="list-name">销售员</view>
<uni-data-select class="uni-data-select" :localdata="categoryList" v-model="valuexsy" <uni-data-select class="uni-data-select" :localdata="categoryList" v-model="xsyId"
placeholder="请选择销售员" @change="categoryChange"></uni-data-select> placeholder="请选择销售员" @change="categoryChange"></uni-data-select>
</view> </view>
</view> </view>
@ -39,7 +39,8 @@
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in priceItems" <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in priceItems"
:key="item.value"> :key="item.value">
<view> <view>
<radio :value="item.value" @tap.stop="priceChange(item.value)" :checked="index === priceCurrent" /> <radio :value="item.value" @tap.stop="priceChange(item.value)"
:checked="index === priceCurrent" />
</view> </view>
<view style="width: 100rpx;">{{item.name}}</view> <view style="width: 100rpx;">{{item.name}}</view>
</label> </label>
@ -61,13 +62,15 @@
</label> </label>
</radio-group> </radio-group>
<view class="discount-num" v-if="discountType == '1'"> <view class="discount-num" v-if="discountType == '1'">
<uni-number-box :min="0.1" :max="10" :value="discountNum" :step="0.1" @change="change"/> <uni-number-box :min="0.1" :max="10" :value="discountNum" :step="0.1"
@change="change" />
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(value,key) in Array.from(carList)" :key="key"> <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;"> <view class="shop-name" style="position: relative;">
<img :src="value[1].productPicture" alt="" <img :src="value[1].productPicture" alt=""
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;"> style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;">
@ -76,7 +79,8 @@
<view>单价:{{value[1].unitPrice}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}</view> <view>单价:{{value[1].unitPrice}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}</view>
<view v-if="value[1].supplierName !=undefined">供应商:{{value[1].supplierName}}</view> <view v-if="value[1].supplierName !=undefined">供应商:{{value[1].supplierName}}</view>
</view> </view>
<view style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;" <view
style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;"
@tap.stop="clickPrice(value[0])"> @tap.stop="clickPrice(value[0])">
改价 改价
</view> </view>
@ -92,7 +96,8 @@
</view> </view>
<view class="collapse-1"> <view class="collapse-1">
<text>折扣(0-10)</text> <text>折扣(0-10)</text>
<input class="input" type="number" :value='value[1].discount | maxNum' @blur="changeDis($event,value[0])"> <input class="input" type="number" :value='value[1].discount | maxNum'
@blur="changeDis($event,value[0])">
</view> </view>
<view class="collapse-1"> <view class="collapse-1">
<text>折后价</text> <text>折后价</text>
@ -103,13 +108,15 @@
<input class="input" type="number" :value='value[1].productCount'> <input class="input" type="number" :value='value[1].productCount'>
</view> </view>
</view> </view>
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key='keys'> <view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)"
<view style="margin-right:5%;" @tap.stop="delShopSpec(value[0],values[0])"> :key='keys'>
<view @tap.stop="delShopSpec(value[0],values[0])">
<uni-icons color="red" type="minus" size="26"></uni-icons> <uni-icons color="red" type="minus" size="26"></uni-icons>
</view> </view>
<text>{{values[0] | sliceMsg}}</text> <text>{{values[0] | sliceMsg}}</text>
<!-- <text style="color: red;">¥100</text> --> <view style="text-align: left;padding-left: 5px;width:50%;display: flex;">数量:<uni-number-box
<text>数量:{{values[1]}}</text> max="100000" style="margin-top:16rpx;" v-model="values[1]"
@change="GoodsNumChange($event,value[0],values[0])" /></view>
</view> </view>
</view> </view>
</view> </view>
@ -176,7 +183,8 @@
</view> </view>
<view class=""> <view class="">
<view class="content-list" v-if="radioType == '0' || radioType == '1'"> <view class="content-list" v-if="radioType == '0' || radioType == '1'">
<view class="list-name" style="width:150rpx;padding-left: 0;">{{radioType == '0'? '选择物流' :'选择快递'}}</view> <view class="list-name" style="width:150rpx;padding-left: 0;">
{{radioType == '0'? '选择物流' :'选择快递'}}</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请选择" disabled :value="wlName.companyName" <input type="text" placeholder="请选择" disabled :value="wlName.companyName"
style="border-bottom: 1px solid #fff;text-align: center;padding-right: 54rpx;" style="border-bottom: 1px solid #fff;text-align: center;padding-right: 54rpx;"
@ -203,7 +211,8 @@
</view> </view>
</view> </view>
<view class="content-list" v-if="radioType1 != '1' && radioType !=''"> <view class="content-list" v-if="radioType1 != '1' && radioType !=''">
<view class="list-name" style="width:150rpx;padding-left:0;">{{radioType == '1'? '快递员' :'拉包工'}}</view> <view class="list-name" style="width:150rpx;padding-left:0;">
{{radioType == '1'? '快递员' :'拉包工'}}</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="可指定人员" disabled <input type="text" placeholder="可指定人员" disabled
:value="radioType == '1'? kdyName.workerName : lbgName.workerName" :value="radioType == '1'? kdyName.workerName : lbgName.workerName"
@ -246,8 +255,10 @@
<text style="display: inline-block">批发价:¥{{wholesalePrice}}</text> <text style="display: inline-block">批发价:¥{{wholesalePrice}}</text>
</view> </view>
<view class="popup-pay-container" style="background: #fff;display: flex;"> <view class="popup-pay-container" style="background: #fff;display: flex;">
<input type="number" style="height: 100rpx;line-height: 100rpx;color:#000;" placeholder="请输入价格" @blur="changePay"> <input type="number" style="height: 100rpx;line-height: 100rpx;color:#000;" placeholder="请输入价格"
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;" @tap.stop="checkPay(customPrice)">确定</view> @blur="changePay">
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;"
@tap.stop="checkPay(customPrice)">确定</view>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
@ -260,7 +271,8 @@
<img :src="goodsDetail.productPicture" alt=""> <img :src="goodsDetail.productPicture" alt="">
</view> </view>
<view class="shop-popup-title-right"> <view class="shop-popup-title-right">
<view class="shop-popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}</view> <view class="shop-popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
</view>
<view class="shop-popup-title-right-box">{{goodsDetail.productSn}}</view> <view class="shop-popup-title-right-box">{{goodsDetail.productSn}}</view>
</view> </view>
</view> </view>
@ -306,11 +318,14 @@
<view style="text-align: center;line-height: 50px;height: 100rpx;"> <view style="text-align: center;line-height: 50px;height: 100rpx;">
需要打印销售小票吗? 需要打印销售小票吗?
</view> </view>
<view style="display: flex;height: 100rpx;margin-top: 20rpx;border-top: 1px solid #eee;position: relative;"> <view
<view @tap='printChenel' style="width:250rpx;line-height: 100rpx;text-align: center;border-right: 1px solid #eee;"> style="display: flex;height: 100rpx;margin-top: 20rpx;border-top: 1px solid #eee;position: relative;">
<view @tap='printChenel'
style="width:250rpx;line-height: 100rpx;text-align: center;border-right: 1px solid #eee;">
暂不需要 暂不需要
</view> </view>
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" style="width: 250rpx;height: 100rpx;line-height: 50px;color: #000;background:#088FEB;position: absolute;bottom: 0;text-align: center;right: 0;"></kk-printer> <kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint"
style="width: 250rpx;height: 100rpx;line-height: 50px;color: #000;background:#088FEB;position: absolute;bottom: 0;text-align: center;right: 0;"></kk-printer>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
@ -419,7 +434,7 @@
}, },
onShow() { onShow() {
let that = this; let that = this;
this.khName = JSON.parse(JSON.stringify(this.khName)) this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
this.gysName = JSON.parse(JSON.stringify(this.gysName)) this.gysName = JSON.parse(JSON.stringify(this.gysName))
this.wlName = JSON.parse(JSON.stringify(this.wlName)) this.wlName = JSON.parse(JSON.stringify(this.wlName))
this.kdyName = JSON.parse(JSON.stringify(this.kdyName)) this.kdyName = JSON.parse(JSON.stringify(this.kdyName))
@ -427,8 +442,11 @@
if (uni.getStorageSync('carList1') != '') { if (uni.getStorageSync('carList1') != '') {
this.carList.clear() this.carList.clear()
this.carList1 = JSON.parse(uni.getStorageSync('carList1')) this.carList1 = JSON.parse(uni.getStorageSync('carList1'))
this.khName = uni.getStorageSync('khName') ? JSON.parse(uni.getStorageSync('khName')) : ''
this.remark = this.carList1[0].remark this.remark = this.carList1[0].remark
this.saleId = this.carList1[0].saleId this.saleId = this.carList1[0].saleId
this.xsyId = this.carList1[0].xsyId
this.createByName = this.carList1[0].createByName
} else { } else {
this.carList1 = this.carList1 this.carList1 = this.carList1
} }
@ -436,6 +454,10 @@
this.carList.clear() this.carList.clear()
this.remark = '' this.remark = ''
this.clearMsg = ''; this.clearMsg = '';
this.createByName = ''
this.xsyId = ''
this.khName = []
this.saleId = ''
} }
this.totalAmount = 0; this.totalAmount = 0;
this.shouldPay = 0 this.shouldPay = 0
@ -466,18 +488,25 @@
this.carList.set(this.carList1[i].id, obj) this.carList.set(this.carList1[i].id, obj)
} }
uni.removeStorageSync('carList1') uni.removeStorageSync('carList1')
uni.removeStorageSync('khName')
this.carList1 = [] this.carList1 = []
} else { //当前页有数据 } else { //当前页有数据
for (let i = 0; i < this.carList1.length; i++) { for (let i = 0; i < this.carList1.length; i++) {
if (this.carList.has(this.carList1[i].id) == true) { //商品相同 if (this.carList.has(this.carList1[i].id) == true) { //商品相同
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i].saleDetailQueryDTO[m].attributeList) == true) { //规格相同 if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i].saleDetailQueryDTO[
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList) + this.carList1[i].saleDetailQueryDTO[m].productCount) m].attributeList) == true) { //规格相同
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[m].productCount this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, this.carList.get(this.carList1[i].id).stockLogList.get(this
.carList1[i].saleDetailQueryDTO[m].attributeList) + this.carList1[i]
.saleDetailQueryDTO[m].productCount)
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[
m].productCount
} else { //规格不同 } else { //规格不同
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[ this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount) m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount)
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[m].productCount this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[
m].productCount
} }
} }
} else { //商品不同 } else { //商品不同
@ -852,13 +881,19 @@
for (let i = 0; i < carList1.length; i++) { for (let i = 0; i < carList1.length; i++) {
if (this.carList.has(carList1[i].id) == true) { //商品相同 if (this.carList.has(carList1[i].id) == true) { //商品相同
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) { for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
if (this.carList.get(carList1[i].id).stockLogList.has(carList1[i].saleDetailQueryDTO[m].attributeList) == true) { //规格相同 if (this.carList.get(carList1[i].id).stockLogList.has(carList1[i].saleDetailQueryDTO[m]
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, this.carList.get(carList1[i].id).stockLogList.get(carList1[i].saleDetailQueryDTO[m].attributeList) + carList1[i].saleDetailQueryDTO[m].productCount) .attributeList) == true) { //规格相同
this.carList.get(carList1[i].id).productCount += carList1[i].saleDetailQueryDTO[m].productCount this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[m]
.attributeList, this.carList.get(carList1[i].id).stockLogList.get(carList1[i]
.saleDetailQueryDTO[m].attributeList) + carList1[i].saleDetailQueryDTO[m]
.productCount)
this.carList.get(carList1[i].id).productCount += carList1[i].saleDetailQueryDTO[m]
.productCount
} else { //规格不同 } else { //规格不同
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[ this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[
m].attributeList, carList1[i].saleDetailQueryDTO[m].productCount) m].attributeList, carList1[i].saleDetailQueryDTO[m].productCount)
this.carList.get(carList1[i].id).productCount += carList1[i].saleDetailQueryDTO[m].productCount this.carList.get(carList1[i].id).productCount += carList1[i].saleDetailQueryDTO[m]
.productCount
} }
} }
} else { //商品不同 } else { //商品不同
@ -919,36 +954,35 @@
}, },
//点击底部开单按钮 //点击底部开单按钮
goSell() { goSell() {
console.log(this.carList) if (this.khName == '') {
this.$refs.printerPopup.open('center') this.tui.toast('请选择客户!')
// console.log(this.khName) return
// console.log(this.lbgName) }
// console.log(this.wlName) if (this.xsyId == '') {
// if(this.khName == ''){ this.tui.toast('请选择销售员!')
// this.tui.toast('请选择客户!') return
// return }
// } if (this.shouldPay == 0) {
// if(this.xsyId ==''){ this.tui.toast('请维护商品金额!')
// this.tui.toast('请选择销售员!') return
// return }
// } if (this.relPrice == (0 || '')) {
// if(this.relPrice == (0 || '')){ this.tui.toast('请输入实收金额!')
// this.tui.toast('请输入实收金额!') return
// return } else if (this.priceOk == (0 || '')) {
// }else if(this.priceOk==(0 || '')){ this.tui.toast('请输入已收金额!')
// this.tui.toast('请输入已收金额!') return
// return }
// } if (this.carList.size == 0) {
// if(this.carList.size == 0){ this.tui.toast('请添加商品!')
// this.tui.toast('请添加商品!') return
// return }
// } if (this.radioType != '') {
// if(this.radioType != ''){ if (this.radioType == 0 || this.radioType == 1 || this.radioType == 4) {
// if(this.radioType == 0 || this.radioType == 1 || this.radioType== 4){ if (this.wlName == '') {
// if(this.wlName == ''){ this.tui.toast('请选择配送公司!')
// this.tui.toast('请选择配送公司!') return
// return }
// }
// if(this.radioType1 == 0){ // if(this.radioType1 == 0){
// if(this.lbgName == ''){ // if(this.lbgName == ''){
// this.tui.toast('请选择配送人员!') // this.tui.toast('请选择配送人员!')
@ -956,73 +990,79 @@
// } // }
// } // }
// }else if(this.radioType== 3){ } else if (this.radioType == 3) {
// if(this.pbAddress == ''){ if (this.pbAddress == '') {
// this.tui.toast('请输入拼包地址!') this.tui.toast('请输入拼包地址!')
// return return
// } }
// } }
// }else{ } else {
// this.tui.toast('请选择发货方式!') this.tui.toast('请选择发货方式!')
// return return
// } }
// let obj = { let obj = {
// orderByWorker: this.lbgName.workerId, orderByWorker: this.lbgName.workerId,
// saleId:this.saleId, saleId: this.saleId,
// sale: { sale: {
// // relPrice:, // relPrice:,
// alreadyEarn: this.priceOk, //已付金额 alreadyEarn: this.priceOk, //已付金额
// realAmount: this.relPrice, //实收金额 realAmount: this.relPrice, //实收金额
// noEarn: this.relPrice - this.priceOk, //欠款 noEarn: this.relPrice - this.priceOk, //欠款
// totalAmount: this.shouldPay, //总金额 totalAmount: this.shouldPay, //总金额
// area: this.khName.area, area: this.khName.area,
// city: this.khName.city, city: this.khName.city,
// province: this.khName.province, province: this.khName.province,
// payStatus: 1, payStatus: 1,
// receiveAddress: this.khName.address, receiveAddress: this.khName.address,
// userId:this.khName.userId, userId: this.khName.userId,
// userName:this.khName.name, userName: this.khName.name,
// transportType: this.radioType1 == 1?2:this.radioType, //this.radioType transportType: this.radioType1 == 1 ? 2 : this.radioType, //this.radioType
// discount: this.discountNum, discount: this.discountNum,
// createBy: this.xsyId, createBy: this.xsyId,
// createByName:this.createByName, createByName: this.createByName,
// remark: this.remark, remark: this.remark,
// otherExpense:this.otherExpense ==''?0:this.otherExpense, //其他费用 otherExpense: this.otherExpense == '' ? 0 : this.otherExpense, //其他费用
// shareAddress:this.pbAddress, shareAddress: this.pbAddress,
// transCompany: this.wlName.id, transCompany: this.wlName.id,
// companyName:this.wlName.companyName, companyName: this.wlName.companyName,
// }, },
// saleDetailList: [] saleDetailList: []
// } }
// let purchaseDetails = []; let purchaseDetails = [];
// this.carList.forEach(function(value, key) { this.carList.forEach(function(value, key) {
// console.log(value.stockLogList) console.log(value.stockLogList)
// value.stockLogList.forEach(function(values, keys) { value.stockLogList.forEach(function(values, keys) {
// let obj = { let obj = {
// productCount: values, productCount: values,
// attributeList: keys attributeList: keys
// } }
// value.stockLogList1.push(obj) value.stockLogList1.push(obj)
// }) })
// console.log(value) console.log(value)
// purchaseDetails.push(value) purchaseDetails.push(value)
// }) })
//this.saleDetailList = purchaseDetails; this.saleDetailList = purchaseDetails;
// obj.saleDetailList = purchaseDetails; obj.saleDetailList = purchaseDetails;
// this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => { let url = ''
// if (res.code == 200) { if (this.saleId != '') {
// uni.showToast({ url = '/app/sale/shareToBuyNew'
// title: "开单成功", } else {
// icon: 'none' url = '/app/sale/buyNew'
// }) }
// setTimeout(res => { this.tui.request(url, "post", obj, false, false).then((res) => {
// this.$refs.printerPopup.open('center') if (res.code == 200) {
// }, 1000) uni.showToast({
title: "开单成功",
// }else{ icon: 'none'
// this.tui.toast(res.message) })
// } setTimeout(res => {
// }) this.$refs.printerPopup.open('center')
}, 1000)
} else {
this.tui.toast(res.message)
}
})
}, },
//打印取消按钮 //打印取消按钮
@ -1034,15 +1074,6 @@
//打印小票 //打印小票
onPrint(opt) { onPrint(opt) {
let that = this; let that = this;
//快递单600*1040 入库单440*320 8像素=1mm
/**
* 打印文字
* x: 文字方块左上角X座标,单位dot
* y: 文字方块左上角Y座标,单位dot
* fontName,fontSize: 字体,取值: 參考文檔
* rotation: 旋转 1-90度 2-180度 3-270度 其他-不旋转
* content: 文字内容
*/
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLSETMAG(2, 2) strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold') blesdk.addCPCLSETBOLD('bold')
@ -1053,19 +1084,25 @@
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:' + this.khName.name) strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:' + this.khName.name)
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:' + this.createByName) strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:' + this.createByName)
strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:'+this.formatDate(new Date(), 'YYYY-MM-DD')) //+ strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:' + this.formatDate(new Date(),
strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0, '=========================================================') 'YYYY-MM-DD')) //+
strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0,
'=========================================================')
this.carList.forEach(function(value, key) { this.carList.forEach(function(value, key) {
strCmd += blesdk.addCPCLText('0', that.yNum+= 30, '24', '0', 0, value.productName+'('+value.productSn+')'+'折扣:'+(value.discount<10?value.discount:'无折扣')) strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, value.productName + '(' +
value.productSn + ')' + '折扣:' + (value.discount < 10 ? value.discount : '无折扣'))
value.stockLogList.forEach(function(value1, key1) { value.stockLogList.forEach(function(value1, key1) {
strCmd += blesdk.addCPCLText('0', that.yNum+= 30, '24', '0', 0,(that.slicePrint(key1))+'*'+value1) strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, (that.slicePrint(
key1)) + '*' + value1)
strCmd += blesdk.addCPCLText('200', that.yNum, '24', '0', 0, '单价:' + value.lsprice) strCmd += blesdk.addCPCLText('200', that.yNum, '24', '0', 0, '单价:' + value.lsprice)
strCmd += blesdk.addCPCLText('360', that.yNum, '24', '0', 0, '总价:'+(value.lsprice*value1)) strCmd += blesdk.addCPCLText('360', that.yNum, '24', '0', 0, '总价:' + (value
.lsprice * value1))
}) })
}) })
strCmd += blesdk.addCPCLText('0', this.yNum+=20, '24', '0', 0, '===============================================================') strCmd += blesdk.addCPCLText('0', this.yNum += 20, '24', '0', 0,
'===============================================================')
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '总数量:' + this.totalAmount) strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '总数量:' + this.totalAmount)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额' + this.shouldPay) strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额' + this.shouldPay)
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice) strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice)
@ -1103,7 +1140,8 @@
if (/(Y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); if (/(Y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
for (var k in o) for (var k in o)
if (new RegExp('(' + k + ')').test(fmt)) if (new RegExp('(' + k + ')').test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))); fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k])
.length)));
return fmt; return fmt;
}, },
//编辑每一个的单价 //编辑每一个的单价
@ -1194,6 +1232,25 @@
}) })
}, },
//修改已选规格的数量
GoodsNumChange(e, index, index1) {
console.log(this.carList)
let that = this;
this.carList.get(index).stockLogList.set(index1, e)
this.carList.get(index).productCount = 0
this.shouldPay = 0
this.totalAmount = 0
this.carList.get(index).stockLogList.forEach(function(value, key) {
console.log(that.carList.get(index))
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)
.unitPrice
})
this.carList.forEach(function(value, key) {
that.shouldPay = that.shouldPay + value.price
that.totalAmount = that.totalAmount + value.productCount
})
},
//清空全部数据 //清空全部数据
clearAll() { clearAll() {
let that = this; let that = this;
@ -1217,6 +1274,9 @@
that.noPay = 0 that.noPay = 0
that.otherExpense = 0 that.otherExpense = 0
that.totalAmount = 0 that.totalAmount = 0
that.createByName = ''
that.xsyId = ''
this.saleId = ''
} }
}) })
} }
@ -1229,6 +1289,7 @@
.page1 { .page1 {
height: 100%; height: 100%;
} }
.popup-pay-content { .popup-pay-content {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -1237,6 +1298,7 @@
height: auto; height: auto;
background-color: #fff; background-color: #fff;
} }
.content { .content {
border-top: 1px solid #eee; border-top: 1px solid #eee;
overflow-y: scroll; overflow-y: scroll;
@ -1250,6 +1312,7 @@
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.popup-pay-title { .popup-pay-title {
font-size: 36rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
@ -1345,9 +1408,11 @@
font-weight: bold; font-weight: bold;
display: flex; display: flex;
} }
.discount-num { .discount-num {
width: 200rpx; width: 200rpx;
} }
.shop-productName { .shop-productName {
flex: 1; flex: 1;
display: flex; display: flex;
@ -1358,9 +1423,11 @@
.shop-productName view { .shop-productName view {
height: 55rpx; height: 55rpx;
} }
.checklist-group { .checklist-group {
height: 80rpx !important; height: 80rpx !important;
} }
// .shop-name { // .shop-name {
// .uni-icons { // .uni-icons {
// color: #088FEB !important; // color: #088FEB !important;
@ -1375,9 +1442,9 @@
} }
.shop-collapse text { .shop-collapse text {
flex: 1; width: 40%;
text-align: center; text-align: center;
padding-right: 40rpx; // padding-right: 40rpx;
border-right: 1px solid #eee; border-right: 1px solid #eee;
} }
@ -1485,6 +1552,7 @@
height: 150rpx; height: 150rpx;
width: 500rpx; width: 500rpx;
} }
.shop-popup-content { .shop-popup-content {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -1602,6 +1670,7 @@
border-radius: 70rpx; border-radius: 70rpx;
} }
} }
// .uni-select__input-text{ // .uni-select__input-text{
// text-align: center !important; // text-align: center !important;
// padding-left: 80rpx; // padding-left: 80rpx;

2
pages/inventory/inventory.vue

@ -22,7 +22,7 @@
</view> </view>
</view> </view>
<view class="title-left-box"> <view class="title-left-box">
<text>¥{{warnMsg.stockCost}}</text> <text>¥{{type ==0?warnMsg.stockCost:'0'}}</text>
<text>库存成本</text> <text>库存成本</text>
</view> </view>

7
pages/inventory/inventoryDetail.vue

@ -91,9 +91,11 @@
}, },
onLoad(option) { onLoad(option) {
this.dataList = JSON.parse(option.item); this.dataList = JSON.parse(option.item);
this.getShareList();
this.type = uni.getStorageSync('type') this.type = uni.getStorageSync('type')
}, },
onShow(){
this.getShareList();
},
methods: { methods: {
//库存商品详情 //库存商品详情
getShareList() { getShareList() {
@ -110,10 +112,9 @@
}, },
//去新增商品页编辑 //去新增商品页编辑
goToAddGoods(){ goToAddGoods(){
console.log(this.id)
//去编辑页的时候,分类不能更改了 //去编辑页的时候,分类不能更改了
uni.navigateTo({ uni.navigateTo({
url: "/pages/inventory/addGoods" url: "/pages/inventory/addGoods?dataList="+JSON.stringify(this.dataList)
}) })
}, },
onPrint(opt) { onPrint(opt) {

Loading…
Cancel
Save