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. 42
      pages/inventory/addGoods.vue
  9. 70
      pages/inventory/addinventory.vue
  10. 2385
      pages/inventory/goodsList1.vue
  11. 2
      pages/inventory/inventory.vue
  12. 9
      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 = {

42
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> -->
@ -64,7 +64,8 @@
salesWeek: '', salesWeek: '',
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) => {
@ -192,12 +205,19 @@
}, },
// 触发提交表单 // 触发提交表单
submit() { submit() {
this.$refs.form.validate().then(res => { let url = ''
this.tui.request("/app/product/save", "post", res, false, false).then((res1) => { this.$refs.form.validate().then(res => {
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,15 +39,21 @@
</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 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>
@ -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>
@ -518,6 +524,41 @@
uni.navigateTo({ uni.navigateTo({
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 == '') {
@ -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;

2385
pages/inventory/goodsList1.vue

File diff suppressed because it is too large

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>

9
pages/inventory/inventoryDetail.vue

@ -90,9 +90,11 @@
kkPrinter kkPrinter
}, },
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: {
//库存商品详情 //库存商品详情
@ -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