zhangyuewww 3 лет назад
Родитель
Сommit
caf230b898
1 измененных файлов с 61 добавлено и 23 удалено
  1. 61 23
      src/views/warehouse/warehouseManagementRecord.vue

+ 61 - 23
src/views/warehouse/warehouseManagementRecord.vue

@@ -43,6 +43,9 @@
 					<img v-if="status == 3" width="18" height="18" src="../../../public/img/radio-check.png"
 						alt="" />入库记录
 				</div>
+				<el-date-picker  style="margin: 0 10px 0 0" class="dataClass" value-format='yyyy-MM-dd' v-model="value2" @change='datechange' type="daterange" align="right" unlink-panels range-separator="至"
+					start-placeholder="出入库日期起" end-placeholder="出入库日期止" >
+				</el-date-picker>
 				<el-table show-summary :summary-method="getSummaries"   :data="warehouseList.records" height="560" v-show="this.warehouseType== '1'">
 					<el-table-column type="expand">
 						<template #default="props">
@@ -86,7 +89,7 @@
 						</template>
 					</el-table-column>
 					<el-table-column prop="goodsName" label="货名" width="60px"> </el-table-column>
-					<el-table-column prop="type" label="类型" width="60px"> </el-table-column>
+					<!-- <el-table-column prop="type" label="类型" width="60px"> </el-table-column> -->
 					<el-table-column prop="grossWeight" label="毛重(吨)" >
 						
 					</el-table-column>
@@ -111,7 +114,7 @@
               }}</span>
 						</template>
 					</el-table-column>
-					<el-table-column prop="inOutDate" label="出入库日期">
+					<el-table-column prop="inOutDate" label="出入库日期" width="100px">
 						<template slot-scope="scope">
 							<span style="color: #8890b1">{{ scope.row.inOutDate }}</span>
 						</template>
@@ -247,11 +250,11 @@
 
 				</el-table>
 
+
 				<div style="text-align: center; padding: 10px">
-					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-						:current-page="currentPage" :page-size="deptCircularPage.pageSize"
-						layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
-					</el-pagination>
+					    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-sizes="[10, 30, 50, 100,500,1000,9999]" layout="total, sizes, prev, pager, next, jumper"
+        :total="deptBudgetTotal"></el-pagination>
 				</div>
 			</ws-form>
 		</div>
@@ -323,6 +326,7 @@
 				remark: '',
 				binNumber: '',
 				status: 1,
+				value2:[],
 				// 提交类型
 				submitType: true,
 				selectpackingMethod: {},
@@ -360,7 +364,7 @@
 			this.capacity = this.$route.query.capacity
 			this.warehouseType = this.$route.query.warehouseType
 			this.getList()
-
+            this.getPassYearFormatDate()
 			this.showType = this.isShow
 		},
 		methods: {
@@ -372,7 +376,7 @@
 					if (index === 0) {
 						sums[index] = '合计'
 					} else if (
-						index === 7 
+						index === 6 
 					) {
 						const values = data.map((item) => Number(item[column.property]))
 						if (!values.every((value) => isNaN(value))) {
@@ -392,6 +396,39 @@
 				})
 				return sums
 			},
+		getPassYearFormatDate () {
+          var nowDate = new Date()
+          nowDate.setTime(nowDate.getTime()-24*60*60*1000*30)
+          var seperator1 = '-'
+          var year = nowDate.getFullYear()
+          var month = nowDate.getMonth() + 1
+          var strDate = nowDate.getDate()
+          if (month >= 1 && month <= 9) {
+            month = '0' + month
+          }
+          if (strDate >= 0 && strDate <= 9) {
+            strDate = '0' + strDate
+          }
+          var formatDate = year + seperator1 + month + seperator1 + strDate
+          this.getNowFormatDate(formatDate)
+        },
+		/* 获取现在时间,并接受过去时间的值 */
+        getNowFormatDate (formatDate) {
+			var date = new Date()
+			date.setTime(date.getTime()+24*60*60*1000)
+			var seperator1 = '-'
+			var year = date.getFullYear()
+			var month = date.getMonth() + 1
+			var strDate = date.getDate()
+			if (month >= 1 && month <= 9) {
+				month = '0' + month
+			}
+			if (strDate >= 0 && strDate <= 9) {
+				strDate = '0' + strDate
+			}
+			var nowData = year + seperator1 + month + seperator1 + strDate
+			this.value2= [formatDate, nowData]  // 默认赋值一年时间
+   		 },
 			print(row){
 				getPrintInfo({
                         id: row.id
@@ -441,6 +478,9 @@
 				}
 				return fmt
 			},
+			datechange(){
+				this.getList()
+			},
 			handleClose() {
 				this.accessoryTFs = false
 			},
@@ -472,12 +512,20 @@
 				// this.onChangeFlag = true
 			},
 			getList() {
+					var startDate=''
+					var endDate=''
+					if(this.value2){
+					startDate=this.value2[0]?this.value2[0]:''
+					endDate=this.value2[1]?this.value2[1]:''
+				}
 				if (this.warehouseType == 1) {
 					addselectinfoList({
 							compId: localStorage.getItem('ws-pf_compId'),
 							baseId: this.deptBudgetList.baseId,
 							positionId: this.deptBudgetList.positionId,
 							warehouseName: this.deptBudgetList.warehouseName,
+							startDate:startDate,
+       					    endDate:endDate,
 							searchType: this.searchType,
 							currentPage: this.currentPage,
 							pcFlag: this.pcFlag,
@@ -505,6 +553,8 @@
 							baseId: this.deptBudgetList.baseId,
 							positionId: this.deptBudgetList.positionId,
 							warehouseName: this.deptBudgetList.warehouseName,
+							startDate:startDate,
+       					    endDate:endDate,
 							searchType: this.searchType,
 							currentPage: this.currentPage,
 							pageSize: this.pageSize,
@@ -549,15 +599,6 @@
 				}
 				this.appendixIdss = row.receiveAttachmentPath
 			},
-			handleExamine(row) {
-				this.$router.push({
-					name: 'salesContractExamine',
-					query: {
-						id: row.id
-					},
-				})
-			},
-
 			// 关闭 dialog时 处理文件url 初始化upload组件
 			handleCloe() {
 				this.dialogViewSpareMoney = false
@@ -572,12 +613,6 @@
 						this.historyList = response
 					})
 			},
-			find() {
-				this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
-				this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
-				this.currentPage = 1
-				this.getList()
-			},
 			// async exportlist() {
 			//   const { data } = await export1(
 			//     {
@@ -954,6 +989,9 @@
 	.ws-info-table .el-form-item {
 		width: 14.28%;
 	}
+	.dataClass {
+       width: 20% !important;
+	}
 
 	/deep/.ws-info-table .el-form-item .el-form-item__label {
 		background-color: #f6f7fc;