|
@@ -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>
|
|
@@ -96,8 +99,9 @@
|
|
|
</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>
|
|
|
+ <!-- <textarea class="el-textarea__inner" rows="1" v-if="scope.row.Edit || isproportion" v-model.lazy="scope.row.r1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,1)"></textarea> -->
|
|
|
+ <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)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW1" :key="9" label="第一班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
@@ -108,14 +112,15 @@
|
|
|
</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>
|
|
|
+ <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;" />
|
|
|
</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>
|
|
|
+ <!-- <textarea class="el-textarea__inner" rows="1" v-if="scope.row.Edit || isproportion" v-model.lazy="scope.row.r2" :disabled="scope.row.isTwoWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,2)" /> -->
|
|
|
+ <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)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW2" :key="12" label="第二班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
@@ -132,8 +137,9 @@
|
|
|
</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>
|
|
|
+ <!-- <textarea class="el-textarea__inner" rows="1" v-if="scope.row.Edit || isproportion" v-model.lazy="scope.row.r3" :disabled="scope.row.isThreeWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,3)" /> -->
|
|
|
+ <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)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW3" :key="15" label="第三班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
@@ -150,8 +156,9 @@
|
|
|
</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>
|
|
|
+ <!-- <textarea class="el-textarea__inner" rows="1" v-if="scope.row.Edit || isproportion" v-model.lazy="scope.row.r4" :disabled="scope.row.isFourWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,4)" /> -->
|
|
|
+ <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)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW4" :key="18" label="第四班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
@@ -168,8 +175,8 @@
|
|
|
</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)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW5" :key="21" label="第五班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
@@ -186,8 +193,8 @@
|
|
|
</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)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="table.isRW6" :key="24" label="第六班重量" min-width="100px" align="center" :render-header="renderHeader">
|
|
@@ -787,8 +794,10 @@ export default {
|
|
|
components: { Pagination, Pagination2, DryMatterRegulation },
|
|
|
data() {
|
|
|
return {
|
|
|
+ isproportion:false,
|
|
|
dialogFull: false,
|
|
|
isRoleEdit: [],
|
|
|
+ isSynchronous:[],
|
|
|
headerList: [],
|
|
|
pickerMinDate: '',
|
|
|
pickerOptions: {
|
|
@@ -816,7 +825,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 +1106,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 +1152,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
|
|
@@ -1850,7 +1866,9 @@ export default {
|
|
|
},
|
|
|
celldblclick(row, column, cell, event) {
|
|
|
console.log(row, '=====')
|
|
|
- this.handleUpdate(row)
|
|
|
+ if(!this.isproportion){
|
|
|
+ this.handleUpdate(row)
|
|
|
+ }
|
|
|
},
|
|
|
// 编辑
|
|
|
handleUpdate(row) {
|
|
@@ -3112,14 +3130,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>
|