Browse Source

1.默认参数新增tmr容量上限/下限;2.TMR设备新增容重;3.栏舍配方编辑删除接口updateLPPbyFPChange;4.撒料计划新增容量状态

duanxiaoduan 1 year ago
parent
commit
3fe7db1dce

+ 2 - 2
.env.development

@@ -6,7 +6,7 @@ ENV = 'development'
 # 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/'
 
@@ -23,7 +23,7 @@ ENV = 'development'
 
 
 # 白少杰
-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 - 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

+ 1 - 1
src/views/basicData/equipmentTMR/index.vue

@@ -49,7 +49,7 @@
             <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="容重(kg/m³)" min-width="110px" align="center">
+        <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;" />

+ 8 - 8
src/views/formulationPlan/dhedFormula/index.vue

@@ -4224,11 +4224,11 @@ export default {
         supplyweight: row.supplyweight,
         ratio: row.ratio
       }}
-      this.requestParam.data[2] = { 'name': 'updateLPPbyFPChange', 'type': 'e', 'parammaps': {
-        pastureid: row.pastureid,
-        fpid: row.id
-      }}
-      this.requestParam.data[3] = { 'name': 'insertFeedphistory', 'type': 'e', 'parammaps': {
+      // this.requestParam.data[2] = { 'name': 'updateLPPbyFPChange', 'type': 'e', 'parammaps': {
+      //   pastureid: row.pastureid,
+      //   fpid: row.id
+      // }}
+      this.requestParam.data[2] = { 'name': 'insertFeedphistory', 'type': 'e', 'parammaps': {
         createdate:createdate,
         pastureid:row.pastureid,
         barname:row.barname,
@@ -4245,9 +4245,9 @@ export default {
         ftweight:row.ftweight,
         supplyweight:row.supplyweight
       }}
-      this.requestParam.data[4] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.table.rwList }}
-      this.requestParam.data[4].children = []
-      this.requestParam.data[4].children[0] = { 'name': 'insertFpdetailhistory', 'type': 'e', 'parammaps': {
+      this.requestParam.data[3] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.table.rwList }}
+      this.requestParam.data[3].children = []
+      this.requestParam.data[3].children[0] = { 'name': 'insertFpdetailhistory', 'type': 'e', 'parammaps': {
         createdate:createdate,
         pastureid: '@insertSpotList2.pastureid',
         barname: row.barname,

+ 63 - 24
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -93,6 +93,11 @@
             <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>{{ scope.row.volumeStatus }}</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,9 +269,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.maxVolume }} - {{ create.temp.minVolume }})</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.volume }} m³ </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>
@@ -807,6 +813,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') {
@@ -851,6 +860,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
@@ -992,7 +1002,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
@@ -1090,7 +1100,6 @@ export default {
           }else{
             this.create.temp.volume = 0
           }
-          console.log('需要计算容积量',this.create.temp.volume)
         } else {
           this.create.list2 = []
           // this.create.temp.sort = 0
@@ -1208,6 +1217,7 @@ export default {
       this.create.temp.mytmrname = row.tmrname
       this.create.temp.mytmrid = row.tmrid
       this.create.checkBarList = []
+      this.create.temp.mytmrid = row.tmrid
       console.log(this.create.temp,'this.create.temp')
       this.getCreateList1()
 
@@ -1219,26 +1229,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 })
         }
       })
     },