|
@@ -3,28 +3,30 @@
|
|
|
<!--销售数据统计 -->
|
|
|
<view class="content-data">
|
|
|
<view class="date-type">
|
|
|
- <text :class="['type',timeType=='day' ? 'active_day' : '']" @click="seleteTime(0)">今日</text>
|
|
|
- <text :class="['type',timeType=='week' ? 'active_day' : '']" @click="seleteTime(1)">本周</text>
|
|
|
- <text :class="['type',timeType=='mounth' ? 'active_day' : '']" @click="seleteTime(2)">本月</text>
|
|
|
+ <text v-for="(item, index) in tabNav" :key="index" :class="[index == navInd ? 'active_day' : '']" @click="seleteTime(index)">{{item.name}}</text>
|
|
|
</view>
|
|
|
<view class="total">
|
|
|
<view class="item-box">
|
|
|
- <u-count-to :end-val="salesCount" separator=","></u-count-to>
|
|
|
+ <u-count-to v-if="navInd==0" :end-val="bizData&&bizData.sales&&(bizData.sales.dayTotalQty || bizData.sales.dayTotalQty==0) ? bizData.sales.dayTotalQty : 0" separator=","></u-count-to>
|
|
|
+ <u-count-to v-if="navInd==1" :end-val="bizData&&bizData.sales&&(bizData.sales.weekSalesQty || bizData.sales.weekSalesQty==0) ? bizData.sales.weekSalesQty : 0" separator=","></u-count-to>
|
|
|
+ <u-count-to v-if="navInd==2" :end-val="bizData&&bizData.sales&&(bizData.sales.monthSalesQty || bizData.sales.monthSalesQty==0) ? bizData.sales.monthSalesQty : 0" separator=","></u-count-to>
|
|
|
<view>销售总单量(个)</view>
|
|
|
</view>
|
|
|
<view class="item-box">
|
|
|
- <u-count-to :end-val="salesAmount" separator="," :decimals="2"></u-count-to>
|
|
|
+ <u-count-to v-if="navInd==0" :end-val="bizData&&bizData.sales&&(bizData.sales.dayTotalAmount || bizData.sales.dayTotalAmount==0) ? bizData.sales.dayTotalAmount : 0" separator="," :decimals="2"></u-count-to>
|
|
|
+ <u-count-to v-if="navInd==1" :end-val="bizData&&bizData.sales&&(bizData.sales.weekSalesAmount || bizData.sales.weekSalesAmount==0) ? bizData.sales.weekSalesAmount : 0" separator="," :decimals="2"></u-count-to>
|
|
|
+ <u-count-to v-if="navInd==2" :end-val="bizData&&bizData.sales&&(bizData.sales.monthSalesAmount || bizData.sales.monthSalesAmount==0) ? bizData.sales.monthSalesAmount : 0" separator="," :decimals="2"></u-count-to>
|
|
|
<view>销售总金额(¥)</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 产品报价及新增销售单 -->
|
|
|
<view class="nav-cont flex align_center justify_between">
|
|
|
- <view class="nav-item">
|
|
|
+ <view class="nav-item" @click="toPage('/pages/sales/productPricing')">
|
|
|
<u-image class="nav-pic" style="margin-top: 5upx;" :src="`../../static/${theme}/navIcon/price_icon.png`" width="60" height="60"></u-image>
|
|
|
<text class="nav-txt" style="margin-top: 5upx;">产品报价</text>
|
|
|
</view>
|
|
|
- <view class="nav-item">
|
|
|
+ <view class="nav-item" @click="toPage('')">
|
|
|
<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/sale_icon.png`" width="70" height="70"></u-image>
|
|
|
<text class="nav-txt">新增销售单</text>
|
|
|
</view>
|
|
@@ -43,12 +45,12 @@
|
|
|
</view>
|
|
|
<view class="list-item-con">
|
|
|
<view class="list-item-line flex align_center justify_between">
|
|
|
- <view class="">
|
|
|
+ <view>
|
|
|
<view style="display: inline-block;margin-right: 6upx;">{{item.salesBillNo}}</view>
|
|
|
- <u-tag v-if="item.oosFlag==1" text="急件" :bg-color="$config('errorColor')" mode="dark" shape="circle" size="mini" style="margin-right: 6upx;" />
|
|
|
- <u-tag v-if="item.salesBillSourceDictValue" :text="item.salesBillSourceDictValue" :bg-color="$config('primaryColor')" mode="dark" shape="circle" size="mini" />
|
|
|
+ <u-tag v-if="item.oosFlag==1" text="急件" :bg-color="$config('errorColor')" mode="dark" shape="circle" size="mini" style="margin-right: 6upx;vertical-align: text-top;" />
|
|
|
+ <u-tag v-if="item.salesBillSourceDictValue" :text="item.salesBillSourceDictValue" :bg-color="$config('primaryColor')" mode="dark" shape="circle" size="mini" style="vertical-align: text-top;" />
|
|
|
</view>
|
|
|
- <view class="color_6">{{item.createDate || '--'}}</view>
|
|
|
+ <view class="color_6 font_13">{{item.createDate || '--'}}</view>
|
|
|
</view>
|
|
|
<view class="list-item-line flex align_center justify_between">
|
|
|
<view>总款数:<text>{{toThousands(item.totalCategory||0)}}</text></view>
|
|
@@ -60,8 +62,13 @@
|
|
|
<view class="flex_1">收款方式:<text>{{item.settleStyleEntity&&item.settleStyleEntity.name||'--'}}</text></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="">
|
|
|
- <!-- <u-button @click="handleOutGoods" type="success" :custom-style="customStyle" hover-class="none" shape="circle">立即出库</u-button> -->
|
|
|
+ <view class="button-box">
|
|
|
+ <u-button @click="handleFun('audit', item)" size="mini" :hair-line="false" plain type="primary" hover-class="none" v-if="item.billStatus == 'WAIT_AUDIT'">审核</u-button>
|
|
|
+ <u-button @click="handleFun('out', item)" size="mini" :hair-line="false" plain type="primary" hover-class="none" v-if="item.billStatus == 'WAIT_OUT_WAREHOUSE'">出库</u-button>
|
|
|
+ <u-button @click="handleEdit(item)" size="mini" :hair-line="false" plain type="primary" hover-class="none" v-if="((item.salesBillSource == 'SATELLITE' || item.salesBillSource == 'SALES') && (item.billStatus == 'WAIT_AUDIT' || item.billStatus == 'WAIT_SUBMIT' || item.billStatus == 'AUDIT_REJECT'))">编辑</u-button>
|
|
|
+ <u-button @click="handleFun('del', item)" size="mini" :hair-line="false" plain type="primary" hover-class="none" v-if="((item.salesBillSource == 'SATELLITE' || item.salesBillSource == 'SALES') && item.billStatus != 'FINISH')">删除</u-button>
|
|
|
+ <u-button @click="handleEdit(item)" size="mini" :hair-line="false" plain type="primary" hover-class="none" v-if="(item.salesBillSource == 'PURCHASE' && (item.billStatus == 'WAIT_AUDIT' || item.billStatus == 'SUPERIOR_CHANGE'))">改单</u-button>
|
|
|
+ <u-button @click="handleFun('cancel', item)" size="mini" :hair-line="false" plain type="primary" hover-class="none" v-if="(item.salesBillSource == 'PURCHASE' && (item.billStatus == 'WAIT_AUDIT' || item.billStatus == 'SUPERIOR_CHANGE'))">取消</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-if="listData && listData.length == 0">
|
|
@@ -70,30 +77,48 @@
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
+ <!-- 审核弹框 -->
|
|
|
+ <common-modal :openModal="auditModal" content="请点击下方按钮确认操作" confirmText="审核通过" cancelText="审核不通过" :isClose="true" @confirm="handleAudit('WAIT_OUT_WAREHOUSE')" @cancel="handleAudit('AUDIT_REJECT')" @close="auditModal=false" />
|
|
|
+ <!-- 出库弹框 -->
|
|
|
+ <common-modal :openModal="outModal" content="确认要出库吗?" @confirm="handleOut" @close="outModal=false" />
|
|
|
+ <!-- 删除/取消弹框 -->
|
|
|
+ <common-modal :openModal="delModal" :content="delText" @confirm="handleDel" @close="delModal=false" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import commonModal from '@/pages/common/commonModal.vue'
|
|
|
import { toThousands } from '@/libs/tools'
|
|
|
- import { bizData, salesList } from '@/api/sales'
|
|
|
+ import { bizData, salesList, salesWriteAudit, salesWriteStockOut, salesDel } from '@/api/sales'
|
|
|
export default{
|
|
|
+ components: { commonModal },
|
|
|
data(){
|
|
|
return{
|
|
|
- timeType:'day',
|
|
|
- bizData:null, // 销售数据统计
|
|
|
- salesCount:0, // 销售总单数
|
|
|
- salesAmount:0, // 销售总金额
|
|
|
+ tabNav: [
|
|
|
+ { name: '今日', ind: 0 },
|
|
|
+ { name: '本周', ind: 1 },
|
|
|
+ { name: '本月', ind: 2 }
|
|
|
+ ],
|
|
|
+ navInd: 0,
|
|
|
+ bizData: null, // 销售数据统计
|
|
|
theme: '',
|
|
|
listData: [],
|
|
|
pageNo: 1,
|
|
|
pageSize: 6,
|
|
|
totalNum: 0,
|
|
|
noDataText: '暂无数据',
|
|
|
- toThousands
|
|
|
+ toThousands,
|
|
|
+ auditModal: false, // 审核弹框
|
|
|
+ dataInfo: null,
|
|
|
+ outModal: false, // 出库弹框
|
|
|
+ delModal: false, // 删除/取消弹框
|
|
|
+ delText: '确认要删除吗?'
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.theme = getApp().globalData.theme
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
this.getBizData()
|
|
|
this.getList()
|
|
|
},
|
|
@@ -127,14 +152,7 @@
|
|
|
}
|
|
|
},
|
|
|
seleteTime(val){
|
|
|
- if(val==0){
|
|
|
- this.timeType='day'
|
|
|
- }else if(val==1){
|
|
|
- this.timeType='week'
|
|
|
- }else{
|
|
|
- this.timeType='mounth'
|
|
|
- }
|
|
|
- this.getBizData()
|
|
|
+ this.navInd = val
|
|
|
},
|
|
|
toPage(url){
|
|
|
uni.navigateTo({ url: url })
|
|
@@ -142,24 +160,68 @@
|
|
|
getBizData () {
|
|
|
bizData({}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.bizData = res.data
|
|
|
- if(this.timeType=='day'){
|
|
|
- this.salesCount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.dayTotalQty || this.bizData.purchaseBill.dayTotalQty==0) ? this.bizData.purchaseBill.dayTotalQty : 0
|
|
|
- this.salesAmount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.dayDiscountedAmount || this.bizData.purchaseBill.dayDiscountedAmount==0) ? this.bizData.purchaseBill.dayDiscountedAmount : 0
|
|
|
- }else if(this.timeType=='week'){
|
|
|
- this.salesCount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.weekPurchaseQty || this.bizData.purchaseBill.weekPurchaseQty==0) ? this.bizData.purchaseBill.weekPurchaseQty : 0
|
|
|
- this.salesAmount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.weekDiscountedAmount || this.bizData.purchaseBill.weekDiscountedAmount==0) ? this.bizData.purchaseBill.weekDiscountedAmount : 0
|
|
|
- }else{
|
|
|
- this.salesCount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.monthPurchaseQty || this.bizData.purchaseBill.monthPurchaseQty==0) ? this.bizData.purchaseBill.monthPurchaseQty : 0
|
|
|
- this.salesAmount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.monthDiscountedAmount || this.bizData.purchaseBill.monthDiscountedAmount==0) ? this.bizData.purchaseBill.monthDiscountedAmount : 0
|
|
|
- }
|
|
|
+ this.bizData = res.data || null
|
|
|
} else {
|
|
|
this.bizData = null
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 查看详情
|
|
|
- getDetail(data){}
|
|
|
+ getDetail(data){},
|
|
|
+ // 操作
|
|
|
+ handleFun(type, data){
|
|
|
+ this.dataInfo = data
|
|
|
+ if(type == 'audit'){ // 审核
|
|
|
+ this.auditModal = true
|
|
|
+ }else if(type == 'out'){ // 出库
|
|
|
+ this.outModal = true
|
|
|
+ }else if(type == 'del'){ // 删除
|
|
|
+ this.delText = '确认要删除吗?'
|
|
|
+ this.delModal = true
|
|
|
+ }else if(type == 'cancel'){ // 取消
|
|
|
+ this.delText = '确认要取消吗?'
|
|
|
+ this.delModal = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 审核通过或不通过
|
|
|
+ handleAudit(billStatus){
|
|
|
+ salesWriteAudit({
|
|
|
+ id: this.dataInfo.id,
|
|
|
+ billStatus: billStatus
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.toashMsg(res.message)
|
|
|
+ this.getList(1)
|
|
|
+ this.auditModal = false
|
|
|
+ } else {
|
|
|
+ this.auditModal = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 出库
|
|
|
+ handleOut(){
|
|
|
+ salesWriteStockOut({ salesBillSn: this.dataInfo.salesBillSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.toashMsg(res.message)
|
|
|
+ this.getList(1)
|
|
|
+ this.outModal = false
|
|
|
+ } else {
|
|
|
+ this.outModal = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ handleDel(){
|
|
|
+ salesDel({ id: this.dataInfo.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.toashMsg(res.message)
|
|
|
+ this.getList(1)
|
|
|
+ this.delModal = false
|
|
|
+ } else {
|
|
|
+ this.delModal = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -167,10 +229,13 @@
|
|
|
<style lang="scss">
|
|
|
.sales-warp{
|
|
|
width: 100%;
|
|
|
- padding: 20rpx 30upx;
|
|
|
+ padding: 20rpx 20upx;
|
|
|
.color_6{
|
|
|
color: #666;
|
|
|
}
|
|
|
+ .font_13{
|
|
|
+ font-size: 26upx;
|
|
|
+ }
|
|
|
.content-data{
|
|
|
background-color: #fff;
|
|
|
padding: 20upx 20upx;
|
|
@@ -178,24 +243,24 @@
|
|
|
box-shadow: 3upx 2upx 6upx #eee;
|
|
|
margin-bottom: 20upx;
|
|
|
.date-type{
|
|
|
- margin: 0 120upx 30upx 120upx;
|
|
|
+ margin: 0 120upx 20upx;
|
|
|
border-radius: 50upx;
|
|
|
border: 1upx solid #eee;
|
|
|
- .type{
|
|
|
+ text{
|
|
|
display: inline-block;
|
|
|
padding: 10upx 0;
|
|
|
width: 33%;
|
|
|
text-align: center;
|
|
|
}
|
|
|
- .type:first-child{
|
|
|
+ text:first-child{
|
|
|
border-top-left-radius: 50upx;
|
|
|
border-bottom-left-radius: 50upx;
|
|
|
}
|
|
|
- .type:last-child{
|
|
|
+ text:last-child{
|
|
|
border-top-right-radius: 50upx;
|
|
|
border-bottom-right-radius: 50upx;
|
|
|
}
|
|
|
- .type:not(:last-child){
|
|
|
+ text:not(:last-child){
|
|
|
border-right: 1upx solid #eee;
|
|
|
}
|
|
|
.active_day {
|
|
@@ -235,6 +300,7 @@
|
|
|
}
|
|
|
.sales-list{
|
|
|
.title{
|
|
|
+ margin-bottom: 14upx;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
@@ -248,8 +314,8 @@
|
|
|
}
|
|
|
}
|
|
|
.sales-list-con{
|
|
|
+ height: calc(100vh - 458upx);
|
|
|
.sales-list-main{
|
|
|
- padding-top: 14upx;
|
|
|
.sales-list-item{
|
|
|
background: #ffffff;
|
|
|
padding: 20upx;
|
|
@@ -273,7 +339,6 @@
|
|
|
}
|
|
|
.list-item-con{
|
|
|
padding: 10upx 0;
|
|
|
- border-bottom: 1px solid #e4e7ed;
|
|
|
.list-item-line{
|
|
|
padding: 8upx 0;
|
|
|
}
|
|
@@ -281,6 +346,14 @@
|
|
|
color: #666;
|
|
|
}
|
|
|
}
|
|
|
+ .button-box{
|
|
|
+ text-align: right;
|
|
|
+ padding-top: 10upx;
|
|
|
+ border-top: 1px dashed #e4e7ed;
|
|
|
+ button{
|
|
|
+ margin: 0 10upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|