123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <template>
- <view class="chooseProduct-wrap">
- <!-- 标题 -->
- <u-navbar title="选择产品" :safeAreaInsetTop="false" :border-bottom="true">
- <view class="u-nav-slot" slot="right" style="padding-right: 30rpx;">
- <u-icon name="search" color="#999" size="28" @click="openModal=true"></u-icon>查询
- </view>
- </u-navbar>
- <!-- 产品列表 -->
- <view class="product-list-box">
- <scroll-view class="sales-list-con" :style="{height: scrollH+'upx'}" scroll-y @scrolltolower="onreachBottom">
- <view class="sales-list-item border-b font_13 flex justify_between" v-for="(item, index) in listData" :key="item.id">
- <view class="pimgs">
- <u-image :src="item.productMainMsg?item.productMainMsg:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
- <view v-if="item.oosFlag == 1" class="sign" :style="{backgroundColor: $config('errorColor')}">急</view>
- <view v-if="item.price < item.cost" class="sign" :style="{backgroundColor: $config('errorColor')}">亏</view>
- <view v-if="item.price == 0" class="sign" :style="{backgroundColor: $config('errorColor')}">赠</view>
- </view>
- <view class="sales-item-main flex_1">
- <view class="sales-item-name">{{item.productName || '--'}}</view>
- <view class="sales-item-txt flex align_center justify_between">
- <view>{{item.productCode || '--'}}</view>
- <u-icon v-if="pageData.type=='edit'" @click="handleDel(item)" name="trash-fill" :color="$config('errorColor')" size="34"></u-icon>
- </view>
- <view class="sales-item-txt color_6" style="font-size: 24upx;" v-if="item.warehouseEntity&&item.warehouseEntity.name || item.warehouseLocationEntity&&item.warehouseLocationEntity.name">{{item.warehouseEntity&&item.warehouseEntity.name}} > {{item.warehouseLocationEntity&&item.warehouseLocationEntity.name}}</view>
- <view class="sales-item-txt flex align_center justify_between">
- <view class="sales-item-priceInfo">
- <view :style="{color: $config('errorColor'), display: 'inline-block'}">¥<text style="font-size: 30upx;">{{toThousands(item.price||0, 2)}}</text></view>
- <text style="display: inline-block;margin: 0 10upx;">*</text>
- <text style="font-size: 30upx;">{{toThousands(item.qty||0)}}</text>
- {{item.productUnit}}
- </view>
- <view class="sales-item-price">¥{{toThousands(item.totalAmount||0, 2)}}</view>
- </view>
- <view class="sales-item-price">折后¥{{toThousands(item.discountedAmount||0, 2)}}</view>
- </view>
- </view>
- <view v-if="listData && listData.length == 0">
- <u-empty :text="noDataText" mode="list" :img-width="200" :margin-top="30"></u-empty>
- </view>
- </scroll-view>
- </view>
- <!-- 查询右侧弹框 -->
- <productSearch :openModal="openModal" :defaultParams="searchForm" @refresh="refresh" @close="openModal=false" />
- </view>
- </template>
- <script>
- import ProductSearch from './productSearch.vue'
- import { toThousands } from '@/libs/tools'
- export default{
- components: { ProductSearch },
- data(){
- return{
- toThousands,
- customBtnStyle: { // 自定义按钮样式
- borderColor: this.$config('primaryColor'),
- backgroundColor: this.$config('primaryColor'),
- color: '#fff'
- },
- listData: [],
- pageNo: 1,
- pageSize: 6,
- totalNum: 0,
- noDataText: '暂无数据',
- searchForm: {},
- searchParams: {},
- openModal: false,
- theme: '',
- chooseProductList: [],
- scrollH: 0,
- }
- },
- onLoad(opt) {
- this.theme = getApp().globalData.theme
- if(opt){
- this.chooseProductList = opt.data ? JSON.parse(opt.data) : null
- }
- console.log(this.chooseProductList)
- this.getList()
-
- const _this = this
- let footerH = _this.$refs.productTotal && _this.$refs.productTotal.$el && _this.$refs.productTotal.$el.offsetHeight || 0
- uni.getSystemInfo({
- success: function (res) {
- const winH = res.windowHeight * 2
- _this.scrollH = winH - footerH - 85
- }
- })
- },
- methods: {
- // 获取查询参数 刷新列表
- refresh(params){
- const _this = this
- this.searchParams = Object.assign(params, this.searchForm)
- this.$nextTick(function(){
- // _this.$refs.salesList.getList(1)
- })
- },
- getList(){}
- }
- }
- </script>
- <style lang="scss">
- .chooseProduct-wrap{
- width: 100%;
- .list-box{
- padding: 20upx 20upx;
- }
- }
- </style>
|