|  | @@ -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 })
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      },
 |