gjy 3 年 前
コミット
db3688fff5

+ 56 - 2
src/views/warehouse/warehouseManagementNoWeight.vue

@@ -37,6 +37,9 @@
             {{ this.$route.query.binNumber }}仓位
           </span>
           <span v-show="this.$route.query.warehouseType == 2">(临)</span>
+          <el-date-picker  style="margin: 0 10px 0 10px" class="dataClass" value-format='yyyy-MM-dd' v-model="value2" @change='datechange' type="daterange" align="right" range-separator="至"
+					start-placeholder="出入库日期起" end-placeholder="出入库日期止" >
+				</el-date-picker>
         </h2>
         <el-table :data="improved.records">
           <el-table-column type="index" label="序号">
@@ -185,6 +188,7 @@ export default {
       contractType: 2,
       startDate: null,
       endDate: null,
+      value2:[],
       deletewarehouse: [],
       improved: [],
       row: [],
@@ -220,7 +224,8 @@ export default {
     this.binNumber = this.$route.params.binNumber
     this.status = this.$route.query.status
     this.deptBudgetList.warehouseType = this.$route.query.warehouseType
-    this.createType=this.$route.query.createType,
+    this.createType=this.$route.query.createType
+    this.getPassYearFormatDate()
     //接参
     this.getList(
       this.$route.query.baseId,
@@ -230,11 +235,46 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+    datechange(){
+				this.getList()
+			},
     //返回按钮
     returnWarehouse() {
       this.$router.push({ path: 'warehouseManagementList' })
     },
-    
+    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]  // 默认赋值一年时间
+   		 },
     //编辑
     edits(row) {
       if (row.inOutFlag == 2) {
@@ -365,6 +405,12 @@ export default {
     },
     //收
     getList(id, id1, id2) {
+      var startDate=''
+					var endDate=''
+					if(this.value2){
+					startDate=this.value2[0]?this.value2[0]:''
+					endDate=this.value2[1]?this.value2[1]:''
+				}
       if (id2 == 1) {
         complete({
           // compId: localStorage.getItem('ws-pf_compId'),
@@ -372,6 +418,8 @@ export default {
           positionId: id1,
           pageSize: this.pageSize,
           currentPage: this.currentPage,
+          startDate:startDate,
+       					    endDate:endDate,
           // inOutDate:this.inOutDate
         })
           .toPromise()
@@ -385,6 +433,8 @@ export default {
           positionId: id1,
           pageSize: this.pageSize,
           currentPage: this.currentPage,
+          startDate:startDate,
+       					    endDate:endDate,
           searchType:this.status
         })
           .toPromise()
@@ -574,6 +624,10 @@ export default {
   color: #ffffff;
   line-height: 20px;
 }
+.dataClass {
+       width: 20% !important;
+       margin-left:10px;
+	}
 .main_css{
 height: calc(100vh - 120px);
 }

+ 11 - 4
src/views/warehouse/warehouseManagementRecord.vue

@@ -19,13 +19,15 @@
 					<!-- {{binNumber}}仓位(容量{{capacity}}吨) -->
 					<el-select filterable clearable v-model="binNumber" placeholder="请选择仓位" class="typeselect"
               @change="binNumberChange">
+			  <el-option  key="" label="全部仓位"
+                value="全部仓位" />
               <el-option v-for="item in binnumberList" :key="item.binNumber" :label="item.binNumber"
                 :value="item.binNumber" />
             </el-select>
 				</div>
 				<span v-show="warehouseType==2">(临)</span>
 			</h2>
-			<p style="
+			<p v-if='remark' style="
           margin-left: 42px;
           background: #f6f7fc;
           color: #afb5cb;
@@ -388,11 +390,16 @@
 		},
 		methods: {
 			binNumberChange(e){
-				for (let i = 0; i < this.binnumberList.length; i++) {
-					if(this.binnumberList[i].binNumber==e){
-						this.deptBudgetList.positionId=this.binnumberList[i].id
+				if(e=='全部仓位'){
+					this.deptBudgetList.positionId=''
+				}else{
+					for (let i = 0; i < this.binnumberList.length; i++) {
+						if(this.binnumberList[i].binNumber==e){
+							this.deptBudgetList.positionId=this.binnumberList[i].id
+						}
 					}
 				}
+				
 				this.getList()
 			},
 			//合计