Browse Source

1.TMR设备新增容重(kg/m³);2.配方模板新增容重(kg/m³);3.撒料计划新增容积量

duanxiaoduan 1 year ago
parent
commit
6754606eda

+ 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 @@ 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.

+ 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="容重(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">
@@ -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 })

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

@@ -266,7 +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 class="sumweight" style="line-height:20px;margin-top: 10px;"><b>容积量:</b>{{ create.temp.volume }} m³ </div>
               </div>
             </el-col>
           </el-row>
@@ -1085,6 +1085,12 @@ export default {
           }
           console.log('sumweight==>', sumweight)
           this.create.temp.sumweight = (sumweight).toFixed(2)
+          if(parseFloat(this.create.temp.ftvolume) !== 0){
+            this.create.temp.volume = (parseFloat(this.create.temp.sumweight) / parseFloat(this.create.temp.ftvolume)).toFixed(2)
+          }else{
+            this.create.temp.volume = 0
+          }
+          console.log('需要计算容积量',this.create.temp.volume)
         } else {
           this.create.list2 = []
           // this.create.temp.sort = 0
@@ -1098,6 +1104,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)

+ 6 - 0
src/views/formulationPlan/recipeTemplate/index.vue

@@ -1351,6 +1351,9 @@ 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 == '') {
@@ -1474,6 +1477,9 @@ 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 })