|
@@ -447,7 +447,7 @@
|
|
|
<p>{{$t('formulationEvaluation.pfmbb')}}</p>
|
|
|
</div>
|
|
|
<div class="operation1">
|
|
|
- <el-date-picker v-model="template.table.getdataListParm.parammaps.date" type="date" :placeholder="$t('formulationEvaluation.lssjjl')":clearable="false" style="width: 180px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeDate" />
|
|
|
+ <el-date-picker v-model="template.table.getdataListParm.parammaps.date" type="date" :placeholder="$t('formulationEvaluation.lssjjl')" :clearable="false" style="width: 180px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeDate" />
|
|
|
<!-- <el-button class="successBorder" @click="handleApplication">应用</el-button> -->
|
|
|
</div>
|
|
|
|
|
@@ -1062,11 +1062,11 @@ export default {
|
|
|
selectList: [],
|
|
|
selectList2: [],
|
|
|
textMap: {
|
|
|
- RecipeRecord: '配方记录',
|
|
|
- SyntheticPremix: '合成预混料',
|
|
|
- historyRecord: '历史记录',
|
|
|
- detail: '饲料详情',
|
|
|
- rowRecipeRecordTxt: '配方修改记录'
|
|
|
+ RecipeRecord: this.$t('message.msg32'),
|
|
|
+ SyntheticPremix: this.$t('message.msg33'),
|
|
|
+ historyRecord: this.$t('message.msg34'),
|
|
|
+ detail: this.$t('message.msg35'),
|
|
|
+ rowRecipeRecordTxt: this.$t('message.msg36')
|
|
|
},
|
|
|
|
|
|
requestParam: {},
|
|
@@ -1403,28 +1403,28 @@ export default {
|
|
|
this.table.temp.volume = parseFloat(row.volume)
|
|
|
this.table.temp.pastureid = Cookies.get('pastureid')
|
|
|
if (this.table.temp.tname == '' && this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
|
|
|
- this.$message({ type: 'error', message: '配方名称/牲畜类别/配方类型不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg16'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
|
|
|
- this.$message({ type: 'error', message: '牲畜类别/配方类型不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg17'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table.temp.tname == '') {
|
|
|
- this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg18'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table.temp.ccid == '') {
|
|
|
- this.$message({ type: 'error', message: '牲畜类别不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg19'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table.temp.fttypeid == '') {
|
|
|
- this.$message({ type: 'error', message: '配方类型不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg20'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
|
|
|
// if (pattern.test(this.table.temp.tname)) {
|
|
|
- // this.$message({ type: 'error', message: '配方名称不可输入特殊字符', duration: 2000 })
|
|
|
+ // this.$message({ type: 'error', message:this.$t('message.msg9'), duration: 2000 })
|
|
|
// return false
|
|
|
// }
|
|
|
if (pattern.test(this.table.temp.tcode)) {
|
|
|
- this.$message({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg21'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
console.log(this.table.temp)
|
|
@@ -1440,7 +1440,7 @@ export default {
|
|
|
if (response.data.list[0].vmsg !== '输入非法字符') {
|
|
|
this.saveCreateData()
|
|
|
} else {
|
|
|
- this.$notify({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
|
|
|
+ this.$notify({ type: 'error',message:this.$t('message.msg21'), duration: 2000 })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -1466,7 +1466,7 @@ export default {
|
|
|
} else {
|
|
|
const isRepeat = new RegExp('Duplicate entry :feedtemplet.tCode')
|
|
|
if (isRepeat.test(response.data)) {
|
|
|
- this.$notify({ type: 'error', message: '配方编码不可重复,请重新录入', duration: 2000 })
|
|
|
+ this.$notify({ type: 'error',message:this.$t('message.msg22'), duration: 2000 })
|
|
|
} else {
|
|
|
this.$notify({ title: this.$t('driver.saveFail'), message: response.data, type: 'warning', duration: 2000 })
|
|
|
}
|
|
@@ -1532,28 +1532,28 @@ export default {
|
|
|
}
|
|
|
this.table.temp.volume = parseFloat(row.volume)
|
|
|
if (this.table.temp.tname == '' && this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
|
|
|
- this.$message({ type: 'error', message: '配方名称/牲畜类别/配方类型不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg16'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
|
|
|
- this.$message({ type: 'error', message: '牲畜类别/配方类型不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg17'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table.temp.tname == '') {
|
|
|
- this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg18'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table.temp.ccid == '') {
|
|
|
- this.$message({ type: 'error', message: '牲畜类别不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg19'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table.temp.fttypeid == '') {
|
|
|
- this.$message({ type: 'error', message: '配方类型不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg20'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
|
|
|
// if (pattern.test(this.table.temp.tname)) {
|
|
|
- // this.$message({ type: 'error', message: '配方名称不可输入特殊字符', duration: 2000 })
|
|
|
+ // this.$message({ type: 'error', message:this.$t('message.msg9'), duration: 2000 })
|
|
|
// return false
|
|
|
// }
|
|
|
if (pattern.test(this.table.temp.tcode)) {
|
|
|
- this.$message({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg21'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
console.log(this.table.temp)
|
|
@@ -1570,7 +1570,7 @@ export default {
|
|
|
if (response.data.list[0].vmsg !== '输入非法字符') {
|
|
|
this.saveUpdateData()
|
|
|
} else {
|
|
|
- this.$notify({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
|
|
|
+ this.$notify({ type: 'error',message:this.$t('message.msg21'), duration: 2000 })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -1603,7 +1603,7 @@ export default {
|
|
|
} else {
|
|
|
const isRepeat = new RegExp('Duplicate entry :feedtemplet.tCode')
|
|
|
if (isRepeat.test(response.data)) {
|
|
|
- this.$notify({ type: 'error', message: '配方编码不可重复,请重新录入', duration: 2000 })
|
|
|
+ this.$notify({ type: 'error',message:this.$t('message.msg22'), duration: 2000 })
|
|
|
} else {
|
|
|
this.$notify({ title: this.$t('driver.saveFail'), message: response.data, type: 'warning', duration: 2000 })
|
|
|
}
|
|
@@ -1612,7 +1612,7 @@ export default {
|
|
|
} else {
|
|
|
const isRepeat = new RegExp('Duplicate entry :feedtemplet.tCode')
|
|
|
if (isRepeat.test(response.data)) {
|
|
|
- this.$notify({ type: 'error', message: '配方编码不可重复,请重新录入', duration: 2000 })
|
|
|
+ this.$notify({ type: 'error',message:this.$t('message.msg22'), duration: 2000 })
|
|
|
} else {
|
|
|
this.$notify({ title: this.$t('driver.saveFail'), message: response.data, type: 'warning', duration: 2000 })
|
|
|
}
|
|
@@ -1635,7 +1635,7 @@ export default {
|
|
|
handleRowDelete(row) {
|
|
|
console.log('点击了行内删除')
|
|
|
MessageBox.confirm( this.$t('common.delMsg'), {
|
|
|
- confirmButtonText: this.$t('common.confirm'), confirmButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
+ confirmButtonText: this.$t('common.confirm'), cancelButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
}).then(() => {
|
|
|
const url = 'authdata/feedtemplet/del'
|
|
|
const data = {
|
|
@@ -1662,10 +1662,10 @@ export default {
|
|
|
form_delete() {
|
|
|
console.log('点击了删除')
|
|
|
if (this.selectList.length == 0) {
|
|
|
- this.$message({ type: 'error', message: '请选择配方', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg3'), duration: 2000 })
|
|
|
} else {
|
|
|
MessageBox.confirm( this.$t('common.delMsg'), {
|
|
|
- confirmButtonText: this.$t('common.confirm'), confirmButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
+ confirmButtonText: this.$t('common.confirm'), cancelButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
}).then(() => {
|
|
|
console.log(this.selectList)
|
|
|
this.requestParam.common = { 'returnmap': '0' }
|
|
@@ -1696,10 +1696,10 @@ export default {
|
|
|
// 复制
|
|
|
handleCopy() {
|
|
|
if (this.selectList.length == 0) {
|
|
|
- this.$message({ type: 'error', message: '请选择配方', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg3'), duration: 2000 })
|
|
|
} else {
|
|
|
- MessageBox.confirm('是否确认复制此信息?', {
|
|
|
- confirmButtonText: this.$t('common.confirm'), confirmButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
+ MessageBox.confirm(this.$t('message.msg4'), {
|
|
|
+ confirmButtonText: this.$t('common.confirm'), cancelButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
}).then(() => {
|
|
|
console.log(this.selectList)
|
|
|
this.requestParam.common = { 'returnmap': '0' }
|
|
@@ -1713,9 +1713,9 @@ export default {
|
|
|
ExecDataByConfig(this.requestParam).then(response => {
|
|
|
console.log('复制保存发送参数', this.requestParam)
|
|
|
if (response.msg === 'fail') {
|
|
|
- this.$notify({ title: '复制失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ this.$notify({ title: this.$t('message.msg1'), message: response.data, type: 'warning', duration: 2000 })
|
|
|
} else {
|
|
|
- this.$notify({ title: '', message: '复制成功', type: 'success', duration: 2000 })
|
|
|
+ this.$notify({ title: '', message: this.$t('message.msg2'), type: 'success', duration: 2000 })
|
|
|
this.getList()
|
|
|
}
|
|
|
})
|
|
@@ -1891,7 +1891,7 @@ export default {
|
|
|
const aLink = document.createElement('a')
|
|
|
aLink.style.display = 'none'
|
|
|
aLink.href = url
|
|
|
- const docname = '配方模板导入模板.xlsx'
|
|
|
+ const docname = this.$t('message.msg54')
|
|
|
aLink.setAttribute('download', docname) // 下载的文件
|
|
|
document.body.appendChild(aLink)
|
|
|
aLink.click()
|
|
@@ -1920,15 +1920,19 @@ export default {
|
|
|
} else {
|
|
|
this.download.list = []
|
|
|
}
|
|
|
+ const table = this.$refs.table1;
|
|
|
+ const columns = table.columns;
|
|
|
+ const labels = columns.map(column => column.label);
|
|
|
+ console.log(table,labels);
|
|
|
var excelDatas = [
|
|
|
{
|
|
|
- tHeader: ['配方名称', '配方编码', '牲畜类别', '配方类型', '来源', '备注', '是否启用', '饲料组', '饲料名称', '重量(kg)', '搅拌延时(min)', '是否锁定牛头数比例', '顺序'],
|
|
|
+ tHeader:this.$t('formulationEvaluation.tHeader') ,
|
|
|
filterVal: ['tname', 'tcode', 'ccname', 'fttype', 'source', 'remark', 'enable', 'feedgroup', 'fname', 'fweight', 'autosecond', 'islockcount', 'sort'],
|
|
|
tableDatas: this.download.list,
|
|
|
sheetName: 'Sheet1'
|
|
|
}
|
|
|
]
|
|
|
- json2excel(excelDatas, '配方模板', true, 'xlsx')
|
|
|
+ json2excel(excelDatas, this.$t('message.msg55'), true, 'xlsx')
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -1943,28 +1947,26 @@ export default {
|
|
|
handleImportSuccess(res, file) {
|
|
|
this.getList()
|
|
|
if (res.msg === 'ok') {
|
|
|
- this.$message({ title: this.$t('common.succes'), message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
|
|
|
+ this.$message({ title: this.$t('common.succes'), message:this.$t('message.msg5') + res.data.success + this.$t('message.msg39'), type: 'success', duration: 2000 })
|
|
|
if (res.data.err_count > 0) {
|
|
|
- this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
|
|
|
+ this.$notify({ title:this.$t('message.msg37'), message: this.$t('message.msg38') + res.data.err_count + this.$t('message.msg39'), type: 'danger', duration: 2000 })
|
|
|
import('@/vendor/Export2Excel').then(excel => {
|
|
|
const list1 = res.data.result
|
|
|
- const tHeader = [
|
|
|
- '配方名称', '牲畜类别', '配方类型', '备注', '饲料组', '饲料名称', '重量(kg)', '搅拌延时(min)', '是否锁定牛头数比例', '错误信息'
|
|
|
- ]
|
|
|
+ const tHeader = this.$t('formulationEvaluation.tHeader1')
|
|
|
const filterVal = [
|
|
|
'配方名称', '牲畜类别', '配方类型', '备注', '饲料组', '饲料名称', '重量(kg)', '搅拌延时(min)', '是否锁定牛头数比例', 'error_msg'
|
|
|
]
|
|
|
const data1 = this.formatJson(filterVal, list1)
|
|
|
- excel.export_json_to_excel({ header: tHeader, data: data1, filename: '配方模板导入报错信息', autoWidth: true, bookType: 'xlsx' })
|
|
|
+ excel.export_json_to_excel({ header: tHeader, data: data1, filename: this.$t('meaagae.msg56'), autoWidth: true, bookType: 'xlsx' })
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
const isRepeat = new RegExp('Duplicate entry :feedtemplet_tname')
|
|
|
if (isRepeat.test(res.data)) {
|
|
|
- this.$notify({ type: 'error', message: '配方名称不可重复,请重新录入', duration: 2000 })
|
|
|
+ this.$notify({ type: 'error', message:this.$t('message.msg57'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
- this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
|
|
|
+ this.$notify({ title:this.$t('message.msg37'), message: this.$t('message.msg40'), type: 'danger', duration: 2000 })
|
|
|
}
|
|
|
},
|
|
|
formatJson(filterVal, jsonData) {
|
|
@@ -1984,8 +1986,8 @@ export default {
|
|
|
// 应用
|
|
|
handleApplication() {
|
|
|
console.log('点击了应用')
|
|
|
- MessageBox.confirm('是否确认将' + this.template.table.getdataListParm.parammaps.date + '的数据应用到当前?', {
|
|
|
- confirmButtonText: this.$t('common.confirm'), confirmButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
+ MessageBox.confirm(this.$t('message.msg58') + this.template.table.getdataListParm.parammaps.date + this.$t('message.msg59'), {
|
|
|
+ confirmButtonText: this.$t('common.confirm'), cancelButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
}).then(() => {
|
|
|
this.requestParam.name = 'applyFTdate'
|
|
|
this.requestParam.parammaps = {}
|
|
@@ -2001,7 +2003,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}).catch(() => {
|
|
|
- this.$message({ type: 'info', message: '已取消应用' })
|
|
|
+ this.$message({ type: 'info', message: this.$t('message.msg41') })
|
|
|
})
|
|
|
},
|
|
|
// 模板行点击
|
|
@@ -2012,7 +2014,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (this.isOrder == false) {
|
|
|
- this.$message({ type: 'error', message: '请保存或取消当前更改顺序操作', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg42'), duration: 2000 })
|
|
|
} else {
|
|
|
if (column.label !== '操作') {
|
|
|
this.isDetail = true // 点击行显示详情
|
|
@@ -2171,9 +2173,9 @@ export default {
|
|
|
ExecDataByConfig(this.requestParam).then(response => {
|
|
|
console.log('顺序切换保存发送参数', this.requestParam)
|
|
|
if (response.msg === 'fail') {
|
|
|
- this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ this.$notify({ title: this.$t('message.msg51'), message: response.data, type: 'warning', duration: 2000 })
|
|
|
} else {
|
|
|
- this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
|
|
|
+ this.$notify({ title: '', message: this.$t('message.msg50'), type: 'success', duration: 2000 })
|
|
|
this.getList2()
|
|
|
this.getList3()
|
|
|
this.isOrder = true
|
|
@@ -2350,29 +2352,29 @@ export default {
|
|
|
this.table2.temp.deviation = row.deviation
|
|
|
this.table2.temp.shutdown = row.shutdown
|
|
|
if (this.table2.temp.fid === '' && this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
|
|
|
- this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg7'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
|
|
|
- this.$message({ type: 'error', message: '重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg43'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
|
|
|
- this.$message({ type: 'error', message: '搅拌延时/允许延时偏差不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg52'), duration: 2000 })
|
|
|
return false
|
|
|
}else if (this.table2.temp.fid === '') {
|
|
|
- this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg44'), duration: 2000 })
|
|
|
return false
|
|
|
}else if (this.table2.temp.fweight === '') {
|
|
|
- this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg45'), duration: 2000 })
|
|
|
return false
|
|
|
}else if (this.table2.temp.autosecond === '') {
|
|
|
- this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg46'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table2.temp.deviation === '') {
|
|
|
- this.$message({ type: 'error', message: '允许延时偏差不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg47'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
if(parseFloat(this.table2.temp.deviation) > parseFloat(this.table2.temp.autosecond)){
|
|
|
- this.$message({ type: 'error', message: '允许延时偏差不可超出搅拌延时', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg48'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
if (this.table2.temp.sort !== '') {
|
|
@@ -2391,14 +2393,14 @@ export default {
|
|
|
}
|
|
|
if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
|
|
|
if (parseInt(this.table2.temp.preftid) > 0) {
|
|
|
- this.$message({ type: 'error', message: '饲料名称不能选择预混配方', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg49'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
// 校验顺序是否>=0
|
|
|
var ruleSort = /^\d+$/
|
|
|
if (!ruleSort.test(this.table2.temp.sort)) {
|
|
|
- this.$message({ type: 'error', message: '饲料顺序不可为负数或小数', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg6'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
// 检验重量>0
|
|
@@ -2409,7 +2411,7 @@ export default {
|
|
|
|
|
|
|
|
|
if (this.table2.temp.fweight == 0) {
|
|
|
- this.$message({ type: 'error', message: '重量请输入正数,最多保留四位小数', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg8'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
this.isokDisable = true
|
|
@@ -2583,30 +2585,30 @@ export default {
|
|
|
// status = 1
|
|
|
// }
|
|
|
if (this.table2.temp.fid === '' && this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
|
|
|
- this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg7'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table2.temp.fweight === '' && this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
|
|
|
- this.$message({ type: 'error', message: '重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg43'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table2.temp.autosecond === '' && this.table2.temp.deviation === '') {
|
|
|
- this.$message({ type: 'error', message: '搅拌延时/允许延时偏差不能为空1=', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg52'), duration: 2000 })
|
|
|
return false
|
|
|
}else if (this.table2.temp.fid === '') {
|
|
|
- this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg44'), duration: 2000 })
|
|
|
return false
|
|
|
}else if (this.table2.temp.fweight === '') {
|
|
|
- this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg45'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
else if (this.table2.temp.autosecond === '') {
|
|
|
- this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg46'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.table2.temp.deviation === '') {
|
|
|
- this.$message({ type: 'error', message: '允许延时偏差不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg47'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
if(parseFloat(this.table2.temp.deviation) > parseFloat(this.table2.temp.autosecond)){
|
|
|
- this.$message({ type: 'error', message: '允许延时偏差不可超出搅拌延时', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg48'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
if (this.table2.temp.shutdown == '') {
|
|
@@ -2619,14 +2621,14 @@ export default {
|
|
|
}
|
|
|
if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
|
|
|
if (parseInt(this.table2.temp.preftid) > 0) {
|
|
|
- this.$message({ type: 'error', message: '饲料名称不能选择预混配方', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg49'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
// 校验顺序是否>=0
|
|
|
var ruleSort = /^\d+$/
|
|
|
if (!ruleSort.test(this.table2.temp.sort)) {
|
|
|
- this.$message({ type: 'error', message: '饲料顺序不可为负数或小数', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg6'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
this.table2.temp.fweight = formatNum(this.table2.temp.fweight, 4) // 根据默认参数设置小数位数
|
|
@@ -2635,7 +2637,7 @@ export default {
|
|
|
// var ruleWeight = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
|
|
|
|
|
|
if (this.table2.temp.fweight == 0) {
|
|
|
- this.$message({ type: 'error', message: '重量请输入正数,最多保留四位小数', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg8'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
console.log(row.fweight,'row.fweight')
|
|
@@ -2735,7 +2737,7 @@ export default {
|
|
|
handleRowDelete2(row) {
|
|
|
console.log('点击了行内删除')
|
|
|
MessageBox.confirm( this.$t('common.delMsg'), {
|
|
|
- confirmButtonText: this.$t('common.confirm'), confirmButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
+ confirmButtonText: this.$t('common.confirm'), cancelButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
}).then(() => {
|
|
|
console.log(this.table2.list.length)
|
|
|
let dateTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
|
|
@@ -2849,10 +2851,10 @@ export default {
|
|
|
form_delete2() {
|
|
|
console.log('点击了删除')
|
|
|
if (this.selectList2.length == 0) {
|
|
|
- this.$message({ type: 'error', message: '请选择配方详情', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message: this.$t('message.msg23'), duration: 2000 })
|
|
|
} else {
|
|
|
MessageBox.confirm( this.$t('common.delMsg'), {
|
|
|
- confirmButtonText: this.$t('common.confirm'), confirmButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
+ confirmButtonText: this.$t('common.confirm'), cancelButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
}).then(() => {
|
|
|
console.log(this.table2.list.length - this.selectList2.length)
|
|
|
let dateTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
|
|
@@ -2957,9 +2959,9 @@ export default {
|
|
|
// 拆分预混料
|
|
|
handleSplitPremix(row) {
|
|
|
console.log('点击了拆分预混料')
|
|
|
- MessageBox.confirm('是否确认拆分当前预混料?', {
|
|
|
+ MessageBox.confirm(this.$t('message.msg60'), {
|
|
|
confirmButtonText: this.$t('common.confirm'),
|
|
|
- confirmButtonText: this.$t('common.cancel'),
|
|
|
+ cancelButtonText: this.$t('common.cancel'),
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
this.requestParam.name = 'splitFTpre'
|
|
@@ -2993,13 +2995,13 @@ export default {
|
|
|
console.log('点击了合成预混料', this.selectList2)
|
|
|
this.dialogFull = false
|
|
|
if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
|
|
|
- this.$message({ type: 'error', message: '预混配方不可合成预混料', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg24'), duration: 2000 })
|
|
|
return false
|
|
|
} else {
|
|
|
if (this.selectList2.length > 1) {
|
|
|
for (let i = 0; i < this.selectList2.length; i++) {
|
|
|
if (parseInt(this.selectList2[i].preftid) > 0) {
|
|
|
- this.$message({ type: 'error', message: '不可选择预混料', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg25') , duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
@@ -3090,7 +3092,7 @@ export default {
|
|
|
}, 100)
|
|
|
}
|
|
|
} else {
|
|
|
- this.$message({ type: 'error', message: '请选择俩条及以上饲料进行合成', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg26'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
@@ -3139,7 +3141,7 @@ export default {
|
|
|
if (response.msg === 'fail') {
|
|
|
const tname = new RegExp("key 'tname'")
|
|
|
if (tname.test(response.data)) {
|
|
|
- this.$message({ type: 'error', message: '预混配方已存在,不可重复生成', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg27'), duration: 2000 })
|
|
|
} else {
|
|
|
this.$notify({ title: this.$t('driver.saveFail'), message: response.data, type: 'warning', duration: 2000 })
|
|
|
}
|
|
@@ -3153,18 +3155,18 @@ export default {
|
|
|
})
|
|
|
} else { // 现生成预混料
|
|
|
if (this.detail.list2[0].tname == '' && this.detail.list2[0].ccid == '') {
|
|
|
- this.$message({ type: 'error', message: '配方名称/牲畜类别/不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg28'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.detail.list2[0].tname == '') {
|
|
|
- this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg18'), duration: 2000 })
|
|
|
return false
|
|
|
} else if (this.detail.list2[0].ccid == '') {
|
|
|
- this.$message({ type: 'error', message: '牲畜类别不能为空', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg19'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
|
|
|
if (pattern.test(this.detail.list2[0].tname)) {
|
|
|
- this.$message({ type: 'error', message: '配方名称不可输入特殊字符', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg9'), duration: 2000 })
|
|
|
return false
|
|
|
}
|
|
|
let sumFweight = 0
|
|
@@ -3235,7 +3237,7 @@ export default {
|
|
|
if (response.msg === 'fail') {
|
|
|
const tname = new RegExp("key 'tname'")
|
|
|
if (tname.test(response.data)) {
|
|
|
- this.$message({ type: 'error', message: '预混配方已存在,不可重复生成', duration: 2000 })
|
|
|
+ this.$message({ type: 'error', message:this.$t('message.msg27'), duration: 2000 })
|
|
|
} else {
|
|
|
this.$notify({ title: this.$t('driver.saveFail'), message: response.data, type: 'warning', duration: 2000 })
|
|
|
}
|
|
@@ -3269,7 +3271,7 @@ export default {
|
|
|
console.log(row)
|
|
|
this.rowRecipeRecord.temp = Object.assign({}, row)
|
|
|
this.rowRecipeRecord.dialogFormVisible = true
|
|
|
- this.textMap.rowRecipeRecordTxt = '配方修改记录——配方:' + row.tname
|
|
|
+ this.textMap.rowRecipeRecordTxt = this.$t('message.msg53') + row.tname
|
|
|
this.rowRecipeRecord.dialogStatus = 'rowRecipeRecordTxt'
|
|
|
this.rowRecipeRecord.getdataListParm.parammaps.pastureid = row.pastureid
|
|
|
this.rowRecipeRecord.getdataListParm.parammaps.fitid = row.id
|
|
@@ -3338,10 +3340,10 @@ export default {
|
|
|
},
|
|
|
handleTakeEffect() {
|
|
|
if (this.selectList.length == 0) {
|
|
|
- this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg12'), duration: 2000 })
|
|
|
} else {
|
|
|
- MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
|
|
|
- confirmButtonText: this.$t('common.confirm'), confirmButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
+ MessageBox.confirm(this.$t('message.msg29')+ this.selectList.length + '条信息,是否生效?', {
|
|
|
+ confirmButtonText: this.$t('common.confirm'), cancelButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
}).then(() => {
|
|
|
let ids = []
|
|
|
for (let i = 0; i < this.selectList.length; i++) {
|
|
@@ -3355,9 +3357,9 @@ export default {
|
|
|
postJson(url,data).then(response => {
|
|
|
console.log('生效保存发送参数', data)
|
|
|
if (response.msg === 'fail') {
|
|
|
- this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ this.$notify({ title:this.$t('message.msg11'), message: response.data, type: 'warning', duration: 2000 })
|
|
|
} else {
|
|
|
- this.$notify({ title: '', message: '生效成功', type: 'success', duration: 2000 })
|
|
|
+ this.$notify({ title: '', message:this.$t('message.msg10'), type: 'success', duration: 2000 })
|
|
|
this.getList()
|
|
|
}
|
|
|
})
|
|
@@ -3366,10 +3368,10 @@ export default {
|
|
|
},
|
|
|
handleDisable() {
|
|
|
if (this.selectList.length == 0) {
|
|
|
- this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
|
|
|
+ this.$message({ type: 'error',message:this.$t('message.msg12'), duration: 2000 })
|
|
|
} else {
|
|
|
- MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
|
|
|
- confirmButtonText: this.$t('common.confirm'), confirmButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
+ MessageBox.confirm(this.$t('message.msg29')+ this.selectList.length + this.$t('message.msg30'), {
|
|
|
+ confirmButtonText: this.$t('common.confirm'), cancelButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
}).then(() => {
|
|
|
let ids = []
|
|
|
for (let i = 0; i < this.selectList.length; i++) {
|
|
@@ -3384,9 +3386,9 @@ export default {
|
|
|
postJson(url,data).then(response => {
|
|
|
console.log('禁用保存发送参数', this.requestParam)
|
|
|
if (response.msg === 'fail') {
|
|
|
- this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ this.$notify({ title:this.$t('message.msg13'), message: response.data, type: 'warning', duration: 2000 })
|
|
|
} else {
|
|
|
- this.$notify({ title: '', message: '禁用成功', type: 'success', duration: 2000 })
|
|
|
+ this.$notify({ title: '', message:this.$t('message.msg15'), type: 'success', duration: 2000 })
|
|
|
this.getList()
|
|
|
}
|
|
|
})
|
|
@@ -3407,13 +3409,13 @@ export default {
|
|
|
this.ispalyUd = true
|
|
|
}
|
|
|
} else {
|
|
|
- this.$notify({ title: '请求失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ this.$notify({ title:this.$t('message.msg14'), message: response.data, type: 'warning', duration: 2000 })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
handleGetUd(){
|
|
|
- MessageBox.confirm('是否上传配方?', {
|
|
|
- confirmButtonText: this.$t('common.confirm'), confirmButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
+ MessageBox.confirm(this.$t('message.msg61'), {
|
|
|
+ confirmButtonText: this.$t('common.confirm'), cancelButtonText: this.$t('common.cancel'), type: 'warning'
|
|
|
}).then(() => {
|
|
|
let url = 'authdata/gm/udfeedtemplet/push'
|
|
|
let data = {
|