|
@@ -16,7 +16,8 @@
|
|
|
<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 && !isproportion" class="successBorder" @click="handle_batchEdit">批量编辑</el-button>
|
|
|
- <el-button v-if="isRoleEdit && isproportion" class="successBorder" @click="handle_batchEdit_save">保存</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>
|
|
@@ -99,6 +100,7 @@
|
|
|
<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 && !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>
|
|
@@ -117,6 +119,7 @@
|
|
|
<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 && !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>
|
|
@@ -135,6 +138,7 @@
|
|
|
<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 && !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>
|
|
@@ -153,6 +157,7 @@
|
|
|
<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 && !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>
|
|
@@ -1853,7 +1858,9 @@ export default {
|
|
|
},
|
|
|
celldblclick(row, column, cell, event) {
|
|
|
console.log(row, '=====')
|
|
|
- this.handleUpdate(row)
|
|
|
+ if(!this.isproportion){
|
|
|
+ this.handleUpdate(row)
|
|
|
+ }
|
|
|
},
|
|
|
// 编辑
|
|
|
handleUpdate(row) {
|
|
@@ -3134,10 +3141,41 @@ export default {
|
|
|
// row.Edit
|
|
|
},
|
|
|
handle_batchEdit_save(){
|
|
|
+ let barList = []
|
|
|
+ this.table.list.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
|
|
|
- console.log(this.oldRowList)
|
|
|
- console.log(this.table.list)
|
|
|
- }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|