Просмотр исходного кода

Merge branch 'master' into feature/times

duanxiaoduan 1 год назад
Родитель
Сommit
e3c3d8b68e

+ 3 - 8
.env.development

@@ -4,15 +4,10 @@ ENV = 'development'
 # base api
 # 测试线
 # VUE_APP_BASE_API = 'http://210.16.189.72:8081/'
-
-
-VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+# VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 # 南通测试线
-# VUE_APP_BASE_API = 'http://kpttestnt.kptyun.com/'
-
-
+# VUE_APP_BASE_API = 'http://kpttestnt.kptyun.com/'
 # VUE_APP_BASE_API = 'http://tmrwatch.cn/'
-
 # 测试线
 # VUE_APP_BASE_API = 'http://tmrwatch.cn:8081/'
 
@@ -23,7 +18,7 @@ VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 
 
 # 白少杰
-# VUE_APP_BASE_API = 'http://192.168.1.77:8081/'
+VUE_APP_BASE_API = 'http://192.168.1.77:8081/'
 
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

+ 20 - 0
cls

@@ -0,0 +1,20 @@
+  develop
+  fearture/ci-test5
+  feature/addproblem
+* feature/addproblem2
+  feature/ci-cd
+  feature/ci-cd2
+  feature/ci-cd3
+  feature/ci-test1
+  feature/ci-test2
+  feature/ci-test3
+  feature/ci-test4
+  feature/ci-test5
+  feature/ci-test6
+  feature/ci-test7
+  feature/fence_shed
+  feature/pasture-export
+  feature/test
+  hotfix/bug1
+  hotfix/test1
+  master

+ 20 - 1
src/views/basicData/defaultParameter/function/index.vue

@@ -143,6 +143,23 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row>
+        <!-- <el-col :span="12">
+          <el-form-item label="设备运转标准时间(分钟):" prop="remainOptRate">
+            <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
+          </el-form-item>
+        </el-col> -->
+        <el-col :span="12">
+          <el-form-item label="tmr容量上限(%):" prop="tmrUpper">
+            <el-input ref="tmrUpper" v-model="createTemp.tmrUpper" :disabled="isRoleEdit==false" class="filter-item" placeholder="tmr容量上限(%)" type="number" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="tmr容量下限(%):" prop="tmrUnder">
+              <el-input ref="tmrUnder" v-model="createTemp.tmrUnder" :disabled="isRoleEdit==false" class="filter-item" placeholder="tmr容量下限(%)" type="number" />
+          </el-form-item>
+        </el-col>
+      </el-row>
     </el-form>
     <div slot="footer" class="dialog-footer" style="bottom: 10px;">
       <el-button v-if="isRoleEdit" class="save" :disabled="isokDisable" @click="handleSave">保存</el-button>
@@ -310,7 +327,9 @@ export default {
         isSmallMaterial: this.createTemp.isSmallMaterial,
         isDataSync: this.createTemp.isDataSync,
         anyCar:this.createTemp.anyCar,
-        accuracy:this.createTemp.accuracy
+        accuracy:this.createTemp.accuracy,
+        tmrUpper:this.createTemp.tmrUpper,
+        tmrUnder:this.createTemp.tmrUnder
       }}
       this.requestParam.data[1] = { 'name': 'updateFPbyFTChangeALL', 'type': 'e', 'parammaps': {
         pastureid: this.createTemp.pastureid

+ 15 - 3
src/views/basicData/equipmentTMR/index.vue

@@ -48,6 +48,12 @@
             <span v-if="scope.row.NoEdit">{{ scope.row.tname }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.tname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:10px 0;" maxlength="32" />
           </template>
+        </el-table-column>
+        <el-table-column label="容量(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">
@@ -263,7 +269,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, 'eqcode': '', 'tname': '', 'datacaptureno': '', 'tclassid': '', 'maxstirfeed': '', 'tcolor': '#ccc', 'autosecond': '0', 'imei': '' })
+      this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'eqcode': '', 'tname': '', 'datacaptureno': '', 'tclassid': '', 'maxstirfeed': '', 'tcolor': '#ccc', 'autosecond': '0', 'imei': '','volume':'' })
     },
     // TMR设备类型
     changeType(item) {
@@ -303,7 +309,10 @@ export default {
       this.table.temp.autosecond = row.autosecond
       this.table.temp.autosecondname = this.table.temp.autosecondname
       this.table.temp.imei = row.imei
-
+      if(this.table.temp.volume == ''){
+        this.table.temp.volume = 0
+      }
+      this.table.temp.volume = parseFloat(row.volume)
       // 检验用户名称/角色是否为空
       if (this.table.temp.eqcode == '' && this.table.temp.tname == '' && this.table.temp.datacaptureno == '' && this.table.temp.tclassid == '' && this.table.temp.maxstirfeed == '') {
         this.$message({ type: 'error', message: 'TMR设备编号/TMR设备名称/数据采集卡编号/TMR设备类型/最大搅拌量不能为空', duration: 2000 })
@@ -440,7 +449,10 @@ export default {
       this.table.temp.autozone = row.autozone
       this.table.temp.autosecond = row.autosecond
       this.table.temp.autosecondname = this.table.temp.autosecondname
-
+      if(this.table.temp.volume == ''){
+        this.table.temp.volume = 0
+      }
+      this.table.temp.volume = parseFloat(row.volume)
       // 检验用户名称/角色是否为空
       if (this.table.temp.eqcode == '' && this.table.temp.tname == '' && this.table.temp.datacaptureno == '' && this.table.temp.tclassid == '' && this.table.temp.maxstirfeed == '') {
         this.$message({ type: 'error', message: 'TMR设备编号/TMR设备名称/数据采集卡编号/TMR设备类型/最大搅拌量不能为空', duration: 2000 })

+ 89 - 41
src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue

@@ -98,6 +98,13 @@
               :inactive-value="0"
             />
           </template>
+        </el-table-column>
+        <el-table-column label="容量状态" width="90px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.volumeStatus == 1" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
+            <span v-if="scope.row.volumeStatus == 2" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
+            <span v-if="scope.row.volumeStatus == 0" style="color:green;">{{ scope.row.volumeStatusStr }}</span>
+          </template>
         </el-table-column>
         <el-table-column label="撒料" min-width="250px" align="left" header-align="center">
           <template slot-scope="scope">
@@ -298,11 +305,12 @@
               </div>
             </el-col>
             <el-col :span="4">
-              <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 style="text-align: center;height: 100px;margin-top: 40px;">
+                <div class="maxweight" style="line-height:20px;"><b>车辆容积量:</b>{{ create.temp.tmrvolume }} ( {{ create.temp.minVolume }} - {{ create.temp.maxVolume }})m³</div>
+                <!-- <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;color: red;" v-if="parseFloat(create.temp.volume) > parseFloat(create.temp.tmrvolume)"><b>容积量:</b>{{ create.temp.volume }} m³ </div>
+                <div class="sumweight" style="line-height:20px;margin-top: 10px;" v-else><b>容积量:</b>{{ create.temp.volume }} m³ </div>
               </div>
             </el-col>
           </el-row>
@@ -830,6 +838,9 @@ export default {
         this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
         this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
         this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
+        this.create.temp.tmrvolume = this.TMRNumberList.find(obj => obj.id === item).tmrvolume
+        this.create.temp.maxVolume = this.TMRNumberList.find(obj => obj.id === item).maxVolume
+        this.create.temp.minVolume = this.TMRNumberList.find(obj => obj.id === item).minVolume
         this.create.temp.mytmrid = this.create.temp.tmrid
         this.create.temp.mytmrname = this.create.temp.tmrname
         console.log('TMR编号item==>', item)
@@ -861,6 +872,9 @@ export default {
           this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
           this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
           this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
+          this.create.temp.tmrvolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tmrvolume
+          this.create.temp.maxVolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxVolume
+          this.create.temp.minVolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).minVolume
           this.tmrNumber.dialogFormVisible = false
           this.getCreateList1()
         }
@@ -1087,7 +1101,8 @@ export default {
         maxweight: '',
         issplit: 1,
         begintime: '',
-        sumweight: 0,
+        sumweight: 0,
+        volume:0,
         display: '',
         times: 1,
         ftid: '',
@@ -1198,11 +1213,17 @@ export default {
             this.$set(this.create.list2[i], 'focusState', false)
           }
           console.log('sumweight==>', sumweight)
-          this.create.temp.sumweight = (sumweight).toFixed(2)
+          this.create.temp.sumweight = (sumweight).toFixed(2)
+          if(parseFloat(this.create.temp.ftvolume) !== 0 &&  parseFloat(this.create.temp.sumweight) !== 0){
+            this.create.temp.volume = (parseFloat(this.create.temp.sumweight) / parseFloat(this.create.temp.ftvolume)).toFixed(2)
+          }else{
+            this.create.temp.volume = 0
+          }
         } else {
           this.create.list2 = []
           // this.create.temp.sort = 0
-          this.create.temp.sumweight = 0
+          this.create.temp.sumweight = 0
+          this.create.temp.volume = 0
         }
       })
     },
@@ -1323,41 +1344,68 @@ export default {
           this.isokDisable = true
           setTimeout(() => {
             this.isokDisable = false
-          }, 1000)
-          const url = 'authdata/PostDataByName'
-          const data = {}
-          data.name = 'updateLppdate'
-          this.create.temp.pastureid = Cookies.get('pastureid')
-          this.create.temp.times = parseInt(this.create.temp.times)
-          this.create.temp.sumcowcount = 0
-          this.create.temp.date = this.date
-          data.parammaps = this.create.temp
-          data.parammaps.tmrid = this.create.temp.tmrid2
-          data.parammaps.tmrname = this.create.temp.mytmrname
-          postJson(url, data).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              this.$notify({
-                title: '成功',
-                message: '保存成功',
-                type: 'success',
-                duration: 2000
-              })
-              this.isDispaly = false
-              this.dialogFull = false
-              this.create.dialogFormVisible = false
-              this.getList()
-            } else {
-              this.$notify({
-                title: '保存失败',
-                message: response.data,
-                type: 'warning',
-                duration: 2000
-              })
-            }
-          })
+          }, 1000)
+          var tip = ''
+          if(parseFloat(this.create.temp.volume) > parseFloat(this.create.temp.tmrvolume)){
+            tip = '装载量已超过车辆容量' + this.create.temp.tmrvolume + 'm³,请确认'
+            MessageBox.confirm(tip, {
+              confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+            }).then(() => {
+              this.save_updateData()
+            })
+          }else if(parseFloat(this.create.temp.volume) > parseFloat(this.create.temp.maxVolume)){
+            tip = '装载量不可超过车辆容量' + this.create.temp.maxVolume + 'm³,请确认'
+            MessageBox.confirm(tip, {
+              confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+            }).then(() => {
+              this.save_updateData()
+            })
+          }else if(parseFloat(this.create.temp.volume) < parseFloat(this.create.temp.minVolume)){
+            tip = '装载量不可低于车辆容量' + this.create.temp.minVolume + 'm³,请确认'
+            MessageBox.confirm(tip, {
+              confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+            }).then(() => {
+              this.save_updateData()
+            })
+          }else{
+            this.save_updateData()
+          }
         }
       })
+    },
+    save_updateData(){
+      const url = 'authdata/PostDataByName'
+      const data = {}
+      data.name = 'updateLppdate'
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.times = parseInt(this.create.temp.times)
+      this.create.temp.sumcowcount = 0
+      this.create.temp.date = this.date
+      data.parammaps = this.create.temp
+      data.parammaps.tmrid = this.create.temp.tmrid2
+      data.parammaps.tmrname = this.create.temp.mytmrname
+      postJson(url, data).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({
+            title: '成功',
+            message: '保存成功',
+            type: 'success',
+            duration: 2000
+          })
+          this.isDispaly = false
+          this.dialogFull = false
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({
+            title: '保存失败',
+            message: response.data,
+            type: 'warning',
+            duration: 2000
+          })
+        }
+      })
     },
     close() {
       if (this.create.dialogStatus == 'create') {

+ 79 - 22
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -93,6 +93,13 @@
             <el-switch v-model="scope.row.issplit" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
           </template>
         </el-table-column>
+        <el-table-column label="容量状态" width="90px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.volumeStatus == 1" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
+            <span v-if="scope.row.volumeStatus == 2" style="color:red;">{{ scope.row.volumeStatusStr }}</span>
+            <span v-if="scope.row.volumeStatus == 0" style="color:green;">{{ scope.row.volumeStatusStr }}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="撒料" min-width="250px" align="left" header-align="center">
           <template slot-scope="scope">
             <div v-for="element in scope.row.arrList" :key="element.name" class="list">
@@ -264,8 +271,10 @@
             </el-col>
             <el-col :span="4">
               <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="maxweight" style="line-height:20px;"><b>车辆容积量:</b>{{ create.temp.tmrvolume }} ( {{ create.temp.minVolume }} - {{ create.temp.maxVolume }})m³</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;color: red;" v-if="parseFloat(create.temp.volume) > parseFloat(create.temp.tmrvolume)"><b>容积量:</b>{{ create.temp.volume }} m³ </div>
+                <div class="sumweight" style="line-height:20px;margin-top: 10px;" v-else><b>容积量:</b>{{ create.temp.volume }} m³ </div>
               </div>
             </el-col>
           </el-row>
@@ -823,6 +832,9 @@ export default {
         this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
         this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
         this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
+        this.create.temp.tmrvolume = this.TMRNumberList.find(obj => obj.id === item).tmrvolume
+        this.create.temp.maxVolume = this.TMRNumberList.find(obj => obj.id === item).maxVolume
+        this.create.temp.minVolume = this.TMRNumberList.find(obj => obj.id === item).minVolume
         this.create.temp.mytmrid = this.create.temp.tmrid
         this.create.temp.mytmrname = this.create.temp.tmrname
         if (this.isDispaly || this.create.dialogStatus == 'update') {
@@ -854,6 +866,9 @@ export default {
           this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
           this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
           this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
+          this.create.temp.tmrvolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tmrvolume
+          this.create.temp.maxVolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxVolume
+          this.create.temp.minVolume = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).minVolume
           this.tmrNumber.dialogFormVisible = false
           this.getCreateList1()
         }
@@ -867,6 +882,7 @@ export default {
       this.create.temp.tmrid2 = this.create.temp.tmrid
       this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
       this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
+      this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
       this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
       this.create.temp.mytmrid = this.create.temp.tmrid2
       this.create.temp.mytmrname = this.create.temp.tmrname
@@ -1008,7 +1024,7 @@ export default {
       })
     },
     handleCreate() {
-      this.create.temp = { sel: 1, tmrid: '', tmrid2: '', maxweight: '', issplit: 1, begintime: '', sumweight: 0, display: '', times: 1, ftid: '', ftname: '', tmrname: '', maxweight: '' }
+      this.create.temp = { sel: 1, tmrid: '', tmrid2: '', maxweight: '', issplit: 1, begintime: '', sumweight: 0,volume:0, display: '', times: 1, ftid: '', ftname: '', tmrname: '', maxweight: '' }
       // console.log('新增车次',create.temp.tmrid2)
 
       this.create.temp.times = this.table.getdataListParm.parammaps.times
@@ -1101,10 +1117,16 @@ export default {
           }
           console.log('sumweight==>', sumweight)
           this.create.temp.sumweight = (sumweight).toFixed(2)
+          if(parseFloat(this.create.temp.ftvolume) !== 0 &&  parseFloat(this.create.temp.sumweight) !== 0){
+            this.create.temp.volume = (parseFloat(this.create.temp.sumweight) / parseFloat(this.create.temp.ftvolume)).toFixed(2)
+          }else{
+            this.create.temp.volume = 0
+          }
         } else {
           this.create.list2 = []
           // this.create.temp.sort = 0
           this.create.temp.sumweight = 0
+          this.create.temp.volume = 0
         }
       })
     },
@@ -1114,6 +1136,7 @@ export default {
         this.isokDisable = false
       }, 1000)
       this.create.temp.sumweight = parseFloat(this.create.temp.sumweight)
+      console.log('需要计算容积量')
       console.log('this.TMRNumberList==>', this.TMRNumberList)
       console.log('点击了栏舍item==>', item)
       console.log('temp==>',this.create.temp)
@@ -1217,6 +1240,11 @@ export default {
       this.create.temp.mytmrname = row.tmrname
       this.create.temp.mytmrid = row.tmrid
       this.create.checkBarList = []
+      this.create.temp.mytmrid = row.tmrid
+      if(this.create.temp.volume == undefined || this.create.temp.volume == ''){
+        console.log(111)
+        this.$set(this.create.temp,'volume',0)
+      }
       console.log(this.create.temp,'this.create.temp')
       this.getCreateList1()
 
@@ -1228,26 +1256,55 @@ export default {
           setTimeout(() => {
             this.isokDisable = false
           }, 1000)
-          const url = 'authdata/lpplan/edit'
-          const data = {}
-          this.create.temp.pastureid = Cookies.get('pastureid')
-          this.create.temp.times = parseInt(this.create.temp.times)
-          data.parammaps = this.create.temp
-          data.parammaps.tmrid = this.create.temp.tmrid2
-          data.parammaps.tmrname = this.create.temp.mytmrname
-          data.old = this.create.temp.arrList
-          postJson(url, data).then(response => {
-            console.log('新增保存发送参数', this.requestParam)
-            if (response.msg !== 'fail') {
-              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-              this.isDispaly = false
-              this.dialogFull = false
-              this.create.dialogFormVisible = false
-              this.getList()
-            } else {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            }
-          })
+          // {{ create.temp.tmrvolume }} ({{ create.temp.maxVolume }} - {{ create.temp.minVolume }})
+          // 当超过车辆容量100%时
+          var tip = ''
+          if(parseFloat(this.create.temp.volume) > parseFloat(this.create.temp.tmrvolume)){
+            tip = '装载量已超过车辆容量' + this.create.temp.tmrvolume + 'm³,请确认'
+            MessageBox.confirm(tip, {
+              confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+            }).then(() => {
+              this.save_updateData()
+            })
+          }else if(parseFloat(this.create.temp.volume) > parseFloat(this.create.temp.maxVolume)){
+            tip = '装载量不可超过车辆容量' + this.create.temp.maxVolume + 'm³,请确认'
+            MessageBox.confirm(tip, {
+              confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+            }).then(() => {
+              this.save_updateData()
+            })
+          }else if(parseFloat(this.create.temp.volume) < parseFloat(this.create.temp.minVolume)){
+            tip = '装载量不可低于车辆容量' + this.create.temp.minVolume + 'm³,请确认'
+            MessageBox.confirm(tip, {
+              confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+            }).then(() => {
+              this.save_updateData()
+            })
+          }else{
+            this.save_updateData()
+          }
+        }
+      })
+    },
+    save_updateData(){
+      const url = 'authdata/lpplan/edit'
+      const data = {}
+      this.create.temp.pastureid = Cookies.get('pastureid')
+      this.create.temp.times = parseInt(this.create.temp.times)
+      data.parammaps = this.create.temp
+      data.parammaps.tmrid = this.create.temp.tmrid2
+      data.parammaps.tmrname = this.create.temp.mytmrname
+      data.old = this.create.temp.arrList
+      postJson(url, data).then(response => {
+        console.log('新增保存发送参数', this.requestParam)
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          this.isDispaly = false
+          this.dialogFull = false
+          this.create.dialogFormVisible = false
+          this.getList()
+        } else {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
         }
       })
     },

+ 15 - 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,10 @@ export default {
       this.table.temp.source = row.source
       this.table.temp.remark = row.remark
       this.table.temp.enable = row.enable
+      if(this.table.temp.volume == ''){
+        this.table.temp.volume = 0
+      }
+      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 +1477,10 @@ export default {
       this.table.temp.pastureid = row.pastureid
       this.table.temp.id = row.id
       this.table.temp.cattle = row.cattle
+      if(this.table.temp.volume == ''){
+        this.table.temp.volume = 0
+      }
+      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) {