Quellcode durchsuchen

Merge branch 'develop_szhj08' of http://git.chelingzhu.com/jianguan-web/qpls-md-app into develop_szhj08

chenrui vor 2 Jahren
Ursprung
Commit
4523d58725
4 geänderte Dateien mit 51 neuen und 50 gelöschten Zeilen
  1. 2 0
      pages/sales/index.vue
  2. 9 40
      pages/sales/list.vue
  3. 39 10
      pages/sales/salesSearch.vue
  4. 1 0
      store/index.js

+ 2 - 0
pages/sales/index.vue

@@ -143,6 +143,8 @@
 			this.getListLookUp();
 			// 获取支付,收款方式
 			this.getLookUpList('SETTLE_STYLE', 'vuex_paymentTypeList');
+			// 获取单据来源
+			this.getLookUpList('SALES_SOURCE', 'vuex_salesSourceList');
 			// 获取门店审核状态
 			this.getLookUpList('XPRH_STORE_APPLY_STATUS', 'vuex_storeAuthState');
 			// 门店审核结算方式

+ 9 - 40
pages/sales/list.vue

@@ -6,10 +6,10 @@
 		</u-dropdown>
 		<!-- 销售单列表 -->
 		<view class="list-box">
-			<listComponent ref="salesList" :height="listHeight" :params="searchParams" />
+			<listComponent ref="salesList" :height="listHeight" :params="searchForm" />
 		</view>
 		<!-- 查询右侧弹框 -->
-		<salesSearch :openModal="openModal" :defaultParams="searchForm" @refresh="refresh" @close="openModal=false" />
+		<salesSearch ref="searchBox" :openModal="openModal" :defaultParams="searchForm" @refresh="refresh" @close="openModal=false" />
 	</view>
 </template>
 
@@ -33,7 +33,6 @@
 					billStatus: null,
 					financialStatus: null
 				},
-				searchParams: {},
 				listHeight: 200,
 				openModal: false
 			}
@@ -43,6 +42,7 @@
 		},
 		onBackPress() {
 			if(this.openModal){
+				this.$refs.searchBox.closeBox()
 				this.openModal = false
 				return true
 			}
@@ -71,50 +71,19 @@
 			// 获取查询参数 刷新列表
 			refresh(params){
 				const _this = this
-				const data = {}
-				if(this.searchForm.billStatus){
-					data.billStatus = this.searchForm.billStatus
-				}
-				if(this.searchForm.financialStatus){
-					data.financialStatus = this.searchForm.financialStatus
-				}
-				
-				if(params){
-					if(params.beginDate){
-						data.beginDate = params.beginDate
-					}
-					if(params.endDate){
-						data.endDate = params.endDate
-					}
-					if(params.buyerName){
-						data.buyerName = params.buyerName
-					}
-					if(params.salesBillNo){
-						data.salesBillNo = params.salesBillNo
-					}
-					if(params.purchaseBillNo){
-						data.purchaseBillNo = params.purchaseBillNo
-					}
-					if(params.settleStyleSn){
-						data.settleStyleSn = params.settleStyleSn
-					}
+				const data = params ? Object.assign(this.searchForm,params) :  {
+					billStatus: null,
+					financialStatus: null
 				}
-				
-				this.searchParams = data
-				this.searchParams.beginDate = data.beginDate ? (data.beginDate + ' 00:00:00') : ''
-				this.searchParams.endDate = data.endDate ? (data.endDate + ' 23:59:59') : ''
-				console.log(this.searchParams,'this.searchParams')
+				data.beginDate = data.beginDate ? (data.beginDate + ' 00:00:00') : ''
+				data.endDate = data.endDate ? (data.endDate + ' 23:59:59') : ''
+				this.searchForm = data
 				this.$nextTick(function(){
 					_this.$refs.salesList.refash()
 				})
 			},
 			// 状态  change
 			handleChange(type){
-				if(type == 'bill'){
-					this.searchParams.billStatus = this.searchForm.billStatus
-				}else if(type == 'financial'){
-					this.searchParams.financialStatus = this.searchForm.financialStatus
-				}
 				this.$refs.salesList.refash()
 			},
 			// 配送方式

+ 39 - 10
pages/sales/salesSearch.vue

@@ -19,6 +19,10 @@
 					<u-input v-model="settleStyleName" @click="settleStyleModal=true" disabled placeholder="请选择收款方式" class="form-item-inp" />
 					<u-icon v-show="settleStyleName.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="clearSettleStyle"></u-icon>
 				</u-form-item>
+				<u-form-item label="单据来源" prop="settleStyleSn" class="form-item">
+					<u-input v-model="sourceTypeName" @click="sourceTypeModal=true" disabled placeholder="请选择单据来源" class="form-item-inp" />
+					<u-icon v-show="sourceTypeName.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="clearSourceType"></u-icon>
+				</u-form-item>
 			</u-form>
 			<view class="uni-list-btns">
 				<u-button class="handle-btn" size="medium" shape="circle" hover-class="none" @click="resetForm">重置</u-button>
@@ -29,6 +33,8 @@
 		<u-calendar v-model="showDate" @change="dateChange" mode="range"></u-calendar>
 		<!-- 选择收款方式 -->
 		<u-picker v-model="settleStyleModal" @confirm="settleStyleChange" :range="settleStyleList" range-key="dispName" mode="selector"></u-picker>
+		<!-- 选择单据来源 -->
+		<u-picker v-model="sourceTypeModal" @confirm="sourceTypeChange" :range="sourceTypeList" range-key="dispName" mode="selector"></u-picker>
 	</view>
 </template>
 
@@ -71,13 +77,20 @@
 				showDate: false, // 是否显示时间弹窗
 				settleStyleName: '',
 				settleStyleModal: false,
-				settleStyleList: []
+				settleStyleList: [],
+				sourceTypeName: '',
+				sourceTypeModal: false,
+				sourceTypeList: []
 			}
 		},
 		mounted() {
-			this.init()
+			// this.init()
 		},
 		methods: {
+			closeBox(){
+				this.settleStyleModal = false
+				this.sourceTypeModal = false
+			},
 			//  初始化数据
 			init(){
 				if(this.defaultParams.beginDate && this.defaultParams.endDate){
@@ -91,6 +104,7 @@
 				this.form.salesBillNo = this.defaultParams.salesBillNo ? this.defaultParams.salesBillNo : ''
 				this.form.purchaseBillNo = this.defaultParams.purchaseBillNo ? this.defaultParams.purchaseBillNo : ''
 				this.form.settleStyleSn = this.defaultParams.settleStyleSn ? this.defaultParams.settleStyleSn : ''
+				this.form.sourceType = this.defaultParams.sourceType ? this.defaultParams.sourceType : ''
 			},
 			// 查询
 			handleSearch() {
@@ -102,6 +116,7 @@
 			// 重置
 			resetForm() {
 				this.settleStyleName = ''
+				this.sourceTypeName = ''
 				this.form.beginDate = ''
 				this.form.endDate = ''
 				this.$refs.uForm.resetFields()
@@ -119,17 +134,30 @@
 				this.form.settleStyleSn = this.settleStyleList[ind].code || undefined
 				this.settleStyleName = this.settleStyleList[ind].dispName || ''
 			},
-			// 收款方式
+			// 清空单据来源
+			clearSourceType(){
+				this.sourceTypeName = ''
+				this.form.sourceType = undefined
+			},
+			// 单据来源 change
+			sourceTypeChange(ind){
+				this.form.sourceType = this.sourceTypeList[ind].code || undefined
+				this.sourceTypeName = this.sourceTypeList[ind].dispName || ''
+			},
+			// 收款方式单据来源// 有值时,匹配对应name
 			getTypeList () {
+				console.log(this.defaultParams)
+				// 收款方式
 				this.settleStyleList = this.$store.state.vuex_paymentTypeList
-				console.log(this.settleStyleList)
-				// 收款方式有值时,匹配对应name
 				if(this.defaultParams.settleStyleSn || this.defaultParams.settleStyleSn==0){
-					this.settleStyleList.map(item => {
-						if(item.code == this.defaultParams.settleStyleSn){
-							this.settleStyleName = item.dispName
-						}
-					})
+					const s = this.settleStyleList.find(item => item.code == this.defaultParams.settleStyleSn)
+					this.settleStyleName = s ? s.dispName : ''
+				}
+				// 单据来源
+				this.sourceTypeList = this.$store.state.vuex_salesSourceList
+				if(this.defaultParams.sourceType){
+					const b = this.sourceTypeList.find(item => item.code == this.defaultParams.sourceType)
+					this.sourceTypeName = b ? b.dispName : ''
 				}
 			},
 			// 时间  change
@@ -155,6 +183,7 @@
 				if (!newValue) {
 					this.$emit('close')
 				}else{
+					this.init()
 					this.getTypeList()
 				}
 			}

+ 1 - 0
store/index.js

@@ -105,6 +105,7 @@ const store = new Vuex.Store({
 		vuex_OrderAddress: {}, // 地址
 		vuex_allLookUp: [],  //  数据字典
 		vuex_paymentTypeList: [], // 收款方式
+		vuex_salesSourceList: [], // 销售单据来源
 		vuex_storeAuthState: [], // 门店审核状态
 		vuex_shelfSettleType: [], // 门店审核结算方式
 		vuex_tempPrintList:[], // 临时打印数据