Procházet zdrojové kódy

1、配方模板添加容重:Kg/立方,饲料表增加每车容积,最小限制,默认50%、最大限制,默认85%。
2、准确性分析中的混料统计和撒料统计,还有效率分析的时间可以选多日
3、混料统计按车次统计时,每一车增加显示车次描述

duanxiaoduan před 1 rokem
rodič
revize
35657a3c05

+ 1 - 0
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -266,6 +266,7 @@
               <div style="text-align: center;height: 100px;margin-top: 40px;">
                 <div class="maxweight" style="line-height:20px;"><b>最大重量:</b>{{ create.temp.maxweight }} (KG)</div>
                 <div class="sumweight" style="line-height:20px;margin-top: 10px;"><b>合计重量:</b>{{ create.temp.sumweight }} (KG) </div>
+                <div class="sumweight" style="line-height:20px;margin-top: 10px;"><b>容积量:</b>{{ create.temp.sumweight }} m³ </div>
               </div>
             </el-col>
           </el-row>

+ 9 - 1
src/views/formulationPlan/recipeTemplate/index.vue

@@ -86,6 +86,12 @@
                 <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tcode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" disabled maxlength="32" style="width:98%;padding:10px 0;" />
               </template>
             </el-table-column>
+            <el-table-column label="容重(kg/m³)" min-width="110px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit">{{ scope.row.volume }}</span>
+                <el-input v-if="scope.row.Edit" v-model.trim="scope.row.volume" type="number" style="width:98%;padding:10px 0;" />
+              </template>
+            </el-table-column>
             <el-table-column label="配方颜色" min-width="70px" align="center">
               <template slot-scope="scope">
                 <el-color-picker v-model="scope.row.tcolor" size="mini" :predefine="predefineColors" style="vertical-align: middle;" :disabled="scope.row.NoEdit" />
@@ -1309,7 +1315,7 @@ export default {
           return false
         }
       }
-      this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'tname': '', tcode: '', 'tcolor': '#ccc', 'ccid': '', 'ccname': '', 'fttype': '', 'fttypeid': '', 'source': '自定义', 'remark': '','cattle':'' })
+      this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'tname': '', tcode: '', 'tcolor': '#ccc', 'ccid': '', 'ccname': '', 'fttype': '', 'fttypeid': '','volume':'', 'source': '自定义', 'remark': '','cattle':'' })
       console.log('点击了新增this.table.list====>', this.table.list)
       this.table.temp = this.table.list[0]
       this.getTcodeList()
@@ -1345,6 +1351,7 @@ export default {
       this.table.temp.source = row.source
       this.table.temp.remark = row.remark
       this.table.temp.enable = row.enable
+      this.table.temp.volume = parseFloat(row.volume)
       this.table.temp.pastureid = Cookies.get('pastureid')
       if (this.table.temp.tname == '' && this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
         this.$message({ type: 'error', message: '配方名称/牲畜类别/配方类型不能为空', duration: 2000 })
@@ -1467,6 +1474,7 @@ export default {
       this.table.temp.pastureid = row.pastureid
       this.table.temp.id = row.id
       this.table.temp.cattle = row.cattle
+      this.table.temp.volume = parseFloat(row.volume)
       if (this.table.temp.tname == '' && this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
         this.$message({ type: 'error', message: '配方名称/牲畜类别/配方类型不能为空', duration: 2000 })
         return false

+ 47 - 23
src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue

@@ -638,7 +638,8 @@
       </el-tab-pane>
       <el-tab-pane label="混料统计" name="second">
         <div class="search" ref="myHeightSecond">
-          <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime2" :clearable="false" style="width: 140px;margin-top: 5px;" type="date" placeholder="选择日期"> </el-date-picker>
+          <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" :picker-options="pickerOptions3" />
+          <!-- <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime2" :clearable="false" style="width: 140px;margin-top: 5px;" type="date" placeholder="选择日期"> </el-date-picker> -->
           <el-button class="el-icon-arrow-left elIconArrowLeft" style="display:inline-block;margin-top: 5px;" :disabled="Beforedisabled2" @click="handleBefore2" />
           <el-button class="el-icon-arrow-right elIconArrowRight" style="display:inline-block;margin-top: 5px;" :disabled="Nextdisabled2" @click="handleNext2" />
           <el-select clearable filterable v-model="tab2.table.getdataListParm.parammaps.tmrtname" placeholder="TMR设备" class="filter-item" style="width: 120px;">
@@ -714,13 +715,15 @@
             <u-table-column sortable label="跳转方式" min-width="55px" align="center" prop="跳转方式" />
             <u-table-column sortable label="开始重量" min-width="55px" align="center" prop="开始重量" />
             <u-table-column sortable label="结束重量" min-width="55px" align="center" prop="结束重量" />
+            <u-table-column sortable label="车次描述" min-width="55px" align="center" prop="remark" />
           </u-table>
           <span v-if="tab2.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab2.table.total }}条</span>
         </div>
       </el-tab-pane>
       <el-tab-pane label="撒料统计" name="third">
         <div class="search" ref="myHeightThird">
-          <el-date-picker v-model="tab3.table.getdataListParm.parammaps.inputDatetime2" :clearable="false" style="margin-top: 5px;width:140px;" type="date" placeholder="选择日期"> </el-date-picker>
+          <el-date-picker v-model="tab3.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" :picker-options="pickerOptions3" />
+          <!-- <el-date-picker v-model="tab3.table.getdataListParm.parammaps.inputDatetime2" :clearable="false" style="margin-top: 5px;width:140px;" type="date" placeholder="选择日期"> </el-date-picker> -->
           <el-button class="el-icon-arrow-left elIconArrowLeft" style="dispaly:inline-block;margin-top: 5px;" :disabled="Beforedisabled3" @click="handleBefore3" />
           <el-button class="el-icon-arrow-right elIconArrowRight" style="dispaly:inline-block;margin-top: 5px;" :disabled="Nextdisabled3" @click="handleNext3" />
           <el-select v-model="tab3.table.getdataListParm.parammaps.tmrtname" placeholder="TMR设备" class="filter-item" style="margin-top: 5px;width: 120px;" clearable filterable>
@@ -1305,6 +1308,27 @@ export default {
           return time.getTime() > Date.now()
         }
       },
+      pickerOptions3:{
+        onPick: ({ maxDate, minDate }) => {
+          this.pickerMinDate = minDate.getTime()
+          if (maxDate) {
+            this.pickerMinDate = ''
+          }
+        },
+        // 限制不能选择今天之后的日期
+        disabledDate: (time) => {
+          if (this.pickerMinDate !== '') {
+            const one = 365 * 24 * 3600 * 1000
+            const minTime = this.pickerMinDate - one
+            let maxTime = this.pickerMinDate + one
+            if (maxTime > new Date()) {
+              maxTime = new Date()
+            }
+            return time.getTime() < minTime || time.getTime() > maxTime
+          }
+          return time.getTime() > Date.now()
+        }
+      },
       // 班次
       maxTime: {
         getMaxTimesParm: {
@@ -4417,17 +4441,17 @@ export default {
     },
     form_search2() {
       this.tab2.table.getdataListParm.name = 'getStatisticsHL'
-      // if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
-      //   console.log(this.tab2.table.getdataListParm.parammaps.inputDatetime)
-      //   this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      //   this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      // } else {
-      //   this.tab2.table.getdataListParm.parammaps.inputDatetime = ''
-      //   this.tab2.table.getdataListParm.parammaps.startTime = ''
-      //   this.tab2.table.getdataListParm.parammaps.stopTime = ''
-      // }
-      this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime2, '{y}-{m}-{d}')
-      this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime2, '{y}-{m}-{d}')
+      if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
+        console.log(this.tab2.table.getdataListParm.parammaps.inputDatetime)
+        this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.tab2.table.getdataListParm.parammaps.inputDatetime = ''
+        this.tab2.table.getdataListParm.parammaps.startTime = ''
+        this.tab2.table.getdataListParm.parammaps.stopTime = ''
+      }
+      // this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime2, '{y}-{m}-{d}')
+      // this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime2, '{y}-{m}-{d}')
       this.tab2.table.getdataListParm.offset = 1
       this.getTab2List()
       this.getTMRNameList2()
@@ -4519,16 +4543,16 @@ export default {
     },
     form_search3() {
       this.tab3.table.getdataListParm.name = 'getStatisticsSL'
-      // if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
-      //   this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-      //   this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      // } else {
-      //   this.tab3.table.getdataListParm.parammaps.inputDatetime = ''
-      //   this.tab3.table.getdataListParm.parammaps.startTime = ''
-      //   this.tab3.table.getdataListParm.parammaps.stopTime = ''
-      // }
-      this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime2, '{y}-{m}-{d}')
-      this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime2, '{y}-{m}-{d}')
+      if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.tab3.table.getdataListParm.parammaps.inputDatetime = ''
+        this.tab3.table.getdataListParm.parammaps.startTime = ''
+        this.tab3.table.getdataListParm.parammaps.stopTime = ''
+      }
+      // this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime2, '{y}-{m}-{d}')
+      // this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime2, '{y}-{m}-{d}')
       this.tab3.table.getdataListParm.offset = 1
       this.getTab3List()
       this.getTMRNameList3()

+ 42 - 13
src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue

@@ -3,10 +3,11 @@
     <el-tabs v-model="activeName" @tab-click="handleTabClick">
       <el-tab-pane label="效率统计" name="first">
         <div class="search">
+          <el-date-picker v-model="tab.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" :picker-options="pickerOptions" @change="changeTab1Date" />
           <!-- <el-date-picker v-model="tab2.date" :clearable="false" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTab2Date" /> -->
-          <el-date-picker v-model="tab.table.getdataListParm.parammaps.date" :clearable="false" style="width: 140px;margin-top: 5px;" type="date" placeholder="选择日期" @change="changeTab1Date"> </el-date-picker>
-          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled1" @click="handleBefore" />
-          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled1" @click="handleNext" />
+          <!-- <el-date-picker v-model="tab.table.getdataListParm.parammaps.date" :clearable="false" style="width: 140px;margin-top: 5px;" type="date" placeholder="选择日期" @change="changeTab1Date"> </el-date-picker> -->
+          <el-button class="el-icon-arrow-left elIconArrowLeft" style="dispaly:inline-block;margin-top: 5px;" :disabled="Beforedisabled1" @click="handleBefore" />
+          <el-button class="el-icon-arrow-right elIconArrowRight" style="dispaly:inline-block;margin-top: 5px;" :disabled="Nextdisabled1" @click="handleNext" />
           <span style="margin-left: 10px;">统计类型:</span>
           <el-radio v-model="tab.radio" label="1" @change="changeRadio">配方</el-radio>
           <el-radio v-model="tab.radio" label="2" @change="changeRadio">栏舍</el-radio>
@@ -658,7 +659,8 @@ export default {
             returntype: 'Map',
             parammaps: {
               pastureid: Cookies.get('pastureid'),
-              date: parseTime(new Date(), '{y}-{m}-{d}'),
+              // date: parseTime(new Date(), '{y}-{m}-{d}'),
+              inputDatetime: [new Date(), new Date()],
               startTime: parseTime(new Date(), '{y}-{m}-{d}'),
               stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
               ftname: '',
@@ -1749,25 +1751,52 @@ export default {
       }
     },
     changeTab1Date(){
-      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.date, '{y}-{m}-{d}')
-      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.date, '{y}-{m}-{d}')
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.tab.table.getdataListParm.parammaps.inputDatetime = ''
+        this.tab.table.getdataListParm.parammaps.startTime = ''
+        this.tab.table.getdataListParm.parammaps.stopTime = ''
+      }
+      // this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.date, '{y}-{m}-{d}')
+      // this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.date, '{y}-{m}-{d}')
       this.getTabList()
     },
     handleBefore() {
-      if (this.tab.table.getdataListParm.parammaps.date !== '' && this.tab.table.getdataListParm.parammaps.date !== null) {
-        this.tab.table.getdataListParm.parammaps.date = new Date(this.tab.table.getdataListParm.parammaps.date)
-        var start = new Date(this.tab.table.getdataListParm.parammaps.date.setDate(this.tab.table.getdataListParm.parammaps.date.getDate() - 1))
-        if (start > Date.now() - 8.64e7) {
+      // if (this.tab.table.getdataListParm.parammaps.date !== '' && this.tab.table.getdataListParm.parammaps.date !== null) {
+      //   this.tab.table.getdataListParm.parammaps.date = new Date(this.tab.table.getdataListParm.parammaps.date)
+      //   var start = new Date(this.tab.table.getdataListParm.parammaps.date.setDate(this.tab.table.getdataListParm.parammaps.date.getDate() - 1))
+      //   if (start > Date.now() - 8.64e7) {
+      //     this.Nextdisabled1 = true
+      //     this.Beforedisabled1 = false
+      //   } else {
+      //     this.Nextdisabled1 = false
+      //     this.Beforedisabled1 = false
+      //   }
+      //   this.tab.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
+      //   this.tab.table.getdataListParm.parammaps.stopTime = parseTime(start, '{y}-{m}-{d}')
+      //   this.getTabList()
+      // }
+      this.$forceUpdate()
+      if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
+        var start = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
+        var stop = new Date(this.tab.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.tab.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
+        if (stop > Date.now() - 8.64e7) {
           this.Nextdisabled1 = true
           this.Beforedisabled1 = false
         } else {
           this.Nextdisabled1 = false
           this.Beforedisabled1 = false
         }
-        this.tab.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
-        this.tab.table.getdataListParm.parammaps.stopTime = parseTime(start, '{y}-{m}-{d}')
-        this.getTabList()
+        this.tab.table.getdataListParm.parammaps.inputDatetime = []
+        this.tab.table.getdataListParm.parammaps.inputDatetime.length = 0
+        this.tab.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
+        this.$forceUpdate()
       }
+      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      this.getTabList()
     },
     handleNext() {
       if (this.tab.table.getdataListParm.parammaps.date !== '' && this.tab.table.getdataListParm.parammaps.date !== null) {