|
@@ -391,6 +391,29 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 更改TMR编号 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="textMap[tmrNumber.dialogStatus]"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :visible.sync="tmrNumber.dialogFormVisible"
|
|
|
+ :before-close="close"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ width="30%"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ :append-to-body="true">
|
|
|
+ <h3 style="text-align: center;">是否要改变TMR设备?</h3>
|
|
|
+ <div class="tmrNumber" style="padding: 10px 30px;">
|
|
|
+ <p>注:更换TMR撒料设备,变更后的装载重量不同,请选择处理方式</p>
|
|
|
+ <el-radio v-model="tmrNumber.radio" label="0">1、多出的饲料平均从已分配的各栏舍中扣减。</el-radio><br/><br/>
|
|
|
+ <el-radio v-model="tmrNumber.radio" label="1">2、多出的饲料从最后一个栏舍依次往前扣减。</el-radio><br/><br/>
|
|
|
+ <el-radio v-model="tmrNumber.radio" label="2">3、清空已分配的撒料车。</el-radio>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer" style="bottom: 10px;">
|
|
|
+ <el-button class="cancelClose" :disabled="isokDisable" @click="closeTmrNumber">否</el-button>
|
|
|
+ <el-button class="save" :disabled="isokDisable" @click="tmrNumberData()">是</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -475,7 +498,8 @@ export default {
|
|
|
selectList: [],
|
|
|
textMap: {
|
|
|
create: '新增',
|
|
|
- update: '编辑'
|
|
|
+ update: '编辑',
|
|
|
+ tmrNumber:''
|
|
|
},
|
|
|
dialogFull: false,
|
|
|
isOrder: true,
|
|
@@ -528,7 +552,13 @@ export default {
|
|
|
equipmentList: [], // 撒料设备
|
|
|
templateFormulationList: [], // 模板配方
|
|
|
isDispaly: false,
|
|
|
- isDropState:false
|
|
|
+ isDropState:false,
|
|
|
+ tmrNumber:{
|
|
|
+ dialogFormVisible: false,
|
|
|
+ dialogStatus: '',
|
|
|
+ temp:{},
|
|
|
+ radio:'0'
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -769,37 +799,42 @@ export default {
|
|
|
// TMR编号
|
|
|
changeTMRNumber(item) {
|
|
|
console.log(this.create.temp.tmrid,'this.create.temp.tmrid111')
|
|
|
- if (this.create.list2.length > 0) {
|
|
|
- MessageBox.confirm('更换TMR撒料设备,会清空撒料车,是否更换?', {
|
|
|
- confirmButtonText: '是',
|
|
|
- cancelButtonText: '否',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.create.temp.tmrid = this.create.temp.tmrid2
|
|
|
- this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
|
|
|
- this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
|
|
|
- this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
|
|
|
- this.create.temp.mytmrid = this.create.temp.tmrid
|
|
|
- this.create.temp.mytmrname = this.create.temp.tmrname
|
|
|
- console.log('tmrname==>', this.create.temp)
|
|
|
- if (this.isDispaly || this.create.dialogStatus == 'update') {
|
|
|
- this.getClearList()
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- console.log(this.create.temp,'====')
|
|
|
- if(this.create.temp.tclassname == '固定式'){
|
|
|
- console.log( this.create.temp,'====')
|
|
|
- this.create.temp.tmrid = this.create.temp.mytmrid
|
|
|
- }
|
|
|
- this.create.temp.tmrid2 = this.create.temp.tmrid
|
|
|
- this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
|
|
|
- this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
|
|
|
- this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
|
|
|
- this.create.temp.mytmrid = this.create.temp.tmrid2
|
|
|
- this.create.temp.mytmrname = this.create.temp.tmrname
|
|
|
- console.log(this.create.temp)
|
|
|
- this.$message({ type: 'info', message: '已取消' })
|
|
|
- })
|
|
|
+ if (this.create.list2.length > 0) {
|
|
|
+ // 备份
|
|
|
+ // MessageBox.confirm('更换TMR撒料设备,会清空撒料车,是否更换?', {
|
|
|
+ // confirmButtonText: '是',
|
|
|
+ // cancelButtonText: '否',
|
|
|
+ // type: 'warning'
|
|
|
+ // }).then(() => {
|
|
|
+ // this.create.temp.tmrid = this.create.temp.tmrid2
|
|
|
+ // this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
|
|
|
+ // this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === item).maxstirfeed
|
|
|
+ // this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === item).tclassname
|
|
|
+ // this.create.temp.mytmrid = this.create.temp.tmrid
|
|
|
+ // this.create.temp.mytmrname = this.create.temp.tmrname
|
|
|
+ // console.log('tmrname==>', this.create.temp)
|
|
|
+ // if (this.isDispaly || this.create.dialogStatus == 'update') {
|
|
|
+ // this.getClearList()
|
|
|
+ // }
|
|
|
+ // }).catch(() => {
|
|
|
+ // console.log(this.create.temp,'====')
|
|
|
+ // if(this.create.temp.tclassname == '固定式'){
|
|
|
+ // console.log( this.create.temp,'====')
|
|
|
+ // this.create.temp.tmrid = this.create.temp.mytmrid
|
|
|
+ // }
|
|
|
+ // this.create.temp.tmrid2 = this.create.temp.tmrid
|
|
|
+ // this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
|
|
|
+ // this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
|
|
|
+ // this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
|
|
|
+ // this.create.temp.mytmrid = this.create.temp.tmrid2
|
|
|
+ // this.create.temp.mytmrname = this.create.temp.tmrname
|
|
|
+ // console.log(this.create.temp)
|
|
|
+ // this.$message({ type: 'info', message: '已取消' })
|
|
|
+ // })
|
|
|
+ // 备份
|
|
|
+ this.tmrNumber.dialogFormVisible = true
|
|
|
+ this.tmrNumber.dialogStatus = 'tmrNumber'
|
|
|
+ this.tmrNumber.radio = '0'
|
|
|
} else {
|
|
|
this.create.temp.tmrid = this.create.temp.tmrid2
|
|
|
this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === item).eqcode
|
|
@@ -810,6 +845,49 @@ export default {
|
|
|
console.log('TMR编号item==>', item)
|
|
|
console.log('tmrname==>', this.create.temp)
|
|
|
}
|
|
|
+ },
|
|
|
+ tmrNumberData(){
|
|
|
+ if(this.tmrNumber.radio == '0'){
|
|
|
+ console.log('1、多出的饲料平均从已分配的各栏舍中扣减。')
|
|
|
+ }else if(this.tmrNumber.radio == '1'){
|
|
|
+ console.log('2、多出的饲料从最后一个栏舍依次往前扣减。')
|
|
|
+ }else if(this.tmrNumber.radio == '2'){
|
|
|
+ console.log('3、清空已分配的撒料车。')
|
|
|
+ }
|
|
|
+ const url = 'authdata/materialtmr/date/edit'
|
|
|
+ const data = {
|
|
|
+ tmrid:this.create.temp.tmrid2,
|
|
|
+ tmrtype: this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassid,
|
|
|
+ lppid:this.create.temp.id,
|
|
|
+ times:this.create.temp.times,
|
|
|
+ pastureid:Cookies.get('pastureid'),
|
|
|
+ status:this.tmrNumber.radio,
|
|
|
+ date:this.date
|
|
|
+ }
|
|
|
+ postJson(url, data).then(response => {
|
|
|
+ if (response.msg === 'fail') {
|
|
|
+ this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ } else {
|
|
|
+ this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
|
|
|
+ this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
|
|
|
+ this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
|
|
|
+ this.tmrNumber.dialogFormVisible = false
|
|
|
+ this.getCreateList1()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ closeTmrNumber(){
|
|
|
+ if(this.create.temp.tclassname == '固定式'){
|
|
|
+ console.log( this.create.temp,'====')
|
|
|
+ this.create.temp.tmrid = this.create.temp.mytmrid
|
|
|
+ }
|
|
|
+ this.create.temp.tmrid2 = this.create.temp.tmrid
|
|
|
+ this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).eqcode
|
|
|
+ this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).maxstirfeed
|
|
|
+ this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === this.create.temp.tmrid2).tclassname
|
|
|
+ this.create.temp.mytmrid = this.create.temp.tmrid2
|
|
|
+ this.create.temp.mytmrname = this.create.temp.tmrname
|
|
|
+ this.tmrNumber.dialogFormVisible = false
|
|
|
},
|
|
|
getClearList() {
|
|
|
const url = 'authdata/lpplandtl/del/day'
|
|
@@ -1264,7 +1342,7 @@ export default {
|
|
|
this.create.temp.sumcowcount = 0
|
|
|
this.create.temp.date = this.date
|
|
|
data.parammaps = this.create.temp
|
|
|
- data.parammaps.tmrid = this.create.temp.mytmrid
|
|
|
+ data.parammaps.tmrid = this.create.temp.tmrid2
|
|
|
data.parammaps.tmrname = this.create.temp.mytmrname
|
|
|
postJson(url, data).then(response => {
|
|
|
console.log('新增保存发送参数', this.requestParam)
|