|
@@ -14,6 +14,7 @@
|
|
|
<!-- <el-input v-model="table.getdataListParm.parammaps.tname" placeholder="请输入配方名称" style="width: 180px;" class="filter-item" /> -->
|
|
|
<el-button class="successBorder" @click="form_search">查询</el-button>
|
|
|
<el-button v-if="isRoleEdit" class="successBorder" @click="handleDryMatterRegulation">干物质调节</el-button>
|
|
|
+ <el-button v-if="isRoleEdit" class="successBorder" @click="handleSynchronous">软件牛头数同步</el-button>
|
|
|
<el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
|
|
|
<el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
|
|
|
</el-upload>
|
|
@@ -1674,7 +1675,7 @@ export default {
|
|
|
|
|
|
// 系数不变
|
|
|
// 系数头数=实际牛头数*系数
|
|
|
- row.ccountratio = row.ccount * row.ccount
|
|
|
+ row.ccountratio = row.ccount * row.ratio / 100
|
|
|
// 配方重量=实际牛头数*系数*配方模板取Sfweight
|
|
|
row.ftweight = (row.ccount * row.ratio / 100 * row.Sfweight).toFixed(this.decimal)
|
|
|
this.public(row)
|
|
@@ -1694,7 +1695,7 @@ export default {
|
|
|
row.ftweight = (row.ccount * row.ratio / 100 * row.Sfweight).toFixed(this.decimal)
|
|
|
// 实际牛头数不变
|
|
|
// 系数头数=实际牛头数*系数
|
|
|
- row.ccountratio = (parseFloat(row.ccount)*parseFloat(row.ratio)).toFixed(this.decimal)
|
|
|
+ row.ccountratio = (parseFloat(row.ccount)*(parseFloat(row.ratio) / 100)).toFixed(this.decimal)
|
|
|
this.public(row)
|
|
|
},
|
|
|
blurCcountratio(row) {
|
|
@@ -1720,42 +1721,44 @@ export default {
|
|
|
// 未锁定时:各班次比例不变,各班次重量=配方重量*各班次比例
|
|
|
// 锁定时:未锁定班次比例不变,锁定班次比例=班次重量/配方重量x100%
|
|
|
if(row.isOneWeight == true){
|
|
|
- row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}else{
|
|
|
row.w1 = (parseFloat(row.ftweight) * parseFloat(row.r1) / 100).toFixed(this.decimal)
|
|
|
}
|
|
|
- if(row.isTWoWeight == true){
|
|
|
- row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ if(row.isTwoWeight == true){
|
|
|
+ row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}else{
|
|
|
row.w2 = (parseFloat(row.ftweight) * parseFloat(row.r2) / 100).toFixed(this.decimal)
|
|
|
}
|
|
|
if(row.isThreeWeight == true){
|
|
|
- row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}else{
|
|
|
row.w3 = (parseFloat(row.ftweight) * parseFloat(row.r3) / 100).toFixed(this.decimal)
|
|
|
}
|
|
|
if(row.isFourWeight == true){
|
|
|
- row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}else{
|
|
|
row.w4 = (parseFloat(row.ftweight) * parseFloat(row.r4) / 100).toFixed(this.decimal)
|
|
|
}
|
|
|
if(row.isFiveWeight == true){
|
|
|
- row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}else{
|
|
|
row.w5 = (parseFloat(row.ftweight) * parseFloat(row.r5) / 100).toFixed(this.decimal)
|
|
|
}
|
|
|
if(row.isSixWeight == true){
|
|
|
- row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}else{
|
|
|
row.w6 = (parseFloat(row.ftweight) * parseFloat(row.r6) / 100).toFixed(this.decimal)
|
|
|
}
|
|
|
console.log(row,'row2')
|
|
|
|
|
|
- if(row.isOneWeight || row.isThreeWeight || row.isThreeWeight || row.isFourWeight || row.isFiveWeight || row.isSixWeight){
|
|
|
+ if(row.isOneWeight || row.isTWoWeight || row.isThreeWeight || row.isFourWeight || row.isFiveWeight || row.isSixWeight){
|
|
|
var sumr = (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4) + parseFloat(row.r5) + parseFloat(row.r6)).toFixed(this.decimalr)
|
|
|
this.$set(row, 'sumr', sumr)
|
|
|
}else{
|
|
|
// 总比例不变
|
|
|
+ var sumr = (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4) + parseFloat(row.r5) + parseFloat(row.r6)).toFixed(this.decimalr)
|
|
|
+ this.$set(row, 'sumr', sumr)
|
|
|
}
|
|
|
// 饲喂投喂量 = 所有班次重量之和
|
|
|
var sumw = (parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4) + parseFloat(row.w5) + parseFloat(row.w6)).toFixed(this.decimal)
|
|
@@ -1797,7 +1800,7 @@ export default {
|
|
|
row.w4 = (parseFloat(row.r4)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
}else if(item == 5){
|
|
|
// 五班比例
|
|
|
- row.w4 = (parseFloat(row.r5)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ row.w5 = (parseFloat(row.r5)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
}else if(item == 6){
|
|
|
// 六班比例
|
|
|
row.w6 = (parseFloat(row.r6)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
@@ -1806,7 +1809,7 @@ export default {
|
|
|
var sumr = (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4) + parseFloat(row.r5) + parseFloat(row.r6)).toFixed(this.decimalr)
|
|
|
this.$set(row, 'sumr', sumr)
|
|
|
// 饲喂投喂量 = 所有班次重量之和
|
|
|
- var sumw = (parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4)).toFixed(this.decimal)
|
|
|
+ var sumw = (parseFloat(row.w1) + parseFloat(row.w2) + parseFloat(row.w3) + parseFloat(row.w4) + parseFloat(row.w5) + parseFloat(row.w6)).toFixed(this.decimal)
|
|
|
this.$set(row, 'todayweight', sumw)
|
|
|
// 日投喂量 = 饲喂投喂量+补料
|
|
|
if (row.bw1 == 'NaN' || row.bw1 == '') { this.$set(row, 'bw1', 0) }
|
|
@@ -1826,22 +1829,22 @@ export default {
|
|
|
}
|
|
|
if(item == 1){
|
|
|
// 一班重量
|
|
|
- row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}else if(item == 2){
|
|
|
// 二班重量
|
|
|
- row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}else if(item == 3){
|
|
|
// 三班重量
|
|
|
- row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}else if(item == 4){
|
|
|
// 四班重量
|
|
|
- row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}else if(item == 5){
|
|
|
// 五班重量
|
|
|
- row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}else if(item == 6){
|
|
|
// 六班重量
|
|
|
- row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight)).toFixed(this.decimalr)
|
|
|
+ row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
}
|
|
|
// 总比例=所有比例之和
|
|
|
var sumr = (parseFloat(row.r1) + parseFloat(row.r2) + parseFloat(row.r3) + parseFloat(row.r4) + parseFloat(row.r5) + parseFloat(row.r6)).toFixed(this.decimalr)
|
|
@@ -3133,6 +3136,15 @@ export default {
|
|
|
},
|
|
|
focusBw(row) {
|
|
|
console.log(row)
|
|
|
+ },
|
|
|
+ handleSynchronous(){
|
|
|
+ const url = 'ud/feedp/sync'
|
|
|
+ const data = {}
|
|
|
+ postJson(url, data).then(response => {
|
|
|
+ if(response.msg !== 'fail'){
|
|
|
+ this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|