Bläddra i källkod

时间组件封装,统计页面编写

asd26269546 2 år sedan
förälder
incheckning
8c0f3f354b

+ 353 - 0
src/components/dateSelect/dateSelect.vue

@@ -0,0 +1,353 @@
+<template>
+	<div class="date-filter-wrap" style="float: right">
+		<DatePicker
+			:clearable="false"
+			@on-change="dateClick2"
+			v-model="dataArea2"
+			type="month"
+			placement="bottom-end"
+			placeholder="请选择月份"
+			style="width: 200px; margin-right: 10px"
+		>
+		</DatePicker>
+		<div class="date-filter">
+			<div
+				class="date-tab"
+				v-for="(item, index) in dateTabs"
+				:key="index"
+				:class="index === dateTabIndex ? 'active' : ''"
+				@click="dateTabToggle(index)"
+			>
+				{{ item.label }}
+			</div>
+			<Poptip placement="bottom">
+				<div class="date-tab" :class="dateTabIndex === 5 ? 'active' : ''" style="width: 50px">其他</div>
+				<div slot="content">
+					<div
+                        class="select-time-box"
+						v-for="i in modalTimeList"
+						@click="modalTimeSelect(i.type)" 
+						:key="i.type"
+					>
+						{{ i.name }}
+					</div>
+				</div>
+			</Poptip>
+		</div>
+		<DatePicker
+			:clearable="false"
+			@on-change="dateClick"
+			v-model="dataArea"
+			type="daterange"
+			placement="bottom-end"
+			placeholder="请选择日期"
+			style="width: 200px; margin-left: 10px"
+		>
+		</DatePicker>
+	</div>
+</template>
+<script>
+export default {
+	name: 'test',
+	props: {
+		value: {
+			type: Object,
+		},
+	},
+	watch: {
+		value: {
+			handler() {
+				this.$emit('input', this.value)
+			},
+			deep: true,
+			immediate: true,
+		},
+	},
+	data() {
+		return {
+			modalTimeList: [
+				{
+					name: '昨日',
+					type: 1,
+				},
+				{
+					name: '前日',
+					type: 2,
+				},
+				{
+					name: '上周',
+					type: 3,
+				},
+				{
+					name: '上月',
+					type: 4,
+				},
+				{
+					name: '近三个月',
+					type: 5,
+				},
+				{
+					name: '近半年',
+					type: 6,
+				},
+			],
+			modalTimeType: null,
+			dateTabIndex: 0,
+			dateTabs: [
+				{ label: '本日' },
+				{ label: '本周' },
+				{ label: '本月' },
+				{ label: '今年' },
+			],
+			dataArea2: null,
+			dataArea: [],
+            time:[],
+		}
+	},
+	methods: {
+        /* 选项卡切换 */
+		dateTabToggle(index) {
+			this.dateTabIndex = index
+            this.dataArea2 = null
+			if (index === 0) {
+				let time = new Date().getTime()
+				this.value.beginTime = this.$dayjs(time).format('YYYY-MM-DD HH:mm:ss')
+				this.value.endTime = this.$dayjs(time).format('YYYY-MM-DD HH:mm:ss')
+				this.dataArea = [this.value.beginTime, this.value.endTime]
+			} else if (index === 1) {
+				let Nowdate = new Date()
+				let WeekFirstDay = Nowdate.getDay()
+					? new Date(Nowdate - (Nowdate.getDay() - 1) * 86400000)
+					: new Date(Nowdate - (Nowdate.getDay() + 6) * 86400000)
+				let WeekLastDay = new Date(
+					(WeekFirstDay / 1000 + 6 * 86400) * 1000
+				)
+				this.value.beginTime = this.$dayjs(WeekFirstDay).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.value.endTime = this.$dayjs(WeekLastDay).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.dataArea = [this.value.beginTime, this.value.endTime]
+			} else if (index === 2) {
+				let now = new Date() // 当前日期
+				let nowMonth = now.getMonth() // 当前月
+				let nowYear = now.getFullYear() // 当前年
+				// 本月的开始时间
+				let monthStartDate = new Date(nowYear, nowMonth, 1)
+				// 本月的结束时间
+				let monthEndDate = new Date(nowYear, nowMonth + 1, 0)
+				this.value.beginTime = this.$dayjs(monthStartDate).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.value.endTime = this.$dayjs(monthEndDate).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.dataArea = [this.value.beginTime, this.value.endTime]
+			} else if (index === 3) {
+				let now = new Date() // 当前日期
+				let nowYear = now.getFullYear() // 当前年
+				// 本年的开始时间
+				let monthStartDate = new Date(nowYear, 0, 1)
+				// 本年的结束时间
+				let monthEndDate = new Date(nowYear, 11, 31)
+				this.value.beginTime = this.$dayjs(monthStartDate).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.value.endTime = this.$dayjs(monthEndDate).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.dataArea = [this.value.beginTime, this.value.endTime]
+			}
+			this.$emit('change')
+		},
+		//外部选择时间
+		changeTypeFn(_type) {
+			this.value.type = _type
+			this.value.beginTime = null
+			this.value.endTime = null
+			this.time = []
+			this.$emit('change')
+		},
+		modalTimeSelect(_type) {
+            const format = (timeStamp) => {
+                var date = new Date();
+                date.setTime(timeStamp * 1);
+                var y = date.getFullYear();
+                var m = date.getMonth() + 1;
+                m = m < 10 ? ('0' + m) : m;
+                var d = date.getDate();
+                d = d < 10 ? ('0' + d) : d;
+                var h = date.getHours();
+                h = h < 10 ? ('0' + h) : h;
+                var minute = date.getMinutes();
+                var second = date.getSeconds();
+                minute = minute < 10 ? ('0' + minute) : minute;
+                second = second < 10 ? ('0' + second) : second;
+                return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
+            }
+			const v = this
+			const todayNum = new Date(new Date().toLocaleDateString()).getTime()
+			const today = new Date()
+			//年
+			var year = today.getFullYear()
+			//月
+			const month = today.getMonth() + 1
+			//周
+			const nows = today.getDay() || 7
+			//天
+			const day = today.getDate()
+			if (_type == 1) {
+				v.value.beginTime = format(todayNum - 86400000)
+				v.value.endTime = format(todayNum)
+			}
+			if (_type == 2) {
+				v.value.beginTime = format(todayNum - 86400000 * 2)
+				v.value.endTime = format(todayNum - 86400000)
+			}
+			if (_type == 3) {
+				v.value.beginTime = format(todayNum - 86400000 * (nows + 6))
+				v.value.endTime = format(todayNum - 86400000 * (nows - 1))
+			}
+			if (_type == 4) {
+				if (month == 1) {
+					v.value.beginTime = year - 1 + '-' + 12 + '-' + '1 00:00:00'
+					v.value.endTime = year + '-' + 1 + '-' + '1 00:00:00'
+				} else {
+					v.value.beginTime =
+						year + '-' + (month - 1) + '-' + '1 00:00:00'
+					v.value.endTime = year + '-' + month + '-' + '1 00:00:00'
+				}
+			}
+			if (_type == 5) {
+				if (month < 4) {
+					v.value.beginTime =
+						year -
+						1 +
+						'-' +
+						(12 - 3 + month) +
+						'-' +
+						day +
+						' 00:00:00'
+					v.value.endTime = format(today.getTime())
+				} else {
+					v.value.beginTime =
+						year + '-' + (month - 3) + '-' + day + ' 00:00:00'
+					v.value.endTime = format(today.getTime())
+				}
+			}
+			if (_type == 6) {
+				if (month < 7) {
+					v.value.beginTime =
+						year -
+						1 +
+						'-' +
+						(12 - 6 + month) +
+						'-' +
+						day +
+						' 00:00:00'
+					v.value.endTime = format(today.getTime())
+				} else {
+					v.value.beginTime =
+						year + '-' + (month - 6) + '-' + day + ' 00:00:00'
+					v.value.endTime = format(today.getTime())
+				}
+			}
+			v.time = [v.value.beginTime, v.value.endTime]
+            v.dateTabIndex = 5
+            this.$emit('change')
+		},
+		dateClick2(date) {
+			const dateDayNum = new Date(date).getDate()
+			const dateMonthNum = new Date(date).getMonth()
+			const dateYearNum = new Date(date).getFullYear()
+			this.value.beginTime = dateYearNum + '-' + dateMonthNum + '-1'
+			this.value.endTime =
+				dateYearNum +
+				'-' +
+				dateMonthNum +
+				'-' +
+				new Date(dateYearNum, dateMonthNum * 1 + 2, 0).getDate()
+			this.dataArea = []
+            this.$emit('change')
+		},
+		dateClick(date) {
+			this.value.beginTime = date[0]
+			this.value.endTime = date[1]
+			this.dataArea2 = null
+            console.log(this.value)
+            this.$emit('change')
+		},
+	},
+}
+</script>
+<style scoped lang="less">
+.select-time-box{
+    height: 30px;
+    line-height: 30px;
+    text-align: center;
+    cursor: pointer;
+}
+.select-time-box:hover,.select-time-box.active{
+    background: #3f92f9;
+    color: #fff;
+}
+.date-filter-wrap {
+	display: flex;
+	align-items: center;
+	.date-filter {
+		width: 300px;
+		overflow: hidden;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		background-color: #ffffff;
+		border-radius: 4px;
+		&.other {
+			width: auto;
+			.date-tab {
+				white-space: nowrap;
+				padding: 9px;
+				.num {
+					font-weight: bold;
+					font-size: 14px;
+					&.red {
+						color: red;
+						cursor: pointer;
+						text-decoration: underline;
+					}
+				}
+				&.active {
+					background-color: #333333;
+				}
+			}
+		}
+
+		.date-tab {
+			flex: 1;
+			padding: 9px 4px;
+			line-height: 1;
+			text-align: center;
+			border: 1px solid #e6e6e6;
+			border-radius: 2px;
+			border-right: none;
+			cursor: pointer;
+			font-weight: 500;
+
+			&:first-child {
+				border-radius: 4px 0 0 4px;
+			}
+
+			&:last-child {
+				border-radius: 0 4px 4px 0;
+				border-right: 1px solid #e6e6e6;
+			}
+
+			&.active {
+				background-color: #3f92f9;
+				color: #ffffff;
+			}
+		}
+	}
+}
+</style>

+ 11 - 3
src/components/my-table/my-table.vue

@@ -166,6 +166,9 @@ export default {
         return []
       }
     },
+    rowClassNameFn:{
+      type:Function
+    },
     // 判断表单显示时的标识
     showFlag: Boolean
   },
@@ -221,8 +224,8 @@ export default {
       }
     },
     rowClassName (row, index) {
-      if (index === this.selectRow) {
-        return 'select-row-bg'
+      if (row.color === 'red') {
+        return 'color-red'
       }
       return ''
     },
@@ -425,8 +428,13 @@ export default {
   }
 }
 </script>
-
+<style>
+.color-red{
+  color: red!important;
+}
+</style>
 <style lang="less" scoped>
+
 .container {
   height: 100%;
   width: 100%;

+ 14 - 4
src/router/routers.js

@@ -326,6 +326,14 @@ export default [
         component: () => import('@/view/material-manege/material-apply-detail/material-apply-detail')
       },
       {
+        path: '/purchaseTotal',
+        name: 'purchaseTotal',
+        meta: {
+          title: '申购金额统计'
+        },
+        component: () => import('@/view/material-manege/purchaseTotal/purchaseTotal')
+      },
+      {
         path: '/material_contract',
         name: 'material_contract',
         meta: {
@@ -333,17 +341,19 @@ export default [
         },
         component: () => import('@/view/material-manege/contract/contract')
       },
+
+      
       {
-        path: '/material_pay',
-        name: 'material_pay',
+        path: '/material_pay2',
+        name: 'material_pay2',
         meta: {
           title: '合同付款'
         },
         component: () => import('@/view/material-manege/pay/pay')
       },
       {
-        path: '/material_pay2',
-        name: 'material_pay2',
+        path: '/material_pay',
+        name: 'material_pay',
         meta: {
           title: '合同付款-新'
         },

+ 16 - 5
src/view/index/schedule/material-approve-form.vue

@@ -237,23 +237,31 @@ export default {
             this.list.push({
               name: '抽检比例',
               new: this.infoData.newData.checkRate,
-              old: this.infoData.oldData.checkRate
+              old: this.infoData.oldData.checkRate,
+              color:this.infoData.newData.checkRate != this.infoData.oldData.checkRate ? 'red' : null
             })
             this.list.push({
               name: '安全库存',
               new: this.infoData.newData.safetyStock,
-              old: this.infoData.oldData.safetyStock
+              old: this.infoData.oldData.safetyStock,
+              color:this.infoData.newData.safetyStock != this.infoData.oldData.safetyStock ? 'red' : null
             })
             this.list.push({
               name: '采购周期',
               new: this.infoData.newData.safetyWarnDay,
-              old: this.infoData.oldData.safetyWarnDay
+              old: this.infoData.oldData.safetyWarnDay,
+              color:this.infoData.newData.safetyWarnDay != this.infoData.oldData.safetyWarnDay ? 'red' : null
             })
-            this.list.push({ name: '物料属性', new: newData, old: oldData })
+            this.list.push({ 
+              name: '物料属性', 
+              new: newData, 
+              old: oldData
+              })
             this.list.push({
               name: '物料类型',
               new: this.infoData.newData.categoryName,
-              old: this.infoData.oldData.categoryName
+              old: this.infoData.oldData.categoryName,
+              color:this.infoData.newData.categoryName != this.infoData.oldData.categoryName ? 'red' : null
             })
             this.list.push({
               name: '备注',
@@ -301,6 +309,9 @@ export default {
 </script>
 
 <style lang="less" scoped>
+.color-red{
+  color: red;
+}
 .content {
   padding: 10px 0;
   border-radius: 5px;

+ 42 - 10
src/view/material-manege/pay/pay2.vue

@@ -14,7 +14,7 @@
             <div class="bar-2">
                 <div :class="payTimeType == 1 ? 'active' : ''" @click="selectTime(1)" v-if="!isFirstMonth"><Table :columns="columns1" :data="data1"></Table></div>
                 <div :class="payTimeType == 1.5 ? 'active' : ''" @click="selectTime(1.5)" style="width:24%"><Table :columns="columns2" :data="data2"></Table></div>
-				<div :class="payTimeType == 1 ? 'active' : ''" @click="selectTime(1)" v-if="isFirstMonth"><Table :columns="columns1" :data="data1"></Table></div>
+				<div :class="payTimeType == 2 ? 'active' : ''" @click="selectTime(2)" v-if="isFirstMonth"><Table :columns="columns1" :data="data1"></Table></div>
                 <div :class="payTimeType == 3 ? 'active' : ''" @click="selectTime(3)"><Table :columns="columns3" :data="data3"></Table></div>
                 <div :class="payTimeType == 4 ? 'active' : ''" @click="selectTime(4)"><Table :columns="columns4" :data="data4"></Table></div>
                 <div :class="payTimeType == 5 ? 'active' : ''" @click="selectTime(5)"><Table :columns="columns5" :data="data5"></Table></div>
@@ -23,9 +23,8 @@
             
 		</div>
 		<div class="container">
-			
 			<div style="background:#fff;padding:10px;margin-bottom:10px">
-				<Tabs v-model="salesVolumeCompanyTotalType">
+				<Tabs v-model="salesVolumeCompanyTotalType" @on-click="tabsChange">
 					<TabPane  label="全部" name="1"></TabPane>
 					<TabPane :label="(h) => {
 						return h('div', [
@@ -607,6 +606,11 @@ export default {
 		}
 	},
 	methods: {
+		tabsChange(){
+			const v = this
+			v.params.companySelectId = null
+			v.searchFn()
+		},
 		selectTime(num){
 			
 			if(this.payTimeType == num){
@@ -674,7 +678,13 @@ export default {
 		},
 		searchFn(){
 			const v = this
+			if(v.salesVolumeCompanyTotalType){
+
+			}else{
+				
+			}
 			const list = JSON.parse(JSON.stringify(v.showListCopy))
+			console.log(v.params.companySelectId)
 			if(v.params.companySelectId){
 				for (let i = 0; i < list.length; i++) {
 					const element = list[i];
@@ -703,10 +713,10 @@ export default {
 				if( (new Date(element.oldPayTime)).valueOf() > zhangqiMo ){
 					v.cycle.nextCycle ++ 
 					element.cycleType = 3
-				}else if((new Date(element.oldPayTime)).valueOf() > zhangqichu){
+				}else if((new Date(element.oldPayTime)).valueOf() < zhangqichu){
 					v.cycle.upperCycle ++
 					element.cycleType = 2
-				}else if((new Date(element.oldPayTime)).valueOf() <= zhangqichu){
+				}else if((new Date(element.oldPayTime)).valueOf() > zhangqichu){
 					v.cycle.currentPeriod ++
 					element.cycleType = 1
 				}
@@ -744,6 +754,14 @@ export default {
 						'5-10':0,
 						'5down':0,
 					}
+					const handle2 = (contractAmount,qtyCheckAmount) => {
+						return function(a,b){
+							const val1 = a[qtyCheckAmount] == 0 ?  a[contractAmount] : a[qtyCheckAmount];
+							const val2 = b[qtyCheckAmount] == 0 ?  b[contractAmount] : b[qtyCheckAmount];
+							return val2 - val1;
+						}
+					}
+					res.result.payBillItems.sort(handle2('contractAmount','qtyCheckAmount'))
 					this.showListCopy = JSON.parse(JSON.stringify(res.result.payBillItems))
 					this.data = JSON.parse(JSON.stringify(res.result))
 					this.showList = this.showListCopy.slice(0,10)
@@ -754,7 +772,9 @@ export default {
 							const jelement = v.company[j];
 							if(element.supplierId == jelement.supplierId){
 								isCompany = true
-								jelement.total = (element.hadPayAmount == 0) ? jelement.total + element.contractAmount : jelement.total + element.hadPayAmount
+								jelement.total = (element.qtyCheckAmount == 0) ? 
+								(jelement.total*1000 + element.contractAmount*1000)/1000 : 
+								(jelement.total*1000 + element.qtyCheckAmount*1000)/1000
 								jelement.list.push(element)
 							}
 						}
@@ -762,12 +782,15 @@ export default {
 						if(!isCompany){
 							v.company.push({
 								list:[{...element}],
-								total:(element.hadPayAmount == 0) ? element.contractAmount : element.hadPayAmount,
+								total:(element.qtyCheckAmount == 0) ? element.contractAmount : element.qtyCheckAmount,
 								supplierId:element.supplierId,
 								supplierName:element.supplierName
 							})
 						}
 					}
+					
+					
+					
 					for (let i = 0; i < v.company.length; i++) {
 						const element = v.company[i];
 						const totalkeyName = 
@@ -785,6 +808,14 @@ export default {
 						v.salesVolumeCompanyTotal[totalkeyName] ++
 
 					}
+					const handle = (property) => {
+						return function(a,b){
+							const val1 = a[property];
+							const val2 = b[property];
+							return val2 - val1;
+						}
+					}
+					v.company.sort(handle('total'));
 					v.searchFn()
 				}
 			})
@@ -851,6 +882,7 @@ export default {
                 console.log(res)
                 var dateDayNum = new Date().getDate();
                 var dateMonthNum = new Date().getMonth();
+				const dateYearNum = new Date().getFullYear()
                 console.log(dateDayNum)
                 if(dateDayNum > 15){
                     v.isFirstMonth = false
@@ -876,7 +908,7 @@ export default {
                     )
                 }else{
 					v.columns1 = [
-                        {title: (dateMonthNum + 1) + '月30号',key:'name'},
+                        {title: (dateMonthNum + 1) + '月'+ new Date(dateYearNum, (dateMonthNum * 1 + 2), 0).getDate() +'号',key:'name'},
                         {title: '应付',key:'yifu'}
                     ]
 					v.data1 = [
@@ -895,7 +927,7 @@ export default {
 					
 				}
                 v.columns2 = [
-                    {title: (dateMonthNum + 1) + '月'+ (dateDayNum > 15 ? '30' : '15')  +'号',key:'name'},
+                    {title: (dateMonthNum + 1) + '月'+ (dateDayNum > 15 ? new Date(dateYearNum, (dateMonthNum * 1 + 2), 0).getDate() : '15')  +'号',key:'name'},
                     {title: '应付',key:'yinfu'},
                     {title: '已付',key:'yifu'},
                     {title: '未付',key:'weifu'}
@@ -1187,7 +1219,7 @@ export default {
 
 
 .bar-2 .active{
-	border:2px solid #3f92f9;
+	border:3px solid #3f92f9;
 }
 .bar-2 .ivu-table-cell{
     padding-left:9px!important;

+ 506 - 0
src/view/material-manege/purchaseTotal/purchaseTotal.vue

@@ -0,0 +1,506 @@
+<template>
+	<div class="purchaseTotal">
+		<div class="bar-title">
+			<span style="font-size: 16px; font-weight: bold; color: #000"
+				>申购金额统计</span
+			>
+            <date-select v-model="params" @change="selectTime"></date-select>
+			<div class="date-filter-wrap" style="float: right;display: none;">
+                <DatePicker
+					:clearable="false"
+					@on-change="dateClick2"
+					v-model="dataArea2"
+					type="month"
+					placement="bottom-end"
+					placeholder="请选择月份"
+					style="width: 200px; margin-right: 10px"
+				>
+				</DatePicker>
+				<div class="date-filter">
+					<div
+						class="date-tab"
+						v-for="(item, index) in dateTabs"
+						:key="index"
+						:class="index === dateTabIndex ? 'active' : ''"
+						@click="dateTabToggle(index)"
+					>
+						{{ item.label }}
+					</div>
+				</div>
+				<DatePicker
+					:clearable="false"
+					@on-change="dateClick"
+					v-model="dataArea"
+					type="daterange"
+					placement="bottom-end"
+					placeholder="请选择日期"
+					style="width: 200px; margin-left: 10px"
+				>
+				</DatePicker>
+			</div>
+		</div>
+		<div class="total-header" style="padding-top:10px">
+			<div class="card-warp" style="width: 13.5%; margin-right: 1%">
+				<Card dis-hover style="color:#3f92f9;font-weight: bold;">
+					<div>申购金额</div>
+					<div class="big-num"  style="color:#3f92f9;font-weight: bold;">{{totalData.money[0]}}</div>
+				</Card>
+			</div>
+			<div class="card-warp" style="width: 38.5%; margin-right: 1%">
+				<Card dis-hover>
+					<ul>
+						<li>
+							<div>面料采购</div>
+							<div class="big-num">{{totalData.money[1]}}</div>
+						</li>
+						<li>
+							<div>墨水采购</div>
+							<div class="big-num">{{totalData.money[2]}}</div>
+						</li>
+						<li>
+							<div>其他</div>
+							<div class="big-num">{{totalData.money[3]}}</div>
+						</li>
+					</ul>
+				</Card>
+			</div>
+			<div class="card-warp" style="width: 46%">
+				<Card dis-hover>
+					<ul>
+						<li style="width: 25%">
+							<div>45天账期</div>
+							<div class="big-num">{{totalData.money[4]}}</div>
+						</li>
+						<li style="width: 25%">
+							<div>30天账期</div>
+							<div class="big-num">{{totalData.money[5]}}</div>
+						</li>
+						<li style="width: 25%">
+							<div>15天账期</div>
+							<div class="big-num">{{totalData.money[6]}}</div>
+						</li>
+						<li style="width: 25%">
+							<div>预付款</div>
+							<div class="big-num">{{totalData.money[7]}}</div>
+						</li>
+					</ul>
+				</Card>
+			</div>
+		</div>
+		<div style="background: #fff; padding: 10px; margin: 10px 0">
+			<Tabs v-model="salesVolumeCompanyTotalType" @on-click="tabsChange">
+				
+				<TabPane
+                    
+					:label="
+						(h) => {
+							return h('div', [
+								h('span', companyMoneyName[index] + '('),
+								h(
+									'span',
+									{ style: { color: 'red' } },
+									i.length
+								),
+								h('span', ')'),
+							])
+						}
+					"
+					:name="index"
+                    v-for="(i,index) in totalData.statisticsSupplier" :key="index"
+				></TabPane>
+				
+			</Tabs>
+			<div>
+				<Button
+					style="margin: 0 10px 5px 0"
+					:type="
+						params.supplierIdListCopy == '' ? 'primary' : 'default'
+					"
+					@click="changeCompany(null, 0)"
+					>全部</Button
+				>
+				<Button
+					style="margin: 0 10px 5px 0"
+					@click="changeCompany(i.supplierId, index)"
+					v-for="(i, index) in company"
+					:type="
+						params.supplierIdList == i.supplierId
+							? 'primary'
+							: 'default'
+					"
+					:key="i.supplierId"
+				>
+					{{ i.supplierName
+					}}<span
+						:style="
+							params.supplierIdList == i.supplierId
+								? 'color:#ffc107'
+								: 'color:red'
+						"
+					>
+						({{ i.money }})</span
+					>
+				</Button>
+			</div>
+		</div>
+        <div class="table">
+            <Table :columns="columns" :data="listData"></Table>
+            <div style="text-align:center;margin-top:10px">
+                <Page
+                    :current="params.pageNum"
+                    :total="params.total"
+                    :page-size="params.pageSize"
+                    :show-total="true"
+                    show-elevator
+                    @on-change="changePage"
+                />
+            </div>
+        </div>
+	</div>
+</template>
+<script>
+import { exportExcel } from '@/libs/util'
+import  dateSelect  from '@/components/dateSelect/dateSelect'
+import axios from 'axios'
+export default {
+	name: 'test',
+    components:{
+        dateSelect
+    },
+	data() {
+		return {
+			topIndex: '',
+			dataArea: [],
+            dataArea2:null,
+			beginTime: '',
+			endTime: '',
+			dateTabIndex: 0,
+			dateTabs: [
+				{ label: '本日' },
+				{ label: '本周' },
+				{ label: '本月' },
+				{ label: '今年' },
+			],
+            company:[],
+            companyMoneyName:[
+                '全部',
+                '50万以上',
+                '20-50万',
+                '10-20万',
+                '5-10万',
+                '5万以下'
+            ],
+			id: '',
+			selectList: [],
+			formData: {},
+			storeType: '',
+			show: false,
+			listData: [],
+			columns: [
+				
+				{
+					title: '序号',
+					type: 'index',
+					width: 60,
+					align: 'center',
+				},
+				{
+					title: '供应商',
+					key: 'supplierName',
+					minWidth: 150,
+				},
+				{
+					title: '合同编码',
+					key: 'purchaseBillNo',
+					minWidth: 150,
+					sortable: true,
+				},
+				{
+					title: '物料名称',
+					key: 'materialName',
+					minWidth: 200,
+					sortable: true,
+				},
+				{
+					title: '采购数量',
+					key: 'purchaseQty',
+					minWidth: 100,
+				},
+                {
+					title: '单价',
+					key: 'price',
+					minWidth: 100,
+				},
+                {
+					title: '合同金额',
+					key: 'totalAmount',
+					minWidth: 100,
+				},
+                {
+					title: '质检金额',
+					key: 'adjustAmount',
+					minWidth: 100,
+				},
+                {
+					title: '审批时间',
+					key: 'approvalTime',
+					minWidth: 100,
+				},
+			],
+			salesVolumeCompanyTotalType:null,
+			params: {
+				pageNum: 1,
+				pageSize: 10,
+				total: 0,
+                supplierIdList:'',
+                supplierIdListCopy:'',
+                beginTime:null,
+                endTime:null,
+			},
+            totalData:{
+                statisticsSupplier:[],
+                money:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0},
+            },
+		}
+	},
+	methods: {
+        selectTime(){
+            this.params.supplierIdList = ''
+            this.params.supplierIdListCopy = ''
+            this.getList()
+            this.getTotal()
+        },
+        changeCompany(_id){
+            if(_id == this.params.supplierIdList) return
+            if(_id == null){
+                this.params.supplierIdList = ''
+                this.params.supplierIdListCopy = ''
+                for (let i = 0; i < this.company.length; i++) {
+                    const element = this.company[i];
+                    if(i == this.company.length){
+                        this.params.supplierIdList = this.params.supplierIdList + element.supplierId
+                    }else{
+                        this.params.supplierIdList = this.params.supplierIdList + element.supplierId + ','
+                    }
+                    
+                }
+            }else{
+                this.params.supplierIdList = _id
+                this.params.supplierIdListCopy = _id
+            }
+            this.params.pageNum = 1
+            this.getList()
+        },
+        tabsChange(_index){
+            console.log(this.totalData.statisticsSupplier)
+            this.company = this.totalData.statisticsSupplier[_index]
+        },
+		topTabClick(index) {
+			if (index === this.topIndex) {
+				this.topIndex = ''
+				this.params.stockTagType = ''
+			} else {
+				this.topIndex = index
+				this.params.stockTagType = index
+			}
+			this.params.pageNum = 1
+			this.getList()
+		},
+        dateClick2(date){
+            
+            const dateDayNum = new Date(date).getDate()
+            const dateMonthNum = new Date(date).getMonth()
+            const dateYearNum = new Date(date).getFullYear()
+            this.beginTime = dateYearNum + '-' + dateMonthNum + '-1'
+			this.endTime = dateYearNum + '-' + dateMonthNum + '-' + new Date(dateYearNum, (dateMonthNum * 1 + 2), 0).getDate()
+            this.dataArea = []
+            this.getList()
+            this.getTotal()
+        },
+		dateClick(date) {
+			this.beginTime = date[0]
+			this.endTime = date[1]
+            this.dataArea2 = null
+			this.getList()
+            this.getTotal()
+            
+		},
+		/* 选项卡切换 */
+		dateTabToggle(index) {
+			this.params.pageNum = 1
+			this.dateTabIndex = index
+            this.params.supplierIdList = ''
+            this.params.supplierIdListCopy = ''
+            this.salesVolumeCompanyTotalType = null
+            this.dataArea2 = null
+			if (index === 0) {
+				let time = new Date().getTime()
+				this.beginTime = this.$dayjs(time).format('YYYY-MM-DD HH:mm:ss')
+				this.endTime = this.$dayjs(time).format('YYYY-MM-DD HH:mm:ss')
+				this.dataArea = [this.beginTime, this.endTime]
+			} else if (index === 1) {
+				let Nowdate = new Date()
+				let WeekFirstDay = Nowdate.getDay()
+					? new Date(Nowdate - (Nowdate.getDay() - 1) * 86400000)
+					: new Date(Nowdate - (Nowdate.getDay() + 6) * 86400000)
+				let WeekLastDay = new Date(
+					(WeekFirstDay / 1000 + 6 * 86400) * 1000
+				)
+				this.beginTime = this.$dayjs(WeekFirstDay).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.endTime = this.$dayjs(WeekLastDay).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.dataArea = [this.beginTime, this.endTime]
+			} else if (index === 2) {
+				let now = new Date() // 当前日期
+				let nowMonth = now.getMonth() // 当前月
+				let nowYear = now.getFullYear() // 当前年
+				// 本月的开始时间
+				let monthStartDate = new Date(nowYear, nowMonth, 1)
+				// 本月的结束时间
+				let monthEndDate = new Date(nowYear, nowMonth + 1, 0)
+				this.beginTime = this.$dayjs(monthStartDate).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.endTime = this.$dayjs(monthEndDate).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.dataArea = [this.beginTime, this.endTime]
+			} else if (index === 3) {
+				let now = new Date() // 当前日期
+				let nowYear = now.getFullYear() // 当前年
+				// 本年的开始时间
+				let monthStartDate = new Date(nowYear, 0, 1)
+				// 本年的结束时间
+				let monthEndDate = new Date(nowYear, 11, 31)
+				this.beginTime = this.$dayjs(monthStartDate).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.endTime = this.$dayjs(monthEndDate).format(
+					'YYYY-MM-DD HH:mm:ss'
+				)
+				this.dataArea = [this.beginTime, this.endTime]
+			}
+			this.getList()
+            this.getTotal()
+		},
+
+		changePage(pageNum) {
+			this.params.pageNum = pageNum
+			this.getList()
+		},
+		getList() {
+            this.$Spin.show()
+            axios.post('/stockWater/subscriptionAmountPage',{
+                ...this.params,
+            }).then(res=>{
+                console.log(res)
+                this.listData = res.data.data.records
+                this.params.total = res.data.data.total
+                this.$Spin.hide()
+            })
+		},
+        getTotal(){
+            axios.post('/stockWater/subscriptionAmountStatistics',{
+				 ...this.params,
+            }).then(res=>{
+                this.totalData = res.data.data
+                this.company = this.totalData.statisticsSupplier[0]
+                this.$Spin.hide()
+            })
+        },
+
+        
+	},
+	mounted() {
+		this.getList()
+        this.getTotal()
+	},
+}
+</script>
+<style lang="less">
+.purchaseTotal {
+    .big-num{
+        font-size: 20px;
+        font-weight: bold;
+        color: #000;
+    }
+	.total-header {
+		display: flex;
+		margin-top: 10px;
+		.card-warp {
+			line-height: 30px;
+			text-align: center;
+			ul {
+				display: flex;
+				li {
+					list-style: none;
+					width: 33.3%;
+					text-align: center;
+                    color:#666;
+				}
+			}
+		}
+	}
+}
+.date-filter-wrap {
+	display: flex;
+	align-items: center;
+	.date-filter {
+		width: 300px;
+		overflow: hidden;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		background-color: #ffffff;
+		border-radius: 4px;
+		&.other {
+			width: auto;
+			.date-tab {
+				white-space: nowrap;
+				padding: 9px;
+				.num {
+					font-weight: bold;
+					font-size: 14px;
+					&.red {
+						color: red;
+						cursor: pointer;
+						text-decoration: underline;
+					}
+				}
+				&.active {
+					background-color: #333333;
+				}
+			}
+		}
+
+		.date-tab {
+			flex: 1;
+			padding: 9px 4px;
+			line-height: 1;
+			text-align: center;
+			border: 1px solid #e6e6e6;
+			border-radius: 2px;
+			border-right: none;
+			cursor: pointer;
+			font-weight: 500;
+
+			&:first-child {
+				border-radius: 4px 0 0 4px;
+			}
+
+			&:last-child {
+				border-radius: 0 4px 4px 0;
+				border-right: 1px solid #e6e6e6;
+			}
+
+			&.active {
+				background-color: #3f92f9;
+				color: #ffffff;
+			}
+		}
+	}
+}
+</style>

+ 1068 - 944
src/view/store-manage/store-report/store-report.vue

@@ -1,964 +1,1088 @@
 <!-- 库存报表 -->
 <template>
-  <div class="container">
-    <Tabs :value="tabName" @on-click="tabClick">
-      <TabPane label="盘盈亏单" name="1">
-        <my-table ref="pykd" :data="data1" :columns="columns1" :table-filter="tableFilter1" :table-page="params1" @event-handle="eventHandle" @on-change="changePage"></my-table>
-      </TabPane>
-      <TabPane label="入库序时簿" name="2">
-        <my-table ref="rkxsb" :data="data2" :columns="columns2" :table-filter="tableFilter2" :table-page="params2" @event-handle="eventHandle" @on-change="changePage"></my-table>
-      </TabPane>
-      <TabPane label="领料序时簿" name="3">
-        <my-table ref="llsxb" :data="data3" :columns="columns3" :table-filter="tableFilter3" :table-page="params3" @event-handle="eventHandle" @on-change="changePage"></my-table>
-      </TabPane>
-      <TabPane label="物料收发汇总" name="4">
-        <my-table ref="wlsfhz" :data="data4" :columns="columns4" :border="true" :table-filter="tableFilter4" @event-handle="eventHandle" :is-show-page="false" @on-change="changePage"></my-table>
-      </TabPane>
-      <TabPane label="物料月汇总" name="5">
-        <my-table :data="data5" :columns="columns5" :border="true" :table-filter="tableFilter5" :table-page="params5" @event-handle="eventHandle" @on-change="changePage"></my-table>
-      </TabPane>
-      <TabPane label="物料进出信息" name="6">
-        <my-table ref="table" :data="data6" :columns="columns6" :table-filter="tableFilter6" @event-handle="eventHandle" :is-show-page="false" @on-change="changePage"></my-table>
-      </TabPane>
-    </Tabs>
-    <my-modal-material ref="materialModal" :multiple="true" v-model="show" @getselectedList="getselectedList"></my-modal-material>
-  </div>
+	<div class="container">
+		<div>
+      <div style="overflow: hidden;">
+        <date-select v-model="params7" @change="selectTime"></date-select>
+      </div>
+      <div style="height:500px">
+        <tree-table :data="data7" arrow-icon-right="ios-arrow-forward" arrow-icon-down="ios-arrow-down" :Columns="columns2" bottom-line border>
+			  </tree-table>
+      </div>
+		</div>
+		<Tabs :value="tabName" @on-click="tabClick">
+			<TabPane label="盘盈亏单" name="1">
+				<my-table
+					ref="pykd"
+					:data="data1"
+					:columns="columns1"
+					:table-filter="tableFilter1"
+					:table-page="params1"
+					@event-handle="eventHandle"
+					@on-change="changePage"
+				></my-table>
+			</TabPane>
+			<TabPane label="入库序时簿" name="2">
+				<my-table
+					ref="rkxsb"
+					:data="data2"
+					:columns="columns2"
+					:table-filter="tableFilter2"
+					:table-page="params2"
+					@event-handle="eventHandle"
+					@on-change="changePage"
+				></my-table>
+			</TabPane>
+			<TabPane label="领料序时簿" name="3">
+				<my-table
+					ref="llsxb"
+					:data="data3"
+					:columns="columns3"
+					:table-filter="tableFilter3"
+					:table-page="params3"
+					@event-handle="eventHandle"
+					@on-change="changePage"
+				></my-table>
+			</TabPane>
+			<TabPane label="物料收发汇总" name="4">
+				<my-table
+					ref="wlsfhz"
+					:data="data4"
+					:columns="columns4"
+					:border="true"
+					:table-filter="tableFilter4"
+					@event-handle="eventHandle"
+					:is-show-page="false"
+					@on-change="changePage"
+				></my-table>
+			</TabPane>
+			<TabPane label="物料月汇总" name="5">
+				<my-table
+					:data="data5"
+					:columns="columns5"
+					:border="true"
+					:table-filter="tableFilter5"
+					:table-page="params5"
+					@event-handle="eventHandle"
+					@on-change="changePage"
+				></my-table>
+			</TabPane>
+			<TabPane label="物料进出信息" name="6">
+				<my-table
+					ref="table"
+					:data="data6"
+					:columns="columns6"
+					:table-filter="tableFilter6"
+					@event-handle="eventHandle"
+					:is-show-page="false"
+					@on-change="changePage"
+				></my-table>
+			</TabPane>
+		</Tabs>
+		<my-modal-material
+			ref="materialModal"
+			:multiple="true"
+			v-model="show"
+			@getselectedList="getselectedList"
+		></my-modal-material>
+	</div>
 </template>
 
 <script>
 import { exportExcel } from '@/libs/util'
 import {
-  GetMonthStockCheck,
-  GetStockInDocumentList,
-  GetStockTakeDocumentList,
-  GetMaterialStockInOutSum,
-  GetMaterialMonthSum,
-  GetStockWaterInOut
+	GetMonthStockCheck,
+	GetStockInDocumentList,
+	GetStockTakeDocumentList,
+	GetMaterialStockInOutSum,
+	GetMaterialMonthSum,
+	GetStockWaterInOut,
 } from '@/api/stock'
 import MyTable from '_c/my-table/my-table'
 import MyModalMaterial from '_c/my-modal-form/my-modal-material'
+import TreeTable from 'iview-tree-table'
+import axios from 'axios'
+import  dateSelect  from '@/components/dateSelect/dateSelect'
 export default {
-  name: 'store_report',
-  components: {
-    MyTable,
-    MyModalMaterial
-  },
-  data () {
-    return {
-      tabName: '1',
-      formData: {},
-      show: false,
-      data1: [],
-      data2: [],
-      data3: [],
-      data4: [],
-      data5: [],
-      data6: [],
-      columns1: [
-        {
-          title: '序号',
-          type: 'index',
-          width: 60,
-          align: 'center'
-        },
-        {
-          title: '盘点日期',
-          key: 'checkTime',
-          minWidth: 150
-        },
-        {
-          title: '盘点人',
-          key: 'userName',
-          minWidth: 150
-        },
-        {
-          title: '审核日期',
-          key: 'approvalTime',
-          minWidth: 150
-        },
-        {
-          title: '物料编码',
-          key: 'materialCode',
-          minWidth: 150
-        },
-        {
-          title: '物料名称',
-          key: 'materialName',
-          minWidth: 150
-        },
-        {
-          title: '物料规格',
-          key: 'spec',
-          minWidth: 150
-        },
-        {
-          title: '单位',
-          key: 'untilName',
-          minWidth: 150
-        },
-        {
-          title: '账存数量',
-          key: 'stockQty',
-          minWidth: 150
-        },
-        {
-          title: '实存数量',
-          key: 'actualQty',
-          minWidth: 150
-        },
-        {
-          title: '盘盈/亏',
-          key: 'checkDiffQty',
-          minWidth: 150
-        },
-        {
-          title: '单价',
-          key: 'price',
-          minWidth: 150
-        },
-        {
-          title: '盘盈/亏金额',
-          key: 'checkDiffAmout',
-          minWidth: 150
-        }
-      ],
-      columns2: [
-        {
-          title: '序号',
-          type: 'index',
-          width: 60,
-          align: 'center'
-        },
-        {
-          title: '物料编码',
-          key: 'materialCode',
-          minWidth: 150
-        },
-        {
-          title: '物料名称',
-          key: 'materialName',
-          minWidth: 150
-        },
-        {
-          title: '物料规格',
-          key: 'spec',
-          minWidth: 150
-        },
-        {
-          title: '采购合同号',
-          key: 'purchaseBillNo',
-          minWidth: 150
-        },
-        {
-          title: '供应商',
-          key: 'supplierName',
-          minWidth: 150
-        },
-        {
-          title: '单位',
-          key: 'untilName',
-          minWidth: 150
-        },
-        {
-          title: '应收数量',
-          key: 'quantity',
-          minWidth: 150
-        },
-        {
-          title: '单价',
-          key: 'price',
-          minWidth: 150
-        },
-        {
-          title: '到货日期',
-          key: 'arriveTime',
-          minWidth: 150
-        },
-        {
-          title: '到货数量',
-          key: 'arriveQty',
-          minWidth: 150
-        },
-        {
-          title: '金额',
-          key: 'amount',
-          minWidth: 150
-        }
-      ],
-      columns3: [
-        {
-          title: '序号',
-          type: 'index',
-          width: 60,
-          align: 'center'
-        },
-        {
-          title: '日期',
-          key: 'createdTime',
-          minWidth: 150
-        },
-        {
-          title: '物料类型',
-          key: 'materialCategoryName',
-          minWidth: 150
-        },
-        {
-          title: '物料编码',
-          key: 'materialCode',
-          minWidth: 150
-        },
-        {
-          title: '物料名称',
-          key: 'materialName',
-          minWidth: 150
-        },
-        {
-          title: '物料规格',
-          key: 'spec',
-          minWidth: 150
-        },
-        {
-          title: '单位',
-          key: 'untilName',
-          minWidth: 150
-        },
-        {
-          title: '领料数量',
-          key: 'quantity',
-          minWidth: 150
-        },
-        {
-          title: '单价',
-          key: 'price',
-          minWidth: 150
-        },
-        {
-          title: '金额',
-          key: 'amount',
-          minWidth: 150
-        },
-        {
-          title: '人员',
-          key: 'userName',
-          minWidth: 150
-        },
-        {
-          title: '备注',
-          key: 'remark',
-          minWidth: 150
-        }
-      ],
-      columns4: [
-        {
-          title: '会计期间',
-          key: 'accPeriod',
-          minWidth: 150
-        },
-        {
-          title: '物料编码',
-          key: 'materialCode',
-          minWidth: 150
-        },
-        {
-          title: '物料名称',
-          key: 'materialName',
-          minWidth: 150
-        },
-        {
-          title: '单位',
-          key: 'untilName',
-          minWidth: 100
-        },
-        {
-          title: '初期存结',
-          align: 'center',
-          children: [
-            {
-              title: '单价',
-              key: 'beginBalancePrice',
-              minWidth: 100
-            },
-            {
-              title: '数量',
-              key: 'beginBalanceQty',
-              minWidth: 100
-            },
-            {
-              title: '金额',
-              key: 'beginBalanceAmount',
-              minWidth: 100
-            }
-          ]
-        },
-        {
-          title: '本期收入',
-          align: 'center',
-          children: [
-            {
-              title: '单价',
-              key: 'curIncomePrice',
-              minWidth: 100
-            },
-            {
-              title: '数量',
-              key: 'curIncomeQty',
-              minWidth: 100
-            },
-            {
-              title: '金额',
-              key: 'curIncomeAmount',
-              minWidth: 100
-            }
-          ]
-        },
-        {
-          title: '本期发出',
-          align: 'center',
-          children: [
-            {
-              title: '单价',
-              key: 'curSendPrice',
-              minWidth: 100
-            },
-            {
-              title: '数量',
-              key: 'curSendQty',
-              minWidth: 100
-            },
-            {
-              title: '金额',
-              key: 'curSendAmount',
-              minWidth: 100
-            }
-          ]
-        },
-        {
-          title: '本期存结',
-          align: 'center',
-          children: [
-            {
-              title: '单价',
-              key: 'curBalancePrice',
-              minWidth: 100
-            },
-            {
-              title: '数量',
-              key: 'curBalanceQty',
-              minWidth: 100
-            },
-            {
-              title: '金额',
-              key: 'curBalanceAmount',
-              minWidth: 100
-            }
-          ]
-        }
-      ],
-      columns_4: [
-        {
-          title: '会计期间',
-          key: 'accPeriod',
-          minWidth: 150
-        },
-        {
-          title: '物料编码',
-          key: 'materialCode',
-          minWidth: 150
-        },
-        {
-          title: '物料名称',
-          key: 'materialName',
-          minWidth: 150
-        },
-        {
-          title: '单位',
-          key: 'untilName',
-          minWidth: 100
-        },
-        {
-          title: '单价',
-          key: 'beginBalancePrice',
-          minWidth: 100
-        },
-        {
-          title: '数量',
-          key: 'beginBalanceQty',
-          minWidth: 100
-        },
-        {
-          title: '金额',
-          key: 'beginBalanceAmount',
-          minWidth: 100
-        },
-        {
-          title: '单价',
-          key: 'curIncomePrice',
-          minWidth: 100
-        },
-        {
-          title: '数量',
-          key: 'curIncomeQty',
-          minWidth: 100
-        },
-        {
-          title: '金额',
-          key: 'curIncomeAmount',
-          minWidth: 100
-        },
-        {
-          title: '单价',
-          key: 'curSendPrice',
-          minWidth: 100
-        },
-        {
-          title: '数量',
-          key: 'curSendQty',
-          minWidth: 100
-        },
-        {
-          title: '金额',
-          key: 'curSendAmount',
-          minWidth: 100
-        },
-        {
-          title: '单价',
-          key: 'curBalancePrice',
-          minWidth: 100
-        },
-        {
-          title: '数量',
-          key: 'curBalanceQty',
-          minWidth: 100
-        },
-        {
-          title: '金额',
-          key: 'curBalanceAmount',
-          minWidth: 100
-        }
-      ],
-      columns5: [
-        {
-          title: '物料编码',
-          key: 'materialCode',
-          align: 'center',
-          minWidth: 150
-        },
-        {
-          title: '物料名称',
-          key: 'materialName',
-          align: 'center',
-          minWidth: 150
-        },
-        {
-          title: '实时库存',
-          key: 'quantity',
-          align: 'center',
-          minWidth: 150
-        },
-        {
-          title: '单位',
-          key: 'untilName',
-          align: 'center',
-          minWidth: 100
-        },
-        {
-          title: '领用数量',
-          align: 'center',
-          children: [
-            {
-              title: this.$dayjs().format('YYYY-MM'),
-              key: 'firstTakeQty',
-              align: 'center',
-              minWidth: 100
-            },
-            {
-              title: this.$dayjs(new Date().setMonth(new Date().getMonth() - 1)).format('YYYY-MM'),
-              key: 'secTakeQty',
-              align: 'center',
-              minWidth: 100
-            },
-            {
-              title: this.$dayjs(new Date().setMonth(new Date().getMonth() - 2)).format('YYYY-MM'),
-              key: 'threeTakeQty',
-              align: 'center',
-              minWidth: 100
-            }
-          ]
-        },
-        {
-          title: '近三月平均用量',
-          key: 'nearlyAverTakeQty',
-          align: 'center',
-          minWidth: 100
-        },
-        {
-          title: '采购周期(天)',
-          key: 'safetyWarnDay',
-          align: 'center',
-          minWidth: 100
-        },
-        {
-          title: '单次申购数量',
-          key: 'averPurchaseQty',
-          align: 'center',
-          minWidth: 100
-        }
-      ],
-      columns6: [
-        {
-          title: '月份',
-          key: 'month',
-          minWidth: 100
-        },
-        {
-          title: '日期',
-          key: 'date',
-          minWidth: 150
-        },
-        {
-          title: '单据号',
-          key: 'billNo',
-          minWidth: 150
-        },
-        {
-          title: '物料编码',
-          key: 'materialCode',
-          minWidth: 150
-        },
-        {
-          title: '物料名称',
-          key: 'materialName',
-          minWidth: 150
-        },
-        {
-          title: '物料规格',
-          key: 'spec',
-          minWidth: 150
-        },
-        {
-          title: '单位',
-          key: 'unitName',
-          minWidth: 150
-        },
-        {
-          title: '类型',
-          key: 'billTypeStr',
-          minWidth: 150
-        },
-        {
-          title: '收入数量',
-          key: 'incomeQty',
-          minWidth: 150
-        },
-        {
-          title: '收入单价',
-          key: 'incomePrice',
-          minWidth: 150
-        },
-        {
-          title: '收入金额',
-          key: 'incomeAmount',
-          minWidth: 150
-        },
-        {
-          title: '发出数量',
-          key: 'sendQty',
-          minWidth: 150
-        },
-        {
-          title: '发出单价',
-          key: 'sendPrice',
-          minWidth: 150
-        },
-        {
-          title: '发出金额',
-          key: 'sendAmount',
-          minWidth: 150
-        },
-        {
-          title: '结存数量',
-          key: 'balanceQty',
-          minWidth: 150
-        },
-        {
-          title: '结存金额',
-          key: 'balanceAmount',
-          minWidth: 150
-        }
-      ],
-      tableFilter1: [
-        {
-          name: 'Input',
-          value: 'workKey',
-          placeholder: '请输入关键字'
-        },
-        {
-          name: 'DatePicker',
-          value: 'yearMonth',
-          placeholder: '请选择日期',
-          type: 'month',
-          unClearable: true
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '查询',
-          e: 'search'
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '导出Excel',
-          e: 'export'
-        }
-      ],
-      tableFilter2: [
-        {
-          name: 'Input',
-          value: 'workKey',
-          placeholder: '请输入关键字'
-        },
-        {
-          name: 'DatePicker',
-          value: 'yearMonth',
-          placeholder: '请选择日期',
-          type: 'month',
-          unClearable: true
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '查询',
-          e: 'search'
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '导出Excel',
-          e: 'export'
-        }
-      ],
-      tableFilter3: [
-        {
-          name: 'Input',
-          value: 'workKey',
-          placeholder: '请输入关键字'
-        },
-        {
-          name: 'DatePicker',
-          value: 'yearMonth',
-          placeholder: '请选择日期',
-          unClearable: true,
-          type: 'month'
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '查询',
-          e: 'search'
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '导出Excel',
-          e: 'export'
-        }
-      ],
-      tableFilter4: [
-        {
-          name: 'Input',
-          value: 'workKey',
-          placeholder: '请输入关键字'
-        },
-        {
-          name: 'DatePicker',
-          value: 'yearMonth',
-          placeholder: '请选择日期',
-          type: 'month',
-          unClearable: true
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '查询',
-          e: 'search'
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '导出Excel',
-          e: 'export'
-        }
-      ],
-      tableFilter5: [
-        {
-          name: 'Input',
-          value: 'workKey',
-          placeholder: '请输入关键字'
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '查询',
-          e: 'search'
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '导出Excel',
-          e: 'export'
-        }
-      ],
-      tableFilter6: [
-        {
-          name: 'Input',
-          value: 'materialCode',
-          placeholder: '请选择物料',
-          icon: 'ios-add-circle-outline',
-          e: 'showMaterial'
-        },
-        {
-          name: 'DatePicker',
-          value: 'yearMonth',
-          placeholder: '请选择日期',
-          type: 'month',
-          unClearable: true
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '查询',
-          e: 'search'
-        },
-        {
-          name: 'Button',
-          type: 'primary',
-          text: '导出Excel',
-          e: 'export'
-        }
-      ],
-      params1: {
-        pageIndex: 1,
-        pageSize: 20,
-        total: 0
-      },
-      params2: {
-        pageIndex: 1,
-        pageSize: 20,
-        total: 0
-      },
-      params3: {
-        pageIndex: 1,
-        pageSize: 20,
-        total: 0
-      },
-      params4: {},
-      params5: {
-        pageIndex: 1,
-        pageSize: 20,
-        total: 0
-      },
-      params6: {}
-    }
-  },
-  methods: {
-    tabClick (name) {
-      this.tabName = name
-      if (this.tabName === '1') {
-        this.$refs.pykd.setModel('yearMonth', new Date())
-      } else if (this.tabName === '2') {
-        this.$refs.rkxsb.setModel('yearMonth', new Date())
-      } else if (this.tabName === '3') {
-        this.$refs.llsxb.setModel('yearMonth', new Date())
-      } else if (this.tabName === '4') {
-        this.$refs.wlsfhz.setModel('yearMonth', new Date())
-      } else if (this.tabName === '6') {
-        this.$refs.table.setModel('yearMonth', new Date())
-      } // 物料进出信息要选择物料所以默认不查找列表
-      if (this.tabName !== '6') {
-        this.getList()
-      }
-    },
-    cfm (type, formData) {
-      if (type === 'add') {
-        FacPriceAdd({
-          ...formData,
-          materialCode: formData.code
-        }).then(res => {
-          if (res.code === 0) {
-            this.$Message.info(res.msg)
-            this.getList()
-          }
-        })
-      } else if (type === 'edit') {
-        FacPriceChange({
-          ...formData,
-          factoryPriceId: formData.id
-        }).then(res => {
-          if (res.code === 0) {
-            this.$Message.info(res.msg)
-            this.getList()
-          }
-        })
-      }
-    },
-    getselectedList (list, multiple) {
-      console.log('????????????????????-----')
-      console.log(list)
-      console.log(multiple)
-      this.$refs.table.setModel('materialCode', list[0].code)
-      this.params6.materialCode = list[0].code
-    },
-    // 检索条件事件处理
-    eventHandle (option) {
-      switch (option._evnet) {
-        case 'search':
-          this['params' + this.tabName].pageIndex = 1
-          this['params' + this.tabName].workKey = option.workKey
-          this['params' + this.tabName].yearMonth = option.yearMonth
-          if (this.tabName === '6') {
-            this.params6.materialCode = option.materialCode
-          }
-          let date = new Date(this.$dayjs(option.yearMonth).format('YYYY-MM')).getTime()
-          let now = new Date(this.$dayjs().format('YYYY-MM')).getTime()
-          if (date > now) {
-            return this.$Message.error('日期不可大于当前月')
-          }
-          this.getList()
-          break
-        case 'export':
-          if (this[`data${this.tabName}`].length < 1) return this.$Message.error('数据为空!')
-          // exportExcel(this[`columns${this.tabName}`], this[`data${this.tabName}`], '库存报表')
-          if (this.tabName === '1') {
-            GetMonthStockCheck({
-              ...this.params1,
-              pageIndex: 1,
-              pageSize: 99999
-            }).then(res => {
-              if (res.code === 0) {
-                exportExcel(this[`columns${this.tabName}`], res.result.list, '盘盈亏单')
-              }
-            })
-          } else if (this.tabName === '2') {
-            GetStockInDocumentList({
-              ...this.params2,
-              pageIndex: 1,
-              pageSize: 99999
-            }).then(res => {
-              if (res.code === 0) {
-                exportExcel(this[`columns${this.tabName}`], res.result.list, '入库序时簿')
-              }
-            })
-          } else if (this.tabName === '3') {
-            GetStockTakeDocumentList({
-              ...this.params3,
-              pageIndex: 1,
-              pageSize: 9999
-            }).then(res => {
-              if (res.code === 0) {
-                exportExcel(this[`columns${this.tabName}`], res.result.list, '领料序时簿')
-              }
-            })
-          } else if (this.tabName === '4') {
-            GetMaterialStockInOutSum({
-              ...this.params4,
-              pageIndex: 1,
-              pageSize: 99999
-            }).then(res => {
-              if (res.code === 0) {
-                exportExcel(this.columns_4, res.result, '物料收发汇总')
-              }
-            })
-          } else if (this.tabName === '5') {
-            GetMaterialMonthSum({
-              ...this.params5,
-              pageIndex: 1,
-              pageSize: 99999
-            }).then(res => {
-              if (res.code === 0) {
-                exportExcel(this[`columns${this.tabName}`], res.result.list, '物料月汇总')
-              }
-            })
-          } else if (this.tabName === '6') {
-            GetStockWaterInOut({
-              ...this.params6,
-              pageIndex: 1,
-              pageSize: 99999
-            }).then(res => {
-              if (res.code === 0) {
-                exportExcel(this[`columns${this.tabName}`], res.result.list, '物料进出信息')
-              }
-            })
-          }
-          break
-        case 'showMaterial':
-          this.show = true
-          break
-      }
-    },
-    changePage (pageIndex) {
-      this['params' + this.tabName].pageIndex = pageIndex
-      this.getList()
-    },
-    getList () {
-      this['data' + this.tabName] = []
-      if (this.tabName === '1') {
-        GetMonthStockCheck(this.params1).then(res => {
-          if (res.code === 0) {
-            this.data1 = res.result.list
-            this.params1.total = res.result.totalCount
-          }
-        })
-      } else if (this.tabName === '2') {
-        GetStockInDocumentList(this.params2).then(res => {
-          if (res.code === 0) {
-            this.data2 = res.result.list
-            this.params2.total = res.result.totalCount
-          }
-        })
-      } else if (this.tabName === '3') {
-        GetStockTakeDocumentList(this.params3).then(res => {
-          if (res.code === 0) {
-            this.data3 = res.result.list
-            this.params3.total = res.result.totalCount
-          }
-        })
-      } else if (this.tabName === '4') {
-        GetMaterialStockInOutSum(this.params4).then(res => {
-          if (res.code === 0) {
-            this.data4 = res.result
-          }
-        })
-      } else if (this.tabName === '5') {
-        GetMaterialMonthSum(this.params5).then(res => {
-          if (res.code === 0) {
-            this.data5 = res.result.list
-            this.params5.total = res.result.totalCount
-          }
-        })
-      } else if (this.tabName === '6') {
-        GetStockWaterInOut(this.params6).then(res => {
-          if (res.code === 0) {
-            this.data6 = res.result.list
-          }
-        })
-      }
-    }
-  },
-  mounted () {
-    this.tabClick('1')
-  }
+	name: 'store_report',
+	components: {
+		MyTable,
+		MyModalMaterial,
+		TreeTable,
+    dateSelect
+	},
+	data() {
+		return {
+			tabName: '1',
+			formData: {},
+			show: false,
+			data1: [],
+			data2: [],
+			data3: [],
+			data4: [],
+			data5: [],
+			data6: [],
+      data7:[],
+			columns1: [
+				{
+					title: '序号',
+					type: 'index',
+					width: 60,
+					align: 'center',
+				},
+				{
+					title: '盘点日期',
+					key: 'checkTime',
+					minWidth: 150,
+				},
+				{
+					title: '盘点人',
+					key: 'userName',
+					minWidth: 150,
+				},
+				{
+					title: '审核日期',
+					key: 'approvalTime',
+					minWidth: 150,
+				},
+				{
+					title: '物料编码',
+					key: 'materialCode',
+					minWidth: 150,
+				},
+				{
+					title: '物料名称',
+					key: 'materialName',
+					minWidth: 150,
+				},
+				{
+					title: '物料规格',
+					key: 'spec',
+					minWidth: 150,
+				},
+				{
+					title: '单位',
+					key: 'untilName',
+					minWidth: 150,
+				},
+				{
+					title: '账存数量',
+					key: 'stockQty',
+					minWidth: 150,
+				},
+				{
+					title: '实存数量',
+					key: 'actualQty',
+					minWidth: 150,
+				},
+				{
+					title: '盘盈/亏',
+					key: 'checkDiffQty',
+					minWidth: 150,
+				},
+				{
+					title: '单价',
+					key: 'price',
+					minWidth: 150,
+				},
+				{
+					title: '盘盈/亏金额',
+					key: 'checkDiffAmout',
+					minWidth: 150,
+				},
+			],
+			columns2: [
+				{
+					title: '序号',
+					type: 'index',
+					width: 60,
+					align: 'center',
+				},
+				{
+					title: '物料编码',
+					key: 'materialCode',
+					minWidth: 150,
+				},
+				{
+					title: '物料名称',
+					key: 'materialName',
+					minWidth: 150,
+				},
+				{
+					title: '物料规格',
+					key: 'spec',
+					minWidth: 150,
+				},
+				{
+					title: '采购合同号',
+					key: 'purchaseBillNo',
+					minWidth: 150,
+				},
+				{
+					title: '供应商',
+					key: 'supplierName',
+					minWidth: 150,
+				},
+				{
+					title: '单位',
+					key: 'untilName',
+					minWidth: 150,
+				},
+				{
+					title: '应收数量',
+					key: 'quantity',
+					minWidth: 150,
+				},
+				{
+					title: '单价',
+					key: 'price',
+					minWidth: 150,
+				},
+				{
+					title: '到货日期',
+					key: 'arriveTime',
+					minWidth: 150,
+				},
+				{
+					title: '到货数量',
+					key: 'arriveQty',
+					minWidth: 150,
+				},
+				{
+					title: '金额',
+					key: 'amount',
+					minWidth: 150,
+				},
+			],
+			columns3: [
+				{
+					title: '序号',
+					type: 'index',
+					width: 60,
+					align: 'center',
+				},
+				{
+					title: '日期',
+					key: 'createdTime',
+					minWidth: 150,
+				},
+				{
+					title: '物料类型',
+					key: 'materialCategoryName',
+					minWidth: 150,
+				},
+				{
+					title: '物料编码',
+					key: 'materialCode',
+					minWidth: 150,
+				},
+				{
+					title: '物料名称',
+					key: 'materialName',
+					minWidth: 150,
+				},
+				{
+					title: '物料规格',
+					key: 'spec',
+					minWidth: 150,
+				},
+				{
+					title: '单位',
+					key: 'untilName',
+					minWidth: 150,
+				},
+				{
+					title: '领料数量',
+					key: 'quantity',
+					minWidth: 150,
+				},
+				{
+					title: '单价',
+					key: 'price',
+					minWidth: 150,
+				},
+				{
+					title: '金额',
+					key: 'amount',
+					minWidth: 150,
+				},
+				{
+					title: '人员',
+					key: 'userName',
+					minWidth: 150,
+				},
+				{
+					title: '备注',
+					key: 'remark',
+					minWidth: 150,
+				},
+			],
+			columns4: [
+				{
+					title: '会计期间',
+					key: 'accPeriod',
+					minWidth: 150,
+				},
+				{
+					title: '物料编码',
+					key: 'materialCode',
+					minWidth: 150,
+				},
+				{
+					title: '物料名称',
+					key: 'materialName',
+					minWidth: 150,
+				},
+				{
+					title: '单位',
+					key: 'untilName',
+					minWidth: 100,
+				},
+				{
+					title: '初期存结',
+					align: 'center',
+					children: [
+						{
+							title: '单价',
+							key: 'beginBalancePrice',
+							minWidth: 100,
+						},
+						{
+							title: '数量',
+							key: 'beginBalanceQty',
+							minWidth: 100,
+						},
+						{
+							title: '金额',
+							key: 'beginBalanceAmount',
+							minWidth: 100,
+						},
+					],
+				},
+				{
+					title: '本期收入',
+					align: 'center',
+					children: [
+						{
+							title: '单价',
+							key: 'curIncomePrice',
+							minWidth: 100,
+						},
+						{
+							title: '数量',
+							key: 'curIncomeQty',
+							minWidth: 100,
+						},
+						{
+							title: '金额',
+							key: 'curIncomeAmount',
+							minWidth: 100,
+						},
+					],
+				},
+				{
+					title: '本期发出',
+					align: 'center',
+					children: [
+						{
+							title: '单价',
+							key: 'curSendPrice',
+							minWidth: 100,
+						},
+						{
+							title: '数量',
+							key: 'curSendQty',
+							minWidth: 100,
+						},
+						{
+							title: '金额',
+							key: 'curSendAmount',
+							minWidth: 100,
+						},
+					],
+				},
+				{
+					title: '本期存结',
+					align: 'center',
+					children: [
+						{
+							title: '单价',
+							key: 'curBalancePrice',
+							minWidth: 100,
+						},
+						{
+							title: '数量',
+							key: 'curBalanceQty',
+							minWidth: 100,
+						},
+						{
+							title: '金额',
+							key: 'curBalanceAmount',
+							minWidth: 100,
+						},
+					],
+				},
+			],
+			columns_4: [
+				{
+					title: '会计期间',
+					key: 'accPeriod',
+					minWidth: 150,
+				},
+				{
+					title: '物料编码',
+					key: 'materialCode',
+					minWidth: 150,
+				},
+				{
+					title: '物料名称',
+					key: 'materialName',
+					minWidth: 150,
+				},
+				{
+					title: '单位',
+					key: 'untilName',
+					minWidth: 100,
+				},
+				{
+					title: '单价',
+					key: 'beginBalancePrice',
+					minWidth: 100,
+				},
+				{
+					title: '数量',
+					key: 'beginBalanceQty',
+					minWidth: 100,
+				},
+				{
+					title: '金额',
+					key: 'beginBalanceAmount',
+					minWidth: 100,
+				},
+				{
+					title: '单价',
+					key: 'curIncomePrice',
+					minWidth: 100,
+				},
+				{
+					title: '数量',
+					key: 'curIncomeQty',
+					minWidth: 100,
+				},
+				{
+					title: '金额',
+					key: 'curIncomeAmount',
+					minWidth: 100,
+				},
+				{
+					title: '单价',
+					key: 'curSendPrice',
+					minWidth: 100,
+				},
+				{
+					title: '数量',
+					key: 'curSendQty',
+					minWidth: 100,
+				},
+				{
+					title: '金额',
+					key: 'curSendAmount',
+					minWidth: 100,
+				},
+				{
+					title: '单价',
+					key: 'curBalancePrice',
+					minWidth: 100,
+				},
+				{
+					title: '数量',
+					key: 'curBalanceQty',
+					minWidth: 100,
+				},
+				{
+					title: '金额',
+					key: 'curBalanceAmount',
+					minWidth: 100,
+				},
+			],
+			columns5: [
+				{
+					title: '物料编码',
+					key: 'materialCode',
+					align: 'center',
+					minWidth: 150,
+				},
+				{
+					title: '物料名称',
+					key: 'materialName',
+					align: 'center',
+					minWidth: 150,
+				},
+				{
+					title: '实时库存',
+					key: 'quantity',
+					align: 'center',
+					minWidth: 150,
+				},
+				{
+					title: '单位',
+					key: 'untilName',
+					align: 'center',
+					minWidth: 100,
+				},
+				{
+					title: '领用数量',
+					align: 'center',
+					children: [
+						{
+							title: this.$dayjs().format('YYYY-MM'),
+							key: 'firstTakeQty',
+							align: 'center',
+							minWidth: 100,
+						},
+						{
+							title: this.$dayjs(
+								new Date().setMonth(new Date().getMonth() - 1)
+							).format('YYYY-MM'),
+							key: 'secTakeQty',
+							align: 'center',
+							minWidth: 100,
+						},
+						{
+							title: this.$dayjs(
+								new Date().setMonth(new Date().getMonth() - 2)
+							).format('YYYY-MM'),
+							key: 'threeTakeQty',
+							align: 'center',
+							minWidth: 100,
+						},
+					],
+				},
+				{
+					title: '近三月平均用量',
+					key: 'nearlyAverTakeQty',
+					align: 'center',
+					minWidth: 100,
+				},
+				{
+					title: '采购周期(天)',
+					key: 'safetyWarnDay',
+					align: 'center',
+					minWidth: 100,
+				},
+				{
+					title: '单次申购数量',
+					key: 'averPurchaseQty',
+					align: 'center',
+					minWidth: 100,
+				},
+			],
+			columns6: [
+				{
+					title: '月份',
+					key: 'month',
+					minWidth: 100,
+				},
+				{
+					title: '日期',
+					key: 'date',
+					minWidth: 150,
+				},
+				{
+					title: '单据号',
+					key: 'billNo',
+					minWidth: 150,
+				},
+				{
+					title: '物料编码',
+					key: 'materialCode',
+					minWidth: 150,
+				},
+				{
+					title: '物料名称',
+					key: 'materialName',
+					minWidth: 150,
+				},
+				{
+					title: '物料规格',
+					key: 'spec',
+					minWidth: 150,
+				},
+				{
+					title: '单位',
+					key: 'unitName',
+					minWidth: 150,
+				},
+				{
+					title: '类型',
+					key: 'billTypeStr',
+					minWidth: 150,
+				},
+				{
+					title: '收入数量',
+					key: 'incomeQty',
+					minWidth: 150,
+				},
+				{
+					title: '收入单价',
+					key: 'incomePrice',
+					minWidth: 150,
+				},
+				{
+					title: '收入金额',
+					key: 'incomeAmount',
+					minWidth: 150,
+				},
+				{
+					title: '发出数量',
+					key: 'sendQty',
+					minWidth: 150,
+				},
+				{
+					title: '发出单价',
+					key: 'sendPrice',
+					minWidth: 150,
+				},
+				{
+					title: '发出金额',
+					key: 'sendAmount',
+					minWidth: 150,
+				},
+				{
+					title: '结存数量',
+					key: 'balanceQty',
+					minWidth: 150,
+				},
+				{
+					title: '结存金额',
+					key: 'balanceAmount',
+					minWidth: 150,
+				},
+			],
+			tableFilter1: [
+				{
+					name: 'Input',
+					value: 'workKey',
+					placeholder: '请输入关键字',
+				},
+				{
+					name: 'DatePicker',
+					value: 'yearMonth',
+					placeholder: '请选择日期',
+					type: 'month',
+					unClearable: true,
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '查询',
+					e: 'search',
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '导出Excel',
+					e: 'export',
+				},
+			],
+			tableFilter2: [
+				{
+					name: 'Input',
+					value: 'workKey',
+					placeholder: '请输入关键字',
+				},
+				{
+					name: 'DatePicker',
+					value: 'yearMonth',
+					placeholder: '请选择日期',
+					type: 'month',
+					unClearable: true,
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '查询',
+					e: 'search',
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '导出Excel',
+					e: 'export',
+				},
+			],
+			tableFilter3: [
+				{
+					name: 'Input',
+					value: 'workKey',
+					placeholder: '请输入关键字',
+				},
+				{
+					name: 'DatePicker',
+					value: 'yearMonth',
+					placeholder: '请选择日期',
+					unClearable: true,
+					type: 'month',
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '查询',
+					e: 'search',
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '导出Excel',
+					e: 'export',
+				},
+			],
+			tableFilter4: [
+				{
+					name: 'Input',
+					value: 'workKey',
+					placeholder: '请输入关键字',
+				},
+				{
+					name: 'DatePicker',
+					value: 'yearMonth',
+					placeholder: '请选择日期',
+					type: 'month',
+					unClearable: true,
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '查询',
+					e: 'search',
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '导出Excel',
+					e: 'export',
+				},
+			],
+			tableFilter5: [
+				{
+					name: 'Input',
+					value: 'workKey',
+					placeholder: '请输入关键字',
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '查询',
+					e: 'search',
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '导出Excel',
+					e: 'export',
+				},
+			],
+			tableFilter6: [
+				{
+					name: 'Input',
+					value: 'materialCode',
+					placeholder: '请选择物料',
+					icon: 'ios-add-circle-outline',
+					e: 'showMaterial',
+				},
+				{
+					name: 'DatePicker',
+					value: 'yearMonth',
+					placeholder: '请选择日期',
+					type: 'month',
+					unClearable: true,
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '查询',
+					e: 'search',
+				},
+				{
+					name: 'Button',
+					type: 'primary',
+					text: '导出Excel',
+					e: 'export',
+				},
+			],
+			params1: {
+				pageIndex: 1,
+				pageSize: 20,
+				total: 0,
+			},
+			params2: {
+				pageIndex: 1,
+				pageSize: 20,
+				total: 0,
+			},
+			params3: {
+				pageIndex: 1,
+				pageSize: 20,
+				total: 0,
+			},
+			params4: {},
+			params5: {
+				pageIndex: 1,
+				pageSize: 20,
+				total: 0,
+			},
+			params6: {},
+      params7: {
+				pageNum: 1,
+				pageSize: 10,
+				total: 0,
+        beginTime:null,
+        endTime:null,
+			},
+		}
+	},
+	methods: {
+    selectTime(){},
+		getPickingPage() {
+
+			axios.post('/stockWater/getPickingStatistics', {
+					...this.params,
+				})
+				.then((res) => {
+          
+					//this.data7 = [{}]
+					console.log(this.data7)
+					
+				})
+		},
+		tabClick(name) {
+			this.tabName = name
+			if (this.tabName === '1') {
+				this.$refs.pykd.setModel('yearMonth', new Date())
+			} else if (this.tabName === '2') {
+				this.$refs.rkxsb.setModel('yearMonth', new Date())
+			} else if (this.tabName === '3') {
+				this.$refs.llsxb.setModel('yearMonth', new Date())
+			} else if (this.tabName === '4') {
+				this.$refs.wlsfhz.setModel('yearMonth', new Date())
+			} else if (this.tabName === '6') {
+				this.$refs.table.setModel('yearMonth', new Date())
+			} // 物料进出信息要选择物料所以默认不查找列表
+			if (this.tabName !== '6') {
+				this.getList()
+			}
+		},
+		cfm(type, formData) {
+			if (type === 'add') {
+				FacPriceAdd({
+					...formData,
+					materialCode: formData.code,
+				}).then((res) => {
+					if (res.code === 0) {
+						this.$Message.info(res.msg)
+						this.getList()
+					}
+				})
+			} else if (type === 'edit') {
+				FacPriceChange({
+					...formData,
+					factoryPriceId: formData.id,
+				}).then((res) => {
+					if (res.code === 0) {
+						this.$Message.info(res.msg)
+						this.getList()
+					}
+				})
+			}
+		},
+		getselectedList(list, multiple) {
+			console.log('????????????????????-----')
+			console.log(list)
+			console.log(multiple)
+			this.$refs.table.setModel('materialCode', list[0].code)
+			this.params6.materialCode = list[0].code
+		},
+		// 检索条件事件处理
+		eventHandle(option) {
+			switch (option._evnet) {
+				case 'search':
+					this['params' + this.tabName].pageIndex = 1
+					this['params' + this.tabName].workKey = option.workKey
+					this['params' + this.tabName].yearMonth = option.yearMonth
+					if (this.tabName === '6') {
+						this.params6.materialCode = option.materialCode
+					}
+					let date = new Date(
+						this.$dayjs(option.yearMonth).format('YYYY-MM')
+					).getTime()
+					let now = new Date(
+						this.$dayjs().format('YYYY-MM')
+					).getTime()
+					if (date > now) {
+						return this.$Message.error('日期不可大于当前月')
+					}
+					this.getList()
+					break
+				case 'export':
+					if (this[`data${this.tabName}`].length < 1)
+						return this.$Message.error('数据为空!')
+					// exportExcel(this[`columns${this.tabName}`], this[`data${this.tabName}`], '库存报表')
+					if (this.tabName === '1') {
+						GetMonthStockCheck({
+							...this.params1,
+							pageIndex: 1,
+							pageSize: 99999,
+						}).then((res) => {
+							if (res.code === 0) {
+								exportExcel(
+									this[`columns${this.tabName}`],
+									res.result.list,
+									'盘盈亏单'
+								)
+							}
+						})
+					} else if (this.tabName === '2') {
+						GetStockInDocumentList({
+							...this.params2,
+							pageIndex: 1,
+							pageSize: 99999,
+						}).then((res) => {
+							if (res.code === 0) {
+								exportExcel(
+									this[`columns${this.tabName}`],
+									res.result.list,
+									'入库序时簿'
+								)
+							}
+						})
+					} else if (this.tabName === '3') {
+						GetStockTakeDocumentList({
+							...this.params3,
+							pageIndex: 1,
+							pageSize: 9999,
+						}).then((res) => {
+							if (res.code === 0) {
+								exportExcel(
+									this[`columns${this.tabName}`],
+									res.result.list,
+									'领料序时簿'
+								)
+							}
+						})
+					} else if (this.tabName === '4') {
+						GetMaterialStockInOutSum({
+							...this.params4,
+							pageIndex: 1,
+							pageSize: 99999,
+						}).then((res) => {
+							if (res.code === 0) {
+								exportExcel(
+									this.columns_4,
+									res.result,
+									'物料收发汇总'
+								)
+							}
+						})
+					} else if (this.tabName === '5') {
+						GetMaterialMonthSum({
+							...this.params5,
+							pageIndex: 1,
+							pageSize: 99999,
+						}).then((res) => {
+							if (res.code === 0) {
+								exportExcel(
+									this[`columns${this.tabName}`],
+									res.result.list,
+									'物料月汇总'
+								)
+							}
+						})
+					} else if (this.tabName === '6') {
+						GetStockWaterInOut({
+							...this.params6,
+							pageIndex: 1,
+							pageSize: 99999,
+						}).then((res) => {
+							if (res.code === 0) {
+								exportExcel(
+									this[`columns${this.tabName}`],
+									res.result.list,
+									'物料进出信息'
+								)
+							}
+						})
+					}
+					break
+				case 'showMaterial':
+					this.show = true
+					break
+			}
+		},
+		changePage(pageIndex) {
+			this['params' + this.tabName].pageIndex = pageIndex
+			this.getList()
+		},
+		getList() {
+			this['data' + this.tabName] = []
+			if (this.tabName === '1') {
+				GetMonthStockCheck(this.params1).then((res) => {
+					if (res.code === 0) {
+						this.data1 = res.result.list
+						this.params1.total = res.result.totalCount
+					}
+				})
+			} else if (this.tabName === '2') {
+				GetStockInDocumentList(this.params2).then((res) => {
+					if (res.code === 0) {
+						this.data2 = res.result.list
+						this.params2.total = res.result.totalCount
+					}
+				})
+			} else if (this.tabName === '3') {
+				GetStockTakeDocumentList(this.params3).then((res) => {
+					if (res.code === 0) {
+						this.data3 = res.result.list
+						this.params3.total = res.result.totalCount
+					}
+				})
+			} else if (this.tabName === '4') {
+				GetMaterialStockInOutSum(this.params4).then((res) => {
+					if (res.code === 0) {
+						this.data4 = res.result
+					}
+				})
+			} else if (this.tabName === '5') {
+				GetMaterialMonthSum(this.params5).then((res) => {
+					if (res.code === 0) {
+						this.data5 = res.result.list
+						this.params5.total = res.result.totalCount
+					}
+				})
+			} else if (this.tabName === '6') {
+				GetStockWaterInOut(this.params6).then((res) => {
+					if (res.code === 0) {
+						this.data6 = res.result.list
+					}
+				})
+			}
+		},
+    
+	},
+	mounted() {
+		this.tabClick('1') 
+    this.getPickingPage()
+	},
 }
 </script>
 
 <style lang="less" scoped>
 .container {
-  height: 100%;
+	height: 100%;
 }
 /deep/ .ivu-tabs {
-  height: 100%;
-  .ivu-tabs-content {
-    height: ~"calc(100% - 52px)"
-  }
+	height: 100%;
+	.ivu-tabs-content {
+		height: ~'calc(100% - 52px)';
+	}
 }
 </style>

+ 21 - 0
vue.config.js

@@ -27,6 +27,27 @@ const BASE_URL = process.env.NODE_ENV === 'production'
   : '/'
 
 module.exports = {
+  devServer: {
+    port: "8080", //代理端口
+    open: false, //项目启动时是否自动打开浏览器,我这里设置为false,不打开,true表示打开
+    headers: {
+      'Access-Control-Allow-Origin': '*',
+    },
+    proxy: {
+      '/stockWater': {
+        //本地服务接口地址
+        target: 'http://192.168.1.112:8300',
+        //远程演示服务地址,可用于直接启动项目
+        //target: 'https://saber.bladex.vip/api',
+        ws: true,
+        pathRewrite: {
+          '^/api': '/'
+        }
+      },
+      
+
+    }
+  },
   // Project deployment base
   // By default we assume your app will be deployed at the root of a domain,
   // e.g. https://www.my-app.com/