|
@@ -244,7 +244,7 @@ import {
|
244
|
244
|
getDateTimeNow,
|
245
|
245
|
haveDone, //处理待办
|
246
|
246
|
haveDone1,
|
247
|
|
- getGrainItems
|
|
247
|
+ getGrainItems,getYearWeek
|
248
|
248
|
} from "@/api/grainCheck/index"
|
249
|
249
|
export default {
|
250
|
250
|
name: "AddNewGrain",
|
|
@@ -291,6 +291,8 @@ export default {
|
291
|
291
|
checkPerson: "",
|
292
|
292
|
data2: {}, //待办传参过来的数据
|
293
|
293
|
uid: "",
|
|
294
|
+ date:new Date(),
|
|
295
|
+ week:0, //今年的第几周
|
294
|
296
|
// 先自定义后台接收数据的模板然后拼接
|
295
|
297
|
data3: {
|
296
|
298
|
checkTime: "",
|
|
@@ -393,9 +395,40 @@ export default {
|
393
|
395
|
|
394
|
396
|
// 新增初始化数据
|
395
|
397
|
this.getinfo()
|
|
398
|
+ this.getdate()
|
396
|
399
|
},
|
397
|
400
|
|
398
|
401
|
methods: {
|
|
402
|
+
|
|
403
|
+ getdate() {
|
|
404
|
+ var myDate = new Date()
|
|
405
|
+ var year = myDate.getFullYear() //获取完整的年份(4位,1970-????)
|
|
406
|
+ var mon = myDate.getMonth() + 1 //获取当前月份(0-11,0代表1月)
|
|
407
|
+ var date = myDate.getDate() //获取当前日(1-31)
|
|
408
|
+ var week = myDate.getDay() //获取当前星期X(0-6,0代表星期天)
|
|
409
|
+ let d1 = new Date()
|
|
410
|
+ let d2 = new Date()
|
|
411
|
+ d2.setMonth(0)
|
|
412
|
+ d2.setDate(1)
|
|
413
|
+ let rq = d1 - d2
|
|
414
|
+ let s1 = Math.ceil(rq / (24 * 60 * 60 * 1000))
|
|
415
|
+ let s2 = Math.ceil(s1 / 7)
|
|
416
|
+ this.week = s2;
|
|
417
|
+
|
|
418
|
+ this.datastr =
|
|
419
|
+ year +
|
|
420
|
+ "年" +
|
|
421
|
+ mon +
|
|
422
|
+ "月" +
|
|
423
|
+ date +
|
|
424
|
+ "日" +
|
|
425
|
+ "\xa0\xa0\xa0" +
|
|
426
|
+ "第" +
|
|
427
|
+ s2 +
|
|
428
|
+ "周"
|
|
429
|
+ },
|
|
430
|
+
|
|
431
|
+
|
399
|
432
|
showHandler(val) {
|
400
|
433
|
// console.log(val, "val...")
|
401
|
434
|
if (val.enumId == 189) {
|
|
@@ -696,6 +729,9 @@ export default {
|
696
|
729
|
// this.data3.grainAbnormalDescribe = this.form
|
697
|
730
|
// this.data3.checkTime = getDateTimeNow()
|
698
|
731
|
this.data5.grainConditionRecord.operationTime = getDateTimeNow()
|
|
732
|
+ this.data5.grainConditionRecord.checkYearWeek = this.week
|
|
733
|
+
|
|
734
|
+ // console.log(this.data5.grainConditionRecord.checkYearWeek,'this.data5.grainConditionRecord.checkYearWeek')
|
699
|
735
|
/* this.data5.grainConditionRecord.depotId = this.depot_id
|
700
|
736
|
this.data5.grainConditionRecord.houseId = this.house_id */
|
701
|
737
|
// console.log(this.data3.checkTime,'this.data3.checkTime')
|