|
@@ -14,7 +14,10 @@
|
|
|
<!-- <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-button v-if="isRoleEdit && isSynchronous" class="successBorder" @click="handleSynchronous">软件牛头数同步</el-button>
|
|
|
+ <el-button v-if="isRoleEdit && !isproportion" class="successBorder" @click="handle_batchEdit">批量编辑</el-button>
|
|
|
+ <el-button v-if="isRoleEdit && isproportion" icon="el-icon-folder-checked" class="success" @click="handle_batchEdit_save">保存</el-button>
|
|
|
+ <el-button v-if="isRoleEdit && isproportion" icon="el-icon-close" class="sortCancel" @click="cancelChangeEdit">取消</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>
|
|
@@ -62,20 +65,20 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column :key="3" label="实际牛头数" min-width="80px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.NoEdit">{{ scope.row.ccount }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.ccount" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurCcount(scope.row)" />
|
|
|
+ <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.ccount }}</span>
|
|
|
+ <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.ccount" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurCcount(scope.row)" :placeholder="scope.row.placeholder_ccount" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :key="4" label="系数(%)" min-width="85px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.ratio }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.ratio" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurRatio(scope.row)" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.ratio" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurRatio(scope.row)" :placeholder="scope.row.placeholder_ratio" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :key="5" label="系数头数" min-width="85px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.ccountratio }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.ccountratio" type="number" style="width:100%;padding:10px 0;" @blur="blurCcountratio(scope.row)" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.ccountratio" type="number" style="width:100%;padding:10px 0;" @blur="blurCcountratio(scope.row)" :placeholder="scope.row.placeholder_ccountratio" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :key="6" label="配方模板" min-width="100px" align="center">
|
|
@@ -96,110 +99,110 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW1" :key="8" label="第一班比例(%)" min-width="85px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.NoEdit">{{ scope.row.r1 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.r1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,1)" />
|
|
|
+ <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r1 }}</span>
|
|
|
+ <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,1)" :placeholder="scope.row.placeholder_r1" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW1" :key="9" label="第一班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.w1 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.w1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurWeight(scope.row,1)" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.w1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurWeight(scope.row,1)" :placeholder="scope.row.placeholder_w1" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW1 && table.isPtsfname" :key="10" label="第一班补料重量" min-width="100px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.NoEdit">{{ scope.row.bw1 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.bw1" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
|
|
|
+ <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.bw1 }}</span>
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.bw1" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" :placeholder="scope.row.placeholder_bw1" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW2" :key="11" label="第二班比例(%)" min-width="85px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.NoEdit">{{ scope.row.r2 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.r2" step="0.01" type="number" :disabled="scope.row.isTwoWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,2)" />
|
|
|
+ <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r2 }}</span>
|
|
|
+ <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r2" step="0.01" type="number" :disabled="scope.row.isTwoWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,2)" :placeholder="scope.row.placeholder_r2" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW2" :key="12" label="第二班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.w2 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.w2" :disabled="scope.row.isTwoWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurWeight(scope.row,2)" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.w2" :disabled="scope.row.isTwoWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurWeight(scope.row,2)" :placeholder="scope.row.placeholder_w2" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW2 && table.isPtsfname" :key="13" label="第二班补料重量" min-width="100px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.bw2 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.bw2" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.bw2" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" :placeholder="scope.row.placeholder_bw2" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW3" :key="14" label="第三班比例(%)" min-width="85px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.NoEdit">{{ scope.row.r3 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.r3" step="0.01" type="number" :disabled="scope.row.isThreeWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,3)" />
|
|
|
+ <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r3 }}</span>
|
|
|
+ <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r3" step="0.01" type="number" :disabled="scope.row.isThreeWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,3)" :placeholder="scope.row.placeholder_r3"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW3" :key="15" label="第三班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.w3 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.w3" :disabled="scope.row.isThreeWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurWeight(scope.row,3)" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.w3" :disabled="scope.row.isThreeWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurWeight(scope.row,3)" :placeholder="scope.row.placeholder_w3" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW3 && table.isPtsfname" :key="16" label="第三班补料重量" min-width="100px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.bw3 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.bw3" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.bw3" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" :placeholder="scope.row.placeholder_bw3" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW4" :key="17" label="第四班比例(%)" min-width="85px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.NoEdit">{{ scope.row.r4 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.r4" step="0.01" type="number" :disabled="scope.row.isFourWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,4)" />
|
|
|
+ <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r4 }}</span>
|
|
|
+ <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r4" step="0.01" type="number" :disabled="scope.row.isFourWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,4)" :placeholder="scope.row.placeholder_r4" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW4" :key="18" label="第四班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.w4 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.w4" :disabled="scope.row.isFourWeight" step="0.01" type="number" style="width:100%;padding:10px 0;padding:10px 0;" @blur="blurWeight(scope.row,4)" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.w4" :disabled="scope.row.isFourWeight" step="0.01" type="number" style="width:100%;padding:10px 0;padding:10px 0;" @blur="blurWeight(scope.row,4)" :placeholder="scope.row.placeholder_w4" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW4 && table.isPtsfname" :key="19" label="第四班补料重量" min-width="90px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.bw4 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.bw4" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.bw4" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" :placeholder="scope.row.placeholder_bw4" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW5" :key="20" label="第五班比例(%)" min-width="85px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.NoEdit">{{ scope.row.r5 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.r5" step="0.01" type="number" :disabled="scope.row.isFiveWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,5)" />
|
|
|
+ <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r5 }}</span>
|
|
|
+ <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r5" step="0.01" type="number" :disabled="scope.row.isFiveWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,5)" :placeholder="scope.row.placeholder_r5" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW5" :key="21" label="第五班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.w5 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.w5" :disabled="scope.row.isFiveWeight" step="0.01" type="number" style="width:100%;padding:10px 0;padding:10px 0;" @blur="blurWeight(scope.row,5)" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.w5" :disabled="scope.row.isFiveWeight" step="0.01" type="number" style="width:100%;padding:10px 0;padding:10px 0;" @blur="blurWeight(scope.row,5)" :placeholder="scope.row.placeholder_w5" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW5 && table.isPtsfname" :key="22" label="第五班补料重量" min-width="90px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.bw5 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.bw5" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.bw5" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" :placeholder="scope.row.placeholder_bw5" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW6" :key="23" label="第六班比例(%)" min-width="85px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.NoEdit">{{ scope.row.r6 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.r6" step="0.01" type="number" :disabled="scope.row.isSixWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,6)" />
|
|
|
+ <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r6 }}</span>
|
|
|
+ <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r6" step="0.01" type="number" :disabled="scope.row.isSixWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,6)" :placeholder="scope.row.placeholder_r6" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW6" :key="24" label="第六班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.w6 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.w6" :disabled="scope.row.isSixWeight" step="0.01" type="number" style="width:100%;padding:10px 0;padding:10px 0;" @blur="blurWeight(scope.row,6)" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.w6" :disabled="scope.row.isSixWeight" step="0.01" type="number" style="width:100%;padding:10px 0;padding:10px 0;" @blur="blurWeight(scope.row,6)" :placeholder="scope.row.placeholder_w6" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW6 && table.isPtsfname" :key="25" label="第六班补料重量" min-width="90px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.NoEdit">{{ scope.row.bw6 }}</span>
|
|
|
- <el-input v-if="scope.row.Edit" v-model="scope.row.bw6" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
|
|
|
+ <el-input v-if="scope.row.Edit" v-model="scope.row.bw6" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" :placeholder="scope.row.placeholder_bw6" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :key="26" label="饲喂总比例(%)" min-width="60px" align="center">
|
|
@@ -787,8 +790,10 @@ export default {
|
|
|
components: { Pagination, Pagination2, DryMatterRegulation },
|
|
|
data() {
|
|
|
return {
|
|
|
+ isproportion:false,
|
|
|
dialogFull: false,
|
|
|
isRoleEdit: [],
|
|
|
+ isSynchronous:[],
|
|
|
headerList: [],
|
|
|
pickerMinDate: '',
|
|
|
pickerOptions: {
|
|
@@ -816,7 +821,8 @@ export default {
|
|
|
{ name: 'getFTSWLSList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
|
|
|
{ name: 'getFTBLList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
|
|
|
{ name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
|
|
|
- { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
|
|
|
+ { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
|
|
|
+ { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'),"inforname":"udFeedpSync" }}
|
|
|
],
|
|
|
getFeedTempletNameListParm: {
|
|
|
name: 'getFeedTempletName',
|
|
@@ -1096,6 +1102,7 @@ export default {
|
|
|
cellStyle: { padding: 0 + 'px' },
|
|
|
myHeight: document.documentElement.clientHeight - 85 - 140,
|
|
|
oldRowList:{},
|
|
|
+ oldList:[],
|
|
|
decimal: parseInt(Cookies.get('decimal')),
|
|
|
decimalr: parseInt(Cookies.get('decimalr'))
|
|
|
}
|
|
@@ -1141,6 +1148,11 @@ export default {
|
|
|
},
|
|
|
getDownList() {
|
|
|
GetDataByNames(this.requestParams).then(response => {
|
|
|
+ if(response.data.getSysoptEnable.list[0].inforvalue == 1){
|
|
|
+ this.isSynchronous = true
|
|
|
+ }else{
|
|
|
+ this.isSynchronous = false
|
|
|
+ }
|
|
|
this.recipeTemplateList = response.data.getFTSWLSList.list
|
|
|
this.feedingFormulaList = response.data.getFTBLList.list
|
|
|
this.livestockTypeList = response.data.getCowclassListEnable.list
|
|
@@ -1236,13 +1248,13 @@ export default {
|
|
|
this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
|
|
|
this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
|
|
|
this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
|
|
|
- if (response.data.list[i].ftid !== undefined && response.data.list[i].ftid !== '') {
|
|
|
- if (this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid) !== undefined) {
|
|
|
- this.$set(response.data.list[i], 'dryweight', this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid).dryweight) // 编辑保存
|
|
|
- } else {
|
|
|
- this.$set(response.data.list[i], 'dryweight', '')
|
|
|
- }
|
|
|
- }
|
|
|
+ // if (response.data.list[i].ftid !== undefined && response.data.list[i].ftid !== '') {
|
|
|
+ // if (this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid) !== undefined) {
|
|
|
+ // this.$set(response.data.list[i], 'dryweight', this.recipeTemplateList.find(obj => obj.id == response.data.list[i].ftid).dryweight) // 编辑保存
|
|
|
+ // } else {
|
|
|
+ // this.$set(response.data.list[i], 'dryweight', '')
|
|
|
+ // }
|
|
|
+ // }
|
|
|
if (response.data.list[i].ftid == undefined || response.data.list[i].ftname == '') {
|
|
|
this.$set(response.data.list[i], 'ftid', '')
|
|
|
this.$set(response.data.list[i], 'ftname', '')
|
|
@@ -1388,8 +1400,22 @@ export default {
|
|
|
response.data.list[i].r6 = 0
|
|
|
response.data.list[i].w6 = 0
|
|
|
}
|
|
|
- this.$set(response.data.list[i], 'sumr', parseFloat(response.data.list[i].r1) + parseFloat(response.data.list[i].r2) + parseFloat(response.data.list[i].r3) + parseFloat(response.data.list[i].r4))
|
|
|
- response.data.list[i].sumr = formatNum(response.data.list[i].sumr, parseInt(Cookies.get('decimalr')))
|
|
|
+ // this.$set(response.data.list[i], 'sumr', parseFloat(response.data.list[i].r1) + parseFloat(response.data.list[i].r2) + parseFloat(response.data.list[i].r3) + parseFloat(response.data.list[i].r4))
|
|
|
+ // response.data.list[i].sumr = formatNum(response.data.list[i].sumr, parseInt(Cookies.get('decimalr')))
|
|
|
+ var sumr = 0
|
|
|
+ if(response.data.list[i].r1 && !isNaN(response.data.list[i].r1)){
|
|
|
+ sumr += parseFloat(response.data.list[i].r1) }
|
|
|
+ if(response.data.list[i].r2 && !isNaN(response.data.list[i].r2)){
|
|
|
+ sumr += parseFloat(response.data.list[i].r2) }
|
|
|
+ if(response.data.list[i].r3 && !isNaN(response.data.list[i].r3)){
|
|
|
+ sumr += parseFloat(response.data.list[i].r3) }
|
|
|
+ if(response.data.list[i].r4 && !isNaN(response.data.list[i].r4)){
|
|
|
+ sumr += parseFloat(response.data.list[i].r4) }
|
|
|
+ if(response.data.list[i].r5 && !isNaN(response.data.list[i].r5)){
|
|
|
+ sumr += parseFloat(response.data.list[i].r5) }
|
|
|
+ if(response.data.list[i].r6 && !isNaN(response.data.list[i].r6)){ sumr += parseFloat(response.data.list[i].r6) }
|
|
|
+ console.log(sumr,'sumr')
|
|
|
+ response.data.list[i].sumr = formatNum(sumr, parseInt(Cookies.get('decimalr')))
|
|
|
// this.$set(response.data.list[i],'feedweight',formatNum(parseFloat(response.data.list[i].feedweight) * parseFloat(response.data.list[i].sumr)/100,2))
|
|
|
this.$set(response.data.list[i], 'dailyWeight', parseFloat(response.data.list[i].w1) + parseFloat(response.data.list[i].w2) + parseFloat(response.data.list[i].w3) + parseFloat(response.data.list[i].w4))
|
|
|
response.data.list[i].dailyWeight = formatNum(response.data.list[i].dailyWeight, parseInt(Cookies.get('decimal')))
|
|
@@ -1654,12 +1680,12 @@ export default {
|
|
|
row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
|
|
|
row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
|
|
|
}
|
|
|
- if (row.w1 == '') { row.w1 = 0 }
|
|
|
- if (row.w2 == '') { row.w2 = 0 }
|
|
|
- if (row.w3 == '') { row.w3 = 0 }
|
|
|
- if (row.w4 == '') { row.w4 = 0 }
|
|
|
- if (row.w5 == '') { row.w5 = 0 }
|
|
|
- if (row.w6 == '') { row.w6 = 0 }
|
|
|
+ if (row.w1 == '' || row.w1 == undefined || isNaN(row.w1)) { row.w1 = 0 }
|
|
|
+ if (row.w2 == '' || row.w2 == undefined || isNaN(row.w2)) { row.w2 = 0 }
|
|
|
+ if (row.w3 == '' || row.w3 == undefined || isNaN(row.w3)) { row.w3 = 0 }
|
|
|
+ if (row.w4 == '' || row.w4 == undefined || isNaN(row.w4)) { row.w4 = 0 }
|
|
|
+ if (row.w5 == '' || row.w5 == undefined || isNaN(row.w5)) { row.w5 = 0 }
|
|
|
+ if (row.w6 == '' || row.w6 == undefined || isNaN(row.w6)) { row.w6 = 0 }
|
|
|
|
|
|
// 系数不变
|
|
|
// 系数头数=实际牛头数*系数
|
|
@@ -1667,98 +1693,175 @@ export default {
|
|
|
// 配方重量=实际牛头数*系数*配方模板取Sfweight
|
|
|
row.ftweight = (row.ccount * row.ratio / 100 * row.Sfweight).toFixed(this.decimal)
|
|
|
this.public(row)
|
|
|
+ this.placeholder(row)
|
|
|
},
|
|
|
blurRatio(row) {
|
|
|
if (row.ftid !== '-1' && row.ftid !== '') {
|
|
|
row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
|
|
|
row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
|
|
|
}
|
|
|
- if (row.w1 == '') { row.w1 = 0 }
|
|
|
- if (row.w2 == '') { row.w2 = 0 }
|
|
|
- if (row.w3 == '') { row.w3 = 0 }
|
|
|
- if (row.w4 == '') { row.w4 = 0 }
|
|
|
- if (row.w5 == '') { row.w5 = 0 }
|
|
|
- if (row.w6 == '') { row.w6 = 0 }
|
|
|
+ if (row.w1 == '' || row.w1 == undefined || isNaN(row.w1)) { row.w1 = 0 }
|
|
|
+ if (row.w2 == '' || row.w2 == undefined || isNaN(row.w2)) { row.w2 = 0 }
|
|
|
+ if (row.w3 == '' || row.w3 == undefined || isNaN(row.w3)) { row.w3 = 0 }
|
|
|
+ if (row.w4 == '' || row.w4 == undefined || isNaN(row.w4)) { row.w4 = 0 }
|
|
|
+ if (row.w5 == '' || row.w5 == undefined || isNaN(row.w5)) { row.w5 = 0 }
|
|
|
+ if (row.w6 == '' || row.w6 == undefined || isNaN(row.w6)) { row.w6 = 0 }
|
|
|
// 配方重量=实际牛头数*系数*配方模板取Sfweight
|
|
|
row.ftweight = (row.ccount * row.ratio / 100 * row.Sfweight).toFixed(this.decimal)
|
|
|
// 实际牛头数不变
|
|
|
// 系数头数=实际牛头数*系数
|
|
|
row.ccountratio = (parseFloat(row.ccount)*(parseFloat(row.ratio) / 100)).toFixed(this.decimal)
|
|
|
this.public(row)
|
|
|
+ this.placeholder(row)
|
|
|
},
|
|
|
blurCcountratio(row) {
|
|
|
if (row.ftid !== '-1' && row.ftid !== '') {
|
|
|
row.Sfweight = this.recipeTemplateList.find(obj => obj.id == row.ftid).Sfweight
|
|
|
row.SfweightLock = this.recipeTemplateList.find(obj => obj.id == row.ftid).SfweightLock
|
|
|
}
|
|
|
- if (row.w1 == '') { row.w1 = 0 }
|
|
|
- if (row.w2 == '') { row.w2 = 0 }
|
|
|
- if (row.w3 == '') { row.w3 = 0 }
|
|
|
- if (row.w4 == '') { row.w4 = 0 }
|
|
|
- if (row.w5 == '') { row.w5 = 0 }
|
|
|
- if (row.w6 == '') { row.w6 = 0 }
|
|
|
+ if (row.w1 == '' || row.w1 == undefined || isNaN(row.w1)) { row.w1 = 0 }
|
|
|
+ if (row.w2 == '' || row.w2 == undefined || isNaN(row.w2)) { row.w2 = 0 }
|
|
|
+ if (row.w3 == '' || row.w3 == undefined || isNaN(row.w3)) { row.w3 = 0 }
|
|
|
+ if (row.w4 == '' || row.w4 == undefined || isNaN(row.w4)) { row.w4 = 0 }
|
|
|
+ if (row.w5 == '' || row.w5 == undefined || isNaN(row.w5)) { row.w5 = 0 }
|
|
|
+ if (row.w6 == '' || row.w6 == undefined || isNaN(row.w6)) { row.w6 = 0 }
|
|
|
// 配方重量=实际牛头数*系数*配方模板取Sfweight
|
|
|
row.ftweight = (row.ccount * row.ratio / 100 * row.Sfweight).toFixed(this.decimal)
|
|
|
// 实际牛头数不变
|
|
|
// 系数=系数头数/实际牛头数*100
|
|
|
row.ratio = (parseFloat(row.ccountratio) / parseFloat(row.ccount) * 100).toFixed(this.decimal)
|
|
|
this.public(row)
|
|
|
+ this.placeholder(row)
|
|
|
},
|
|
|
public(row){
|
|
|
console.log(row,'row')
|
|
|
// 未锁定时:各班次比例不变,各班次重量=配方重量*各班次比例
|
|
|
// 锁定时:未锁定班次比例不变,锁定班次比例=班次重量/配方重量x100%
|
|
|
if(row.isOneWeight == true){
|
|
|
- row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(row.w1 && row.ftweight && !isNaN(parseFloat(row.w1)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r1 = 0
|
|
|
+ }
|
|
|
}else{
|
|
|
- row.w1 = (parseFloat(row.ftweight) * parseFloat(row.r1) / 100).toFixed(this.decimal)
|
|
|
+ if(row.r1 && row.ftweight && !isNaN(parseFloat(row.r1)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.w1 = (parseFloat(row.ftweight) * parseFloat(row.r1) / 100).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w1 = 0
|
|
|
+ }
|
|
|
}
|
|
|
if(row.isTwoWeight == true){
|
|
|
- row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(row.w2 && row.ftweight && !isNaN(parseFloat(row.w2)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r2 = 0
|
|
|
+ }
|
|
|
}else{
|
|
|
- row.w2 = (parseFloat(row.ftweight) * parseFloat(row.r2) / 100).toFixed(this.decimal)
|
|
|
+ if(row.r2 && row.ftweight && !isNaN(parseFloat(row.r2)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.w2 = (parseFloat(row.ftweight) * parseFloat(row.r2) / 100).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w2 = 0
|
|
|
+ }
|
|
|
}
|
|
|
if(row.isThreeWeight == true){
|
|
|
- row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(row.w3 && row.ftweight && !isNaN(parseFloat(row.w3)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r3 = 0
|
|
|
+ }
|
|
|
}else{
|
|
|
- row.w3 = (parseFloat(row.ftweight) * parseFloat(row.r3) / 100).toFixed(this.decimal)
|
|
|
+ if(row.r3 && row.ftweight && !isNaN(parseFloat(row.r3)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.w3 = (parseFloat(row.ftweight) * parseFloat(row.r3) / 100).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w3 = 0
|
|
|
+ }
|
|
|
}
|
|
|
if(row.isFourWeight == true){
|
|
|
- row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(row.w4 && row.ftweight && !isNaN(parseFloat(row.w4)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r4 = 0
|
|
|
+ }
|
|
|
}else{
|
|
|
- row.w4 = (parseFloat(row.ftweight) * parseFloat(row.r4) / 100).toFixed(this.decimal)
|
|
|
+ if(row.r4 && row.ftweight && !isNaN(parseFloat(row.r4)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.w4 = (parseFloat(row.ftweight) * parseFloat(row.r4) / 100).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w4 = 0
|
|
|
+ }
|
|
|
}
|
|
|
if(row.isFiveWeight == true){
|
|
|
- row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(row.w5 && row.ftweight && !isNaN(parseFloat(row.w5)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r5 = 0
|
|
|
+ }
|
|
|
}else{
|
|
|
- row.w5 = (parseFloat(row.ftweight) * parseFloat(row.r5) / 100).toFixed(this.decimal)
|
|
|
+ if(row.r5 && row.ftweight && !isNaN(parseFloat(row.r5)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.w5 = (parseFloat(row.ftweight) * parseFloat(row.r5) / 100).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w5 = 0
|
|
|
+ }
|
|
|
}
|
|
|
if(row.isSixWeight == true){
|
|
|
- row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(row.w6 && row.ftweight && !isNaN(parseFloat(row.w6)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r5 = 0
|
|
|
+ }
|
|
|
}else{
|
|
|
- row.w6 = (parseFloat(row.ftweight) * parseFloat(row.r6) / 100).toFixed(this.decimal)
|
|
|
+ if(row.r6 && row.ftweight && !isNaN(parseFloat(row.r6)) && !isNaN(parseFloat(row.ftweight))){
|
|
|
+ row.w6 = (parseFloat(row.ftweight) * parseFloat(row.r6) / 100).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w6 = 0
|
|
|
+ }
|
|
|
}
|
|
|
console.log(row,'row2')
|
|
|
|
|
|
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)
|
|
|
+ var sumr = 0
|
|
|
+ if(row.r1 && !isNaN(row.r1)){ sumr += parseFloat(row.r1) }
|
|
|
+ if(row.r2 && !isNaN(row.r2)){ sumr += parseFloat(row.r2) }
|
|
|
+ if(row.r3 && !isNaN(row.r3)){ sumr += parseFloat(row.r3) }
|
|
|
+ if(row.r4 && !isNaN(row.r4)){ sumr += parseFloat(row.r4) }
|
|
|
+ if(row.r5 && !isNaN(row.r5)){ sumr += parseFloat(row.r5) }
|
|
|
+ if(row.r6 && !isNaN(row.r6)){ sumr += parseFloat(row.r6) }
|
|
|
+ this.$set(row, 'sumr', sumr.toFixed(this.decimalr))
|
|
|
}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 sumr = 0
|
|
|
+ if(row.r1 && !isNaN(row.r1)){ sumr += parseFloat(row.r1) }
|
|
|
+ if(row.r2 && !isNaN(row.r2)){ sumr += parseFloat(row.r2) }
|
|
|
+ if(row.r3 && !isNaN(row.r3)){ sumr += parseFloat(row.r3) }
|
|
|
+ if(row.r4 && !isNaN(row.r4)){ sumr += parseFloat(row.r4) }
|
|
|
+ if(row.r5 && !isNaN(row.r5)){ sumr += parseFloat(row.r5) }
|
|
|
+ if(row.r6 && !isNaN(row.r6)){ sumr += parseFloat(row.r6) }
|
|
|
+ this.$set(row, 'sumr', sumr.toFixed(this.decimalr))
|
|
|
}
|
|
|
// 饲喂投喂量 = 所有班次重量之和
|
|
|
- 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)
|
|
|
+ var sumw = 0
|
|
|
+ if(row.w1 && !isNaN(row.w1)){ sumw += parseFloat(row.w1) }
|
|
|
+ if(row.w2 && !isNaN(row.w2)){ sumw += parseFloat(row.w2) }
|
|
|
+ if(row.w3 && !isNaN(row.w3)){ sumw += parseFloat(row.w3) }
|
|
|
+ if(row.w4 && !isNaN(row.w4)){ sumw += parseFloat(row.w4) }
|
|
|
+ if(row.w5 && !isNaN(row.w5)){ sumw += parseFloat(row.w5) }
|
|
|
+ if(row.w6 && !isNaN(row.w6)){ sumw += parseFloat(row.w6) }
|
|
|
+ this.$set(row, 'sumw', sumw.toFixed(this.decimal))
|
|
|
// 日投喂量 = 饲喂投喂量+补料
|
|
|
- if (row.bw1 == 'NaN' || row.bw1 == '') { this.$set(row, 'bw1', 0) }
|
|
|
- if (row.bw2 == 'NaN' || row.bw2 == '') { this.$set(row, 'bw2', 0) }
|
|
|
- if (row.bw3 == 'NaN' || row.bw3 == '') { this.$set(row, 'bw3', 0) }
|
|
|
- if (row.bw4 == 'NaN' || row.bw4 == '') { this.$set(row, 'bw4', 0) }
|
|
|
- if (row.bw5 == 'NaN' || row.bw5 == '') { this.$set(row, 'bw5', 0) }
|
|
|
- if (row.bw6 == 'NaN' || row.bw6 == '') { this.$set(row, 'bw6', 0) }
|
|
|
- var sumbw = (parseFloat(row.bw1) + parseFloat(row.bw2) + parseFloat(row.bw3) + parseFloat(row.bw4) + parseFloat(row.bw5) + parseFloat(row.bw6)).toFixed(this.decimal)
|
|
|
+ if (isNaN(row.bw1) || row.bw1 == '') { this.$set(row, 'bw1', 0) }
|
|
|
+ if (isNaN(row.bw2) || row.bw2 == '') { this.$set(row, 'bw2', 0) }
|
|
|
+ if (isNaN(row.bw3) || row.bw3 == '') { this.$set(row, 'bw3', 0) }
|
|
|
+ if (isNaN(row.bw4) || row.bw4 == '') { this.$set(row, 'bw4', 0) }
|
|
|
+ if (isNaN(row.bw5) || row.bw5 == '') { this.$set(row, 'bw5', 0) }
|
|
|
+ if (isNaN(row.bw6) || row.bw6 == '') { this.$set(row, 'bw6', 0) }
|
|
|
+ // var sumbw = (parseFloat(row.bw1) + parseFloat(row.bw2) + parseFloat(row.bw3) + parseFloat(row.bw4) + parseFloat(row.bw5) + parseFloat(row.bw6)).toFixed(this.decimal)
|
|
|
+ var sumbw = 0
|
|
|
+ if(row.bw1 && !isNaN(row.bw1)){ sumbw += parseFloat(row.bw1) }
|
|
|
+ if(row.bw2 && !isNaN(row.bw2)){ sumbw += parseFloat(row.bw2) }
|
|
|
+ if(row.bw3 && !isNaN(row.bw3)){ sumbw += parseFloat(row.bw3) }
|
|
|
+ if(row.bw4 && !isNaN(row.bw4)){ sumbw += parseFloat(row.bw4) }
|
|
|
+ if(row.bw5 && !isNaN(row.bw5)){ sumbw += parseFloat(row.bw5) }
|
|
|
+ if(row.bw6 && !isNaN(row.bw6)){ sumbw += parseFloat(row.bw6) }
|
|
|
+ this.$set(row, 'sumbw', sumbw.toFixed(this.decimal))
|
|
|
var todayfeed = parseFloat(sumw) + parseFloat(sumbw)
|
|
|
this.$set(row, 'todayfeed', todayfeed)
|
|
|
},
|
|
@@ -1769,43 +1872,112 @@ export default {
|
|
|
}
|
|
|
// 配方重量=实际牛头数*系数*配方模板取Sfweight
|
|
|
row.ftweight = (parseFloat(row.ccount) * parseFloat(row.ratio) / 100 * parseFloat(row.Sfweight)).toFixed(this.decimal)
|
|
|
- console.log(parseFloat(row.ccount))
|
|
|
- console.log(parseFloat(row.ftweight))
|
|
|
+ console.log(parseFloat(row.ccount),'======ccount')
|
|
|
+ console.log(parseFloat(row.ftweight),'======ftweight')
|
|
|
if(item == 1){
|
|
|
// 一班比例
|
|
|
- row.w1 = (parseFloat(row.r1)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ if(!isNaN(parseFloat(row.r1)) && !isNaN(parseFloat(row.ftweight)) && row.r1 && row.ftweight){
|
|
|
+ row.w1 = (parseFloat(row.r1)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w1 = 0
|
|
|
+ }
|
|
|
}else if(item == 2){
|
|
|
// 二班比例
|
|
|
- row.w2 = (parseFloat(row.r2)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ if(!isNaN(parseFloat(row.r2)) && !isNaN(parseFloat(row.ftweight)) && row.r2 && row.ftweight){
|
|
|
+ row.w2 = (parseFloat(row.r2)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w2 = 0
|
|
|
+ }
|
|
|
}else if(item == 3){
|
|
|
// 三班比例
|
|
|
- row.w3 = (parseFloat(row.r3)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ if(!isNaN(parseFloat(row.r3)) && !isNaN(parseFloat(row.ftweight)) && row.r3 && row.ftweight){
|
|
|
+ row.w3 = (parseFloat(row.r3)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w3 = 0
|
|
|
+ }
|
|
|
}else if(item == 4){
|
|
|
// 四班比例
|
|
|
- row.w4 = (parseFloat(row.r4)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ if(!isNaN(parseFloat(row.r4)) && !isNaN(parseFloat(row.ftweight)) && row.r4 && row.ftweight){
|
|
|
+ row.w4 = (parseFloat(row.r4)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w4 = 0
|
|
|
+ }
|
|
|
}else if(item == 5){
|
|
|
// 五班比例
|
|
|
- row.w5 = (parseFloat(row.r5)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ if(!isNaN(parseFloat(row.r5)) && !isNaN(parseFloat(row.ftweight)) && row.r5 && row.ftweight){
|
|
|
+ row.w5 = (parseFloat(row.r5)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w5 = 0
|
|
|
+ }
|
|
|
}else if(item == 6){
|
|
|
// 六班比例
|
|
|
- row.w6 = (parseFloat(row.r6)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ if(!isNaN(parseFloat(row.r6)) && !isNaN(parseFloat(row.ftweight)) && row.r6 && row.ftweight){
|
|
|
+ row.w6 = (parseFloat(row.r6)/100 * parseFloat(row.ftweight)).toFixed(this.decimal)
|
|
|
+ }else{
|
|
|
+ row.w6 = 0
|
|
|
+ }
|
|
|
}
|
|
|
// 总比例=所有比例之和
|
|
|
- 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)
|
|
|
- this.$set(row, 'todayweight', sumw)
|
|
|
+ var sumr = 0
|
|
|
+ if(row.r1 && !isNaN(row.r1)){ sumr += parseFloat(row.r1) }
|
|
|
+ if(row.r2 && !isNaN(row.r2)){ sumr += parseFloat(row.r2) }
|
|
|
+ if(row.r3 && !isNaN(row.r3)){ sumr += parseFloat(row.r3) }
|
|
|
+ if(row.r4 && !isNaN(row.r4)){ sumr += parseFloat(row.r4) }
|
|
|
+ if(row.r5 && !isNaN(row.r5)){ sumr += parseFloat(row.r5) }
|
|
|
+ if(row.r6 && !isNaN(row.r6)){ sumr += parseFloat(row.r6) }
|
|
|
+ this.$set(row, 'sumr', sumr.toFixed(this.decimalr))
|
|
|
+ var sumw = 0
|
|
|
+ if(row.w1 && !isNaN(row.w1)){ sumw += parseFloat(row.w1) }
|
|
|
+ if(row.w2 && !isNaN(row.w2)){ sumw += parseFloat(row.w2) }
|
|
|
+ if(row.w3 && !isNaN(row.w3)){ sumw += parseFloat(row.w3) }
|
|
|
+ if(row.w4 && !isNaN(row.w4)){ sumw += parseFloat(row.w4) }
|
|
|
+ if(row.w5 && !isNaN(row.w5)){ sumw += parseFloat(row.w5) }
|
|
|
+ if(row.w6 && !isNaN(row.w6)){ sumw += parseFloat(row.w6) }
|
|
|
+ this.$set(row, 'sumw', sumw.toFixed(this.decimal))
|
|
|
// 日投喂量 = 饲喂投喂量+补料
|
|
|
- if (row.bw1 == 'NaN' || row.bw1 == '') { this.$set(row, 'bw1', 0) }
|
|
|
- if (row.bw2 == 'NaN' || row.bw2 == '') { this.$set(row, 'bw2', 0) }
|
|
|
- if (row.bw3 == 'NaN' || row.bw3 == '') { this.$set(row, 'bw3', 0) }
|
|
|
- if (row.bw4 == 'NaN' || row.bw4 == '') { this.$set(row, 'bw4', 0) }
|
|
|
- if (row.bw5 == 'NaN' || row.bw5 == '') { this.$set(row, 'bw5', 0) }
|
|
|
- if (row.bw6 == 'NaN' || row.bw6 == '') { this.$set(row, 'bw6', 0) }
|
|
|
- var sumbw = (parseFloat(row.bw1) + parseFloat(row.bw2) + parseFloat(row.bw3) + parseFloat(row.bw4) + parseFloat(row.bw5) + parseFloat(row.bw6)).toFixed(this.decimal)
|
|
|
+ if (isNaN(row.bw1) || row.bw1 == '' || row.bw1 == undefined) { this.$set(row, 'bw1', 0) }
|
|
|
+ if (isNaN(row.bw2) || row.bw2 == '' || row.bw1 == undefined) { this.$set(row, 'bw2', 0) }
|
|
|
+ if (isNaN(row.bw3) || row.bw3 == '' || row.bw1 == undefined) { this.$set(row, 'bw3', 0) }
|
|
|
+ if (isNaN(row.bw4) || row.bw4 == '' || row.bw1 == undefined) { this.$set(row, 'bw4', 0) }
|
|
|
+ if (isNaN(row.bw5) || row.bw5 == '' || row.bw1 == undefined) { this.$set(row, 'bw5', 0) }
|
|
|
+ if (isNaN(row.bw6) || row.bw6 == '' || row.bw1 == undefined) { this.$set(row, 'bw6', 0) }
|
|
|
+ var sumbw = 0
|
|
|
+ if(row.bw1 && !isNaN(row.bw1)){ sumbw += parseFloat(row.bw1) }
|
|
|
+ if(row.bw2 && !isNaN(row.bw2)){ sumbw += parseFloat(row.bw2) }
|
|
|
+ if(row.bw3 && !isNaN(row.bw3)){ sumbw += parseFloat(row.bw3) }
|
|
|
+ if(row.bw4 && !isNaN(row.bw4)){ sumbw += parseFloat(row.bw4) }
|
|
|
+ if(row.bw5 && !isNaN(row.bw5)){ sumbw += parseFloat(row.bw5) }
|
|
|
+ if(row.bw6 && !isNaN(row.bw6)){ sumbw += parseFloat(row.bw6) }
|
|
|
+ this.$set(row, 'sumbw', sumbw.toFixed(this.decimal))
|
|
|
+ // var sumbw = (parseFloat(row.bw1) + parseFloat(row.bw2) + parseFloat(row.bw3) + parseFloat(row.bw4) + parseFloat(row.bw5) + parseFloat(row.bw6)).toFixed(this.decimal)
|
|
|
var todayfeed = parseFloat(sumw) + parseFloat(sumbw)
|
|
|
+ console.log(todayfeed,'sumw==')
|
|
|
this.$set(row, 'todayfeed', todayfeed)
|
|
|
+ this.placeholder(row)
|
|
|
+ },
|
|
|
+ placeholder(row){
|
|
|
+ this.$set(row, 'placeholder_r1', this.oldRowList.r1)
|
|
|
+ this.$set(row, 'placeholder_r2', this.oldRowList.r2)
|
|
|
+ this.$set(row, 'placeholder_r3', this.oldRowList.r3)
|
|
|
+ this.$set(row, 'placeholder_r4', this.oldRowList.r4)
|
|
|
+ this.$set(row, 'placeholder_r5', this.oldRowList.r5)
|
|
|
+ this.$set(row, 'placeholder_r6', this.oldRowList.r6)
|
|
|
+ this.$set(row, 'placeholder_w1', this.oldRowList.w1)
|
|
|
+ this.$set(row, 'placeholder_w2', this.oldRowList.w2)
|
|
|
+ this.$set(row, 'placeholder_w3', this.oldRowList.w3)
|
|
|
+ this.$set(row, 'placeholder_w4', this.oldRowList.w4)
|
|
|
+ this.$set(row, 'placeholder_w5', this.oldRowList.w5)
|
|
|
+ this.$set(row, 'placeholder_w6', this.oldRowList.w6)
|
|
|
+ this.$set(row, 'placeholder_bw1', this.oldRowList.bw1)
|
|
|
+ this.$set(row, 'placeholder_bw2', this.oldRowList.bw2)
|
|
|
+ this.$set(row, 'placeholder_bw3', this.oldRowList.bw3)
|
|
|
+ this.$set(row, 'placeholder_bw4', this.oldRowList.bw4)
|
|
|
+ this.$set(row, 'placeholder_bw5', this.oldRowList.bw5)
|
|
|
+ this.$set(row, 'placeholder_bw6', this.oldRowList.bw6)
|
|
|
+ this.$set(row, 'placeholder_ccount', this.oldRowList.ccount)
|
|
|
+ this.$set(row, 'placeholder_ratio', this.oldRowList.ratio)
|
|
|
+ this.$set(row, 'placeholder_ccountratio', this.oldRowList.ccountratio)
|
|
|
},
|
|
|
blurWeight(row,item) {
|
|
|
// 配方重量=实际牛头数*系数*配方模板取Sfweight
|
|
@@ -1814,43 +1986,93 @@ export default {
|
|
|
}
|
|
|
if(item == 1){
|
|
|
// 一班重量
|
|
|
- row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(!isNaN(parseFloat(row.w1)) && !isNaN(parseFloat(row.ftweight)) && row.w1 && row.ftweight){
|
|
|
+ row.r1 = (parseFloat(row.w1) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r1 = 0
|
|
|
+ }
|
|
|
}else if(item == 2){
|
|
|
// 二班重量
|
|
|
- row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(!isNaN(parseFloat(row.w2)) && !isNaN(parseFloat(row.ftweight)) && row.w2 && row.ftweight){
|
|
|
+ row.r2 = (parseFloat(row.w2) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r2 = 0
|
|
|
+ }
|
|
|
}else if(item == 3){
|
|
|
// 三班重量
|
|
|
- row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(!isNaN(parseFloat(row.w3)) && !isNaN(parseFloat(row.ftweight)) && row.w3 && row.ftweight){
|
|
|
+ row.r3 = (parseFloat(row.w3) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r3 = 0
|
|
|
+ }
|
|
|
}else if(item == 4){
|
|
|
// 四班重量
|
|
|
- row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(!isNaN(parseFloat(row.w4)) && !isNaN(parseFloat(row.ftweight)) && row.w4 && row.ftweight){
|
|
|
+ row.r4 = (parseFloat(row.w4) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r4 = 0
|
|
|
+ }
|
|
|
}else if(item == 5){
|
|
|
// 五班重量
|
|
|
- row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(!isNaN(parseFloat(row.w5)) && !isNaN(parseFloat(row.ftweight)) && row.w5 && row.ftweight){
|
|
|
+ row.r5 = (parseFloat(row.w5) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r5 = 0
|
|
|
+ }
|
|
|
}else if(item == 6){
|
|
|
// 六班重量
|
|
|
- row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ if(!isNaN(parseFloat(row.w6)) && !isNaN(parseFloat(row.ftweight)) && row.w6 && row.ftweight){
|
|
|
+ row.r6 = (parseFloat(row.w6) / parseFloat(row.ftweight) * 100).toFixed(this.decimalr)
|
|
|
+ }else{
|
|
|
+ row.r6 = 0
|
|
|
+ }
|
|
|
}
|
|
|
// 总比例=所有比例之和
|
|
|
- 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)
|
|
|
- this.$set(row, 'todayweight', sumw)
|
|
|
+ var sumr = 0
|
|
|
+ if(row.r1 && !isNaN(row.r1)){ sumr += parseFloat(row.r1) }
|
|
|
+ if(row.r2 && !isNaN(row.r2)){ sumr += parseFloat(row.r2) }
|
|
|
+ if(row.r3 && !isNaN(row.r3)){ sumr += parseFloat(row.r3) }
|
|
|
+ if(row.r4 && !isNaN(row.r4)){ sumr += parseFloat(row.r4) }
|
|
|
+ if(row.r5 && !isNaN(row.r5)){ sumr += parseFloat(row.r5) }
|
|
|
+ if(row.r6 && !isNaN(row.r6)){ sumr += parseFloat(row.r6) }
|
|
|
+ this.$set(row, 'sumr', sumr.toFixed(this.decimalr))
|
|
|
+ var sumw = 0
|
|
|
+ if(row.w1 && !isNaN(row.w1)){ sumw += parseFloat(row.w1) }
|
|
|
+ if(row.w2 && !isNaN(row.w2)){ sumw += parseFloat(row.w2) }
|
|
|
+ if(row.w3 && !isNaN(row.w3)){ sumw += parseFloat(row.w3) }
|
|
|
+ if(row.w4 && !isNaN(row.w4)){ sumw += parseFloat(row.w4) }
|
|
|
+ if(row.w5 && !isNaN(row.w5)){ sumw += parseFloat(row.w5) }
|
|
|
+ if(row.w6 && !isNaN(row.w6)){ sumw += parseFloat(row.w6) }
|
|
|
+ this.$set(row, 'sumw', sumw.toFixed(this.decimal))
|
|
|
// 日投喂量 = 饲喂投喂量+补料
|
|
|
- if (row.bw1 == 'NaN' || row.bw1 == '') { this.$set(row, 'bw1', 0) }
|
|
|
- if (row.bw2 == 'NaN' || row.bw2 == '') { this.$set(row, 'bw2', 0) }
|
|
|
- if (row.bw3 == 'NaN' || row.bw3 == '') { this.$set(row, 'bw3', 0) }
|
|
|
- if (row.bw4 == 'NaN' || row.bw4 == '') { this.$set(row, 'bw4', 0) }
|
|
|
- if (row.bw5 == 'NaN' || row.bw5 == '') { this.$set(row, 'bw5', 0) }
|
|
|
- if (row.bw6 == 'NaN' || row.bw6 == '') { this.$set(row, 'bw6', 0) }
|
|
|
- var sumbw = (parseFloat(row.bw1) + parseFloat(row.bw2) + parseFloat(row.bw3) + parseFloat(row.bw4) + parseFloat(row.bw5) + parseFloat(row.bw6)).toFixed(this.decimal)
|
|
|
+ if (isNaN(row.bw1) || row.bw1 == '' || row.bw1 == undefined) { this.$set(row, 'bw1', 0) }
|
|
|
+ if (isNaN(row.bw2) || row.bw2 == '' || row.bw2 == undefined) { this.$set(row, 'bw2', 0) }
|
|
|
+ if (isNaN(row.bw3) || row.bw3 == '' || row.bw3 == undefined) { this.$set(row, 'bw3', 0) }
|
|
|
+ if (isNaN(row.bw4) || row.bw4 == '' || row.bw4 == undefined) { this.$set(row, 'bw4', 0) }
|
|
|
+ if (isNaN(row.bw5) || row.bw5 == '' || row.bw5 == undefined) { this.$set(row, 'bw5', 0) }
|
|
|
+ if (isNaN(row.bw6) || row.bw6 == '' || row.bw6 == undefined) { this.$set(row, 'bw6', 0) }
|
|
|
+ var sumbw = 0
|
|
|
+ if(row.bw1 && !isNaN(row.bw1)){ sumbw += parseFloat(row.bw1) }
|
|
|
+ if(row.bw2 && !isNaN(row.bw2)){ sumbw += parseFloat(row.bw2) }
|
|
|
+ if(row.bw3 && !isNaN(row.bw3)){ sumbw += parseFloat(row.bw3) }
|
|
|
+ if(row.bw4 && !isNaN(row.bw4)){ sumbw += parseFloat(row.bw4) }
|
|
|
+ if(row.bw5 && !isNaN(row.bw5)){ sumbw += parseFloat(row.bw5) }
|
|
|
+ if(row.bw6 && !isNaN(row.bw6)){ sumbw += parseFloat(row.bw6) }
|
|
|
+ this.$set(row, 'sumbw', sumbw.toFixed(this.decimal))
|
|
|
+ // var sumbw = (parseFloat(row.bw1) + parseFloat(row.bw2) + parseFloat(row.bw3) + parseFloat(row.bw4) + parseFloat(row.bw5) + parseFloat(row.bw6)).toFixed(this.decimal)
|
|
|
var todayfeed = parseFloat(sumw) + parseFloat(sumbw)
|
|
|
this.$set(row, 'todayfeed', todayfeed)
|
|
|
+ this.placeholder(row)
|
|
|
+ },
|
|
|
+ blurBw(row){
|
|
|
+ this.placeholder(row)
|
|
|
},
|
|
|
celldblclick(row, column, cell, event) {
|
|
|
console.log(row, '=====')
|
|
|
- this.handleUpdate(row)
|
|
|
+ if(!this.isproportion){
|
|
|
+ this.handleUpdate(row)
|
|
|
+ }
|
|
|
},
|
|
|
// 编辑
|
|
|
handleUpdate(row) {
|
|
@@ -1880,24 +2102,24 @@ export default {
|
|
|
this.table.temp.ptsfname = row.ptsfname
|
|
|
},
|
|
|
updateData(row) {
|
|
|
- if (row.r1 == 'NaN') { this.$set(row, 'r1', 0) }
|
|
|
- if (row.r2 == 'NaN') { this.$set(row, 'r2', 0) }
|
|
|
- if (row.r3 == 'NaN') { this.$set(row, 'r3', 0) }
|
|
|
- if (row.r4 == 'NaN') { this.$set(row, 'r4', 0) }
|
|
|
- if (row.r5 == 'NaN') { this.$set(row, 'r5', 0) }
|
|
|
- if (row.r6 == 'NaN') { this.$set(row, 'r6', 0) }
|
|
|
- if (row.w1 == 'NaN') { this.$set(row, 'w1', 0) }
|
|
|
- if (row.w2 == 'NaN') { this.$set(row, 'w2', 0) }
|
|
|
- if (row.w3 == 'NaN') { this.$set(row, 'w3', 0) }
|
|
|
- if (row.w4 == 'NaN') { this.$set(row, 'w4', 0) }
|
|
|
- if (row.w5 == 'NaN') { this.$set(row, 'w5', 0) }
|
|
|
- if (row.w6 == 'NaN') { this.$set(row, 'w6', 0) }
|
|
|
- if (row.bw1 == 'NaN') { this.$set(row, 'bw1', 0) }
|
|
|
- if (row.bw2 == 'NaN') { this.$set(row, 'bw2', 0) }
|
|
|
- if (row.bw3 == 'NaN') { this.$set(row, 'bw3', 0) }
|
|
|
- if (row.bw4 == 'NaN') { this.$set(row, 'bw4', 0) }
|
|
|
- if (row.bw5 == 'NaN') { this.$set(row, 'bw5', 0) }
|
|
|
- if (row.bw6 == 'NaN') { this.$set(row, 'bw6', 0) }
|
|
|
+ if (isNaN(row.r1)) { this.$set(row, 'r1', 0) }
|
|
|
+ if (isNaN(row.r2)) { this.$set(row, 'r2', 0) }
|
|
|
+ if (isNaN(row.r3)) { this.$set(row, 'r3', 0) }
|
|
|
+ if (isNaN(row.r4)) { this.$set(row, 'r4', 0) }
|
|
|
+ if (isNaN(row.r5)) { this.$set(row, 'r5', 0) }
|
|
|
+ if (isNaN(row.r6)) { this.$set(row, 'r6', 0) }
|
|
|
+ if (isNaN(row.w1)) { this.$set(row, 'w1', 0) }
|
|
|
+ if (isNaN(row.w2)) { this.$set(row, 'w2', 0) }
|
|
|
+ if (isNaN(row.w3)) { this.$set(row, 'w3', 0) }
|
|
|
+ if (isNaN(row.w4)) { this.$set(row, 'w4', 0) }
|
|
|
+ if (isNaN(row.w5)) { this.$set(row, 'w5', 0) }
|
|
|
+ if (isNaN(row.w6)) { this.$set(row, 'w6', 0) }
|
|
|
+ if (isNaN(row.bw1)) { this.$set(row, 'bw1', 0) }
|
|
|
+ if (isNaN(row.bw2)) { this.$set(row, 'bw2', 0) }
|
|
|
+ if (isNaN(row.bw3)) { this.$set(row, 'bw3', 0) }
|
|
|
+ if (isNaN(row.bw4)) { this.$set(row, 'bw4', 0) }
|
|
|
+ if (isNaN(row.bw5)) { this.$set(row, 'bw5', 0) }
|
|
|
+ if (isNaN(row.bw6)) { this.$set(row, 'bw6', 0) }
|
|
|
var arr = []
|
|
|
for (let i = 1; i <= this.table.RWLength; i++) {
|
|
|
var obj = {}
|
|
@@ -1919,11 +2141,15 @@ export default {
|
|
|
obj['supplement'] = row['bw' + i]
|
|
|
}
|
|
|
obj['tratio'] = (parseFloat(row['r' + i])).toFixed(parseInt(Cookies.get('decimalr')))
|
|
|
- // obj['tratio'] = Math.round(row['r' + i])
|
|
|
obj['todaysupplement'] = row.todaysupplement
|
|
|
obj['todayweight'] = row.todayweight
|
|
|
arr.push(obj)
|
|
|
}
|
|
|
+ arr.forEach((item)=>{
|
|
|
+ if(isNaN(item.tratio)){
|
|
|
+ item.tratio = 0
|
|
|
+ }
|
|
|
+ })
|
|
|
if (this.table.isPtsfname == 0) {
|
|
|
row.ptsfid = '-1'
|
|
|
row.ptsfname = ''
|
|
@@ -1939,11 +2165,11 @@ export default {
|
|
|
if (this.table.isPtsfname == false) {
|
|
|
row.supplyweight = '0'
|
|
|
}
|
|
|
- console.log(row, '============')
|
|
|
this.$set(row, 'ratio', Math.floor(parseFloat(row.ratio) * 100) / 100)
|
|
|
this.$set(row, 'ccountratio', Math.floor(parseFloat(row.ccountratio) * 100) / 100)
|
|
|
row.ccountratio = String(row.ccountratio)
|
|
|
row.sumr = Math.round(row.sumr)
|
|
|
+
|
|
|
// for(let i=0;i<arr.length;i++){
|
|
|
// if(arr[i].tratio == undefined ||arr[i].tratio =='' || arr[i].tratio == null){
|
|
|
// arr[i].tratio = 0
|
|
@@ -1973,40 +2199,40 @@ export default {
|
|
|
if (row.softccount == '') {
|
|
|
row.softccount = 0
|
|
|
}
|
|
|
- if (row.r1 == '') {
|
|
|
+ if (row.r1 == '' || isNaN(row.r1)) {
|
|
|
row.r1 = 0
|
|
|
}
|
|
|
- if (row.r2 == '') {
|
|
|
+ if (row.r2 == '' || isNaN(row.r2)) {
|
|
|
row.r2 = 0
|
|
|
}
|
|
|
- if (row.r3 == '') {
|
|
|
+ if (row.r3 == '' || isNaN(row.r3)) {
|
|
|
row.r3 = 0
|
|
|
}
|
|
|
- if (row.r4 == '') {
|
|
|
+ if (row.r4 == '' || isNaN(row.r4)) {
|
|
|
row.r4 = 0
|
|
|
}
|
|
|
- if (row.r5 == '') {
|
|
|
+ if (row.r5 == '' || isNaN(row.r5)) {
|
|
|
row.r5 = 0
|
|
|
}
|
|
|
- if (row.r6 == '') {
|
|
|
+ if (row.r6 == '' || isNaN(row.r6)) {
|
|
|
row.r6 = 0
|
|
|
}
|
|
|
- if (row.w1 == '') {
|
|
|
+ if (row.w1 == '' || isNaN(row.w1)) {
|
|
|
row.w1 = 0
|
|
|
}
|
|
|
- if (row.w2 == '' || row.w4 == NaN) {
|
|
|
+ if (row.w2 == '' || isNaN(row.w2)) {
|
|
|
row.w2 = 0
|
|
|
}
|
|
|
- if (row.w3 == '' || row.w4 == NaN) {
|
|
|
+ if (row.w3 == '' || isNaN(row.w3)) {
|
|
|
row.w3 = 0
|
|
|
}
|
|
|
- if (row.w4 == '' || row.w4 == NaN) {
|
|
|
+ if (row.w4 == '' || isNaN(row.w4)) {
|
|
|
row.w4 = 0
|
|
|
}
|
|
|
- if (row.w5 == '' || row.w5 == NaN) {
|
|
|
+ if (row.w5 == '' || isNaN(row.w5)) {
|
|
|
row.w5 = 0
|
|
|
}
|
|
|
- if (row.w6 == '' || row.w6 == NaN) {
|
|
|
+ if (row.w6 == '' || isNaN(row.w6)) {
|
|
|
row.w6 = 0
|
|
|
}
|
|
|
console.log(row, '===========')
|
|
@@ -3112,14 +3338,70 @@ export default {
|
|
|
this.$refs.mychild.restTemp()
|
|
|
},
|
|
|
handleSynchronous(){
|
|
|
- const url = 'authdata/ud/feedp/sync'
|
|
|
- const data = {}
|
|
|
+ MessageBox.confirm('是否进行软件牛头数同步?', {
|
|
|
+ confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ const url = 'authdata/ud/feedp/sync'
|
|
|
+ const data = {}
|
|
|
+ postJson(url, data).then(response => {
|
|
|
+ if(response.msg !== 'fail'){
|
|
|
+ this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({ type: 'info', message: '已取消软件牛头数同步' })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handle_batchEdit(){
|
|
|
+ this.isproportion = true
|
|
|
+ console.log(this.isproportion)
|
|
|
+ this.oldList = JSON.parse(JSON.stringify(this.table.list));
|
|
|
+ // this.table.list.forEach((item,key)=>{
|
|
|
+ // item.Edit = true
|
|
|
+ // item.NoEdit = false
|
|
|
+ // })
|
|
|
+ // row.Edit
|
|
|
+ },
|
|
|
+ handle_batchEdit_save(){
|
|
|
+ const arr = this.table.list.filter(item2 => {
|
|
|
+ console.log(item2,'item2')
|
|
|
+ return !this.oldList.some(item1 => item1.r1 === item2.r1 && item1.r2 === item2.r2 && item1.r3 === item2.r3 && item1.r4 === item2.r4 && item1.r5 === item2.r5 && item1.r6 === item2.r6);
|
|
|
+ });
|
|
|
+ const barList = []
|
|
|
+ arr.forEach((item)=>{
|
|
|
+ let obj = {}
|
|
|
+ obj.barname = item.barname
|
|
|
+ obj.ccount = item.ccount
|
|
|
+ obj.ratio = item.ratio
|
|
|
+ obj.ftname = item.ftname
|
|
|
+ obj.ptsfname = item.ptsfname
|
|
|
+ obj.times1 = item.r1
|
|
|
+ obj.times2 = item.r2
|
|
|
+ obj.times3 = item.r3
|
|
|
+ obj.times4 = item.r4
|
|
|
+ obj.times5 = item.r5
|
|
|
+ obj.times6 = item.r6
|
|
|
+ barList.push(obj)
|
|
|
+ })
|
|
|
+ const url = 'authdata/fpdetail/batch/edit'
|
|
|
+ let data = {
|
|
|
+ pastureId:Cookies.get('pastureid'),
|
|
|
+ barList:barList
|
|
|
+ }
|
|
|
postJson(url, data).then(response => {
|
|
|
if(response.msg !== 'fail'){
|
|
|
this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
+ }else{
|
|
|
+ this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
}
|
|
|
+ this.isproportion = false
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ cancelChangeEdit() {
|
|
|
+ // 取消顺序
|
|
|
+ this.getList()
|
|
|
+ this.isproportion = false
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|