Browse Source

编辑销售单

chenrui 3 years ago
parent
commit
088a803c73

+ 31 - 0
api/sales.js

@@ -35,6 +35,30 @@ export const salesWriteStockOut = (params) => {
     method: 'get'
   })
 }
+//  销售 提交
+export const salesSubmit = (params) => {
+  return axios.request({
+    url: 'sales/submit',
+    data: params,
+    method: 'post'
+  })
+}
+//  销售 折扣
+export const salesDiscount = (params) => {
+  return axios.request({
+    url: 'sales/discount',
+    data: params,
+    method: 'post'
+  })
+}
+//  销售 详情
+export const salesDetail = (params) => {
+  return axios.request({
+    url: `sales/findById/${params.id}`,
+    data: params,
+    method: 'get'
+  })
+}
 //  销售 删除
 export const salesDel = (params) => {
   return axios.request({
@@ -43,6 +67,13 @@ export const salesDel = (params) => {
     method: 'post'
   })
 }
+// 车架号
+export const supperCodeByVin = (params) => {
+  return axios.request({
+    url: `vinIdentify/queryPartCodeByVin/${params.vin}`,
+    method: 'get'
+  })
+}
 //  销售详情 列表  分页
 export const salesDetailList = (params) => {
   const url = `salesDetail/queryPage/${params.pageNo}/${params.pageSize}`

+ 1 - 1
pages/common/commonModal.vue

@@ -1,5 +1,5 @@
 <template>
-	<u-mask class="commonModal" :show="isShow" :mask-click-able="false">
+	<u-mask class="commonModal" :show="isShow" :mask-click-able="false" z-index="999999">
 		<view class="modal-con">
 			<u-icon v-if="isClose" @click="isShow=false" class="close-icon" name="close-circle" size="40" color="#999"></u-icon>
 			<view class="modal-title">{{title}}</view>

+ 125 - 28
pages/sales/chooseProduct.vue

@@ -1,5 +1,11 @@
 <template>
 	<view class="chooseProduct-wrap">
+		<!-- 标题 -->
+		<u-navbar title="选择产品" :safeAreaInsetTop="false" :border-bottom="true">
+			<view class="u-nav-slot" slot="right" style="padding-right: 40rpx;">
+				<u-icon name="search" color="#999" size="28" @click="openModal=true"></u-icon>查询
+			</view>
+		</u-navbar>
 		<!-- 产品列表 -->
 		<view class="product-list-box">
 			<scroll-view class="product-list-con" :style="{height: scrollH+'upx'}" scroll-y @scrolltolower="onreachBottom">
@@ -15,7 +21,7 @@
 							<view>产品编码:{{item.productCode || '--'}}</view>
 							<view class="padding_3 flex align_center justify_between">
 								<view>原厂编码:{{item.productOrigCode || '--'}}</view>
-								<u-icon name="plus-circle" :color="$config('primaryColor')" size="40" class="close-circle" @click="handleAdd"></u-icon>
+								<u-icon name="plus-circle" :color="$config('primaryColor')" size="40" class="close-circle" @click="handleAdd(item, 'add')"></u-icon>
 							</view>
 							<view v-if="item.warehouseName || item.warehouseLocationName">仓库仓位:{{item.warehouseName}} > {{item.warehouseLocationName}}</view>
 						</view>
@@ -27,7 +33,7 @@
 						</view>
 						<view class="footer-item">
 							<view>
-								<text :style="{color: $config('errorColor')}">{{toThousands((item.lastSalePrice ? item.lastSalePrice : item.salePrice)||0, 2)}}</text>
+								<text :style="{color: $config('errorColor')}">{{toThousands(item.price||0, 2)}}</text>
 								<text v-if="item.origSalePriceFlag == 1">(原)</text>
 							</view>
 							<view class="color_6">参考售价</view>
@@ -39,44 +45,56 @@
 				</view>
 			</scroll-view>
 		</view>
-		<!-- 已选产品 -->
+		<!-- 合计 -->
 		<view ref="productTotal" class="selected-box flex align_center justify_between">
 			<view class="choose-info flex_1 flex align_center justify_between" @click="lookProduct">
-				<text>已选 3 款,合计 ¥96.00</text>
+				<text>已选 {{detailData && (detailData.totalCategory || detailData.totalCategory==0) ? toThousands(detailData.totalCategory) : '--'}} 款,合计 ¥{{detailData && (detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount, 2) : '--'}}</text>
 				<u-icon name="arrow-up" :color="$config('primaryColor')" size="34" class="close-circle"></u-icon>
 			</view>
 			<view class="choose-btn" @click="handleChoose" :style="{backgroundColor: $config('primaryColor')}">选好了</view>
 		</view>
 		<!-- 查询右侧弹框 -->
-		<productSearch :openModal="openModal" :defaultParams="searchForm" @refresh="refresh" @close="openModal=false" />
+		<productSearch :openModal="openModal" :defaultParams="searchParams" @refresh="refresh" @close="openModal=false" />
+		<!-- 添加/编辑产品 -->
+		<productModal :openModal="openProductModal" :infoData="productData" @confirm="productConfirm" @close="openProductModal=false" />
+		<!-- 已选产品 -->
+		<selectedProductsModal :openModal="openSelectedModal" :nowData="detailData" @confirm="handleChoose" @refreshTotal="selectedProductTotal" @close="openSelectedModal=false" />
+		<!-- 弹框 -->
+		<common-modal :openModal="commonModal" :content="modalText" @confirm="handleCommon" @close="commonModal=false" />
 	</view>
 </template>
 
 <script>
 	import ProductSearch from './productSearch.vue'
+	import ProductModal from './productModal.vue'
+	import SelectedProductsModal from './selectedProductsModal.vue'
+	import commonModal from '@/pages/common/commonModal.vue'
 	import { toThousands } from '@/libs/tools'
 	import { querySumByProductLocation } from '@/api/stock'
+	import { salesDetail, supperCodeByVin } from '@/api/sales'
 	export default{
-		components: { ProductSearch },
+		components: { ProductSearch, ProductModal, SelectedProductsModal, commonModal },
 		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: [],
+				salesInfo: null,  // 销售单信息
 				scrollH: 0,
+				openProductModal: false,  // 编辑产品信息弹框是否显示
+				productData: null,  // 当前操作的产品信息
+				chooseType: 'add',  // 添加产品add,编辑产品edit
+				commonModal: false,  // 公共弹框是否显示
+				modalText: '',  // 公共弹框提示语
+				commonType: 1,  // 公共弹框类型  1为添加产品时库存不足,2为编辑产品时库存不足,
+				openSelectedModal: false,  // 已选产品弹框是否显示
+				detailData: null  // 销售单详情数据
 			}
 		},
 		onNavigationBarButtonTap(e){  // 标题栏 按钮操作
@@ -85,25 +103,40 @@
 		onLoad(opt) {
 			this.theme = getApp().globalData.theme
 			if(opt){
-				this.chooseProductList = opt.data ? JSON.parse(opt.data) : null
+				this.salesInfo = opt.data ? JSON.parse(opt.data) : null
 			}
-			console.log(this.chooseProductList)
-			this.getList()
+			this.init()
 			
 			const _this = this
 			uni.getSystemInfo({
 				success: function (res) {
 					const winH = res.windowHeight * 2
-					_this.scrollH = winH - 200
+					_this.scrollH = winH - 180
 				}
 			})
 		},
 		methods: {
+			init(){
+				this.getList(1)  // 产品列表
+				this.selectedProductTotal()  // 已选产品合计
+			},
 			// 获取查询参数 刷新列表
 			refresh(params){
+				console.log('查询', params)
 				const _this = this
-				this.searchParams = Object.assign(params, this.searchForm)
-				this.getList(1)
+				if(params.vinCode && params.vinCode.length == 17){
+					// 查询vin码
+					supperCodeByVin({ vin: params.vinCode }).then(res => {
+						if(res.status == 200){
+							params.productCodeList = res.data.partCodeList || []
+							this.searchParams = params
+							this.getList(1)
+						}
+					})
+				}else{
+					this.searchParams = params
+					this.getList(1)
+				}
 			},
 			// 列表
 			getList(pageNo){
@@ -115,8 +148,19 @@
 					pageNo: this.pageNo,
 					pageSize: this.pageSize
 				}
-				querySumByProductLocation(Object.assign(params, this.searchParams)).then(res => {
+				let searchParams = JSON.parse(JSON.stringify(this.searchParams))
+				searchParams.brandName = undefined
+				searchParams.nowData = undefined
+				searchParams.warehouseName = undefined
+				querySumByProductLocation(Object.assign(params, searchParams, { customerSn: this.salesInfo.buyerSn })).then(res => {
 					if (res.status == 200) {
+						if(res.data && res.data.list){
+							res.data.list.map(item => {
+								item.salesNums = 1
+								item.currentQty = item.currentQty || 0
+								item.price = item.lastSalePrice ? item.lastSalePrice : item.salePrice
+							})
+						}
 						if(this.pageNo>1){
 							this.listData = this.listData.concat(res.data.list || [])
 						}else{
@@ -137,14 +181,71 @@
 					this.getList()
 				}
 			},
-			// 添加产品
-			handleAdd(){},
+			// 添加/编辑产品
+			handleAdd(data, type){
+				this.openProductModal = true
+				this.chooseType = type
+				this.productData = data
+			},
 			// 选好了
-			handleChoose(){},
+			handleChoose(){
+				uni.redirectTo({ url: '/pages/sales/edit?pageType=edit&data='+JSON.stringify(this.detailData) })
+			},
 			// 查看已选产品
 			lookProduct(){
+				this.openSelectedModal = true
+			},
+			// 确认产品信息
+			productConfirm(data){
+				console.log('form',data)
+				console.log('info',this.productData)
+				if (this.productData.lastSalePrice && (this.productData.price < this.productData.salePrice)) {  // 售价低于定价
+					
+				}
+				if(this.chooseType == 'add'){
+					// 库存不足时
+					if (this.productData.currentQty < data.qty) {
+						this.commonType = 1
+						this.modalText = '库存不足,将产生急件,确认要添加吗?'
+						this.commonModal = true
+					}else{
+						
+					}
+				}else if(this.chooseType == 'edit'){
+					// 库存不足时
+					if (this.productData.currentQty < this.productData.salesNums) {
+						this.commonType = 2
+						this.modalText = '库存不足,将产生急件,确认修改吗?'
+						this.commonModal = true
+					}else{
+						
+					}
+				}
+				// this.openProductModal = false
+			},
+			addProduct(data){
 				
-			}
+			},
+			// 公共弹框
+			handleCommon(){
+				if(this.commonType == 1){  // 添加产品时库存不足
+					
+				}else if(this.commonType == 2){  // 编辑产品时库存不足
+					
+				}
+			},
+			// 已选产品  提交
+			selectedConfirm(){},
+			// 已选产品合计
+			selectedProductTotal(){
+				salesDetail({ id: this.salesInfo.id }).then(res => {
+					if(res.status == 200){
+						this.detailData = res.data
+					}else{
+						this.detailData = null
+					}
+				})
+			},
 		}
 	}
 </script>
@@ -204,10 +305,6 @@
 			}
 		}
 		.selected-box{
-			position: fixed;
-			bottom: 0;
-			left: 0;
-			width: 100%;
 			background-color: #fff;
 			box-shadow: 1px -1px 3px #EEEEEE;
 			.choose-info{

+ 7 - 3
pages/sales/discountModal.vue

@@ -46,7 +46,11 @@
 		methods: {
 			// 确认
 			handleConfirm(){
-				this.$emit('confirm', this.formValidate.discountAmount)
+				if(this.formValidate.discountAmount){
+					this.$emit('confirm', this.formValidate.discountAmount)
+				}else{
+					this.toashMsg('请输入折扣金额')
+				}
 			},
 			// 小数点后两位
 			numberToFixed: function (key, num, max) {
@@ -88,11 +92,11 @@
 		}
 		.discount-con{
 			width: 78%;
-			margin: 45% auto 0;
+			margin: 55% auto 0;
 			background-color: #fff;
 			border-radius: 24upx;
 			.discount-main{
-				padding: 20upx 20upx;
+				padding: 60upx 20upx 50upx;
 				.discount-price{
 					margin: 10upx 0;
 					.price{

+ 68 - 26
pages/sales/edit.vue

@@ -5,11 +5,11 @@
 			<u-section @click="infoModal=true" title="基础信息" sub-title="查看更多" :line-color="$config('primaryColor')"></u-section>
 			<view class="info-item-box">
 				<text class="info-item-tit color_6">销售单号</text>
-				<text>{{pageData.data && pageData.data.salesBillNo || '--'}}</text>
+				<text>{{detailData && detailData.salesBillNo || '--'}}</text>
 			</view>
 			<view class="info-item-box">
 				<text class="info-item-tit color_6">客户名称</text>
-				<text>{{pageData.data && pageData.data.buyerName || '--'}}</text>
+				<text>{{detailData && detailData.buyerName || '--'}}</text>
 			</view>
 		</view>
 		<!-- 产品列表 -->
@@ -21,7 +21,7 @@
 						<view class="sales-product-operation">
 							<u-button @click="discountModal=true" size="mini" :hair-line="false" plain type="primary" hover-class="none">
 								打折
-								<text v-if="discountAmount">:¥{{discountAmount}}</text>
+								<text v-if="detailData&&detailData.discountAmount">:¥{{detailData.discountAmount}}</text>
 							</u-button>
 							<u-button @click="handleProduct" size="mini" :hair-line="false" plain type="primary" hover-class="none">选择产品</u-button>
 						</view>
@@ -32,16 +32,16 @@
 			<view ref="salesTotal" class="sales-total-box border-b font_13 flex justify_between">
 				<view class="sales-total-con flex_1" :style="{height: toggle ? 'auto' : '44upx'}">
 					<view>
-						总款数:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{pageData.data && (pageData.data.totalCategory || pageData.data.totalCategory==0) ? toThousands(pageData.data.totalCategory) : '--'}}</text>;总数量:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{pageData.data && (pageData.data.totalQty || pageData.data.totalQty==0) ? toThousands(pageData.data.totalQty) : '--'}}</text>;总售价:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{pageData.data && (pageData.data.totalAmount || pageData.data.totalAmount==0) ? toThousands(pageData.data.totalAmount, 2) : '--'}}</text>;
+						总款数:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{detailData && (detailData.totalCategory || detailData.totalCategory==0) ? toThousands(detailData.totalCategory) : '--'}}</text>;总数量:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{detailData && (detailData.totalQty || detailData.totalQty==0) ? toThousands(detailData.totalQty) : '--'}}</text>;总售价:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{detailData && (detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount, 2) : '--'}}</text>;
 					</view>
 					<view>
-						折扣金额:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{pageData.data && (pageData.data.discountAmount || pageData.data.discountAmount==0) ? toThousands(pageData.data.discountAmount, 2) : '--'}}</text>;折扣:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{pageData.data && (pageData.data.discountRate || pageData.data.discountRate==0) ? pageData.data.discountRate+'%' : '--'}}</text>;折后总售价:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{pageData.data && (pageData.data.discountedAmount || pageData.data.discountedAmount==0) ? toThousands(pageData.data.discountedAmount, 2) : '--'}}</text>;
+						折扣金额:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{detailData && (detailData.discountAmount || detailData.discountAmount==0) ? toThousands(detailData.discountAmount, 2) : '--'}}</text>;折扣:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{detailData && (detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--'}}</text>;折后总售价:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{detailData && (detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount, 2) : '--'}}</text>;
 					</view>
 					<view>
-						急件总款数:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{pageData.data && (pageData.data.oosCategory || pageData.data.oosCategory==0) ? toThousands(pageData.data.oosCategory) : '--'}}</text>;急件总数量:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{pageData.data && (pageData.data.oosQty || pageData.data.oosQty==0) ? toThousands(pageData.data.oosQty) : '--'}}</text>;赠品总数量:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{pageData.data && (pageData.data.giftQty || pageData.data.giftQty==0) ? toThousands(pageData.data.giftQty) : '--'}}</text>;
+						急件总款数:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{detailData && (detailData.oosCategory || detailData.oosCategory==0) ? toThousands(detailData.oosCategory) : '--'}}</text>;急件总数量:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{detailData && (detailData.oosQty || detailData.oosQty==0) ? toThousands(detailData.oosQty) : '--'}}</text>;赠品总数量:<text class="sales-total-num" :style="{color: $config('warringColor')}">{{detailData && (detailData.giftQty || detailData.giftQty==0) ? toThousands(detailData.giftQty) : '--'}}</text>;
 					</view>
 					<view>
-						总成本:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{pageData.data && (pageData.data.totalCost || pageData.data.totalCost==0) ? toThousands(pageData.data.totalCost, 2) : '--'}}</text>;总毛利:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{pageData.data && (pageData.data.grossProfit || pageData.data.grossProfit==0) ? toThousands(pageData.data.grossProfit, 2) : '--'}}</text>;
+						总成本:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{detailData && (detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost, 2) : '--'}}</text>;总毛利:<text class="sales-total-num" :style="{color: $config('warringColor')}">¥{{detailData && (detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit, 2) : '--'}}</text>;
 					</view>
 				</view>
 				<text class="sales-total-btn" @click="toggle=!toggle" :style="{color: $config('primaryColor')}">{{ toggle ? '收起' : '展开' }}</text>
@@ -72,7 +72,7 @@
 								</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 class="sales-item-price" v-if="detailData&&detailData.discountAmount">折后¥{{toThousands(item.discountedAmount||0, 2)}}</view>
 						</view>
 					</view>
 					<view v-if="listData && listData.length == 0">
@@ -85,13 +85,14 @@
 		<view class="sales-btn-box">
 			<view v-if="pageData.type=='edit'" class="flex align_center justify_between">
 				<u-button class="handle-btn" size="medium" hover-class="none" @click="handleDel()">整单删除</u-button>
-				<u-button class="handle-btn search-btn" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="handleSearch">提交</u-button>
+				<u-button class="handle-btn search-btn" @click="handleSubmit" size="medium" hover-class="none" :custom-style="customBtnStyle">提交</u-button>
 			</view>
+			<u-button v-if="pageData.type=='detail' && (detailData&&detailData.billStatus !== 'CANCEL' && detailData.billStatus !== 'FINISH' && detailData.billStatus != 'WAIT_OUT_WAREHOUSE')" class="edit-btn" @click="goPage" size="medium" hover-class="none" :custom-style="customBtnStyle">编辑</u-button>
 		</view>
 		<!-- 基础信息 -->
-		<orderInfoModal :openModal="infoModal" :infoData="pageData.data" @close="infoModal=false" />
+		<orderInfoModal :openModal="infoModal" :infoData="detailData" @close="infoModal=false" />
 		<!-- 折扣 -->
-		<discountModal :openModal="discountModal" :infoData="pageData.data" :amount="discountAmount" @confirm="discountConfirm" @close="discountModal=false" />
+		<discountModal :openModal="discountModal" :infoData="detailData" :amount="detailData&&detailData.discountAmount" @confirm="discountConfirm" @close="discountModal=false" />
 		<!-- 删除产品/整单删除弹框 -->
 		<common-modal :openModal="delModal" :content="delText" @confirm="handleConfirm" @close="delModal=false" />
 	</view>
@@ -102,7 +103,7 @@
 	import OrderInfoModal from './orderInfoModal.vue'
 	import DiscountModal from './discountModal.vue'
 	import { toThousands } from '@/libs/tools'
-	import { salesDetailList, salesDetailDel, salesDel } from '@/api/sales'
+	import { salesDetailList, salesDetailDel, salesDel, salesDetail, salesSubmit, salesDiscount } from '@/api/sales'
 	export default{
 		components: { OrderInfoModal, DiscountModal, commonModal },
 		data(){
@@ -124,13 +125,13 @@
 				totalNum: 0,
 				noDataText: '暂无数据',
 				theme: '',
-				scrollH: 1036,
+				scrollH: 916,
 				infoModal: false,
 				discountModal: false,
-				discountAmount: 0,
 				delModal: false,
 				delText: '确认要删除吗?',
 				dataInfo: null,
+				detailData: null  // 销售单详情
 			}
 		},
 		onLoad(opt) {
@@ -141,9 +142,18 @@
 					data: opt.data ? JSON.parse(opt.data) : null
 				}
 			}
-			this.getList()
+			this.init()
+			// 监听整改完成后刷新事件
+			uni.$on('refreshBL', this.init)
+		},
+		onUnload() {
+			uni.$off('refreshBL')
 		},
 		methods: {
+			init(){
+				this.getList(1)
+				this.getDetail()
+			},
 			// 列表
 			getList(pageNo){
 				const _this = this
@@ -186,9 +196,29 @@
 					this.getList()
 				}
 			},
+			// 折扣金额
 			discountConfirm(amount){
-				this.discountAmount = amount
-				this.discountModal = false
+				let params = {
+					discountAmount: amount,
+					salesBillSn: this.detailData.salesBillSn,
+					id: this.detailData.id
+				}
+				salesDiscount(params).then(res => {
+					if(res.status == 200){
+						this.init()
+						this.discountModal = false
+					}
+				})
+			},
+			// 提交
+			handleSubmit(){
+				salesSubmit({ id: this.detailData.id }).then(res => {
+					if(res.status == 200){
+						this.toashMsg(res.message)
+						uni.$emit('refreshBL')
+						uni.navigateBack()
+					}
+				})
 			},
 			// 删除
 			handleDel(item){
@@ -211,7 +241,7 @@
 					params = { id: this.dataInfo.id }
 				}else{  // 整单删除
 					url = salesDel
-					params = { id: this.pageData.data && this.pageData.data.id }
+					params = { id: this.detailData && this.detailData.id }
 				}
 				url(params).then(res => {
 					if (res.status == 200) {
@@ -231,7 +261,21 @@
 			},
 			// 选择产品
 			handleProduct(){
-				uni.navigateTo({ url: '/pages/sales/chooseProduct?data='+JSON.stringify(this.listData) })
+				uni.navigateTo({ url: '/pages/sales/chooseProduct?data='+JSON.stringify(this.detailData) })
+			},
+			// 编辑
+			goPage(){
+				uni.redirectTo({ url: '/pages/sales/edit?pageType=edit&data='+JSON.stringify(this.detailData) })
+			},
+			// 销售单详情
+			getDetail(){
+				salesDetail({ id: this.pageData.data.id }).then(res => {
+					if(res.status == 200){
+						this.detailData = res.data
+					}else{
+						this.detailData = null
+					}
+				})
 			},
 			changeScrollH(){
 				const _this = this
@@ -240,9 +284,9 @@
 						const winH = res.windowHeight * 2
 						let totalH = _this.$refs.salesTotal && _this.$refs.salesTotal.$el && _this.$refs.salesTotal.$el.offsetHeight || 0
 						if(_this.toggle){
-							_this.scrollH = winH - 556 - totalH
+							_this.scrollH = winH - 656 - totalH
 						}else{
-							_this.scrollH = winH - 416 - totalH
+							_this.scrollH = winH - 522 - totalH
 						}
 					}
 				})
@@ -259,7 +303,6 @@
 <style lang="scss">
 	.sales-edit-wrap{
 		width: 100%;
-		position: relative;
 		.color_6{
 			color: #666;
 		}
@@ -370,14 +413,13 @@
 		}
 		.sales-btn-box{
 			background-color: #fff;
-			position: fixed;
-			bottom: 0;
-			left: 0;
-			width: 100%;
 			padding: 16upx 20upx 12upx;
 			.handle-btn{
 				width: 47%;
 			}
+			.edit-btn{
+				width: 100%;
+			}
 		}
 	}
 </style>

+ 4 - 4
pages/sales/listComponent.vue

@@ -28,10 +28,10 @@
 					<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>
+						<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.salesBillSource == 'TEMPORARY_DISPATCHING') && (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.salesBillSource == 'TEMPORARY_DISPATCHING') && 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">

+ 2 - 2
pages/sales/orderInfoModal.vue

@@ -13,7 +13,7 @@
 				<view>
 					<text class="info-item-tit">客户地址:</text>
 					<text class="info-item-txt" v-if="infoData && (infoData.shippingAddressProvinceName || infoData.shippingAddressCityName || infoData.shippingAddressCountyName || infoData.shippingAddress)">
-						{{infoData.shippingAddress || ''}}{{infoData.shippingAddressCityName || ''}}{{infoData.shippingAddressCountyName || ''}}{{infoData.shippingAddress || ''}}
+						{{infoData.shippingAddressProvinceName || ''}}{{infoData.shippingAddressCityName || ''}}{{infoData.shippingAddressCountyName || ''}}{{infoData.shippingAddress || ''}}
 					</text>
 					<text class="info-item-txt" v-else>--</text>
 				</view>
@@ -98,7 +98,7 @@
 		height: 100%;
 		.order-info-con{
 			width: 78%;
-			margin: 20% auto 0;
+			margin: 30% auto 0;
 			background-color: #fff;
 			border-radius: 24upx;
 			.order-info-main{

+ 183 - 0
pages/sales/productModal.vue

@@ -0,0 +1,183 @@
+<template>
+	<u-mask class="productModal" :show="isShow" :mask-click-able="false">
+		<view class="product-con">
+			<view class="product-main">
+				<view class="list-item-tit">
+					<view class="item-tit ellipsis-one" :style="{borderColor: $config('primaryColor')}">{{infoData && infoData.productName}}</view>
+				</view>
+				<view class="list-item-con flex align_center justify_between">
+					<view class="pimgs">
+						<u-image :src="infoData && infoData.productMainPic && infoData.productMainPic.imageUrl?infoData.productMainPic.imageUrl:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
+					</view>
+					<view class="flex_1">
+						<view>产品编码:{{infoData && infoData.productCode || '--'}}</view>
+						<view class="padding_3">原厂编码:{{infoData && infoData.productOrigCode || '--'}}</view>
+						<view v-if="infoData && (infoData.warehouseName || infoData.warehouseLocationName)">仓库仓位:{{infoData && infoData.warehouseName}} > {{infoData && infoData.warehouseLocationName}}</view>
+					</view>
+				</view>
+				<u-form class="form-content" :model="form" :error-type="['toast']" ref="uForm" label-width="180">
+					<u-form-item label="销售单价" required prop="price">
+						<u-input class="form-item" v-model="form.price" @input="numberToFixed('price',2,999999)" placeholder="请输入销售单价" :clearable="false" type="digit" input-align="right" style="margin-right: 8upx;" />元
+					</u-form-item>
+					<u-form-item label="销售数量" required prop="qty">
+						<view style="text-align: right;width: 100%;">
+							<u-number-box class="form-item" input-height="60" v-model="form.qty" :min="1" :max="999999" @change="numChange"></u-number-box>
+						</view>
+					</u-form-item>
+				</u-form>
+			</view>
+			<view class="product-footer">
+				<view class="button-cancel" @click="isShow=false">取消</view>
+				<view class="button-confirm" @click="handleConfirm">确定</view>
+			</view>
+		</view>
+	</u-mask>
+</template>
+
+<script>
+	import { numberToFixed } from '@/libs/tools'
+	export default {
+		props: {
+			openModal: { //  弹框显示状态
+				type: Boolean,
+				default: false
+			},
+			infoData: {
+				tyoe: Object,
+				default: ()=>{
+					return null
+				}
+			},
+		},
+		data() {
+			return {
+				isShow: this.openModal, //  是否打开弹框
+				theme: '',
+				form: {
+					price: null,
+					qty: 1,
+				},
+				rules: {
+					price: [ { required: true, message: '请输入销售单价', trigger: ['change','blur'] } ],
+					qty: [ { required: true, type: 'number', message: '请输入销售数量', trigger: 'blur' } ]
+				},
+			}
+		},
+		mounted() {
+			this.$refs.uForm.setRules(this.rules)
+			this.theme = getApp().globalData.theme
+		},
+		methods: {
+			// 确认
+			handleConfirm(){
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						console.log('验证通过')
+						this.$emit('confirm', this.form)
+					} else {
+						console.log('验证失败')
+					}
+				})
+			},
+			// 小数点后两位
+			numberToFixed: function (key, num, max) {
+				let val = this.form[key]
+				let ret = numberToFixed(val, num, max)
+				this.$nextTick(() => {
+					this.form[key] = ret
+				})
+			},
+			numChange(val){
+				if (val.value < 1){
+					this.$nextTick(() => {
+						this.form.qty = 0
+					})
+				} else if (val.value > 999999){
+					this.$nextTick(() => {
+						this.form.qty = 999999
+					})
+				}else{
+					this.form.qty = Number(val.value)
+				}
+			},
+		},
+		watch: {
+			//  父页面传过来的弹框状态
+			openModal (newValue, oldValue) {
+				this.isShow = newValue
+			},
+			//  重定义的弹框状态
+			isShow (newValue, oldValue) {
+				if (!newValue) {
+					this.$emit('close')
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.productModal{
+		width: 100%;
+		height: 100%;
+		.text-c{
+			text-align: center;
+		}
+		.padding_3{
+			padding: 6upx 0;
+		}
+		.product-con{
+			width: 78%;
+			margin: 45% auto 0;
+			background-color: #fff;
+			border-radius: 24upx;
+			.product-main{
+				padding: 20upx 30upx 0;
+				.list-item-tit{
+					padding-bottom: 12upx;
+					border-bottom: 1px solid #e4e7ed;
+					.item-tit{
+						font-weight: bold;
+						color: rgb(48, 49, 51);
+						font-size: 28upx;
+						padding-left: 10upx;
+						border-left: 6upx solid #000;
+						line-height: 1;
+					}
+				}
+				.list-item-con{
+					padding: 14upx 0 16upx;
+					font-size: 26upx;
+					.pimgs{
+						margin-right: 16upx;
+					}
+				}
+				.form-content{
+					border-top: 1px dashed #e4e7ed;
+					.form-item{
+						text-align: right;
+					}
+				}
+			}
+			.product-footer{
+				font-size: 30upx;
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				text-align: center;
+				border-top: 1upx solid #E5E5E5;
+				.button-cancel{
+					color: #999;
+					border-right: 1upx solid #E5E5E5;
+					flex-grow: 1;
+					padding: 20upx 0;
+				}
+				.button-confirm{
+					color: #2A86F4;
+					flex-grow: 1;
+					padding: 20upx 0;
+				}
+			}
+		}
+	}
+</style>

+ 65 - 61
pages/sales/productSearch.vue

@@ -2,14 +2,13 @@
 	<view class="productSearch-wrap">
 		<u-popup v-model="isShow" class="search-popup" mode="right" @close="isShow=false" length="85%">
 			<u-form class="form-content" :model="form" ref="uForm" label-width="180">
-				<u-form-item label="车架号(VIN)" prop="productCode" class="form-item">
-					<u-input v-model.trim="form.productCode" :maxlength="17" placeholder="请输入车架号" input-align="right" />
-					<u-icon @click="uploadFun" :name="vinLoading?'loading':'camera-fill'" name="camera-fill" color="#c8c0cc" size="34" style="margin-left: 14upx;"></u-icon>
-					<!-- <u-upload ref="uUpload" :custom-btn="true" :action="action" :form-data="{savePathType: 'local'}" @on-success="uploadSuccess" :max-size="2 * 1024 * 1024" max-count="1">
+				<u-form-item label="车架号(VIN)" prop="vinCode" class="form-item">
+					<u-input v-model.trim="form.vinCode" :maxlength="17" placeholder="请输入车架号" input-align="right" />
+					<u-upload :custom-btn="true" ref="uUpload" :show-upload-list="false" :action="action" :form-data="{savePathType: 'local'}" @on-success="uploadSuccess" :max-size="2 * 1024 * 1024">
 						<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
 							<u-icon name="camera-fill" color="#c8c0cc" size="34" style="margin-left: 14upx;"></u-icon>
 						</view>
-					</u-upload> -->
+					</u-upload>
 				</u-form-item>
 				<u-form-item label="产品编码" prop="productCode" class="form-item">
 					<u-input v-model.trim="form.productCode" placeholder="请输入产品编码" input-align="right" />
@@ -31,10 +30,10 @@
 					<u-icon v-show="warehouseName.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="clearWarehouse"></u-icon>
 				</u-form-item>
 				<u-form-item label="成本价">
-					<u-switch slot="right" v-model="cost"></u-switch>
+					<u-switch slot="right" v-model="form.cost"></u-switch>
 				</u-form-item>
 				<u-form-item label="市级价">
-					<u-switch slot="right" v-model="cityPrice"></u-switch>
+					<u-switch slot="right" v-model="form.cityPrice"></u-switch>
 				</u-form-item>
 			</u-form>
 			<view class="uni-list-btns">
@@ -48,7 +47,6 @@
 		<productType :openModal="showTypeModal" :nowData="nowData" @choose="typeChoose" @clean="typeClean" @close="showTypeModal=false" />
 		<!-- 选择收款方式 -->
 		<u-picker v-model="warehouseModal" @confirm="warehouseChange" :range="warehouseList" range-key="name" mode="selector"></u-picker>
-		<input type="file" id="filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
 	</view>
 </template>
 
@@ -83,10 +81,10 @@
 					productTypeSn1: undefined, //  产品分类1
 					productTypeSn2: undefined, //  产品分类2
 					productTypeSn3: undefined, //  产品分类3
-					warehouseSn: undefined //  仓库
+					warehouseSn: undefined, //  仓库
+					cost: false,  // 成本价
+					cityPrice: false,  // 市级价
 				},
-				cost: false,  // 成本价
-				cityPrice: false,  // 市级价
 				customBtnStyle: {  //  自定义按钮样式
 					borderColor: this.$config('primaryColor'),
 					backgroundColor: this.$config('primaryColor'),
@@ -103,7 +101,7 @@
 					indArr: [],
 					nowInd: 0
 				},
-				vinLoading: false,
+				action: baseUrl + 'vinIdentify/ocr',
 			}
 		},
 		computed: {
@@ -116,73 +114,66 @@
 			}
 		},
 		mounted() {
-			this.init()
 			this.getWarehouse()
 		},
 		methods: {
 			//  初始化数据
 			init(){
-				// if(this.defaultParams.beginDate && this.defaultParams.endDate){
-				// 	this.form.date = this.defaultParams.beginDate + ' ~ ' + this.defaultParams.endDate
-				// }else{
-				// 	this.form.date = ''
-				// }
-				// this.beginDate = this.defaultParams.beginDate ? this.defaultParams.beginDate : ''
-				// this.endDate = this.defaultParams.endDate ? this.defaultParams.endDate : ''
-				// this.form.buyerName = this.defaultParams.buyerName ? this.defaultParams.buyerName : ''
-				// this.form.salesBillNo = this.defaultParams.salesBillNo ? this.defaultParams.salesBillNo : ''
-				// this.form.purchaseBillNo = this.defaultParams.purchaseBillNo ? this.defaultParams.purchaseBillNo : ''
-				// this.form.warehouseSn = this.defaultParams.warehouseSn ? this.defaultParams.warehouseSn : ''
+				console.log(this.defaultParams)
+				this.form.vinCode = this.defaultParams.vinCode || ''
+				this.form.productCode = this.defaultParams.productCode || ''
+				this.form.productName = this.defaultParams.productName || ''
+				this.form.productOrigCode = this.defaultParams.productOrigCode || ''
+				this.form.productBrandSn = this.defaultParams.productBrandSn || undefined
+				this.form.productTypeSn1 = this.defaultParams.productTypeSn1 || undefined
+				this.form.productTypeSn2 = this.defaultParams.productTypeSn2 || undefined
+				this.form.productTypeSn3 = this.defaultParams.productTypeSn3 || undefined
+				this.form.warehouseSn = this.defaultParams.warehouseSn || undefined
+				this.form.cost = this.defaultParams.cost || false
+				this.form.cityPrice = this.defaultParams.cityPrice || false
+				this.brandName = this.defaultParams.brandName || ''
+				if(this.defaultParams.nowData){
+					this.nowData = this.defaultParams.nowData
+				}else{
+					this.nowData = {
+						data: [],
+						indArr: [],
+						nowInd: 0
+					}
+				}
+				this.warehouseName = this.defaultParams.warehouseName || ''
 			},
 			// 查询
 			handleSearch() {
 				let params = JSON.parse(JSON.stringify(this.form))
-				delete params.date
-				this.$emit('refresh', params)
+				let other = {
+					brandName: this.brandName,
+					nowData: this.nowData,
+					warehouseName: this.warehouseName
+				}
+				this.$emit('refresh', Object.assign(params, other))
 				this.isShow = false
 			},
 			// 重置
 			resetForm() {
 				this.warehouseName = ''
-				this.form.beginDate = ''
-				this.form.endDate = ''
+				this.nowData = {
+					data: [],
+					indArr: [],
+					nowInd: 0
+				}
+				this.brandName = ''
 				this.$refs.uForm.resetFields()
 				this.$emit('refresh', {})
 				this.isShow = false
 			},
-			uploadFun () {
-				console.log(111,document.getElementById('filed'))
-				document.getElementById('filed').click()
-				console.log(333)
-			},
-			filePreview (e) {
-				console.log(222)
-				const _this = this
-				var files = e.target.files[0]
-				const formData = new FormData()
-				formData.append('savePathType', 'local')
-				formData.append('file', files)
-				this.vinLoading = true
-				vinCodeParse(formData).then(res => {
-					if (res.type == 'application/json') {
-						var reader = new FileReader()
-						reader.addEventListener('loadend', function () {
-						const obj = JSON.parse(reader.result)
-						if (obj.status == 200) {
-							_this.form.vinCode = obj.data || ''
-							// 移除表单项的校验结果
-							// _this.$refs.uForm.clearValidate('vinCode')
-						} else {
-							this.toashMsg(obj.message)
-						}
-						_this.vinLoading = false
-						document.getElementById('filed').value = ''
-					})
-					reader.readAsText(res)
-			    } else {
-					_this.vinLoading = false
-			    }
-			  })
+			uploadSuccess(res){
+				console.log(res)
+				if(res.status == 200){
+					this.form.vinCode = res.data
+				}else{
+					this.toashMsg(res.message)
+				}
 			},
 			// 选择品牌
 			brandChoose(data){
@@ -254,6 +245,8 @@
 			isShow (newValue, oldValue) {
 				if (!newValue) {
 					this.$emit('close')
+				}else{
+					this.init()
 				}
 			}
 		}
@@ -267,6 +260,17 @@
 				display: block;
 				padding: 0 20upx;
 				box-sizing: content-box;
+				.form-item{
+					.vin-box{
+						margin-left: 14upx;
+						position: relative;
+						.vin-upload{
+							position: absolute;
+							right: 0;
+							top: 0;
+						}
+					}
+				}
 				.form-item-inp{
 					display: inline-block;
 					width: 88%;

+ 221 - 0
pages/sales/selectedProductsModal.vue

@@ -0,0 +1,221 @@
+<template>
+	<view class="selectedProducts-modal">
+		<u-popup v-model="isShow" @close="isShow=false" mode="bottom" z-index="9999">
+			<!-- 已选产品 -->
+			<scroll-view class="product-list-con" scroll-y @scrolltolower="onreachBottom">
+				<view class="product-list-item flex align_center justify_between" v-for="(item, index) in listData" :key="item.id">
+					<view class="product-item-main font_13 flex_1">
+						<view class="flex align_center justify_between">
+							<view>{{item.productCode || '--'}}</view>
+							<view class="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>
+							<u-tag v-if="item.oosFlag==1" text="急件" type="error" mode="light" shape="circle" size="mini" style="vertical-align: text-top;" />
+						</view>
+						<view class="product-item-name ellipsis-one">{{item.productName || '--'}}</view>
+						<view class="product-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>
+					<view class="btn-box">
+						<u-icon @click="handleDel(item, index)" name="trash-fill" :color="$config('errorColor')" size="34"></u-icon>
+					</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 ref="productTotal" class="selected-box flex align_center justify_between">
+				<view class="choose-info flex_1 flex align_center justify_between" @click="isShow=false">
+					<text>已选 {{nowData && (nowData.totalCategory || nowData.totalCategory==0) ? toThousands(nowData.totalCategory) : '--'}} 款,合计 ¥{{nowData && (nowData.totalAmount || nowData.totalAmount==0) ? toThousands(nowData.totalAmount, 2) : '--'}}</text>
+					<u-icon name="arrow-down" :color="$config('primaryColor')" size="34" class="close-circle"></u-icon>
+				</view>
+				<view class="choose-btn" @click="handleChoose" :style="{backgroundColor: $config('primaryColor')}">选好了</view>
+			</view>
+		</u-popup>
+		<!-- 弹框 -->
+		<common-modal :openModal="commonModal" content="确认要删除吗?" @confirm="handleCommon" @close="commonModal=false" />
+	</view>
+</template>
+
+<script>
+	import commonModal from '@/pages/common/commonModal.vue'
+	import { toThousands } from '@/libs/tools'
+	import { salesDetailList, salesDetailDel } from '@/api/sales'
+	export default {
+		components: { commonModal },
+		props: {
+			openModal: { //  弹框显示状态
+				type: Boolean,
+				default: false
+			},
+			nowData: {
+				type: Object,
+				default: ()=>{
+					return null
+				}
+			}
+		},
+		data() {
+			return {
+				isShow: this.openModal, //  是否打开弹框
+				listData: [],
+				pageNo: 1,
+				pageSize: 6,
+				totalNum: 0,
+				noDataText: '暂无数据',
+				toThousands,
+				theme: '',
+				commonModal: false,
+				infoData: null,  // 
+				detailData: null
+			}
+		},
+		mounted() {
+			this.theme = getApp().globalData.theme
+		},
+		methods: {
+			// 列表
+			getList(pageNo){
+				console.log(this.nowData,'++')
+				console.log(this.nowData.salesBillSn,'--++')
+				const _this = this
+				if (pageNo) {
+					this.pageNo = pageNo
+				}
+				let params = {
+					pageNo: this.pageNo,
+					pageSize: this.pageSize,
+					salesBillSn: this.nowData && this.nowData.salesBillSn
+				}
+				salesDetailList(params).then(res => {
+					if (res.status == 200) {
+						if(res.data && res.data.list){
+							res.data.list.map(item => {
+								item.productName = item.productEntity && item.productEntity.name || item.dealerProductEntity && item.dealerProductEntity.name
+								item.productCode = item.productEntity && item.productEntity.code || item.dealerProductEntity && item.dealerProductEntity.code
+								item.productUnit = item.productEntity && item.productEntity.unit || item.dealerProductEntity && item.dealerProductEntity.unit
+							})
+							if(this.pageNo>1){
+								this.listData = this.listData.concat(res.data && res.data.list || [])
+							}else{
+								this.listData = res.data.list || []
+							}
+						}else{
+							this.listData = []
+						}
+						this.totalNum = res.data && res.data.count || 0
+					} else {
+						this.listData = []
+						this.totalNum = 0
+						this.noDataText = res.message
+					}
+				})
+			},
+			// scroll-view到底部加载更多
+			onreachBottom() {
+				if(this.listData.length < this.totalNum){
+					this.pageNo += 1
+					this.getList()
+				}
+			},
+			// 已选产品  删除
+			handleDel(data, ind){
+				this.infoData = data
+				this.infoData.no = ind
+				this.commonModal = true
+			},
+			// 删除
+			handleCommon(){
+				salesDetailDel({ id: this.infoData.id }).then(res => {
+					if(res.status == 200){
+						this.listData.splice(this.infoData.no, 1)
+						this.commonModal = false
+						this.$emit('refreshTotal')
+					}
+				})
+			},
+			// 选好了
+			handleChoose(){
+				this.$emit('confirm')
+			},
+			// 已选产品合计
+			selectedProductTotal(){
+				salesDetail({ id: this.infoData.id }).then(res => {
+					if(res.status == 200){
+						this.detailData = res.data
+					}else{
+						this.detailData = null
+					}
+				})
+			},
+		},
+		watch: {
+			//  父页面传过来的弹框状态
+			openModal (newValue, oldValue) {
+				this.isShow = newValue
+			},
+			//  重定义的弹框状态
+			isShow (newValue, oldValue) {
+				if (!newValue) {
+					this.$emit('close')
+				}else{
+					this.getList()  // 已选产品列表
+				}
+			},
+			nowData: {
+				handler (newValue, oldValue) {
+					console.log(newValue,'---nowData')
+					if (this.isShow && newValue) {
+						
+					}
+				},
+				deep: true
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.selectedProducts-modal{
+		.product-list-con{
+			height: 700upx;
+			padding: 20upx 20upx 30upx;
+			box-sizing: border-box;
+			.product-list-item{
+				border-bottom: 1px solid #e4e7ed;
+				padding: 10upx 0;
+				.product-item-main{
+					.product-item-name{
+						padding: 6upx 0;
+					}
+				}
+				.btn-box{
+					padding: 0 30upx;
+				}
+			}
+			.product-list-item:last-child{
+				border: none;
+			}
+		}
+		.selected-box{
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			width: 100%;
+			background-color: #fff;
+			box-shadow: 1px -1px 3px #EEEEEE;
+			.choose-info{
+				padding: 0 30upx;
+			}
+			.choose-btn{
+				color: #fff;
+				width: 28%;
+				padding: 26upx 0;
+				text-align: center;
+			}
+		}
+	}
+</style>