123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- <template>
- <view class="productPricing-content">
- <view class="checkbox-price">
- <u-checkbox-group placement="row" :size="28">
- <u-checkbox :label-size="26" v-model="item.checked" activeColor="rgb(4, 133, 246)" v-for="(item,index) in tabList" :key="index" :name="item.val">{{item.name}}</u-checkbox>
- </u-checkbox-group>
- </view>
- <scroll-view class="product-list" scroll-y @scrolltolower="onreachBottom">
- <view class="st-detailList-main">
- <view class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id">
- <view class="st-detailList-tit flex justify_between align_center">
- <view class="u-name flex align_center justify_between">
- <view style="flex-grow: 1;width:80%" class="flex align_center">
- <text>{{item.name}}</text>
- <copyText :text="item.name" style="zoom:0.8;margin-left: 5px;" label="产品名称"></copyText>
- </view>
- <view style="zoom:0.7;margin-left: 5px;">
- <u-tag size="mini" :type="item.onlineFalg==1?'success':'info'" :text="item.onlineFalgDictValue"></u-tag>
- </view>
- </view>
- </view>
- <view class="st-detailList-item-con flex align_center">
- <view class="pimgs">
- <u-image :src="item.productMainPic&&item.productMainPic.imageUrl?item.productMainPic.imageUrl:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
- </view>
- <view class="flex_1">
- <view class="padding_3">产品编码:{{item.code}} <copyText :text="item.code" style="zoom:0.8;margin-left: 5px;" label="产品编码"></copyText></view>
- <view class="padding_3">原厂编码:{{(item.origCode&&item.origCode!=' ')?item.origCode:'--'}} </view>
- <view class="padding_3">品牌:{{item.productBrandName || '--'}} </view>
- <view class="flex align_center justify_between">
- <view class="font_13">库存数:<text>{{toThousands(item.stockQty|| 0)}} 个</text></view>
- <view><u-button size="mini" type="primary" plain @click="toViewDetail(item)" shape="circle">销售记录</u-button></view>
- </view>
- <view class="font_13">
- 车主价/自定义车主价:<text class="red">{{item.carOwnersPrice ||item.carOwnersPrice==0?'¥'+toThousands(item.carOwnersPrice,2):'--'}}/{{item.dealerProductPrice&&(item.dealerProductPrice.carOwnersPrice||item.dealerProductPrice.carOwnersPrice==0)?'¥'+toThousands(item.dealerProductPrice.carOwnersPrice,2):'--'}} </text>
- </view>
- </view>
- </view>
- <view class="price-all flex" v-if="selPriceShow">
- <view class="price-item1" v-if="priceList[0].checked">
- <text>{{(item.offerCost||item.offerCost==0)?toThousands(item.offerCost,2):'--'}} </text>
- <view>参考成本价</view>
- </view>
- <view class="price-item1" v-if="priceList[1].checked">
- <text>{{(item.cityPrice || item.cityPrice==0)?toThousands(item.cityPrice,2):'--'}} </text>
- <view>市级价</view>
- </view>
- <view class="price-item1" v-if="priceList[2].checked">
- <text>{{(item.specialPrice||item.specialPrice==0)?toThousands(item.specialPrice,2):'--'}} </text>
- <view>特约价</view>
- </view>
- <view class="price-item1" v-if="priceList[3].checked">
- <text>{{(item.terminalPrice||item.terminalPrice==0)?toThousands(item.terminalPrice,2):'--'}}/{{item.dealerProductPrice&&(item.dealerProductPrice.terminalPrice||item.dealerProductPrice.terminalPrice==0)?toThousands(item.dealerProductPrice.terminalPrice,2):'--'}} </text>
- <view>终端价/自定义终端价</view>
- </view>
- </view>
- </view>
- <u-empty v-if="listData.length == 0 &&status!='loading'" :text="noDataText" mode="list" ></u-empty>
- <view style="padding-bottom: 20upx;">
- <u-loadmore v-if="totalNum>listData.length || status=='loading'" :status="status" />
- </view>
- </view>
- </scroll-view>
- <!-- 搜索弹窗 -->
- <search :showModal="showModal" @refresh="refreshList" @close="showModal=false"/>
- </view>
- </template>
- <script>
- import { toThousands } from '@/libs/tools'
- import { dealerProductList } from '@/api/sales'
- import { getCurrentDealer } from '@/api/data'
- import search from './search.vue'
- import copyText from '@/pages/common/copyText.vue'
- export default{
- components:{search,copyText},
- data(){
- return{
- toThousands,
- listData:[],
- totalNum:0,
- priceList:[
- { name: '参考成本价', checked: false, val: 'offerCost' },
- { name: '市级价', checked: false, val: 'cityPrice' },
- { name: '特约价', checked: false, val: 'specialPrice' },
- { name: '终端价/自定义终端价', checked: false, val: 'terminalPrice' },
- ],
- pageNo:1,
- pageSize:15,
- noDataText: '暂无数据',
- theme: '',
- status: 'loadmore',
- showModal:false,
- params:{
- "code": "",
- "name": "",
- "origCode": "",
- "putStockFlag": 1
- },
- dealerData: null
- }
- },
- onNavigationBarButtonTap(e){
- this.showModal=true
- },
- onBackPress() {
- if(this.showModal){
- this.showModal = false
- return true
- }
- },
- computed: {
- selPriceShow() {
- const a = this.priceList.filter(item => item.checked)
- return a.length > 0
- },
- tabList(){
- let ret = this.priceList
- // 成本价不显示
- if(!this.$hasPermissions('M_showCostPrice_mobile')){
- ret = ret.filter((item, index) => item.val != 'offerCost')
- }
- if(this.dealerData){
- // 特约价不显示市级
- if(this.dealerData.dealerLevel == 'SPECIAL' || !this.$hasPermissions('M_showAllCityPrice_mobile')){
- ret = ret.filter((item, index) => item.val != 'cityPrice')
- }
- // 不显示特约
- if(this.dealerData.isShowSpecialPrice != '1'){
- ret = ret.filter((item, index) => item.val != 'specialPrice')
- }
- }
-
- return ret
- }
- },
- onLoad(option) {
- this.theme = getApp({ allowDefault: true }).globalData.theme
- this.getList()
- this.getDealer()
- },
- methods:{
- toPage(url){
- uni.switchTab({
- url:url
- })
- },
- // 刷新列表
- refreshList(val){
- this.params =val ? val : {},
- this.listData = []
- this.totalNum = 0
- this.getList(1)
- },
- // 获取当前经销商信息
- getDealer(){
- getCurrentDealer().then(res => {
- if (res.status == 200) {
- this.dealerData = res.data
- } else {
- this.dealerData = null
- }
- })
- },
- // 列表
- getList(pageNo){
- const _this = this
- if (pageNo) {
- this.pageNo = pageNo
- }
- let params = Object.assign(this.params, { pageNo: this.pageNo, pageSize: this.pageSize })
- this.status = "loading"
- console.log(params)
- dealerProductList(params).then(res => {
- if (res.status == 200) {
- if(this.pageNo>1){
- this.listData = this.listData.concat(res.data.list || [])
- }else{
- this.listData = res.data.list || []
- }
- this.totalNum = res.data.count || 0
- } else {
- this.listData = []
- this.totalNum = 0
- this.noDataText = res.message
- }
- this.status = "loadmore"
- })
- },
- // scroll-view到底部加载更多
- onreachBottom() {
- if(this.listData.length < this.totalNum){
- this.pageNo += 1
- this.getList()
- }
- },
- // 查看销售记录
- toViewDetail(row){
- uni.navigateTo({
- url: "/pages/sales/salesRecord?productSn="+row.productSn + "&productName="+row.name+ "&productCode="+row.code
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .productPricing-content{
- width:100%;
- height: 100vh;
- .checkbox-price{
- background-color: #fff;
- display: flex;
- justify-content: space-around;
- padding: 20rpx 0;
- margin-bottom: 15rpx;
- color: #191919;
- }
- .product-list{
- height: calc(100vh - 94upx);
- .st-detailList-main{
- padding: 0 20upx 20upx;
- .st-detailList-main-item{
- background: #ffffff;
- padding: 20upx;
- margin-bottom: 25upx;
- border-radius: 25upx;
- box-shadow: 1px 1px 3px #EEEEEE;
- .st-detailList-tit{
- padding-bottom: 20upx;
- border-bottom: 1px solid #e4e7ed;
- .u-name{
- font-weight: bold;
- flex-grow: 1;
- width: 75%;
- }
- .u-line{
- display: inline-block;
- width: 6upx;
- height: 30upx;
- margin: 0 10upx 0;
- border-radius: 5rpx;
- }
- .u-last{
- text-align: right;
- width: 25%;
- color: dodgerblue;
- }
- }
- .st-detailList-item-con{
- padding: 20upx 0;
- font-size: 26upx;
- .red{
- color: red;
- }
- .pimgs{
- margin-right: 20upx;
- }
- .font_13{
- font-size: 26upx;
- }
- .padding_3{
- padding: 6upx 0;
- word-break: break-all;
- }
- }
- .price-all{
- border-top: 1px solid #e4e7ed;
- padding: 20upx 20upx 0 20upx;
- flex:1;
- .price-item1{
- width: 33%;
- text-align: center;
- >view{
- color:#999;
- font-size:0.8em;
- }
- }
- }
- }
- }
-
-
- }
- }
- </style>
|