Browse Source

新版本

master
wangfukang 2 years ago
parent
commit
f3c0430503
  1. BIN
      pages/.DS_Store
  2. BIN
      pages/billing/.DS_Store
  3. 74
      pages/billing/addUser.vue
  4. 767
      pages/billing/changeGoods1.vue
  5. 83
      pages/billing/delivery.vue
  6. BIN
      pages/index/.DS_Store
  7. 1309
      pages/index/addHangOrder.vue
  8. 1
      pages/index/checkShop.vue
  9. 685
      pages/index/customAndSupplierProductDetail.vue
  10. 80
      pages/index/dataStatistics.vue
  11. 1285
      pages/index/downStearmList.vue
  12. 4
      pages/index/downarrears.vue
  13. 101
      pages/index/downstream.vue
  14. 2
      pages/index/home.vue
  15. 388
      pages/index/index.vue
  16. 244
      pages/index/shareStyle.vue
  17. 99
      pages/index/upstream.vue
  18. 12
      pages/index/waitStorage.vue
  19. 80
      pages/index/waitStorageDetail.vue
  20. BIN
      pages/inventory/.DS_Store
  21. 2390
      pages/inventory/AIInventory.vue
  22. 1665
      pages/inventory/addinventory.vue
  23. 277
      pages/inventory/changeGoods1.vue
  24. 3988
      pages/inventory/goodsList1.vue
  25. 389
      pages/inventory/inventory.vue
  26. 318
      pages/inventory/inventoryDetail.vue

BIN
pages/.DS_Store

Binary file not shown.

BIN
pages/billing/.DS_Store

Binary file not shown.

74
pages/billing/addUser.vue

@ -2,15 +2,26 @@
<template>
<view>
<view class="formBox">
<uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="85px">
<uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="170rpx">
<uni-forms-item label="名称" name="consigneeName">
<uni-easyinput type="text" v-model="formData.consigneeName" placeholder="请输入名称" />
<button @tap="getUserPhone">通讯录导入</button>
</uni-forms-item>
<uni-forms-item label="手机号码" name="consigneeMobile">
<uni-easyinput type="number" v-model="formData.consigneeMobile" placeholder="请输入手机号码" />
</uni-forms-item>
</uni-forms-item>
<uni-forms-item class="qichu" label="期初欠款" name="consigneeMobile" v-if="popleType == 'khName'">
<input type="number" @tap="showPrice = true" disabled v-model="formData.noEarn" placeholder="请输入客户已有欠款" style="width: 100%;height: 100%;border: 1px solid #eee;padding-left: 20rpx;"/>
</uni-forms-item>
<view v-if="popleType == 'khName'" style="color: red;font-size:22rpx;text-align:right;margin-bottom: 20rpx;">
*客户欠款输入正数,如有余额则此处输入负数
</view>
<uni-forms-item class="qichu" label="期初欠款" name="consigneeMobile" v-if="popleType == 'gysName'">
<input type="number" @tap="showPrice = true" disabled v-model="formData.noEarn" placeholder="请输入已有供应商欠款" style="width: 100%;height: 100%;border: 1px solid #eee;padding-left: 20rpx;"/>
</uni-forms-item>
<view v-if="popleType == 'gysName'" style="color: red;font-size:22rpx;text-align:right;margin-bottom: 20rpx;">
*供应商的欠款需输入正数,如有余额则此处输入负数
</view>
<uni-forms-item label="地址" name="address1">
<view class="input selectcity" @tap="openPicker">
<input placeholder="请选择省市区" disabled type="text" v-model="formData.address1"></input>
@ -27,7 +38,8 @@
<cc-selectDity :show="show" @sureSelectArea="onsetCity" @hideShow="onhideShow"></cc-selectDity>
</view>
<u-modal :show="delShow" :title="'删除'" :content="'是否确认删除此用户?'" showCancelButton="true" @cancel="delShow = false"
@confirm="delItemModal"></u-modal>
@confirm="delItemModal"></u-modal>
<u-keyboard ref="uKeyboard" @confirm='keyboardConfirm' @cancel="keyCancel" :defaultText="keyboardNum" @change="valChange" @backspace="backspace" :overlay='false' :closeOnClickOverlay='true' mode="price" :show="showPrice"></u-keyboard>
</view>
</template>
@ -40,9 +52,12 @@
} from 'vuex';
export default {
data() {
return {
return {
showPrice:false,
keyboardNum:'',
userInfo: '',
show: false,
show: false,
goodsNum:'',
delShow: false,
addressObj: {},
type: '',
@ -54,7 +69,8 @@
address: '',
province: '',
city: '',
area: ''
area: '',
noEarn:""
},
// 单选数据源
sexs: [{
@ -131,19 +147,22 @@
},
methods: {
//获取手机通讯录
getUserPhone() {
getUserPhone() {
let that = this;
wx.chooseContact({
success: function(res) {
that.formData.consigneeMobile = res.phoneNumber
that.formData.consigneeName = res.displayName
},
fail(res) {
}
fail(res) {}
})
},
keyboardConfirm(){
if(this.keyboardNum != ''){
this.formData.noEarn = this.keyboardNum
}
this.showPrice = false
this.keyboardNum = ''
},
del() {
this.delShow = true;
@ -189,6 +208,20 @@
},
nameBlur() {
this.formData.username = this.formData.phone;
},
keyCancel(){
this.showFu = false
this.showPrice = false
this.keyboardNum = ''
},
// 按键被点击(点击退格键不会触发此事件)
valChange(val) {
// 将每次按键的值拼接到value变量中,注意+=写法
this.keyboardNum += val
},
// 退格键被点击
backspace(val) {
this.keyboardNum = val
},
authVerification() {
uni.getSetting({
@ -223,12 +256,9 @@
uni.chooseLocation({
latitude:'38.335974',
longitude:'116.805783',
success: function(res) {
console.log('11111',res)
if (res.name != '') {
let aaa = getArea(res.address)
console.log('2222',aaa)
success: function(res) {
if (res.name != '') {
let aaa = getArea(res.address)
that.formData.province = aaa.province
that.formData.city = aaa.city
that.formData.area = aaa.country
@ -285,7 +315,8 @@
province: this.formData.province,
city: this.formData.city,
area: this.formData.area,
userName: this.formData.consigneeMobile
userName: this.formData.consigneeMobile,
amountOwed:this.formData.noEarn
}, false, true).then((res) => {
if (res.code == 200) {
uni.showToast({
@ -402,5 +433,8 @@
background: #088FEB;
color: #fff;
border-radius: 0;
}
.qichu{
margin-bottom: 0;
}
</style>

767
pages/billing/changeGoods1.vue

File diff suppressed because it is too large

83
pages/billing/delivery.vue

@ -1,83 +0,0 @@
<template>
<view>
<view class="formBox">
<view>
<u-radio-group
borderBottom
placement="column"
v-model="choose"
iconPlacement="right">
<u-radio activeColor="red" label="思悠悠,恨悠悠,恨到归时方始休" name="1"></u-radio>
<u-radio activeColor="red" label="思悠悠,恨悠悠,恨到归时方始休" name="2"></u-radio>
<u-radio activeColor="red" label="思悠悠,恨悠悠,恨到归时方始休" name="3"></u-radio>
</u-radio-group>
</view>
<view class="tui-tabbar">
<u-button type="primary" shape="circle" @tap.stop="submit(ret)">确定</u-button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
choose:''
}
}
}
</script>
<style lang="scss" scoped>
.formBox {
margin: 20rpx;
padding: 20rpx 26rpx;
border-radius: 14rpx;
box-shadow: 0px 1px 10px 2px #e2e2e2;
background-color: #fff;
.uni-data-select {
width: 100%;
}
.tui-order-title {
position: relative;
font-size: 28upx;
line-height: 28upx;
padding-left: 16upx;
box-sizing: border-box;
}
.tui-order-title::before {
content: '';
position: absolute;
left: 0;
top: 0;
border-left: 8upx solid $u-primary;
height: 120%;
border-radius: 4upx;
}
}
.tui-tabbar {
width: 100%;
height: 98rpx;
background: #fff;
position: fixed;
left: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 26rpx;
box-shadow: 0 0 1px rgba(0, 0, 0, .3);
padding-bottom: env(safe-area-inset-bottom);
z-index: 996;
}
</style>
<style>
.u-radio {
margin: 15upx 0;
}
</style>

BIN
pages/index/.DS_Store

Binary file not shown.

1309
pages/index/addHangOrder.vue

File diff suppressed because it is too large

1
pages/index/checkShop.vue

@ -87,6 +87,7 @@
uni.setStorageSync('shopAddress', res.result.shopAddress)
uni.setStorageSync('shopIcon', res.result.shopIcon)
uni.setStorageSync('type', res.result.userType)
uni.setStorageSync('shopId', this.current)
this.tui.toast('切换店铺成功', 2000, true)
setTimeout(() => {
uni.reLaunch({

685
pages/index/customAndSupplierProductDetail.vue

@ -1,34 +1,310 @@
<template>
<view class="container">
<view class="tui-order-item boxbg">
<view class="shop-box" v-for="(item,index4) in list" :key="index4">
<uni-card :title="item.productName?item.productName:'暂无'" :sub-title="item.productSn" v-if="type=='khName'">
<view v-for="(data,index2) in item.customerBuySaleVoList" :key="index2" style="padding-bottom: 20rpx;margin-bottom: 20rpx;border-bottom: 1px solid #eee;">
<view class="uni-body" style="text-align: center;display: flex;flex-direction: column;">
<text>{{data.createTime}} </text>
<text style="color:red;">实际售价:{{data.customerBuyProductDetailLogVos[0].realPrice}}</text>
<view class="container">
<uni-datetime-picker style="margin-bottom:10px;" v-if="type=='khName'" v-model="range" type="daterange" @change="searchList" />
<view class="tui-order-item boxbg" v-if="type=='khName'">
<view style="background: #fff;border: 1px solid #eee;">
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#007aff"></uni-segmented-control>
</view>
<view class="content">
<view v-show="current === 1">
<view class="shop-box" v-for="(item,index4) in list" :key="index4" style="background: #fff;display: block;overflow: hidden;margin: 0 auto 10px;">
<view>
<view style="width: 100%;height: 80rpx;line-height: 80rpx;">
<text style="display:inline-block;width: 55%;text-align: center;font-weight: bold;font-size: 30rpx;">
日期:{{item.createTime | removeStr}}
</text>
<text style="display:inline-block;width: 45%;text-align: center;border-left: 1px solid #eee;">
操作:{{item.createByName}}
</text>
</view>
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr style="background: #eee;">
<uni-th align="center" width="60">货号</uni-th>
<uni-th align="center" width="50">数量</uni-th>
<uni-th align="center" width="70">拿货金额</uni-th>
<uni-th align="center" width="70">采购成本</uni-th>
<uni-th align="center" width="70">利润</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item1,index) in item.saleDetailDTOList" :key="index" @tap="xiaoshouDetail('1',item1)">
<uni-td align="center">{{item1.productSn}}</uni-td>
<uni-td align="center">{{item1.productCount == null ?'0':item1.productCount}}</uni-td>
<uni-td align="center">{{item1.discountAmount * item1.productCount}}</uni-td>
<uni-td align="center">{{userType == 0 && isDownKH == false?(item1.purchasePrice * item1.productCount):'0'}}</uni-td>
<uni-td align="center">{{userType == 0 && isDownKH == false?((item1.discountAmount - item1.purchasePrice)*item1.productCount).toFixed(2):0}}</uni-td>
</uni-tr>
</uni-table>
</view>
<view style="margin: 5px 0;height: 1px;background: #eee;"></view>
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;">
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;">商品规格</view>
<view style="width: 29%;text-align: center;">数量</view>
</view>
</view>
<view v-show="current === 0">
<view style="background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%);overflow: hidden;color:#eee;">
<view class="top" ref="top">
<view class="top1">
<view class="hello-box">
<view class="hello-left">
<text style="font-size: 40rpx;font-weight: 800;line-height: 56rpx;color: rgba(86, 132, 255, 1);">
Hi
</text>
</view>
<view class="hello-name">
{{shopName+'对账单'}}
</view>
<view class="hello-right"></view>
</view>
<view class="hello-text">
欢迎查看客户:{{duizhangList.userName == null ?"" : duizhangList.userName}}的对账单
</view>
<view style="text-align: center;display: flex;border-top: 1px solid #eee;padding: 10px 0;color: #7E5E60;position: absolute;top: 380rpx;width: 100%;font-weight: bold;">
<view style="display: flex;flex-direction: column;width: 20%;">
<text>{{duizhangList.initialArrears >= 0?'期初欠款':'期初余额'}}</text>
<text>{{duizhangList.initialArrears == null ?"0" :Math.abs(duizhangList.initialArrears)}}</text>
</view>
<view style="display: flex;flex-direction: column;width: 20%;border-left: 1px solid #eee;">
<text>{{duizhangList.endArrears >= 0?'期末欠款':'期末余额'}}</text>
<text>{{duizhangList.endArrears == null ?"0" :Math.abs(duizhangList.endArrears)}}</text>
</view>
<view style="display: flex;flex-direction: column;width: 20%;border-left: 1px solid #eee;">
<text>{{duizhangList.arrears >= 0?'本期欠款':'本期余额'}}</text>
<text>{{duizhangList.arrears == null ?"0" :Math.abs(duizhangList.arrears)}}</text>
</view>
<view style="display: flex;flex-direction: column;width: 20%;border-left: 1px solid #eee;">
<text>拿货总额</text>
<text>{{duizhangList.totalSale == null ?"0" :duizhangList.totalSale}}</text>
</view>
<view style="display: flex;flex-direction: column;width: 20%;border-left: 1px solid #eee;">
<text>退货总额</text>
<text>{{duizhangList.totalReturn == null ?"0" :duizhangList.totalReturn}}</text>
</view>
</view>
</view>
</view>
<view v-for="(data1,index) in data.customerBuyProductDetailLogVos" :key="index" style='height: 50rpx;line-height: 50rpx;'>
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;float: left;height: 50rpx;overflow: hidden;">
{{data1.attributeList | sliceMsg}}
</view>
<view v-if="duizhangList" v-for="(item,index) in duizhangRecords" :key="index" style="background: #fff;display: block;overflow: hidden;margin: 20rpx auto;width: 95%;border-radius: 10px;">
<view style="display: flex;">
<view style="margin-top: 40rpx;width: 100rpx;height: 100rpx;border-radius: 80rpx;background: #8470FF;color: #fff;font-size: 26rpx;padding: 17rpx 24rpx;margin: 35rpx 0 0 35rpx;">
{{item.dealingsType == 0 ?"销售开单" :item.dealingsType == 1 ?"退货" :item.dealingsType == 2 ?"回款" :item.dealingsType == 3 && item.amount< 0?"初始余额" :item.dealingsType == 3 && item.amount>= 0?"初始欠款" :item.dealingsType == 4 ?"充值金额" :item.dealingsType == 5 ?"追加欠款" :item.dealingsType == 6 ?"撤销订单" :""}}
</view>
<view style="height: 170rpx;line-height: 50rpx;padding-left: 30rpx;">
<view style="color: #747474;font-size: 28rpx;font-weight: bold;font-size: 32rpx;color: #000;margin-top:36rpx;">
{{item.createTime | removeStr}}
</view>
<view style="color: #747474;font-size: 28rpx;">
操作人:{{item.createByName == null ?"" :item.createByName}}
</view>
</view>
</view>
<view v-if="item.billSaleDetailVos != null || item.billReturnSaleDetailVos != null" style="height: 60rpx;line-height: 60rpx;padding-left: 20rpx;font-size: 28rpx;background: #FFF0F5;color: #F08080;margin-bottom: 20rpx;width: 95%;margin: 0 auto 20rpx;border-radius: 5px;">
拿货数据~请查收
</view>
<view v-if="item.billSaleDetailVos != null" style="width: 95%;margin: 0 auto;border: 1.5px solid #000;border-radius: 10px;">
<uni-table stripe>
<uni-tr style="background: #FFBF00;">
<uni-th align="center" width="120">
<text style="font-weight: bold;">
【销】
</text>
货号
</uni-th>
<uni-th align="center" width="55">数量</uni-th>
<uni-th align="center" width="70">销售价</uni-th>
<uni-th align="center" width="80">总价</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item1,index1) in item.billSaleDetailVos" :key="index1" @tap="clickDetail(item1)">
<uni-td align="center">
<text>
{{item1.productSn == null ?"" :item1.productSn}}
</text>
</uni-td>
<uni-td align="center">{{item1.productCount == null ?"0" :item1.productCount}}</uni-td>
<uni-td align="center">{{item1.discountAmount == null ?"0" :item1.discountAmount}}</uni-td>
<uni-td align="center">{{item1.totalAmount == null ?"0" :item1.totalAmount}}</uni-td>
</uni-tr>
</uni-table>
</view>
<view v-if="item.billReturnSaleDetailVos != null" style="width: 95%;margin: 20rpx auto 0;border: 1.5px solid #000;border-radius: 10px;">
<uni-table stripe>
<uni-tr style="background: #FFBF00;">
<uni-th align="center" width="120">
<text style="font-weight: bold;color:#F08080;">
【退】
</text>
货号
</uni-th>
<!-- <uni-th align="center">规格</uni-th> -->
<uni-th align="center" width="55">数量</uni-th>
<uni-th align="center" width="70">退货价</uni-th>
<uni-th align="center" width="80">总价</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item1,index1) in item.billReturnSaleDetailVos" :key="index1" @tap="clickDetail(item1)">
<uni-td align="center">
<text>
{{item1.productSn == null ?"" :item1.productSn}}
</text>
</uni-td>
<uni-td align="center">{{item1.productCount == null ?"0" :item1.productCount}}</uni-td>
<uni-td align="center">{{item1.discountAmount == null ?"0" :item1.discountAmount}}</uni-td>
<uni-td align="center">{{item1.totalAmount == null ?"0" :item1.totalAmount}}</uni-td>
</uni-tr>
</uni-table>
</view>
<view style="border-bottom: 2px solid #eee;" v-if="item.billSaleDetailVos != null">
<view style="font-weight: bold;padding: 20rpx;">
付款明细:
</view>
<view>
<view>
<view style="padding-left: 20rpx;">
<text>销售金额:{{item.totalAmount == null ?"0" :item.totalAmount}}</text>
</view>
<view style="padding-left: 20rpx;">
<text>退货金额:{{item.returnSaleTotalAmount == null ?"0" :item.returnSaleTotalAmount}}</text>
</view>
</view>
<view style="padding-left: 20rpx;margin-top: 40rpx;">
<view>欠款抵退货:{{item.debtDeductionAmount == null ?"0" :item.debtDeductionAmount}}</view>
<view>销售抵退货:{{item.saleDeductionAmount == null ?"0" :item.saleDeductionAmount}}</view>
<view>余额抵销售:{{item.balanceDeductionAmount == null ?"0" :item.balanceDeductionAmount}}</view>
</view>
</view>
<view style="width: 29%;text-align: center;float: left;">
{{data1.productCount}}
<view style="padding-left: 10px;margin: 20px 0 10px;height: 60rpx;line-height: 60rpx;text-align: center;font-size: 30rpx;font-weight: bold;display: flex;">
<text style="flex: 1;">本单实收:{{item.realAmount == null ?"0" :item.realAmount}}</text>
<text style="display: inline-block;padding-left: 20rpx;flex: 1;">本单已收:{{item.alreadyEarn == null ?"0" :item.alreadyEarn}}</text>
</view>
</view>
<view style="text-align: center;display: flex;padding: 10px 0;color: #000;">
<view v-if="item.lastDebtAmount >= 0" style="flex: 1;display: flex;flex-direction: column;">
<text>之前欠款</text>
<text>{{item.lastDebtAmount == null ?"0" :item.lastDebtAmount}}</text>
</view>
<view v-if="item.lastDebtAmount < 0" style="flex: 1;display: flex;flex-direction: column;">
<text>之前余额</text>
<text>{{item.lastDebtAmount == null ?"0" :Math.abs(item.lastDebtAmount)}}</text>
</view>
<view v-if="item.dealingsType == 5 || item.amount >= 0" style="flex: 1;border-left: 1px solid #eee;display: flex;flex-direction: column;">
<text>{{item.dealingsType == 5?'追加欠款':item.dealingsType == 4?'充值金额':item.dealingsType == 6?'撤销余额':'本单欠款'}}</text>
<text>{{item.amount == null ?"0" :item.dealingsType == 5?Math.abs(item.amount):item.amount}}</text>
</view>
<view v-if="item.amount < 0 && item.dealingsType != 5" style="flex: 1;border-left: 1px solid #eee;display: flex;flex-direction: column;">
<text>{{item.dealingsType == 4?'充值金额':item.dealingsType == 6?'撤销欠款':'本单余额'}}</text>
<text>{{item.amount == null ?"0" :Math.abs(item.amount)}}</text>
</view>
<view v-if="item.balanceDue >= 0" style="flex: 1;border-left: 1px solid #eee;display: flex;flex-direction: column;">
<text>{{item.dealingsType == 6?'撤销后欠款':'本单后欠款'}}</text>
<text>{{item.balanceDue == null ?"0" :item.balanceDue}}</text>
</view>
<view v-if="item.balanceDue < 0" style="flex: 1;border-left: 1px solid #eee;display: flex;flex-direction: column;">
<text>{{item.dealingsType == 6?'撤销后余额':'本单后余额'}}</text>
<text>{{item.balanceDue == null ?"0" :Math.abs(item.balanceDue)}}</text>
</view>
</view>
</view>
<view style="text-align: center;margin-bottom:20rpx;">
<text>对账时间:{{duizhangList.queryDate == null ?"" :duizhangList.queryDate}}</text>
</view>
<view style="text-align: center;height: 100rpx;line-height: 100rpx;border-top: 1px solid #eee;color: #777;">
<text>用快衣店AI,入库、开单更方便</text>
</view>
</view>
<view v-show="current === 2">
<view class="shop-box" v-for="(item,index4) in list" :key="index4" style="background: #fff;display: block;overflow: hidden;margin: 0 auto 10px;">
<view>
<view style="padding-left: 20rpx;margin: 40rpx 0; font-weight: bold;font-size: 36rpx;text-align: center;">
<text>货号:{{item.productSn}}</text>
</view>
<view style="text-align: center;margin-bottom:20rpx;">
<text>名称:{{item.productName}}</text>
<text style="padding: 0 20rpx;">总数量:{{item.productCount == undefined ?'0':item.productCount}}</text>
<!-- <text style="padding: 0 20rpx;" v-if="userType == 0">利润:{{item1.lirun.toFixed(2)}}</text> -->
</view>
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr style="background: #eee;">
<uni-th align="center" width="100">日期</uni-th>
<uni-th align="center" width="50">数量</uni-th>
<uni-th align="center" width="70">拿货价</uni-th>
<uni-th align="center" width="70">采购价</uni-th>
<uni-th align="center" width="70">利润</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item1,index1) in item.customerBuySaleVoList" :key="index1" @tap="xiaoshouDetail('2',item1)">
<uni-td align="center">{{item1.createTime | removeStr}}</uni-td>
<uni-td align="center">{{item1.productCount}}</uni-td>
<uni-td align="center">{{item1.customerBuyProductDetailLogVos[0].realPrice * item1.productCount}}</uni-td>
<uni-td align="center">{{userType == 0 && isDownKH == false?item1.customerBuyProductDetailLogVos[0].purchasePrice * item1.productCount:0}}</uni-td>
<uni-td align="center">{{userType == 0 && isDownKH == false?((item1.customerBuyProductDetailLogVos[0].realPrice - item1.customerBuyProductDetailLogVos[0].purchasePrice) * item1.productCount).toFixed(2):0}}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view v-show="current === 3">
<view v-for="(item,index) in list" :key="index" style="background: #fff;display: block;overflow: hidden;margin: 0 auto 10px;">
<view style="width: 100%;height: 80rpx;line-height: 80rpx;">
<text style="display:inline-block;width: 55%;text-align: center;font-weight: bold;font-size: 30rpx;">
日期:{{item.createTime | removeStr}}
</text>
<text style="display:inline-block;width: 45%;text-align: center;border-left: 1px solid #eee;">
操作:{{item.createByName}}
</text>
</view>
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr style="background: #eee;">
<uni-th align="center" width="85">货号</uni-th>
<uni-th align="center" width="50">数量</uni-th>
<uni-th align="center" width="70">退货价</uni-th>
<uni-th align="center" width="70">采购价</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(items,index1) in item.returnSaleDetailList" :key="index1" @tap="xiaoshouDetail('3',items)">
<uni-td align="center">{{items.productSn}}</uni-td>
<uni-td align="center">{{item.productCount}}</uni-td>
<uni-td align="center">{{items.discountAmount}}</uni-td>
<uni-td align="center">{{userType == 0 && isDownKH == false?items.purchasePrice == null?0:items.purchasePrice:0}}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view class="shop-box" v-if="type==1" v-for="(item,index3) in list" :key="index3">
<uni-card :title="'供应商:'+ (item.purchase.supplierName?item.purchase.supplierName:'暂无')"
:sub-title="item.purchase.createTime?item.purchase.createTime:'暂无'" >
<view class="uni-body" style="text-align: center;"><text v-if="userType == 0 && isDownKH == false">采购价:{{item.purchaseDetails[0].purchasePrice?item.purchaseDetails[0].purchasePrice:'暂无'}}</text> 总数量:{{item.purchase.totalAmount?item.purchase.totalAmount:'暂无'}}</view>
<view style="margin: 5px 0;height: 1px;background: #eee;"></view>
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;">
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;">商品规格</view>
<view style="width: 50%;text-align: center;">总数量</view>
</view>
<view v-for="(items,index1) in item.purchaseDetails" :key="index1">
<view v-for="(data,index2) in items.stockLogList1" :key="index2" style='height: 50rpx;line-height: 50rpx;'>
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;float: left;">
{{data.attributeList | sliceMsg}}
</view>
<view style="width: 50%;text-align: center;float: left;">
{{data.productCount}}
</view>
</view>
</view>
</uni-card>
<uni-card :title="item.productName?item.productName:'暂无'" :sub-title="item.productSn" v-else>
</view>
</view>
<view class="tui-order-item boxbg" v-else>
<view class="shop-box" v-for="(item,index4) in list" :key="index4">
<uni-card :title="item.productName?item.productName:'暂无'" :sub-title="item.productSn">
<view v-for="(data,index2) in item.supplierBuySaleVos" :key="index2" style="padding-bottom: 20rpx;margin-bottom: 20rpx;border-bottom: 1px solid #eee;">
<view class="uni-body" style="text-align: center;display: flex;flex-direction: column;">
<text>{{data.createTime}} </text>
<text v-if="userType==0" style="color:red;">采购价:{{data.supplierBuyProductDetailLogVos[0].purchasePrice}}</text>
<text v-if="userType == 0 && isDownKH == false" style="color:red;">采购价:{{data.supplierBuyProductDetailLogVos[0].purchasePrice}}</text>
</view>
<view style="margin: 5px 0;height: 1px;background: #eee;"></view>
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;">
@ -45,9 +321,61 @@
</view>
</view>
</uni-card>
</view>
</view>
</view>
<view v-if="type =='khName'" style="width: 90rpx;height: 80rpx;position: fixed;bottom: 50rpx;right: 40rpx;">
<button open-type="share" class="shareBtn">
<uni-icons type="redo" size="32"></uni-icons>
<text>分享</text>
</button>
</view>
<u-loadmore :status="status" />
<u-loadmore :status="status" />
<!-- 弹出销售商品规格 -->
<uni-popup ref="xsdetailPopup" background-color="#fff">
<view style="width: 500rpx;min-height: 500rpx;max-height: 1000rpx;overflow: scroll;">
<view @tap="$refs.xsdetailPopup.close()" style='width: 50rpx;height: 50rpx;position: absolute;right: 20rpx;top: 25rpx;'>
<uni-icons type="closeempty" color="red" size="22"></uni-icons>
</view>
<view style="height: 100rpx;line-height: 100rpx;font-weight: bold;font-size: 36rpx;text-align: center;">
规格数量详情
</view>
<uni-table border stripe emptyText="暂无更多数据" style="margin-bottom: 20rpx;border-radius: 10px;">
<!-- 表头行 -->
<uni-tr style="background: #eee;">
<uni-th align="center" width="80">规格</uni-th>
<uni-th align="center" width="55">数量</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item,index) in GDList" :key="index">
<uni-td align="center">{{item.attributeList | sliceMsg}}</uni-td>
<uni-td align="center">{{item.productCount}}</uni-td>
</uni-tr>
</uni-table>
</view>
</uni-popup>
<!-- 弹出商品规格 -->
<uni-popup ref="detailPopup" background-color="#fff">
<view style="width: 250px;min-height: 250px;max-height: 1000rpx;overflow: scroll;">
<view @tap="$refs.detailPopup.close()" style='width: 50rpx;height: 50rpx;position: absolute;right: 20rpx;top: 25rpx;'>
<uni-icons type="closeempty" color="red" size="22"></uni-icons>
</view>
<view style="height: 100rpx;line-height: 100rpx;font-weight: bold;font-size: 36rpx;text-align: center;">
{{detailList.productName}}({{detailList.productSn}})
</view>
<uni-table border stripe emptyText="暂无更多数据" style="margin-bottom: 20rpx;">
<!-- 表头行 -->
<uni-tr style="background: #eee;">
<uni-th align="center" width="80">规格</uni-th>
<uni-th align="center" width="55">数量</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item,index) in detailList.billAttributeListVos" :key="index">
<uni-td align="center">{{item.attributeList | sliceMsg}}</uni-td>
<uni-td align="center">{{item.productCount}}</uni-td>
</uni-tr>
</uni-table>
</view>
</uni-popup>
</view>
</template>
@ -56,12 +384,22 @@
data() {
return {
list:[],
range:[],
GDList:[],
status: 'loadmore',
pages: 1,
pageNum: 1,
userId:'',
shopId:'',
duizhangRecords:[],
detailList:{},
duizhangList:{},
type:'',
userType:''
isDownKH:false,
userType:uni.getStorageSync('type'),
items:['对账单', '拿货(按订单)','拿货(按商品)','退货明细'],
current: 1,
shopName:""
}
},
filters: {
@ -74,21 +412,98 @@
}
}
return name;
},
removeStr(val) {
if(val == null){
return "";
}else{
var dotIndex = val.indexOf('.');
if (dotIndex !== -1) {
return val.substring(0, dotIndex);
}
return val;
}
}
},
onShareAppMessage() {
return {
title: '查看对账单详情',
imageUrl: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/b28b3d46c21d4f60a334b25f56175cf3.jpg',
path: '/pages/index/customAndSupplierProductDetail?popleType=khName&id=' + this.userId + '&shopId=' + this.shopId+ '&shopName=' + this.shopName
}
},
onLoad(option) {
let that = this;
this.getMonth();
this.userId = option.id
this.userType = uni.getStorageSync('type')
this.type = option.popleType
this.type = option.popleType
this.shopName = option.shopName ?option.shopName : uni.getStorageSync('shopName')
this.shopId = option.shopId ?option.shopId : uni.getStorageSync('shopId')
if(option.shopId && option.shopId != uni.getStorageSync('shopId')){
this.isDownKH = true
}
this.getList()
},
onReachBottom() {
if (this.pages >= this.pageNum) return;
if (this.pageNum >= this.pages) return;
this.status = 'loading';
this.pages = ++this.pages;
this.getList();
this.pageNum++;
if(this.current == 0){
this.duizhangdan()
}else{
this.getList();
}
},
methods: {
methods: {
//获取当月1日到当前时间
getMonth() {
let date = new Date()
let year = date.getFullYear().toString() //'年'
let month = date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1).toString():(date.getMonth()+1).toString() //'月'
let da = date.getDate() < 10 ? '0'+date.getDate().toString():date.getDate().toString() //'日'
let end = year + '-' + month + '-' + da //当天
let beg = year + '-' + month + '-01' //当月第一天
this.range = [beg,end]
},
duizhangdan(){
this.tui.request("/app/bill/getCustomerBill", "post", {
customerId:this.userId,
pageNum:this.pageNum,
pageSize:'10',
startDate:this.range[0],
endDate:this.range[1],
shopId:this.shopId
}, false, false).then((res) => {
if (res.code == 200) {
this.status = 'nomore';
if (this.pages == 1) {
this.duizhangList = res.result
this.duizhangRecords = res.result.customerBillSaleVos.records
} else {
for(let i=0;i<res.result.customerBillSaleVos.records.length;i++){
this.duizhangRecords.push(res.result.customerBillSaleVos.records[i])
}
}
this.pages = res.result.customerBillSaleVos.pages
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
xiaoshouDetail(type,item){
if(item){
if(type == '1'){
this.GDList = item.stockLogList1
this.$refs.xsdetailPopup.open()
}else if(type == '2'){
this.GDList = item.customerBuyProductDetailLogVos
this.$refs.xsdetailPopup.open()
}else if(type == '3'){
this.GDList = item.stockLogList1
this.$refs.xsdetailPopup.open()
}
}
},
getList(id) {
this.status = 'loading';
var url,data
@ -100,11 +515,37 @@
pageNum: this.pageNum
}
}else{
url = "/app/sale/getCustomerBuyProductLog"
data = {
userId: this.userId,
pageSize: 10,
pageNum: this.pageNum
if(this.current == 1){
url = "/app/sale/listPages"
data = {
userId: this.userId,
pageVo: {pageSize: 10, pageNumber: this.pageNum},
searchStr: "",
startTime:this.range[0],
endTime:this.range[1],
shopId:this.shopId,
fromWhere:1
}
}else if(this.current == 2){
url = "/app/sale/getCustomerBuyProductLog"
data = {
userId: this.userId,
pageSize: 10,
startDate:this.range[0],
endDate:this.range[1],
pageNum: this.pageNum,
shopId:this.shopId
}
}else if(this.current == 3){
url = "/app/return/getReturnSaleListByUserId"
data = {
userId:this.userId,
startDate:this.range[0],
endDate:this.range[1],
pageNum:this.pageNum,
pageSize:"10",
shopId:this.shopId
}
}
}
this.tui.request(url, "post", data, false, false).then((res) => {
@ -117,12 +558,83 @@
this.list = [...this.list, ...res.result.records]
}
this.pageNum = res.result.pages
this.pages = res.result.pages
if(this.current == 1){
for(let i=0;i<this.list.length;i++){
for(let j=0;j<this.list[i].saleDetailDTOList.length;j++){
this.list[i].saleDetailDTOList[j].productCount = 0
for(let m=0;m<this.list[i].saleDetailDTOList[j].stockLogList1.length;m++){
this.list[i].saleDetailDTOList[j].productCount += this.list[i].saleDetailDTOList[j].stockLogList1[m].productCount
}
}
}
this.$forceUpdate()
}else if(this.current == 2){
for(let i=0;i<this.list.length;i++){
this.list[i].productCount = 0
for(let j=0;j<this.list[i].customerBuySaleVoList.length;j++){
this.list[i].customerBuySaleVoList[j].productCount = 0
for(let m=0;m<this.list[i].customerBuySaleVoList[j].customerBuyProductDetailLogVos.length;m++){
this.list[i].productCount += this.list[i].customerBuySaleVoList[j].customerBuyProductDetailLogVos[m].productCount
this.list[i].customerBuySaleVoList[j].productCount += this.list[i].customerBuySaleVoList[j].customerBuyProductDetailLogVos[m].productCount
}
}
}
this.$forceUpdate()
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}
},
clickDetail(item){
this.detailList = item
this.$refs.detailPopup.open()
},
onClickItem(e) {
if (this.current !== e.currentIndex) {
this.current = e.currentIndex
}
if(e.currentIndex == 0){
this.duizhangList = []
this.pageNum = 1
this.pages = 1
this.duizhangdan()
}else if(e.currentIndex == 1){
this.list = []
this.pageNum = 1
this.getList()
}else if(e.currentIndex == 2){
this.list = []
this.pageNum = 1
this.getList()
}else if(e.currentIndex == 3){
this.list = []
this.pageNum = 1
this.getList()
}
},
searchList() {
if(this.current == 0){
this.duizhangList = []
this.pageNum = 1
this.pages = 1
this.duizhangdan()
}else if(this.current == 1){
this.list = []
this.pageNum = 1
this.getList()
}else if(this.current == 2){
this.list = []
this.pageNum = 1
this.getList()
}else if(this.current == 3){
this.list = []
this.pageNum = 1
this.getList()
}
},
},
}
</script>
@ -135,14 +647,10 @@
font-weight: bold;
}
.container {
padding-bottom: 118rpx;
.boxbg {
padding-top: 10rpx;
background-color: #fff;
margin: 30upx;
border-radius: 10upx;
box-shadow: 0px 1px 10px 2px #e2e2e2;
background-color: #FAF7F7;
}
.tui-order-item {
@ -235,7 +743,6 @@
margin-right: 30rpx;
}
.shop-box {
width: 95%;
margin: 0 auto;
position: relative;
}
@ -314,10 +821,102 @@
padding-left: 20rpx;
border-bottom: 1px solid #088FEB;
}
.shareBtn{
background: rgba(255, 255, 255, 0);
width: 90rpx;
height: 50;
height: 80rpx;
line-height: 80rpx;
border: 1px solid #f3f4f6;
background-color: rgba(255,255,255,0);
}
.shareBtn::after{
border: none;
}
textarea {
margin: 20rpx;
border: 1px solid #eee;
height: 150rpx;
width: 500rpx;
}
.uni-table-scroll {
width: 100%;
overflow-x: auto;
border-radius: 10px;
}
.uni-table-th{
background: #FAE7B5 !important;
color: #000 !important;
}
.top1 {
width: 780rpx;
height: 390rpx;
opacity: 1;
background: linear-gradient(360deg, #FAF7F7 0%, rgba(255, 255, 255, 0) 100%);
}
.ai-bot {
position: absolute;
top: 200rpx;
right: 40rpx;
width: 90rpx;
height: 110rpx;
background-size: 100% !important;
background: url(https://jewel-shop.oss-cn-beijing.aliyuncs.com/66dc640d9e8f4749a234d9ef2af1b257.png) no-repeat;
}
.hello-box {
position: absolute;
left: 42rpx;
top: 205rpx;
width: 220rpx;
height: 56rpx;
.hello-left {
width: 102rpx;
height: 56rpx;
opacity: 1;
background: #fff;
border-radius: 3px;
text-align: center;
transform: skewX(8deg);
}
.hello-right {
position: absolute;
left: 5px;
bottom: 0rpx;
width: 220rpx;
height: 2px;
opacity: 1;
background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
}
.hello-name {
position: absolute;
left: 118rpx;
top: 0;
width: 400rpx;
height: 55rpx;
font-size: 32rpx;
line-height: 55rpx;
color: white;
overflow: hidden;
}
}
.hello-text {
position: absolute;
top: 275rpx;
left: 50rpx;
color: #fff;
font-size: 28rpx;
}
.top {
width: 780rpx;
height: 330rpx;
opacity: 1;
background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%);
overflow: hidden;
}
</style>

80
pages/index/dataStatistics.vue

@ -1,8 +1,8 @@
<template>
<view>
<view style="position: fixed;top: 0;z-index: 99;width:100%;">
<!-- <view style="position: fixed;top: 0;z-index: 99;width:100%;"> -->
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" type="daterange" @change="searchList" />
<view class="IndexContent">
<!-- <view class="IndexContent">
<view class="contentPadding">
<u-grid :col="3">
<u-grid-item>
@ -48,6 +48,20 @@
</view>
</uni-card>
</view>
</view> -->
<view style="width: 100%;margin: 20rpx auto;background: #fff;">
<view class="box" v-for="(item,index) in dataList" :key="index" @tap="goDetail(item)">
<view style="width: 69%;">
<view style="width: 50rpx;height: 50rpx;float: left;margin-right: 20rpx;">
<uni-icons :type="item.icon" size="24" color="red"></uni-icons>
</view>
{{item.name}}
</view>
<view style="width: 30%;">
<text style="display: inline-block;width: 150rpx;text-align: center;">{{item.name == '销售金额'?shopInfo.totalAmount:item.name == '实收金额'?shopInfo.totalAlreadyEarn:item.name == '利润' && type == 0?shopInfo.totalProfit:item.name == '进货金额' && type == 0?shopInfo.purchasingCost:item.name == '退货金额'?shopInfo.returnTotalAmount:item.name == '下单客户'?shopInfo.totalCCount:""}}</text>
<uni-icons type="right" size="24" color="#777"></uni-icons>
</view>
</view>
</view>
</view>
</template>
@ -58,19 +72,45 @@
return {
range:[],
shopInfo:{},
priceList:[],
type:''
type:uni.getStorageSync('type'),
dataList:[{
name:'销售金额',
value:'xiaoshou',
icon:'cart',
},{
name:'实收金额',
value:'shishou',
icon:'auth'
},{
name:'利润',
value:'lirun',
icon:'wallet'
},{
name:'进货金额',
value:'jinhuo',
icon:'home'
},{
name:'退货金额',
value:'tuihuo',
icon:'refreshempty'
},{
name:'下单客户',
value:'xiadankehu',
icon:'staff'
}]
};
},
onShow(){
this.getMonth();
if(this.range ==''){
this.getMonth();
}
this.getSaleInfo();
this.getList();
this.type = uni.getStorageSync('type')
},
methods: {
maskPrice(){
this.tui.toast('订单实收:' + this.shopInfo.totalAlreadyEarn +'回款:'+ this.shopInfo.totalPayAmount)
goDetail(item){
uni.navigateTo({
url:'/package1/index/statisticsDetail?value='+ item.value + '&range=' + JSON.stringify(this.range)
})
},
getSaleInfo() {
this.shopInfo = {}
@ -90,18 +130,6 @@
})
},
getList() {
this.tui.request("/app/sale/getShopMonthData", "POST", {
startDate:this.range[0],
endDate:this.range[1]
}, false, false).then((res) => {
if (res.code == 200) {
this.priceList = res.result
} else {
this.tui.toast(res.message)
}
})
},
//获取当月1日到当前时间
getMonth() {
let date = new Date()
@ -114,7 +142,6 @@
},
searchList() {
this.priceList = [];
this.getList()
this.getSaleInfo()
},
}
@ -222,4 +249,13 @@
.u-zidingyi:nth-child(4) {
background: linear-gradient(#84C1FF, #C4E1FF) !important;
}
.box{
width: 100%;
height: 100rpx;
padding-left: 20rpx;
display: flex;
line-height: 100rpx;
font-size: 34rpx;
border-bottom: 1px solid #eee;
}
</style>

1285
pages/index/downStearmList.vue

File diff suppressed because it is too large

4
pages/index/downarrears.vue

@ -3,7 +3,7 @@
<u-alert description="点击可跳转至出库单" type="primary"></u-alert>
<view class="ulList" v-if="list.length > 0">
<ul>
<li v-for="item in list" @tap="returnPrice(item)">
<li v-for="(item,index) in list" @tap="returnPrice(item)" :key="index">
<uni-card :title="item.userName == null ?'暂无':item.userName" :sub-title="item.createTime == null ?'暂无':item.createTime" :extra="'订单金额:¥'+(item.totalAmount == null ?'暂无':item.totalAmount)"
thumbnail="/static/images/dingdan/dd1.png">
<view class="uni-body"><text class="cardText">销售员:</text> {{item.createByName == null ?'暂无':item.createByName}}</view>
@ -14,7 +14,7 @@
<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 ?'待配货' :'挂单'}}
</view>
<view class="return-price" @tap.stop="returnPrice(item)">回款</view>
<!-- <view class="return-price" @tap.stop="returnPrice(item)">回款</view> -->
</uni-card>
</li>
</ul>

101
pages/index/downstream.vue

@ -2,20 +2,48 @@
<view>
<view class="formBox">
<u-alert description="点击可查看对应每笔销售单" type="primary"></u-alert>
<view class="swipe-action">
<view class="swipe-action__content" @tap="onItemClick(item)" v-for="(item,index) in list" :key="index">
<view class="swipe-action__content__left">
<view class="swipe-action__content__text">{{ item.nickname == null ?'暂无':item.nickname}}</view>
</view>
<view class="swipe-action__content__right">
<view class="swipe-action__content__right__text">欠款总金额:</view>
<view class="swipe-action__content__right__money">
{{ item.no_earn == null ?'暂无':item.no_earn }}
</view>
<view>
<view v-for="(item,index) in list" :key="index" style="display: flex;height: 160rpx;margin-top: 20rpx;background: #fff;">
<view style="flex: 1;height: 160rpx;padding-left: 20rpx;">
<view style="height: 80rpx;line-height: 80rpx;">
<view>{{ item.nickname == null ?'暂无':item.nickname}}</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;color: red;">
<view>欠款总金额:</view>
<view>
{{ item.no_earn == null ?'暂无':item.no_earn }}
</view>
</view>
</view>
<view style="flex: 1;height: 70rpx;height: 160rpx;">
<view @tap="onItemClick(item)" style="height: 60rpx;line-height: 60rpx;width: 130rpx;background: #5fd9ee;color: #fff;border-radius: 10px;text-align: center;margin-top: 10rpx;margin: 10rpx 0 0 200rpx;">
查看详情
</view>
<view @tap.stop="toggle(item)" style="height: 60rpx;line-height: 60rpx;width: 130rpx;background: #5fd9ee;color: #fff;border-radius: 10px;text-align: center;margin-top: 10rpx;margin: 20rpx 0 0 200rpx;">
回款
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 回款金额输入框 -->
<uni-popup ref="inputDialog" type="dialog">
<!-- <uni-popup-dialog ref="inputClose" mode="input" inputType="digit" title="充值金额" placeholder="请输入充值金额"
@confirm="receivePay"></uni-popup-dialog> -->
<view style="background: #fff;width: 500rpx;height: 293rpx;border-radius: 10px;">
<view style="text-align: center;line-height: 80rpx;font-size: 36rpx;font-weight: 500;color: #777;">
充值金额
</view>
<view @tap="showPrice = true" style="width: 90%;border: 1px solid #eee;height: 70rpx;margin: 30rpx auto 0;">
<input type="number" v-model="keyboardNum" disabled placeholder="请输入充值金额" style="width: 100%;height: 100%;padding-left:20rpx;">
</view>
<view style="display: flex;border-top: 1px solid #eee;margin-top: 30rpx;text-align: center;font-size: 30rpx;line-height: 80rpx;">
<view style="flex: 1;" @tap='huicancel'>取消</view>
<view style="flex: 1;color: blue;border-left: 1px solid #eee;" @tap="receivePay()">确定</view>
</view>
</view>
</uni-popup>
<u-keyboard ref="uKeyboard" @confirm='keyboardConfirm' @cancel="keyCancel" @change="valChange" @backspace="backspace" :overlay='false' :closeOnClickOverlay='true' :defaultText="keyboardNum" mode="price" :show="showPrice"></u-keyboard>
</view>
</template>
@ -28,7 +56,9 @@
computed: mapState(['userId', 'shopIndex']),
data() {
return {
choose: '1',
choose: '1',
userId:'',
showPrice:false,
options1: [{
text: '编辑金额',
style: {
@ -37,13 +67,56 @@
}],
popupShow: false,
shopName: '',
list: []
list: [],
keyboardNum:'',
}
},
onShow() {
this.getList()
},
methods: {
methods: {
keyboardConfirm(){
this.showPrice = false
},
keyCancel(){
this.showPrice = false
this.keyboardNum = ''
},
// 按键被点击
valChange(val) {
this.keyboardNum += val
},
// 退格键被点击
backspace(val) {
this.keyboardNum = val
},
huicancel(){
this.$refs.inputDialog.close()
this.keyboardNum = ''
},
//回款按钮
receivePay(e){
this.tui.request('/app/debt/saveOrUpdateDebt', "post", {
userId:this.userId,
amountOwed:this.keyboardNum,
userType:'0'
}, false, false).then((res) => {
if (res.code == 200) {
this.getList()
this.tui.toast('操作成功')
this.keyboardNum = ''
this.$refs.inputDialog.close()
}else{
this.keyboardNum = ""
this.tui.toast(res.message)
}
})
},
//打开弹出层
toggle(item) {
this.userId = item.userId
this.$refs.inputDialog.open()
},
getList() {
this.tui.request("/app/customer/debt", "POST", {}, false, true).then((res) => {
if (res.code == 200) {

2
pages/index/home.vue

@ -29,7 +29,7 @@
}
} else if(option.khid){
uni.reLaunch({
url: '/pages/index/downStearmList?khid='+option.khid
url: '/package1/index/downStearmList?khid='+option.khid
})
}else {
uni.reLaunch({

388
pages/index/index.vue

@ -2,47 +2,51 @@
<view>
<cmd-nav-bar iconOne="menu" @iconOne="goToInfo" :title="shopName" background-color="#fff"></cmd-nav-bar>
<view class="IndexContent">
<view class="contentPadding"
style="color:#000; !important;padding: 28rpx 20rpx 0 !important;">
<view class="contentPadding" style="color:#000; !important;padding: 28rpx 20rpx 0 !important;">
<view class="title-btn-d">
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/returnList')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/b46f57fed2604228bcd1801a156fafbc.jpg" alt="" class="title-img" />
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/returnList')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/b46f57fed2604228bcd1801a156fafbc.jpg"
alt="" class="title-img" />
<text>待退货</text>
<text v-if="waitCount.waitReturnCount > 0"
class="red-circle">{{waitCount.waitReturnCount > 99 ? '99+' :waitCount.waitReturnCount}}</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/package1/index/order?listStatus=6')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/15211be8bbf74600ba90e040c57e2f45.jpg" alt="" class="title-img" />
<view class="title-btn-sbtn" @tap="goSonPage('/package1/index/order?listStatus=6')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/15211be8bbf74600ba90e040c57e2f45.jpg"
alt="" class="title-img" />
<text>待配货</text>
<text v-if="waitCount.waitAddProductCount > 0"
class="red-circle">{{waitCount.waitAddProductCount > 99 ? '99+' :waitCount.waitAddProductCount}}</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/package1/AI/AIHangOrderList')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/750b982236234011a959d1afe68a8069.jpg" alt="" class="title-img" />
<view class="title-btn-sbtn" @tap="goSonPage('/package1/AI/AIHangOrderList')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/750b982236234011a959d1afe68a8069.jpg"
alt="" class="title-img" />
<text>挂单</text>
<text v-if="waitCount.registrationCount > 0"
class="red-circle">{{waitCount.registrationCount > 99 ? '99+' :waitCount.registrationCount}}</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/shareStyle')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/83b7267c23b242d888385d7397542122.jpg" alt="" class="title-img" />
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/shareStyle')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/83b7267c23b242d888385d7397542122.jpg"
alt="" class="title-img" />
<text>推款</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/package1/AI/AIInventoryList')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/01c48cc06cfb4f44aa304fbc26df048c.jpg" alt="" class="title-img" />
<text>Ai入库</text>
<!-- <text v-if="waitCount.waitPurchaseCount > 0"
class="red-circle">{{waitCount.waitPurchaseCount > 99 ? '99+' :waitCount.waitPurchaseCount}}</text> -->
</view>
<!-- <view class="title-btn-sbtn" @tap="goSonPage('/pages/index/waitStorage?inStorageStatus=0')">
<view class="title-btn-sbtn" @tap="goSonPage('/package1/AI/AIInventoryList')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/01c48cc06cfb4f44aa304fbc26df048c.jpg"
alt="" class="title-img" />
<text>Ai入库</text>
<!-- <text v-if="waitCount.waitPurchaseCount > 0"
class="red-circle">{{waitCount.waitPurchaseCount > 99 ? '99+' :waitCount.waitPurchaseCount}}</text> -->
</view>
<!-- <view class="title-btn-sbtn" @tap="goSonPage('/pages/index/waitStorage?inStorageStatus=0')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/01c48cc06cfb4f44aa304fbc26df048c.jpg" alt="" class="title-img" />
<text>待入库</text>
<text v-if="waitCount.waitPurchaseCount > 0"
class="red-circle">{{waitCount.waitPurchaseCount > 99 ? '99+' :waitCount.waitPurchaseCount}}</text>
</view> -->
</view>
</view>
<view class="waimai" @tap="quwaimai"></view>
</view>
<view class="waimai" @tap="quwaimai"></view>
<view class="contentPadding">
<view class="title">
<i class="iconfont icon-xiaoshouyuce"> 今日营收详情</i>
@ -52,10 +56,11 @@
<u-count-to :start-val="0" :end-val="shopInfo.totalAmount" :decimals="2"></u-count-to>
<text class="grid-text">销售总金额</text>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0"
:end-val="shopInfo.totalAlreadyEarn"></u-count-to>
<text class="grid-text">今日实收</text>
<u-grid-item @tap="showPayType">
<u-count-to :start-val="0" :end-val="shopInfo.totalAlreadyEarn"></u-count-to>
<text class="grid-text">今日实收</text>
<uni-icons type="help" size="21"
style="position: absolute;bottom: 35rpx;right: 10rpx;"></uni-icons>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="type==0?shopInfo.totalProfit:0" :decimals="2"></u-count-to>
@ -101,6 +106,9 @@
<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' ?'待配货':item.status == '8' ?'待物流上门':item.status == '9' ?'已完成' :'挂单'}}
</view>
<view class="floatRight" v-if="item.status == 4 || item.status == 1 || item.status == 0" @tap.stop="cancelOrder(item)">撤销</view>
<view class="floatRight" v-if="item.status == 4 || item.status == 1 || item.status == 0" @tap.stop="cancelOrder(item,'goPay')">撤销并复制
</view>
</uni-card>
</li>
</ul>
@ -121,8 +129,8 @@
<view class="border-line"></view>
<u-cell icon="man-add-fill" url="/package1/index/peopleList?popleType=gysName&noClick=1"
title="供货商管理" clickable isLink arrow-direction="left"></u-cell>
<u-cell icon="man-add-fill" url="/pages/index/upstream" v-if="type==0" title="供货商欠款"
clickable isLink arrow-direction="left"></u-cell>
<!-- <u-cell icon="man-add-fill" url="/pages/index/upstream" v-if="type==0" title="供货商欠款"
clickable isLink arrow-direction="left"></u-cell> -->
<u-cell icon="man-add-fill" url="/pages/index/waitStorage?inStorageStatus=1" title="采购单历史"
clickable isLink arrow-direction="left"></u-cell>
<u-cell icon="man-add-fill" url="/package1/stock/goodsStock" title="盘点管理" clickable isLink
@ -130,12 +138,15 @@
<view class="border-line"></view>
<u-cell icon="account-fill" url="/package1/index/peopleList?popleType=khName&noClick=1"
title="客户管理" clickable isLink arrow-direction="left"></u-cell>
<u-cell icon="account-fill" url="/pages/index/downstream" v-if="type==0" title="客户欠款"
clickable isLink arrow-direction="left"></u-cell>
<!-- <u-cell icon="account-fill" url="/pages/index/downstream" v-if="type==0" title="客户欠款"
clickable isLink arrow-direction="left"></u-cell> -->
<u-cell icon="account-fill" url="/package1/index/order?type=dingdan" title="销售单历史" clickable
isLink arrow-direction="left"></u-cell>
<u-cell icon="account-fill" url="/package1/index/returnOrder" title="退货单历史" clickable
isLink arrow-direction="left"></u-cell>
<view class="border-line"></view>
<u-cell v-if="shopName == '老王测试店铺' || shopName == '田一的店' || shopName == '青星'|| shopName == '侧视颠仆'" icon="integral-fill" url="/package1/AI/addAiList" title="管理员登录" clickable isLink
<u-cell v-if="shopName == '提钱退休' || shopName == '测试库新店' || shopName == '侧视颠仆'"
icon="integral-fill" url="/package1/AI/addAiList" title="管理员登录" clickable isLink
arrow-direction="left"></u-cell>
<!-- <u-cell icon="integral-fill" url="" title="电费缴纳" clickable isLink
arrow-direction="left"></u-cell>
@ -144,8 +155,8 @@
<u-cell icon="rewind-right-fill" url="/pages/rebate/rebateShare" title="邀请返佣" clickable
isLink arrow-direction="left"></u-cell>
<!-- <u-cell icon="heart-fill" url="/pages/index/publicWelfare" title="公益公示" clickable isLink
arrow-direction="left"></u-cell> -->
<u-cell icon="heart-fill" url="/package1/other/tutorialList" title="使用教程" clickable isLink
arrow-direction="left"></u-cell> -->
<u-cell icon="heart-fill" url="/package1/other/tutorialList" title="使用教程" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="server-man" url="/package1/index/feedBack" title="问题反馈" clickable isLink
arrow-direction="left"></u-cell>
@ -166,6 +177,18 @@
<view class="pop-close" @tap="popClose">X</view>
</view>
</uni-popup>
<view v-if="showDayPrice" :style="{height:(80 + shopInfo.totalAlreadyEarnDetail.length * 80)+ 'rpx'}"
style="position: fixed;margin:auto;left:0;right:0;top:0;bottom:0;width:200px;background: rgba(0,0,0,0.7);border-radius: 10px;color: #eee;">
<view style="width:100%;height:80rpx;font-size: 30rpx;text-align: center;line-height: 80rpx;">
今日收款方式统计
</view>
<view v-for="(item,index) in shopInfo.totalAlreadyEarnDetail" :key="index"
style="text-align: center;line-height: 80rpx;">
<view>
{{item.payType == 0?'现金收款:':item.payType == 1?'微信收款:':item.payType == 2?'支付宝收款:':item.payType == 3?'银行卡收款:':item.payType == 4?'收款码收款:':''}}{{item.payAmount}}元
</view>
</view>
</view>
</view>
</template>
<!-- cmd-nav-bar.vue index.vue pages.json -->
@ -183,8 +206,10 @@
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
inventoryList: [],
settingShow: false,
chartData: {},
chartData: {},
returnList:new Map(),
shopName: '',
showDayPrice: false,
opts: {
padding: [15, 10, 0, 15],
dataLabel: true,
@ -233,36 +258,38 @@
return val;
}
},
onLoad() {
let that = this;
wx.getLocation({
type: 'gcj02',
success(res) {
}
})
uni.getStorage({
key: 'shopName',
success: function (res) {
that.shopName = res.data
}
});
uni.getStorage({
key: 'type',
success: function (res) {
that.type = res.data
}
});
var today = new Date();
onShow() {
this.getSaleInfo()
},
onLoad() {
let that = this;
wx.getLocation({
type: 'gcj02',
success(res) {
}
})
uni.getStorage({
key: 'shopName',
success: function(res) {
that.shopName = res.data
}
});
uni.getStorage({
key: 'type',
success: function(res) {
that.type = res.data
}
});
var today = new Date();
var day = today.getDate();
//宣传页
if(uni.getStorageSync('publicize') == day){
}else{
if (uni.getStorageSync('publicize') == day) {
} else {
uni.setStorageSync("publicize", day)
this.$refs.publicizepopup.open('center')
}
this.getSaleInfo()
},
onTabItemTap(e) {
this.getSaleInfo()
@ -271,8 +298,174 @@
popClose() {
this.$refs.publicizepopup.close()
},
getSaleInfo() {
this.shopInfo = {}
//退款接口
async getReturnOrder(id) {
let that = this;
await this.tui.request("/app/return/list", "post", {
remark: 3,
saleId: id
}, false, false).then((res) => {
if (res.code == 200 && res.result != null && res.result != undefined) {
if (res.result != '') {
res.result.forEach(item => {
this.tui.request("/app/return/get/" + item.id, "GET", null, false,false).then((res) => {
if (res.code == 200 && res.result != null && res.result != undefined) {
for(let i=0;i<res.result.saleDetailDTOList.length;i++){
res.result.saleDetailDTOList[i].returnPrice = res.result.saleDetailDTOList[i].discountAmount
res.result.saleDetailDTOList[i].stockLogList = new Map()
that.returnList.set(res.result.saleDetailDTOList[i].productId,res.result.saleDetailDTOList[i])
for(let m=0;m<res.result.saleDetailDTOList[i].stockLogList1.length;m++){
res.result.saleDetailDTOList[i].stockLogList1[m].productCount = 0-res.result.saleDetailDTOList[i].stockLogList1[m].productCount
that.returnList.get(res.result.saleDetailDTOList[i].productId).stockLogList.set(res.result.saleDetailDTOList[i].stockLogList1[m].attributeList,res.result.saleDetailDTOList[i].stockLogList1[m])
}
}
}
}).catch((res) => {})
})
}
} else {
this.tui.toast(res.message)
}
})
},
// 取消订单
async cancelOrder(item, type) {
let that = this;
await this.getReturnOrder(item.id)
await this.tui.modal("提示", "您确定要撤销订单吗?", true, (res) => {
if (res) {
that.cancelSale(item,type)
}
})
},
cancelSale(item,type){
this.tui.request('/app/sale/cancelSale', "POST", {
id:item.id
}, true, true).then((res1) => {
if (res1.code == 200) {
if (type == 'goPay') {
this.goSaleGoods(item)
} else {
this.getSaleInfo()
}
} else {
this.tui.toast(res.message)
}
}).catch((res1) => {})
},
// 取消订单
getOrderInfoList(item,type) {
let that = this;
// if(item.status == 0 || item.status == 1){
// this.tui.request('/app/sale/status', "POST", {
// status: 4,
// orderId: item.id
// }, true, true).then((res1) => {
// if (res1.code == 200) {
this.cancelSale(item,type)
// } else {
// this.tui.toast(res.message)
// }
// }).catch((res1) => {})
// }else{
// this.cancelSale(item,type)
// }
},
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
},
//带参数跳转到开单页
goSaleGoods(item) {
let dataList = []
if(item.saleDetailDTOList == null || item.saleDetailDTOList == ''){
item.saleDetailDTOList = []
}
this.returnList.forEach(function(value, key) {
item.saleDetailDTOList.push(value)
})
if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
let obj = {}
let attrMap = new Map()
let newSaleDetailDTOList = []
let num = 0
for (let m = 0; m < item.saleDetailDTOList[i].stockLogList1.length; m++) {
if (attrMap.has(item.saleDetailDTOList[i].stockLogList1[m].attributeList) == true) {
let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList)
newSaleDetailDTOList[hasCount].productCount = Number(newSaleDetailDTOList[hasCount]
.productCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount)
} else {
item.saleDetailDTOList[i].stockLogList1[m].name = this.sliceMsg(item.saleDetailDTOList[i]
.stockLogList1[m].attributeList)
newSaleDetailDTOList.push(item.saleDetailDTOList[i].stockLogList1[m])
attrMap.set(item.saleDetailDTOList[i].stockLogList1[m].attributeList, num)
num++
}
}
obj.saleDetailQueryDTO = newSaleDetailDTOList
obj.num = 0
obj.id = item.saleDetailDTOList[i].productId
obj.price = item.saleDetailDTOList[i].price
obj.lsprice = item.saleDetailDTOList[i].price
obj.categoryId = item.saleDetailDTOList[i].categoryId
obj.zPrice = item.saleDetailDTOList[i].discountAmount
obj.unitPrice = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i]
.wholesalePrice
obj.productName = item.saleDetailDTOList[i].productName
obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime()
obj.productSn = item.saleDetailDTOList[i].productSn
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
obj.returnPrice = item.saleDetailDTOList[i].returnPrice
obj.saleId = item.id
obj.remark = item.remark
obj.xsyId = item.createBy
obj.createByName = item.createByName
dataList.push(obj)
}
} else {
let obj = {}
obj.num = 0
obj.price = 0
obj.saleId = item.id
obj.remark = item.remark
obj.xsyId = item.createBy
obj.createByName = item.createByName
dataList.push(obj)
}
console.log('lastDebtAmount',item.lastDebtAmount)
this.$nextTick(()=>{
this.tui.request("/app/customer/list", "post", {
notBuyDays: "",
pageNum: 1,
pageSize: 10,
searchStr: item.userName,
sort: "",
}, false, false).then((res) => {
if (res.code == 200) {
this.returnList = new Map()
uni.setStorageSync('khName', JSON.stringify(res.result.records[0]))
uni.setStorageSync('carList1', JSON.stringify(dataList))
uni.setStorageSync('hangOrder', true)
uni.switchTab({
url: '/pages/inventory/goodsList1'
})
}
})
})
},
getSaleInfo() {
this.shopInfo = {}
this.inventoryList = []
this.tui.request("/app/sale/getShopAll", "POST", {
pageVo: {
@ -291,6 +484,7 @@
totalProfit: res.result.totalProfit,
returnTotalAmount: res.result.returnTotalAmount,
returnTotalCount: res.result.returnTotalCount,
totalAlreadyEarnDetail: res.result.totalAlreadyEarnDetail
}
let dataList = {
categories: this.getWeek(),
@ -321,18 +515,24 @@
},
goToInfo() {
this.settingShow = true
},
//跳转外卖小程序
quwaimai(){
uni.openEmbeddedMiniProgram({
appId: 'wxf5362b6e97ecee2f'
})
},
//跳转外卖小程序
quwaimai() {
uni.openEmbeddedMiniProgram({
appId: 'wxf5362b6e97ecee2f'
})
},
gotoSearchData() {
uni.navigateTo({
url: '/pages/index/dataStatistics'
})
},
showPayType() {
this.showDayPrice = true
setTimeout(res => {
this.showDayPrice = false
}, 2000)
},
outLogin(e) {
let that = this;
uni.showModal({
@ -377,7 +577,7 @@
url: '/package1/index/orderDetail?id=' + id
})
},
//首页头部四个按钮的菜单
//首页头部五个按钮的菜单
goSonPage(url) {
if (url == '/pages/index/waitStorage?inStorageStatus=0') {
if (this.type != 0) {
@ -473,12 +673,12 @@
}
.title-btn-sbtn {
flex: 1;
line-height: 40rpx;
text-align: center;
position: relative;
display: flex;
flex-direction: column;
flex: 1;
line-height: 40rpx;
text-align: center;
position: relative;
display: flex;
flex-direction: column;
font-size: 24rpx;
}
@ -572,7 +772,7 @@
.publicize-content img {
width: 460rpx;
height: 460rpx;
height: 460rpx;
border-radius: 50px;
}
@ -595,22 +795,30 @@
.uni-tooltip-popup {
width: 180rpx;
}
.waimai{
position: fixed;
bottom: 0;
right: 20rpx;
background: url(https://jewel-shop.oss-cn-beijing.aliyuncs.com/cda1b75affd349118081f3880f815a0f.jpg) no-repeat;
background-size: 100%;
width: 130rpx;
height: 130rpx;
margin: 0 auto 10rpx;
z-index: 999;
}
.title-img{
width: 60rpx;
height: 60rpx;
margin: 0 auto;
}
.waimai {
position: fixed;
bottom: 0;
right: 20rpx;
background: url(https://jewel-shop.oss-cn-beijing.aliyuncs.com/cda1b75affd349118081f3880f815a0f.jpg) no-repeat;
background-size: 100%;
width: 130rpx;
height: 130rpx;
margin: 0 auto 10rpx;
z-index: 999;
}
.title-img {
width: 60rpx;
height: 60rpx;
margin: 0 auto;
}
.floatRight {
float: right;
padding: 14rpx;
color: $u-primary;
font-size: 26upx;
}
</style>

244
pages/index/shareStyle.vue

@ -1,57 +1,56 @@
<template>
<view class="page1">
<view>
<view class="title-box">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称" cancelButton="none" @blur="search" @clear="clearSearch" />
</view>
<view class="content-box" :style="{height:height - 240}">
<view class="content-left">
<view class="left-box" v-for="(item, index) in indexList" :key="index"
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;"
:class="item.parentId ? 'red' :''">{{item.categoryName}}</text>
</view>
<view class="content-left" style="height: 85%;float: left;position: fixed;top: 100rpx;">
<view class="left-box" v-for="(item, index) in indexList" :key="index"
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;"
:class="item.parentId ? 'red' :''">{{item.categoryName}}</text>
</view>
<view class="content-right">
<view class="right-box" v-for="(item,index) in goodsList" :key="index" v-if="item.delFlag">
<!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 -->
<!-- <view class="shop-mask" v-if="item.delFlag == 0 || item.purchasePrice==null || item.inStorageStatus == 0" @tap.stop="clickMask"></view> -->
<view class="box-left">
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="content-right" style="width: 570rpx;background: #fff;margin: 100rpx 0 70rpx 170rpx;height: 76%;padding-bottom: 50rpx;">
<view class="right-box" v-for="(item,index) in shopList" :key="index" v-if="item.delFlag">
<!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 -->
<!-- <view class="shop-mask" v-if="item.delFlag == 0 || item.purchasePrice==null || item.inStorageStatus == 0" @tap.stop="clickMask"></view> -->
<view class="box-left">
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="box-right">
<view class="box-right-name">
{{item.productName}}
<text style="color: red;" v-if="item.delFlag == 0">(已下架)</text>
</view>
<view class="box-right">
<view class="box-right-name">
{{item.productName}}
<text style="color: red;" v-if="item.delFlag == 0">(已下架)</text>
<view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price">
<view class="price-box" v-if="type==0">
<text>{{item.purchasePrice?item.purchasePrice:'暂无'}}</text>
<text>采购价</text>
</view>
<view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price">
<view class="price-box" v-if="type==0">
<text>{{item.purchasePrice?item.purchasePrice:'暂无'}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
</view>
<checkbox-group @tap="checkboxChange(item)">
<label>
<checkbox :checked="item.checked" class="checkbox" />
</label>
</checkbox-group>
</view>
</view>
</view>
<checkbox-group @tap="checkboxChange(item)">
<label>
<checkbox :checked="item.checked" class="checkbox" />
</label>
</checkbox-group>
</view>
<u-loadmore :status="status" />
</view>
<view class="bottom-box">
<view class="bottom-left" @tap="toggle('carPopup')">
<view class="bottom-left-box">
@ -126,7 +125,8 @@
return {
indexList: [],
pageNum: 1, //分页的页码
shopList: [],
shopList: [],
shopList1: [],
info: 0,
goodsList: [],
categoryId: '', //分类id
@ -147,6 +147,13 @@
created() {
uni.hideHomeButton() //左上角HOME按钮
},
onReachBottom() {
console.log("触底")
if (this.pageNum >= this.pages) return;
// this.status = 'loading';
this.pageNum ++;
this.getShareList();
},
onShareTimeline() {
return {
title: '查看我的推荐',
@ -162,15 +169,15 @@
}
},
onLoad(options) {
wx.updateShareMenu({
withShareTicket: true,
isPrivateMessage:true,
success () { }
})
// wx.updateShareMenu({
// withShareTicket: true,
// isPrivateMessage:true,
// success () { }
// })
this.height = wx.getSystemInfoSync().windowHeight
if (options.khid != undefined) {
uni.redirectTo({
url: "/pages/index/downStearmList?khid=" + options.khid
url: "/package1/index/downStearmList?khid=" + options.khid
})
}else{
this.type = uni.getStorageSync('type')
@ -180,41 +187,39 @@
},
methods: {
//初始化获取分类列表
async getGategoryList() {
this.shopList = []
this.indexList = []
await this.tui.request("/app/productCategory/list", "get", {}, false, true).then((res) => {
if (res.code == 200) {
this.indexList = res.result;
for (var i = 0; i < this.indexList.length; i++) {
if (i == 0) {
this.indexList[i].parentId = true
} else {
this.indexList[i].parentId = false
}
let data = {
categoryId: this.indexList[i].id
getGategoryList() {
this.tui.request("/app/productCategory/list", "get", {
// shopId: 1,
}, false, true).then((res) => {
if (res.code == 200) {
this.indexList = res.result;
for (var i = 0; i < this.indexList.length; i++) {
if (i == 0) {
this.indexList[i].parentId = true
} else {
this.indexList[i].parentId = false
}
this.shopList.push(data)
this.categoryId = this.indexList[i].id
this.getShareList(this.indexList[i].id)
}
} else {
this.tui.toast(res.message)
}
this.categoryId = this.indexList[0].id
this.pageNum = 1
this.searchName = ""
this.shopList1 = []
this.shopList = []
this.getShareList();
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//点击分类获取商品列表
async getShareList(id) {
async getShareList(type) {
let that = this
this.goodsList = []
await this.tui.request("/app/product/getShareList", "POST", {
categoryId: this.searchName == ""?this.categoryId:"",
searchStr: this.searchName,
pageNum: this.pageNum,
pageSize: '100'
pageSize: '10'
}, false, false).then((res) => {
if (res.code == 200) {
for(var i = 0; i < res.result.records.length; i++){
@ -223,21 +228,25 @@
}
}
this.$nextTick(()=>{
if(this.searchName == ""){
for (var i = 0; i < that.shopList.length; i++) {
if(res.result.records != []){
if(that.shopList[i].categoryId == res.result.records[0].categoryId){
that.shopList[i] = res.result.records
}
}else{
that.shopList[i] = []
}
if(type=='search'){
this.shopList = []
this.status = 'nomore';
if (this.pages == 1) {
this.shopList1 = res.result.records
} else {
this.shopList1 = [...this.shopList1, ...res.result.records]
}
this.pages = res.result.pages
}else{
that.shopList.push(res.result.records)
this.shopList1 = []
this.status = 'nomore';
if (this.pages == 1) {
this.shopList = res.result.records
} else {
this.shopList = [...this.shopList, ...res.result.records]
}
this.pages = res.result.pages
}
that.goodsList = that.shopList[0]
})
@ -248,15 +257,14 @@
await this.getCheck()
},
//顶部搜索框
search(res) {
this.shopList = []
this.indexList = []
this.searchName = res.value
if(res.value == ''){
this.getGategoryList()
}else{
search(e) {
if(e.value == ''){
this.searchName = ""
this.getShareList()
}else{
this.searchName = e.value
this.getShareList('search')
}
},
clearSearch(){
@ -277,15 +285,16 @@
}else{
for (var i = 0; i < that.carList.length; i++) {
for (var m = 0; m < that.shopList.length; m++) {
for (var j = 0; j < that.shopList[m].length; j++) {
if(that.carList[i] == that.shopList[m][j].id){
that.shopList[m][j].checked = true
// for (var j = 0; j < that.shopList[m].length; j++) {
if(that.carList[i] == that.shopList[m].id){
that.shopList[m].checked = true
}
}
// }
}
}
}
}
console.log(this.shopList)
this.$forceUpdate()
},
//未入库遮罩
@ -297,22 +306,23 @@
},
//点击左侧菜单切换
clickLeftBtn(index) {
for (var i = 0; i < this.indexList.length; i++) {
if (i == index) {
this.indexList[i].parentId = true
} else {
this.indexList[i].parentId = false
}
for (var i = 0; i < this.indexList.length; i++) {
if (i == index) {
this.indexList[i].parentId = true
} else {
this.indexList[i].parentId = false
}
}
this.categoryId = this.shopList[index].id
this.goodsList = this.shopList[index]
this.getCheck()
this.categoryId = this.indexList[index].id
this.pageNum = 1
this.searchName = ""
this.shopList1 = []
this.shopList = []
this.getShareList(this.indexList[index].id)
},
//选中商品
checkboxChange(item) {
item.checked = !item.checked
item.checked = !item.checked
if (this.carList.indexOf(item.id) != -1) {
this.carList.splice(this.carList.indexOf(item.id), 1)
} else {
@ -334,10 +344,9 @@
}
}
}
console.log('点击',this.shopList)
console.log('点击',this.carList)
console.log('点击',this.gwcList)
}
console.log('gwcList',this.gwcList)
console.log('carList',this.carList)
},
//点击分享按钮
clickShareBtn(e) {
@ -426,7 +435,7 @@
.page1 {
display: flex;
flex-direction: column;
height: 92%;
height: 100%;
}
.uni-tab__dot {
@ -543,7 +552,8 @@
}
.content-right {
flex: 1;
flex: 1;
height: 100%;
overflow-y: scroll;
}

99
pages/index/upstream.vue

@ -2,18 +2,48 @@
<view>
<view class="formBox">
<u-alert description="点击可查看对应每笔入库单" type="primary"></u-alert>
<view class="swipe-action">
<view class="swipe-action__content" @tap="onItemClick(item)" v-for="(item,index) in list" :key="index">
<view class="swipe-action__content__left">
<view class="swipe-action__content__text">{{ item.supplierName == null ?'暂无':item.supplierName }}</view>
</view>
<view class="swipe-action__content__right">
<view class="swipe-action__content__right__text">欠款总金额:</view>
<view class="swipe-action__content__right__money">{{ item.noPay == null ?'暂无':item.noPay }}</view>
</view>
</view>
<view>
<view v-for="(item,index) in list" :key="index" style="display: flex;height: 160rpx;margin-top: 20rpx;background: #fff;">
<view style="flex: 1;height: 160rpx;padding-left: 20rpx;">
<view style="height: 80rpx;line-height: 80rpx;">
<view>{{ item.supplierName == null ?'暂无':item.supplierName}}</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;color: red;">
<view>欠款总金额:</view>
<view>
{{ item.noPay == null ?'暂无':item.noPay }}
</view>
</view>
</view>
<view style="flex: 1;height: 70rpx;height: 160rpx;">
<view @tap="onItemClick(item)" style="height: 60rpx;line-height: 60rpx;width: 130rpx;background: #5fd9ee;color: #fff;border-radius: 10px;text-align: center;margin-top: 10rpx;margin: 10rpx 0 0 200rpx;">
查看详情
</view>
<view @tap.stop="toggle(item)" style="height: 60rpx;line-height: 60rpx;width: 130rpx;background: #5fd9ee;color: #fff;border-radius: 10px;text-align: center;margin-top: 10rpx;margin: 20rpx 0 0 200rpx;">
回款
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 回款金额输入框 -->
<uni-popup ref="inputDialog" type="dialog">
<!-- <uni-popup-dialog ref="inputClose" mode="input" inputType="digit" title="充值金额" placeholder="请输入充值金额"
@confirm="receivePay"></uni-popup-dialog> -->
<view style="background: #fff;width: 500rpx;height: 293rpx;border-radius: 10px;">
<view style="text-align: center;line-height: 80rpx;font-size: 36rpx;font-weight: 500;color: #777;">
充值金额
</view>
<view @tap="showPrice = true" style="width: 90%;border: 1px solid #eee;height: 70rpx;margin: 30rpx auto 0;">
<input type="number" v-model="keyboardNum" disabled placeholder="请输入充值金额" style="width: 100%;height: 100%;padding-left:20rpx;">
</view>
<view style="display: flex;border-top: 1px solid #eee;margin-top: 30rpx;text-align: center;font-size: 30rpx;line-height: 80rpx;">
<view style="flex: 1;" @tap='huicancel'>取消</view>
<view style="flex: 1;color: blue;border-left: 1px solid #eee;" @tap="receivePay()">确定</view>
</view>
</view>
</uni-popup>
<u-keyboard ref="uKeyboard" @confirm='keyboardConfirm' @cancel="keyCancel" @change="valChange" @backspace="backspace" :overlay='false' :closeOnClickOverlay='true' :defaultText="keyboardNum" mode="price" :show="showPrice"></u-keyboard>
</view>
</template>
@ -26,7 +56,10 @@
computed: mapState(['userId', 'shopIndex']),
data() {
return {
choose: '1',
choose: '1',
keyboardNum:'',
userId:'',
showPrice:false,
options1: [{
text: '编辑金额',
style: {
@ -59,6 +92,48 @@
uni.navigateTo({
url: `/pages/index/uparrears?supplierId=${target.supplierId}&consigneeName=${target.supplierName}`
})
},
keyboardConfirm(){
this.showPrice = false
},
keyCancel(){
this.showPrice = false
this.keyboardNum = ''
},
// 按键被点击
valChange(val) {
this.keyboardNum += val
},
// 退格键被点击
backspace(val) {
this.keyboardNum = val
},
huicancel(){
this.$refs.inputDialog.close()
this.keyboardNum = ''
},
//回款按钮
receivePay(e){
this.tui.request('/app/debt/saveOrUpdateDebt', "post", {
userId:this.userId,
amountOwed:this.keyboardNum,
userType:'1'
}, false, false).then((res) => {
if (res.code == 200) {
this.getList()
this.tui.toast('操作成功')
this.keyboardNum = ''
this.$refs.inputDialog.close()
}else{
this.keyboardNum = ""
this.tui.toast(res.message)
}
})
},
//打开弹出层
toggle(item) {
this.userId = item.supplierId
this.$refs.inputDialog.open()
}
}
}

12
pages/index/waitStorage.vue

@ -1,7 +1,7 @@
<template>
<view>
<view class="search" style="position: fixed;top: 0;z-index: 99;">
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" @change="getList" type="daterange" />
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" @change="searchTime" type="daterange" />
<uni-search-bar class="uni-mt-10" radius="5" placeholder="输入供应商/商品名称/货号查询" cancelButton="none"
@confirm="searchList" />
</view>
@ -79,6 +79,16 @@
}
},
methods: {
searchTime(res){
console.log(res)
if(res == ''){
this.range = []
}
this.pages = 1;
this.pageNum = 1;
this.list = [];
this.getList()
},
searchList(res) {
this.searchStr = res.value
this.pages = 1;

80
pages/index/waitStorageDetail.vue

@ -9,22 +9,19 @@
<img class="img-radius" :src="item.productPicture" alt="" style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
<view class="shop-productName">
<view style="color:#FF5809;">{{item.productName == null ?'暂无':item.productName}}</view>
<view>货号:{{item.productSn == null ?'暂无':item.productSn}}</view>
<view style="color:#FF5809;">{{item.productName == null ?'暂无':item.productName}}({{item.productSn == null ?'暂无':item.productSn}})</view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;" v-if="type==0">
采购价: <input type="digit" :disabled="sales.inStorageStatus == 0?false:true" @blur="PriceAndWho($event,index,'caigou')" @focus="obtainPrice($event,'caigou',index)" v-model="item.purchasePrice" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 100rpx;padding-left: 20rpx;">
</view>
<view>
<text v-if="type==0">单价:{{item.purchasePrice == null ?'暂无':item.purchasePrice}} </text>
<text style="padding: 0 5rpx;">数量:{{item.productCount == null ?'暂无':item.productCount}} </text>
<text v-if="type==0">总价:{{(item.productCount*item.purchasePrice)== null?'暂无':(item.productCount*item.purchasePrice)}}</text>
<text style="padding: 0 5rpx;"> 数量: {{item.productCount == null ?'暂无':item.productCount}} </text>
<text v-if="type==0" style="padding-left: 10rpx;"> 总价:{{(item.productCount*item.purchasePrice)== null?'暂无':(item.productCount*item.purchasePrice)}}</text>
</view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;margin-top: 10rpx;">
批发价: <input type="digit" @blur="PriceAndWho($event,index,'pi')" @focus="obtainPrice($event,'pifa',index)" v-model="item.wholesalePrice" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 100rpx;padding-left: 20rpx;">
零售价:<input type="digit" @blur="PriceAndWho($event,index)" @focus="obtainPrice($event,'lingshou',index)" v-model="item.lsprice" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 100rpx;padding-left: 20rpx;">
<view style="display: flex;height: 55rpx;line-height: 55rpx;">
批发价: <input type="digit" @blur="PriceAndWho($event,index,'pi')" @focus="obtainPrice($event,'pifa',index)" v-model="item.wholesalePrice" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 100rpx;padding-left: 20rpx;" :disabled="sales.inStorageStatus == 0?false:true">
零售价:<input type="digit" @blur="PriceAndWho($event,index)" @focus="obtainPrice($event,'lingshou',index)" v-model="item.price" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 100rpx;padding-left: 20rpx;" :disabled="sales.inStorageStatus == 0?false:true">
</view>
</view>
<view v-if="type==0 && sales.inStorageStatus == 0" style="position: absolute;top: 20rpx;right: 40rpx;color: blue;text-decoration: underline;"
@tap="clickCollapse(index)">
维护采购价
</view>
</view>
<view class="shop-type">
<view class="shop-collapse" v-for="(items,index) in item.stockLogList1" :key='index'>
@ -128,7 +125,7 @@
</view>
<!-- 弹出输入框 -->
<uni-popup ref="priceDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" inputType="digit" title="采购价" placeholder="请输入采购价"
<uni-popup-dialog ref="purInput" mode="input" inputType="digit" title="采购价" placeholder="请输入采购价"
@confirm="changePrice"></uni-popup-dialog>
</uni-popup>
<!-- 回款金额输入框 -->
@ -191,14 +188,19 @@
if (res.code == 200) {
for(let i = 0;i<res.result.purchaseDetails.length;i++){
res.result.purchaseDetails[i].lsprice = res.result.purchaseDetails[i].price
if(res.result.purchaseDetails[i].purchasePrice != null){
res.result.purchaseDetails[i].zPrice = res.result.purchaseDetails[i].purchasePrice * res.result.purchaseDetails[i].productCount
}else{
res.result.purchaseDetails[i].zPrice = 0
}
res.result.purchaseDetails[i].lsPrice = res.result.purchaseDetails[i].lsPrice
}
this.sales = res.result.purchase
this.noPay = res.result.purchase.noPay
this.supplier = res.result.supplier
this.remark = res.result.purchase.remark
this.goodsList = res.result.purchaseDetails
this.getAllPrice()
} else {
this.tui.toast(res.message)
}
@ -242,30 +244,45 @@
this.goodsList[id].wholesalePrice = Number(e.detail.value)
}
}
}else if(type == 'caigou'){
this.shouldPay = 0
if(this.linshiPrice == e.target.value){
this.goodsList[id].purchasePrice = e.target.value
}else{
if(e.detail.value == ''){
this.goodsList[id].purchasePrice = this.linshiPrice
}else{
this.goodsList[id].purchasePrice = Number(e.detail.value)
}
}
this.goodsList[id].zPrice = this.goodsList[id].purchasePrice * this.goodsList[id].productCount;
this.getAllPrice()
}else{
if(this.linshiPrice == e.target.value){
// this.goodsList[id].price = e.target.value
this.goodsList[id].lsprice = e.target.value
this.goodsList[id].lsPrice = e.target.value
}else{
if(e.detail.value == ''){
// this.goodsList[id].price = this.linshiPrice
this.goodsList[id].lsprice = this.linshiPrice
this.goodsList[id].lsPrice = this.linshiPrice
}else{
// this.goodsList[id].price = Number(e.detail.value)
this.goodsList[id].lsprice = Number(e.detail.value)
this.goodsList[id].lsPrice = Number(e.detail.value)
}
}
}
this.$forceUpdate()
},
obtainPrice(e,type,num){
console.log("获得焦点")
this.linshiPrice = e.target.value
if(type=='pifa'){
this.goodsList[num].wholesalePrice = ''
this.$forceUpdate()
}else if(type=='lingshou'){
this.goodsList[num].lsprice = ''
this.goodsList[num].price = ''
this.$forceUpdate()
}else if(type=='caigou'){
this.goodsList[num].purchasePrice = ''
this.$forceUpdate()
}
},
@ -329,15 +346,25 @@
//计算价格
changePrice(val) {
let that = this;
this.$refs.inputClose.value = ''
this.$refs.purInput.val = ''
that.shouldPay = 0
that.goodsList[that.index].purchasePrice = val
that.goodsList[that.index].price = val * that.goodsList[that.index].productCount;
that.goodsList.forEach(function(value, key) {
that.shouldPay += value.price
that.goodsList[that.index].zPrice = val * that.goodsList[that.index].productCount;
this.getAllPrice()
},
//计算总金额和总数量
getAllPrice() {
let that = this;
this.shouldPay = 0
this.totalAmount = 0
this.goodsList.forEach(function(value, key) {
that.shouldPay = that.shouldPay + value.zPrice
})
that.noPay = that.shouldPay
}
that.shouldPay = that.shouldPay.toFixed(2)
this.alreadyPay = this.shouldPay
that.noPay = this.shouldPay - this.alreadyPay
this.$forceUpdate()
},
},
}
</script>
@ -523,6 +550,7 @@
.shop-productName view {
height: 55rpx;
line-height: 55rpx;
}
.shop-collapse {

BIN
pages/inventory/.DS_Store

Binary file not shown.

2390
pages/inventory/AIInventory.vue

File diff suppressed because it is too large

1665
pages/inventory/addinventory.vue

File diff suppressed because it is too large

277
pages/inventory/changeGoods1.vue

@ -1,6 +1,6 @@
<template>
<view class="page1">
<view style="z-index: 99;width: 100%;">
<view>
<view style="z-index: 99;width: 100%;position: fixed;top: 0;background: #fff;">
<view style="background: #fff;">
<button size="default" type="default" @tap="goAddGoods" hover-class="is-hover">新增商品</button>
</view>
@ -9,78 +9,77 @@
@confirm="search" @blur="search" @clear="clearSearch" />
</view>
</view>
<view class="content-box" :style="{height:height - 360 +'rpx'}">
<view class="content-left">
<view class="left-box" v-if="gateType == ''" v-for="(item, index) in indexList" :key="index"
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;"
:class="item.parentId ? 'red' :''">{{item.categoryName}}</text>
</view>
<view class="content-left" style="height: 76%;position: fixed;top: 16%;overflow: scroll;">
<view class="left-box" v-if="gateType == ''" v-for="(item, index) in indexList" :key="index"
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;"
:class="item.parentId ? 'red' :''">{{item.categoryName}}</text>
</view>
<view class="content-right">
<view class="right-box" v-for="(item,index) in shopList" :key="index" @tap="toggle('bottom',item)">
<!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 -->
<view class="shop-mask" v-if="item.delFlag == 0 || item.inStorageStatus == 0"
@tap.stop="clickMask(item)"></view>
<view class="box-left">
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="box-right">
<view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price">
<view class="price-box" v-if="storageType == 0">
<text>{{item.inStorageStatus==0?'待入库':item.purchasePrice == null ?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
</view>
<view class="content-right" style="width: 570rpx;background: #fff;margin: 30% 0 120rpx 170rpx;height: 76%;padding-bottom: 50rpx;">
<view class="right-box" v-for="(item,index) in shopList" :key="index" @tap="toggle('bottom',item)">
<!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 -->
<view class="shop-mask" v-if="item.delFlag == 0 || item.inStorageStatus == 0"
@tap.stop="clickMask(item)"></view>
<view class="box-left">
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="box-right">
<view class="box-right-name">{{item.productSn}}</view>
<view class="box-right-num">{{item.productName}}</view>
<view class="box-right-price">
<view class="price-box" v-if="storageType == 0">
<text>{{item.inStorageStatus==0?'待入库':item.purchasePrice == null ?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
</view>
</view>
</view>
<view class="right-box" v-for="(item,index) in shopList1" :key="index" @tap="toggle('bottom',item)">
<!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 -->
<view class="shop-mask" v-if="item.delFlag == 0 || item.inStorageStatus == 0"
@tap.stop="clickMask(item)"></view>
<view class="box-left">
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="right-box" v-for="(item,index) in shopList1" :key="index" @tap="toggle('bottom',item)">
<!-- 当商品的delFlag=0和未入库状态时,显示此遮罩,点击弹出弹窗提示不能操作 -->
<view class="shop-mask" v-if="item.delFlag == 0 || item.inStorageStatus == 0"
@tap.stop="clickMask(item)"></view>
<view class="box-left">
<img class="img-radius" :src="item.productPicture" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="box-right">
<view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price">
<view class="price-box" v-if="storageType == 0">
<text>{{item.inStorageStatus==0?'待入库':item.purchasePrice == null ?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
<view class="box-right">
<view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price">
<view class="price-box" v-if="storageType == 0">
<text>{{item.inStorageStatus==0?'待入库':item.purchasePrice == null ?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
</view>
</view>
</view>
</view>
</view>
<u-loadmore :status="status" />
</view>
<view class="bottom-box">
<view class="bottom-left" @tap="toggle('carPopup')">
@ -155,7 +154,16 @@
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <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" />
<!-- <uni-number-box max="100000" v-model="item.productCount" @change="temporaryChange" /> -->
<view class="zuni-numbox">
<view @tap="oneMinusNum(index)" class="zuni-numbox__minus zuni-numbox-btns" style="background: #f5f5f5;">
<text class="zuni-numbox--text">-</text>
</view>
<input v-model="item.productCount" @blur="numChange($event,index)" @focus="obtainPrice($event,'danjishu',index)" class="zuni-numbox__value" type="number" />
<view @tap="onePlusNum(index)" class="zuni-numbox__plus zuni-numbox-btns" style="background: #f5f5f5;">
<text class="zuni-numbox--text">+</text>
</view>
</view>
</view>
</view>
</view>
@ -201,8 +209,17 @@
<view class="checkList-box">
{{item1.attributeList | sliceMsg}}
</view>
<uni-number-box max="100000" v-model="item1.productCount"
@change="carChange($event,index,index1)" />
<!-- <uni-number-box max="100000" v-model="item1.productCount"
@change="carChange($event,index,index1)" /> -->
<view class="zuni-numbox">
<view @tap="oneMinusNum(index1)" class="zuni-numbox__minus zuni-numbox-btns" style="background: #f5f5f5;">
<text class="zuni-numbox--text">-</text>
</view>
<input v-model="item1.productCount" @blur="chenumChange($event,index,index1)" @focus="obtainPrice($event,'chejishu',index,index1)" class="zuni-numbox__value" type="number" />
<view @tap="onePlusNum(index1)" class="zuni-numbox__plus zuni-numbox-btns" style="background: #f5f5f5;">
<text class="zuni-numbox--text">+</text>
</view>
</view>
</view>
</view>
</view>
@ -241,7 +258,8 @@
carList: [],
columns: [],
keyList: [],
evalue: [],
evalue: [],
show: false,
attributeList: {},
purchasePrice: "",
zPrice: 0,
@ -287,6 +305,12 @@
},
onShow() {
this.getGategoryList()
},
onReachBottom() {
if (this.pageNum >= this.pages) return;
// this.status = 'loading';
this.pageNum ++;
this.getShareList();
},
methods: {
//初始化获取分类列表
@ -481,9 +505,9 @@
value.push(value1)
this.evalue.push(name)
}
if(jishuqi == 0){
this.oldTemList = []
this.temporaryList = this.pageOldTemList
}
if(this.temporaryList.length == 0){
if(jishuqi == this.goodsList.length){
@ -556,7 +580,6 @@
}
}
})
if(jishuqi != this.goodsList.length){
if(this.oldTemList.length ==0 && this.pageOldTemList.length ==0){
this.newTemList = []
@ -595,8 +618,8 @@
data = {
categoryId: "",
searchStr: this.searchName,
pageNum: this.pageNum,
pageSize: '100'
pageNum: 1,
pageSize: '10'
}
}else{
this.gateType = ''
@ -604,17 +627,29 @@
categoryId: this.categoryId,
searchStr: this.searchName,
pageNum: this.pageNum,
pageSize: '100'
pageSize: '10'
}
}
this.tui.request("/app/product/getShareList", "POST", data, false, false).then((res) => {
if (res.code == 200) {
if(type=='search'){
this.shopList = []
this.shopList1 = res.result.records
this.status = 'nomore';
if (this.pages == 1) {
this.shopList1 = res.result.records
} else {
this.shopList1 = [...this.shopList1, ...res.result.records]
}
this.pages = res.result.pages
}else{
this.shopList1 = []
this.shopList = res.result.records
this.status = 'nomore';
if (this.pages == 1) {
this.shopList = res.result.records
} else {
this.shopList = [...this.shopList, ...res.result.records]
}
this.pages = res.result.pages
}
} else {
this.tui.toast(res.message)
@ -685,8 +720,8 @@
categoryId: this.goodsDetail.attrId
}, false, true).then((res1) => {
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
if (typeof(res1.result.attributeAndValue) == 'string') {
let newObj = JSON.parse(res1.result.attributeAndValue)
let newArr = []
let dataArr = []
for (let val in newObj) {
@ -751,24 +786,23 @@
}
}
this.getKCList(res1.result.stock);
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
this.getKCList(item.id);
},
//库存商品详情
getKCList(id) {
this.tui.request("/app/stock/productCount", "GET", {
productId: id
}, false, true).then((res) => {
if (res.code == 200) {
this.pecsList = res.result
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
getKCList(list) {
// this.tui.request("/app/stock/productCount", "GET", {
// productId: id
// }, false, true).then((res) => {
// if (res.code == 200) {
this.pecsList = list
// } else {
// this.tui.toast(res.message)
// }
// }).catch((res) => {})
setTimeout(res => {
uni.hideLoading();
}, 200)
@ -789,20 +823,56 @@
this.searchName = ''
this.getShareList()
},
chenumChange(e,index,index1){
if(this.linshiPrice == e.target.value){
this.carList[index].saleDetailQueryDTO[index1].productCount = Number(e.target.value)
}else{
if(e.detail.value == ''){
this.carList[index].saleDetailQueryDTO[index1].productCount = Number(this.linshiPrice)
}else if(e.detail.value == 0){
this.carList[index].saleDetailQueryDTO[index1].productCount = 0
}else{
this.carList[index].saleDetailQueryDTO[index1].productCount = Number(e.detail.value);
}
this.$forceUpdate()
}
this.carChange()
},
numChange(e,index){
if(this.linshiPrice == e.target.value){
this.temporaryList[index].productCount = Number(e.target.value)
}else{
if(e.detail.value == ''){
this.temporaryList[index].productCount = Number(this.linshiPrice)
}else if(e.detail.value == 0){
this.temporaryList[index].productCount = 0
}else{
this.temporaryList[index].productCount = Number(e.detail.value);
}
this.$forceUpdate()
}
this.temporaryChange()
},
oneMinusNum(index){
this.temporaryList[index].productCount --
this.temporaryChange()
},
onePlusNum(index){
this.temporaryList[index].productCount ++
this.temporaryChange()
},
obtainPrice(e,type,index,index1){
// console.log("获得焦点",e)
this.linshiPrice = e.target.value
console.log('12121',this.linshiPrice)
if(type=='zongjishu'){
this.allChangeNum = ''
}else if(type=='danjishu'){
this.temporaryList[index].productCount = ''
this.$forceUpdate()
}else if(type=='chejishu'){
this.carList[index].saleDetailQueryDTO[index1].productCount = ''
this.$forceUpdate()
}
// else if(type=='danjishu'){
// this.temporaryList[index].productCount = ''
// this.$forceUpdate()
// }else if(type=='chejishu'){
// this.carList[index].saleDetailQueryDTO[index1].productCount = ''
// this.$forceUpdate()
// }
},
//未入库遮罩
clickMask(item) {
@ -1139,7 +1209,8 @@
}
.content-right {
flex: 1;
flex: 1;
height: 100%;
overflow-y: scroll;
}

3988
pages/inventory/goodsList1.vue

File diff suppressed because it is too large

389
pages/inventory/inventory.vue

@ -1,7 +1,7 @@
<!-- 库存列表页 -->
<template>
<view style="display: flex;flex-direction: column;" :style="{height: windowHeight + 'px'}">
<view class="" style="display: flex;border-top: 1px solid #eee;border-bottom: 1px solid #eee;">
<view>
<view class="" style="width: 100%;display: flex;border-top: 1px solid #eee;border-bottom: 1px solid #eee;position: fixed;background: #fff;top: 0;z-index: 99;">
<view class="title-left">
<view class="title-left-box" style="color:blue;text-decoration: underline;" @tap="goWarnList">
<text>{{warnMsg.tailWarnCount}}</text>
@ -49,86 +49,88 @@
<view class="search">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none" @confirm="search" @blur="search" @clear="clearSearch" />
</view>
<view class="content-box">
<view class="content-left">
<view v-if="gateType == ''" class="left-box" v-for="(item, index) in indexList" :key="index"
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;" :class="item.parentId ? 'red' :''">{{item.categoryName}}</text>
</view>
<view class="content-left" style="height: 78%;float: left;position: fixed;top: 23%;">
<view v-if="gateType == ''" class="left-box" v-for="(item, index) in indexList" :key="index"
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;" :class="item.parentId ? 'red' :''">{{item.categoryName}}</text>
</view>
<view class="content-right">
<view class="right-box" v-for="(item,index) in shopList" :key="index" @tap="goDetail(item)">
<view class="box-left">
<img :src="item.productPicture" class="img-radius" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="content-right" style="width: 570rpx;background: #fff;margin-left:170rpx;margin-top: 300rpx;">
<view class="right-box" v-for="(item,index) in shopList" :key="index" @tap="goDetail(item)">
<view class="box-left">
<img :src="item.productPicture" class="img-radius" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="box-right">
<view class="box-right-num">货号:{{item.productSn}}</view>
<view class="box-right-name">名称:{{item.productName == null?'暂无':item.productName}}</view>
<view class="box-right-name">供应商:{{item.supplierName == null?'暂无':item.supplierName}}</view>
<!-- 1上架 0下架 -->
<view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">下架</view>
<view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">上架</view>
<view @tap.stop="oneShare(item)" style="position: absolute;top: 20rpx;right: 20rpx;width: 100rpx;height: 100rpx;">
<button class="shareBtn">
<uni-icons type="redo" size="22"></uni-icons>
</button>
</view>
<view class="box-right">
<view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view>
<!-- 1上架 0下架 -->
<view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">下架</view>
<view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">上架</view>
<view class="box-right-price">
<view class="price-box" v-if='type==0'>
<text style="color: red;">{{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
<view class="box-right-price">
<view class="price-box" v-if='type==0'>
<text style="color: red;">{{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
</view>
</view>
</view>
<view class="right-box" v-for="(item,index) in shopList1" :key="index" @tap="goDetail(item)">
<view class="box-left">
<img :src="item.productPicture" class="img-radius" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="right-box" v-for="(item,index) in shopList1" :key="index" @tap="goDetail(item)">
<view class="box-left">
<img :src="item.productPicture" class="img-radius" alt="" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
<view class="box-right">
<view class="box-right-name" style="height: 60rpx;line-height: 60rpx;">{{item.productName}}</view>
<view class="box-right-num">货号:{{item.productSn}}</view>
<!-- 1上架 0下架 -->
<view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">下架</view>
<view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">上架</view>
<view @tap.stop="oneShare(item)" style="position: absolute;top: 20rpx;right: 20rpx;width: 100rpx;height: 100rpx;">
<button class="shareBtn">
<uni-icons type="redo" size="22"></uni-icons>
</button>
</view>
<view class="box-right">
<view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view>
<!-- 1上架 0下架 -->
<view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">下架</view>
<view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">上架</view>
<view class="box-right-price">
<view class="price-box" v-if='type==0'>
<text style="color: red;">{{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
<view class="box-right-price">
<view class="price-box" v-if='type==0'>
<text style="color: red;">{{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}</text>
<text>采购价</text>
</view>
<view class="price-box">
<text>{{item.wholesalePrice}}</text>
<text>批发价</text>
</view>
<view class="price-box">
<text>{{item.price}}</text>
<text>零售价</text>
</view>
<view class="price-box">
<text>{{item.stockCount}}</text>
<text>库存</text>
</view>
</view>
</view>
</view>
</view>
<!-- 新增入库弹出层 -->
<uni-popup ref="popup" background-color="#fff">
<view style="height:340rpx;">
<view @tap="addInventory('0')" class="popup-photo">AI入库</view>
<view @tap="addInventory('1')" class="popup-photo">扫码入库</view>
<view @tap="$refs.popup.close()" class="popup-photo" style="border-bottom:0;border-top:10px solid #eee;">取消</view>
</view>
</view>
</uni-popup>
<u-loadmore :status="status" />
</view>
<!-- 弹出输入框 -->
<uni-popup ref="payDialog" background-color="#fff">
<view class="popup-pay-content">
@ -140,7 +142,31 @@
</view>
<view class="popup-pay-container" @tap="onGridClick('4')">
<text style="display: inline-block">批量打印商品码</text>
</view>
<view class="popup-pay-container" @tap="onGridClick('5')">
<text style="display: inline-block">批量下架</text>
</view>
</view>
</uni-popup>
<!-- 弹出输入框 -->
<uni-popup ref="sharePriceDialog" background-color="#fff">
<view class="popup-pay-content">
<view class="popup-pay-title">
<text>选择商品价格</text>
</view>
<view class="popup-pay-container" @tap="checkPay('0')">
<text style="display: inline-block">以零售价分享</text>
</view>
<view class="popup-pay-container" @tap="checkPay('1')">
<text style="display: inline-block">以批发价分享</text>
</view>
</view>
</uni-popup>
<!-- 弹出层 -->
<uni-popup ref="sharePopup" background-color="#fff">
<view style="height: 250rpx;">
<button open-type="share" @tap="$refs.sharePopup.close()" class="popup-photo">分享给微信好友</button>
<view @tap="$refs.sharePopup.close()" class="popup-photo" style="border-bottom:0;border-top:10px solid #eee;">取消</view>
</view>
</uni-popup>
</view>
@ -155,22 +181,30 @@
data() {
return {
size: 30,
indexList: [],
indexList: [],
// status: 'loadmore',
pageNum: 1, //分页的页码
shopList: [],
categoryId: '', //分类id
shopId: '', //店铺id,
type:'',
warnMsg:[],
goodsData:[],
searchName:'',
categoryIndex:0,
windowHeight:0,
shopList1:[],
picture:'',
gateType:'',
total:0
}
},
onLoad(){
onLoad(option){
if (option.khid != undefined) {
uni.redirectTo({
url: "/package1/index/downStearmList?khid=" + option.khid
})
}
let that = this
this.type=uni.getStorageSync('type')
uni.getSystemInfo({
@ -178,13 +212,46 @@
that.windowHeight = info.windowHeight
}
});
},
onShareAppMessage() {
return {
title: '查看我的推荐',
imageUrl:this.picture,
path: '/pages/index/shareStyle?khid=' + this.khid
}
},
onReachBottom() {
if (this.pageNum >= this.pages) return;
// this.status = 'loading';
this.pageNum ++;
this.getShareList();
},
onShow() {
this.getGategoryList()
onShow() {
if(uni.getStorageSync('noReload') == true){
uni.removeStorageSync('noReload')
}else{
this.getGategoryList()
}
this.getWarnMsg()
this.getweiruku()
},
methods: {
methods: {
checkPay(type){
this.tui.request("/app/productShare/save", "POST", {
shareType: '2',
shareProductId: [this.goodsData.id],
priceType:1
}, false, true).then((res) => {
if (res.code == 200) {
this.khid = res.result.id
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
this.checkPayData = type
this.$refs.sharePriceDialog.close()
this.$refs.sharePopup.open('bottom')
},
//初始化获取分类列表
getGategoryList() {
this.tui.request("/app/productCategory/list", "get", {
@ -199,7 +266,11 @@
this.indexList[i].parentId = false
}
}
this.categoryId = this.indexList[this.categoryIndex].id
this.categoryId = this.indexList[this.categoryIndex].id
this.pageNum = 1
this.searchName = ""
this.shopList1 = []
this.shopList = []
this.getShareList();
} else {
this.tui.toast(res.message)
@ -218,15 +289,19 @@
},
//点击左侧菜单切换
clickLeftBtn(index) {
this.categoryIndex = index
for (var i = 0; i < this.indexList.length; i++) {
if (i == index) {
this.indexList[i].parentId = true
} else {
this.indexList[i].parentId = false
}
uni.removeStorageSync('noReload')
for (var i = 0; i < this.indexList.length; i++) {
if (i == index) {
this.indexList[i].parentId = true
} else {
this.indexList[i].parentId = false
}
}
this.categoryId = this.indexList[index].id
this.categoryId = this.indexList[index].id
this.pageNum = 1
this.searchName = ""
this.shopList1 = []
this.shopList = []
this.getShareList()
},
//待入库
@ -249,7 +324,8 @@
})
},
//入库单详情
goDetail(item) {
goDetail(item) {
uni.setStorageSync('noReload',true)
uni.navigateTo({
url: '/pages/inventory/inventoryDetail?item=' + JSON.stringify(item)
})
@ -268,6 +344,10 @@
},
//点击分类获取商品列表
getShareList(type) {
uni.showLoading({
title:'加载中...',
mask:true
})
let data = {}
if(type=='search'){
this.gateType = 'search'
@ -275,7 +355,7 @@
categoryId: "",
searchStr: this.searchName,
pageNum: this.pageNum,
pageSize: '100'
pageSize: '10'
}
}else{
this.gateType = ''
@ -283,22 +363,41 @@
categoryId: this.categoryId,
searchStr: this.searchName,
pageNum: this.pageNum,
pageSize: '100'
pageSize: '10'
}
}
}
this.status = 'loading';
this.tui.request("/app/product/getShareList", "POST", data, false, false).then((res) => {
if (res.code == 200) {
if(type=='search'){
this.shopList = []
this.shopList1 = res.result.records
this.status = 'nomore';
if (this.pages == 1) {
this.shopList1 = res.result.records
} else {
this.shopList1 = [...this.shopList1, ...res.result.records]
}
this.pages = res.result.pages
}else{
this.shopList1 = []
this.shopList = res.result.records
this.status = 'nomore';
if (this.pages == 1) {
this.shopList = res.result.records
} else {
this.shopList = [...this.shopList, ...res.result.records]
}
this.pages = res.result.pages
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}).catch((res) => {})
uni.hideLoading()
},
oneShare(item){
this.goodsData = item
this.picture = item.productPicture == null ?'https://jewel-shop.oss-cn-beijing.aliyuncs.com/70c3d9a274ff4feeb6df0bcb8be0f733.jpg':item.productPicture
this.$refs.sharePriceDialog.open()
},
//商品上下架
upDown(type, data) {
@ -309,6 +408,10 @@
content: title,
success: function(res) {
if(res.confirm){
that.pageNum = 1
that.searchName = ""
that.shopList1 = []
that.shopList = []
if (type == 0) { //下架
that.tui.request("/app/product/down", "POST", {
id: data.id
@ -318,7 +421,7 @@
} else {
that.tui.toast(res.message)
}
this.categoryId = data.categoryId
that.categoryId = data.categoryId
that.getShareList()
}).catch((res) => {})
} else { //上架
@ -330,7 +433,7 @@
} else {
that.tui.toast(res.message)
}
this.categoryId = data.categoryId
that.categoryId = data.categoryId
that.getShareList()
}).catch((res) => {})
}
@ -353,18 +456,6 @@
clearSearch(){
this.searchName = ''
this.getShareList()
},
addInventory(type){
if(type=='0'){
uni.navigateTo({
url: '/package1/AI/AIInventoryList'
})
}else{
uni.navigateTo({
url: '/pages/inventory/addinventory'
})
}
this.$refs.popup.close()
},
//点击头部 更多 和 新增入库 按钮
onGridClick(target) {
@ -386,11 +477,16 @@
this.$refs.payDialog.close()
}else if(target == '3'){
this.$refs.payDialog.open('center')
}else{
}else if(target == '4'){
uni.navigateTo({
url: "/package1/inventory/batchPrint"
})
this.$refs.payDialog.close()
}else{
uni.navigateTo({
url: "/package1/inventory/goodsDelisting"
})
this.$refs.payDialog.close()
}
}
}
@ -399,9 +495,12 @@
<style lang="scss">
.search {
background-color: #fff;
width: 100%;
background-color: #fff;
width: 100%;
height: 7%;
background-color: #fff;
position: fixed;
top: 200rpx;
z-index: 99;
}
.title-left {
@ -502,13 +601,14 @@
}
.content-right {
width: 550rpx;
width: 550rpx;
height: 78%;
overflow-y: scroll;
}
.right-box {
width: 100%;
height: 190rpx;
height: 250rpx;
display: flex;
border-bottom: 1px solid #eee;
position: relative;
@ -532,16 +632,6 @@
margin-top: 17rpx;
}
.box-right-name {
font-size: 30rpx;
font-weight: bold;
}
.box-right-num {
padding: 5rpx 0;
color: #777;
}
.box-right-price {
display: flex;
font-size: 25rpx;
@ -550,7 +640,20 @@
.price-box {
display: flex;
flex-direction: column;
margin-right: 20rpx;
margin-right: 20rpx;
margin-top:10rpx;
}
.box-right-name {
font-size: 26rpx;
height: 50rpx;
line-height: 50rpx;
}
.box-right-num {
padding: 5rpx 0;
color: #000;
font-weight: bold;
font-size: 30rpx;
}
.price-box text:first-child {
@ -570,13 +673,15 @@
}
.up-down {
position: absolute;
top: 20rpx;
right: 10rpx;
color: #fff;
background: #088FEB;
padding: 10rpx 10rpx;
border-radius: 10px;
position: absolute;
bottom: 10rpx;
left: 10rpx;
color: #fff;
background: #088FEB;
padding: 10rpx 10rpx;
border-radius: 5px;
width: 140rpx;
text-align: center;
}
.noPic{
border-radius: 10px;
@ -625,5 +730,25 @@
}
.vue-ref{
padding-bottom:0 !important;
}
.shareBtn{
background: rgba(255, 255, 255, 0);
width: 90rpx;
height: 50;
height: 80rpx;
line-height: 80rpx;
border: 1px solid #fff;
background-color: rgba(255,255,255,0);
}
.shareBtn::after{
border: none;
}
.popup-photo{
height: 110rpx;
line-height: 110rpx;
text-align: center;
font-size: 36rpx;
font-weight: 800;
border-bottom: 1px solid #eee;
}
</style>

318
pages/inventory/inventoryDetail.vue

@ -40,20 +40,107 @@
<text>库存</text>
</view>
</view>
</view>
<view class="container-box" v-for="(item,index) in pecsList" :key='index'>
<view class="prec-list">
<view class="prec-list-box" :style="{width:isPrint?'40%':'70%'}">
{{item.attributeList | sliceMsg}}
</view>
<view class="prec-list-box" style="font-size: 26rpx;width: 26%;">
数量:{{item.stockCount}}
</view>
<view style="background: #fff;border: 1px solid #eee;">
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#007aff"></uni-segmented-control>
</view>
<view class="content" style="background: #fff;">
<view v-show="current === 0">
<view class="container-box" v-for="(item,index) in pecsList" :key='index'>
<view class="prec-list">
<view class="prec-list-box" :style="{width:isPrint?'40%':'70%'}">
{{item.attributeList | sliceMsg}}
</view>
<view class="prec-list-box" style="font-size: 26rpx;width: 26%;">
数量:{{item.stockCount}}
</view>
<view>
<uni-number-box v-if="isPrint" v-model="item.productCount" max="10000"
@change="changeNumBtn(item)" style="margin-top: 10rpx;display: block;" />
</view>
</view>
</view>
<view>
<uni-number-box v-if="isPrint" v-model="item.productCount" max="10000"
@change="changeNumBtn(item)" style="margin-top: 10rpx;display: block;" />
</view>
</view>
</view>
<view v-show="current === 1">
<view v-for="(item,index) in detailList" :key="index">
<view style="width: 100%;height: 80rpx;line-height: 80rpx;">
<text style="display:inline-block;width: 55%;text-align: center;font-weight: bold;font-size: 30rpx;">
{{item.createTime}}
</text>
<text style="display:inline-block;width: 45%;text-align: center;border-left: 1px solid #eee;">
操作:{{item.createByName}}
</text>
</view>
<uni-table border stripe emptyText="暂无更多数据">
<uni-tr style="background: #eee;">
<uni-th align="center" width="85">客户</uni-th>
<uni-th align="center" width="50">数量</uni-th>
<uni-th align="center" width="70">拿货价</uni-th>
<uni-th align="center" width="70">采购价</uni-th>
<uni-th align="center" width="70">总利润</uni-th>
</uni-tr>
<uni-tr @tap="xiaoshouDetail(item)">
<uni-td align="center">{{item.userName}}</uni-td>
<uni-td align="center">{{item.productCount}}</uni-td>
<uni-td align="center">{{item.saleDetailDTOList[0].discountAmount}}</uni-td>
<uni-td align="center">{{type == 0?(item.saleDetailDTOList[0].purchasePrice != null ? item.saleDetailDTOList[0].purchasePrice:0):0}}</uni-td>
<uni-td align="center">{{type == 0?item.lirun:0}}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
<view v-show="current === 2">
<view v-for="(item,index) in detailList" :key="index">
<view style="width: 100%;height: 80rpx;line-height: 80rpx;">
<text style="display:inline-block;width: 55%;text-align: center;font-weight: bold;font-size: 30rpx;">
{{item.purchase.createTime}}
</text>
<text style="display:inline-block;width: 45%;text-align: center;border-left: 1px solid #eee;">
操作:{{item.purchase.createByName}}
</text>
</view>
<uni-table border stripe emptyText="暂无更多数据">
<uni-tr style="background: #eee;">
<uni-th align="center" width="85">供应商</uni-th>
<uni-th align="center" width="50">数量</uni-th>
<uni-th align="center" width="70">进货价</uni-th>
<uni-th align="center" width="70">总价</uni-th>
</uni-tr>
<uni-tr @tap="rukuDetail(item.purchaseDetails[0])">
<uni-td align="center">{{item.purchase.supplierName}}</uni-td>
<uni-td align="center">{{item.purchase.totalAmount}}</uni-td>
<uni-td align="center">{{type == 0?item.purchaseDetails[0].purchasePrice:0}}</uni-td>
<uni-td align="center">{{type == 0?item.purchaseDetails[0].zPrice:0}}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
<view v-show="current === 3">
<view v-for="(item,index) in detailList" :key="index">
<view style="width: 100%;height: 80rpx;line-height: 80rpx;">
<text style="display:inline-block;width: 55%;text-align: center;font-weight: bold;font-size: 30rpx;">
{{item.createTime}}
</text>
<text style="display:inline-block;width: 45%;text-align: center;border-left: 1px solid #eee;">
操作:{{item.createByName?item.createByName:''}}
</text>
</view>
<uni-table border stripe emptyText="暂无更多数据">
<uni-tr style="background: #eee;">
<uni-th align="center" width="85">客户</uni-th>
<uni-th align="center" width="50">数量</uni-th>
<uni-th align="center" width="70">退货价</uni-th>
<uni-th align="center" width="70">采购价</uni-th>
</uni-tr>
<uni-tr @tap="tuihuoDetail(item)">
<uni-td align="center">{{item.userName?item.userName:''}}</uni-td>
<uni-td align="center">{{item.productCount?item.productCount:'0'}}</uni-td>
<uni-td align="center">{{item.totalAmount?item.totalAmount:'0'}}</uni-td>
<uni-td align="center">{{type == 0?(item.returnSaleDetailList[0].purchasePrice?item.returnSaleDetailList[0].purchasePrice:'0'):0}}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<!-- 打印选择框 -->
<uni-popup ref="payDialog" background-color="#fff">
@ -150,6 +237,29 @@
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint1" :printNum="printNum" :defaultText="'打印'"></kk-printer>
</view>
</view>
</uni-popup>
<!-- 弹出商品规格 -->
<uni-popup ref="detailPopup" background-color="#fff">
<view style="width: 500rpx;min-height: 500rpx;max-height: 1000rpx;overflow: scroll;">
<view @tap="$refs.detailPopup.close()" style='width: 50rpx;height: 50rpx;position: absolute;right: 20rpx;top: 25rpx;'>
<uni-icons type="closeempty" color="red" size="22"></uni-icons>
</view>
<view style="height: 100rpx;line-height: 100rpx;font-weight: bold;font-size: 36rpx;text-align: center;">
</view>
<uni-table border stripe emptyText="暂无更多数据" style="margin-bottom: 20rpx;border-radius: 10px;">
<!-- 表头行 -->
<uni-tr style="background: #eee;">
<uni-th align="center" width="80">规格</uni-th>
<uni-th align="center" width="55">数量</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item,index) in GDList.stockLogList" :key="index">
<uni-td align="center">{{item.attributeList | sliceMsg}}</uni-td>
<uni-td align="center">{{item.productCount}}</uni-td>
</uni-tr>
</uni-table>
</view>
</uni-popup>
<!-- 弹出输入框 -->
<uni-popup ref="inputDialog" type="dialog">
@ -160,8 +270,8 @@
<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" />
<uni-fab v-if="!isPrint" ref="fab" :content="content" :horizontal="horizontal"
@trigger="trigger"/>
</view>
</template>
@ -173,14 +283,19 @@
export default {
data() {
return {
pageNum: 1, //分页的页码
pageNum: 1, //分页的页码
pages:1,
dataList: [],
detailList:[],
GDList:[],
isPrint:false,
bufferData: [],
items:['库存', '销售明细', '入库明细','退货'],
current: 0,
horizontal: 'right',
pecsList:[],
defaultText:'',
type:'',
type:uni.getStorageSync('type'),
size:'',
color:'',
number:'',
@ -208,16 +323,6 @@
selectedIconPath: '/static/images/tabbar/home-sel.png',
text: '自定打印',
active: false
},{
iconPath: '/static/images/tabbar/home.png',
selectedIconPath: '/static/images/tabbar/home-sel.png',
text: '销售明细',
active: false
},{
iconPath: '/static/images/tabbar/home.png',
selectedIconPath: '/static/images/tabbar/home-sel.png',
text: '入库明细',
active: false
},{
iconPath: '/static/images/tabbar/home.png',
selectedIconPath: '/static/images/tabbar/home-sel.png',
@ -255,9 +360,7 @@
uni.closeBLEConnection({
deviceId:uni.getStorageSync('deviceId'),
success(res) {
console.log(res)
},fail(err){
console.log(err)
}
})
},5000)
@ -265,13 +368,63 @@
onLoad(option) {
// 初始化蓝牙模块
wx.openBluetoothAdapter({mode: 'central'})
this.dataList = JSON.parse(option.item);
this.type = uni.getStorageSync('type')
this.dataList = JSON.parse(option.item);
},
onReachBottom() {
if (this.pageNum >= this.pages) return;
this.status = 'loading';
this.pageNum ++;
this.getWaitStorage();
},
onShow(){
this.getShareList();
},
methods: {
methods: {
getWaitStorage() {
this.status = 'loading';
var url;
if(this.current==1){ //销售
url = "/app/sale/getSaleListByProductId"
}else if(this.current==2){ //入库
url = "/app/purchase/getPurchaseListByProductId"
}else if(this.current==3){ //退货
url = "/app/return/getReturnSaleListByProductId"
}
this.tui.request(url, "post", {
productId: this.dataList.id,
pageSize: 10,
pageNum: this.pageNum
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
// this.list = res.result.records
if (this.pages == 1) {
this.detailList = res.result.records
} else {
this.detailList = [...this.detailList, ...res.result.records]
}
if(this.current==1){
for(let i=0;i<this.detailList.length;i++){
this.detailList[i].lirun = 0
for(let m=0;m<this.detailList[i].saleDetailDTOList.length;m++){
this.detailList[i].lirun += (this.detailList[i].saleDetailDTOList[m].discountAmount - this.detailList[i].saleDetailDTOList[m].purchasePrice) * this.detailList[i].saleDetailDTOList[m].stockLogList1[0].productCount
}
}
}else if(this.current==2){
for(let i=0;i<this.detailList.length;i++){
for(let m=0;m<this.detailList[i].purchaseDetails.length;m++){
this.detailList[i].purchaseDetails[m].zPrice = this.detailList[i].purchaseDetails[m].productCount * this.detailList[i].purchaseDetails[m].purchasePrice
}
}
}
this.pages = res.result.pages
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//库存商品详情
getShareList() {
this.tui.request("/app/stock/productCount", "GET", {
@ -309,6 +462,56 @@
this.$refs.payDialog.close()
this.isPrint = !this.isPrint
},
rukuDetail(item){
console.log('item',item)
if(item){
item.stockLogList = []
for(let i=0;i<item.stockLogList1.length;i++){
item.stockLogList.push(item.stockLogList1[i])
}
this.GDList = item
this.$refs.detailPopup.open()
}
console.log('GDList',this.GDList)
},
xiaoshouDetail(item){
console.log('item',item)
if(item){
item.saleDetailDTOList[0].stockLogList = []
for(let i=0;i<item.saleDetailDTOList.length;i++){
item.saleDetailDTOList[0].stockLogList.push(item.saleDetailDTOList[i].stockLogList1[0])
}
this.GDList = item.saleDetailDTOList[0]
this.$refs.detailPopup.open()
}
},
tuihuoDetail(item){
console.log('item',item)
if(item){
item.returnSaleDetailList[0].stockLogList = []
for(let i=0;i<item.returnSaleDetailList.length;i++){
item.returnSaleDetailList[0].stockLogList.push(item.returnSaleDetailList[i].stockLogList1[0])
}
this.GDList = item.returnSaleDetailList[0]
this.$refs.detailPopup.open()
}
},
onClickItem(e) {
this.pageNum = 1
this.detailList = []
if (this.current !== e.currentIndex) {
this.current = e.currentIndex
}
if(e.currentIndex == 0){
this.getShareList();
}else if(e.currentIndex == 1){
this.getWaitStorage('1')
}else if(e.currentIndex == 2){
this.getWaitStorage('2')
}else if(e.currentIndex == 3){
this.getWaitStorage('3')
}
},
//点击打印按钮
clickzidingyiPrint() {
this.$refs.zidingyiDialog.close()
@ -369,22 +572,22 @@
for(let i=0;i<item.productCount;i++){
that.yNum = 10
let strCmd = blesdk.CreatCPCLPage(440, 320, 1, 0);
strCmd += blesdk.addCPCLText('0', '10', '24', '0', 0, '商品名:'+that.dataList.productName)
let strCmd = blesdk.CreatCPCLPage(410, 320, 1, 0);
strCmd += blesdk.addCPCLText('30', '10', '24', '0', 0, '商品名:'+that.dataList.productName)
if(that.multipleList.indexOf('货号') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '货 号:'+that.dataList.productSn)
strCmd += blesdk.addCPCLText('30', that.countPrint(), '24', '0', 0, '货 号:'+that.dataList.productSn)
}
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '规 格:'+ that.sliceMsg(item.attributeList))
strCmd += blesdk.addCPCLText('30', that.countPrint(), '24', '0', 0, '规 格:'+ that.sliceMsg(item.attributeList))
if(that.multipleList.indexOf('供应商') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '供应商:'+that.dataList.supplierName)
strCmd += blesdk.addCPCLText('30', that.countPrint(), '24', '0', 0, '供应商:'+that.dataList.supplierName)
}
if(that.multipleList.indexOf('批发价') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '批发价:'+that.dataList.wholesalePrice)
strCmd += blesdk.addCPCLText('30', that.countPrint(), '24', '0', 0, '批发价:'+that.dataList.wholesalePrice)
}
if(that.multipleList.indexOf('零售价') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '零售价:'+that.dataList.price)
strCmd += blesdk.addCPCLText('30', that.countPrint(), '24', '0', 0, '零售价:'+that.dataList.price)
}
strCmd += blesdk.addCPCLQRCode(220, 160, 'H', '1', 4, [base.encode(that.dataList.id),base.encode(uni.getStorageSync('shopId'))]) //二维码
strCmd += blesdk.addCPCLQRCode(240, 160, 'H', '1', 4, [base.encode(that.dataList.id),base.encode(uni.getStorageSync('shopId'))]) //二维码
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
@ -404,22 +607,22 @@
}
for(let i=0;i<this.number;i++){
that.yNum = 10
let strCmd = blesdk.CreatCPCLPage(440, 320, 1, 0);
strCmd += blesdk.addCPCLText('0', '10', '24', '0', 0, '商品名:'+that.dataList.productName)
let strCmd = blesdk.CreatCPCLPage(410, 320, 1, 0);
strCmd += blesdk.addCPCLText('30', '10', '24', '0', 0, '商品名:'+that.dataList.productName)
if(that.multipleList.indexOf('货号') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '货 号:'+that.dataList.productSn)
strCmd += blesdk.addCPCLText('30', that.countPrint(), '24', '0', 0, '货 号:'+that.dataList.productSn)
}
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '规 格:'+ this.color+' '+this.size)
strCmd += blesdk.addCPCLText('30', that.countPrint(), '24', '0', 0, '规 格:'+ this.color+' '+this.size)
if(that.multipleList.indexOf('供应商') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '供应商:'+that.dataList.supplierName)
strCmd += blesdk.addCPCLText('30', that.countPrint(), '24', '0', 0, '供应商:'+that.dataList.supplierName)
}
if(that.multipleList.indexOf('批发价') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '批发价:'+that.dataList.wholesalePrice)
strCmd += blesdk.addCPCLText('30', that.countPrint(), '24', '0', 0, '批发价:'+that.dataList.wholesalePrice)
}
if(that.multipleList.indexOf('零售价') != -1){
strCmd += blesdk.addCPCLText('0', that.countPrint(), '24', '0', 0, '零售价:'+that.dataList.price)
strCmd += blesdk.addCPCLText('30', that.countPrint(), '24', '0', 0, '零售价:'+that.dataList.price)
}
strCmd += blesdk.addCPCLQRCode(220, 160, 'H', '1', 4, [base.encode(that.dataList.id),base.encode(uni.getStorageSync('shopId'))]) //二维码
strCmd += blesdk.addCPCLQRCode(240, 160, 'H', '1', 4, [base.encode(that.dataList.id),base.encode(uni.getStorageSync('shopId'))]) //二维码
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint();
that.bufferData.push(strCmd);
@ -434,20 +637,9 @@
trigger(e) {
if(e.index==0){ //自定义打印
this.$refs.zidingyiDialog.open();
}else if(e.index==1){
uni.navigateTo({
url: '/package1/inventory/getProductIdToList?type=0&id=' + this.dataList.id
})
}else if(e.index==2){
uni.navigateTo({
url: '/package1/inventory/getProductIdToList?type=1&id=' + this.dataList.id
})
}else{
this.delGoods()
}
},
delGoods(){
let that = this;
@ -460,6 +652,14 @@
id:that.dataList.id
}, false, true).then((res1) => {
if (res1.code == 200) {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
let shopList = prevPage.$vm.shopList
for(let i=0;i<shopList.length;i++){
if(shopList[i].id == that.dataList.id){
shopList.splice(i, 1);
}
}
uni.navigateBack({
delta: 1
})

Loading…
Cancel
Save