chenrui 3 years ago
parent
commit
48d513af19
4 changed files with 104 additions and 4 deletions
  1. 7 0
      pages.json
  2. 1 1
      pages/sales/index.vue
  3. 88 0
      pages/sales/list.vue
  4. 8 3
      pages/stock/index.vue

+ 7 - 0
pages.json

@@ -200,6 +200,13 @@
 				"enablePullDownRefresh": false
 			}
 		},
+		{
+			"path": "pages/sales/list", // 销售列表
+			"style": {
+				"navigationBarTitleText": "销售单",
+				"enablePullDownRefresh": false
+			}
+		},
 		{
 			"path": "pages/sales/productPricing", // 产品报价
 			"style": {

+ 1 - 1
pages/sales/index.vue

@@ -35,7 +35,7 @@
 		<view class="sales-list">
 			<view class="title">
 				<text class="title-name">销售单</text>
-				<view class="title-all">查看全部<u-icon name="arrow-right" color="#666" size="28"></u-icon></view>
+				<view class="title-all" @click="toPage('/pages/sales/list')">查看全部<u-icon name="arrow-right" color="#666" size="28"></u-icon></view>
 			</view>
 			<scroll-view class="sales-list-con" scroll-y @scrolltolower="onreachBottom">
 				<view class="sales-list-main">

+ 88 - 0
pages/sales/list.vue

@@ -0,0 +1,88 @@
+<template>
+	<view class="sales-list-wrap">
+		<u-dropdown>
+			<u-dropdown-item v-model="billStatus" title="业务状态" :options="billStatusOpt"></u-dropdown-item>
+		</u-dropdown>
+	</view>
+</template>
+
+<script>
+	import { getLookUpItem } from '@/api/data'
+	import { salesList } from '@/api/sales'
+	export default{
+		data(){
+			return{
+				listData: [],
+				pageNo: 1,
+				pageSize: 6,
+				totalNum: 0,
+				noDataText: '暂无数据',
+				billStatus: undefined,
+				financialStatus: undefined,
+				billStatusOpt: [],
+				financialStatusOpt: [],
+			}
+		},
+		onLoad() {
+			this.getLookUpItem('SALES_BILL_STATUS')
+			this.getLookUpItem('FINANCIAL_RECEIVE_STATUS')
+			this.getList()
+		},
+		methods: {
+			// 列表
+			getList(pageNo){
+				const _this = this
+				if (pageNo) {
+					this.pageNo = pageNo
+				}
+				salesList({ pageNo: this.pageNo, pageSize: this.pageSize }).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
+					}
+				})
+			},
+			// scroll-view到底部加载更多
+			onreachBottom() {
+				if(this.listData.length < this.totalNum){
+					this.pageNo += 1
+					this.getList()
+				}
+			},
+			handleChange(){},
+			// 配送方式
+			getLookUpItem (type) {
+				getLookUpItem({ lookupCode: type, pageNo: 1, pageSize: 1000 }).then(res => {
+					if (res.status == 200 && res.data && res.data.list) {
+						res.data.list.map(item => {
+							item.label = item.dispName
+							item.value = item.code
+						})
+						if(type == 'SALES_BILL_STATUS'){
+							this.billStatusOpt = res.data.list
+						}else if(type == 'FINANCIAL_RECEIVE_STATUS'){
+							this.financialStatusOpt = res.data.list
+						}
+					} else {
+						if(type == 'SALES_BILL_STATUS'){
+							this.billStatusOpt = []
+						}else if(type == 'FINANCIAL_RECEIVE_STATUS'){
+							this.financialStatusOpt = []
+						}
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+</style>

+ 8 - 3
pages/stock/index.vue

@@ -99,7 +99,13 @@
 				this.form.productCode = ''
 				this.form.productName = ''
 				this.form.productOrigCode = ''
+				this.brandName = ''
 				this.form.productBrandSn = undefined
+				this.nowData = {
+					data: [],
+					indArr: [],
+					nowInd: 0
+				}
 				this.form.productTypeSn1 = undefined
 				this.form.productTypeSn2 = undefined
 				this.form.productTypeSn3 = undefined
@@ -113,7 +119,6 @@
 				} else {
 					params.zeroQtyFlag = ''
 				}
-				console.log(params)
 				uni.navigateTo({ url: "/pages/stock/stockSearch?data="+JSON.stringify(params) })
 			},
 			// 选择品牌
@@ -134,8 +139,8 @@
 					nowInd: obj.nowInd
 				}
 				this.form.productTypeSn1 = this.nowData.data[0]&&this.nowData.data[0].productTypeSn ? this.nowData.data[0].productTypeSn : undefined
-				this.form.productTypeSn2 = this.nowData.data[0]&&this.nowData.data[1].productTypeSn ? this.nowData.data[1].productTypeSn : undefined
-				this.form.productTypeSn3 = this.nowData.data[0]&&this.nowData.data[2].productTypeSn ? this.nowData.data[2].productTypeSn : undefined
+				this.form.productTypeSn2 = this.nowData.data[1]&&this.nowData.data[1].productTypeSn ? this.nowData.data[1].productTypeSn : undefined
+				this.form.productTypeSn3 = this.nowData.data[2]&&this.nowData.data[2].productTypeSn ? this.nowData.data[2].productTypeSn : undefined
 			},
 			// 清空分类
 			typeClean(){