123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478 |
- <template>
- <div class="app-container" style="width: 90%;">
- <div class="el-icon-info" style="font-size: 30px;float: right;color: #009C69;" @click="handleDescription" />
- <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="250px" style="margin-top: 40px;margin-bottom:30px;">
- <el-row>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.sfkqqytjh')" prop="isGetLastPlan">
- <el-select v-model="createTemp.isGetLastPlan" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.sfkqqytjh')"class="filter-item" style="width:100%">
- <el-option v-for="item in planBeforeDayList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.sfkqqytjh1')" prop="isGetNextPlan">
- <el-select v-model="createTemp.isGetNextPlan" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.sfkqqytjh1')"class="filter-item" style="width:100%">
- <el-option v-for="item in planNextDayList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.bcsl')" prop="times">
- <el-select v-model="createTemp.times" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.bcsl')" class="filter-item" style="width:100%">
- <el-option v-for="item in numberList" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.zlxsdws')" prop="decimalPlaces">
- <el-select v-model="createTemp.decimalPlaces" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.zlxsdws')" class="filter-item" style="width:100%">
- <el-option v-for="item in weightDecimalPlacesList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.blxsdws')" prop="decimalRate">
- <el-select v-model="createTemp.decimalRate" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.blxsdws')" class="filter-item" style="width:100%">
- <el-option v-for="item in rateDecimalPlacesList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.sfqyslht')" prop="isEnableContract">
- <el-select v-model="createTemp.isEnableContract" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.sfqyslht')" class="filter-item" style="width:100%">
- <el-option v-for="item in feedontractList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.qyslsdnts')" prop="isLockCount">
- <el-select v-model="createTemp.isLockCount" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.qyslsdnts')" class="filter-item" style="width:100%">
- <el-option v-for="item in isLockBullsList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.clzzcszltxbl')" prop="remainOptRate">
- <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" :placeholder="$t('defaultParameter.clzzcszltxbl')" type="text" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.clzdzczlzzbl')" prop="remainOptRate">
- <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" :placeholder="$t('defaultParameter.clzdzczlzzbl')" type="text" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.sfqybl')" prop="isEnableSupplyFeed">
- <el-select v-model="createTemp.isEnableSupplyFeed" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.sfqybl')" class="filter-item" style="width:100%">
- <el-option v-for="item in isSupplementList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.sfqysl')" prop="isEnableRemainFeed">
- <el-select v-model="createTemp.isEnableRemainFeed" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.sfqysl')" class="filter-item" style="width:100%">
- <el-option v-for="item in isLeftoverMaterialList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.slclxx')" prop="remainOpt">
- <el-select v-model="createTemp.remainOpt" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.slclxx')" class="filter-item" style="width:100%">
- <el-option v-for="item in disposalList" :key="item.id" :label="item.fname" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.slfbfs')" prop="remainOptDis">
- <el-select v-model="createTemp.remainOptDis" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.slfbfs')" class="filter-item" style="width:100%">
- <el-option v-for="item in leftoverMaterialList" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.slfbzbyl')" prop="remainOptRate">
- <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" :placeholder="$t('defaultParameter.slfbzbyl')" type="text" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.xlsfcz')" prop="isSmallMaterial">
- <el-select v-model="createTemp.isSmallMaterial" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.xlsfcz')" class="filter-item" style="width:100%">
- <el-option v-for="item in smallMaterialList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.sfqysjtb')" prop="isDataSync">
- <el-select v-model="createTemp.isDataSync" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.sfqysjtb')" class="filter-item" style="width:100%">
- <el-option v-for="item in dataSynchronizationList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <!-- <el-col :span="12">
- <el-form-item label="设备运转标准时间(分钟):" prop="remainOptRate">
- <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item"
- :placeholder="$t('defaultParameter.slfpzb')" type="text" />
- </el-form-item>
- </el-col> -->
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.rycsl')" prop="anyCar">
- <el-input ref="anyCar" v-model="createTemp.anyCar" :disabled="isRoleEdit==false" class="filter-item" :placeholder="$t('defaultParameter.rycsl')" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.hlzql')" prop="accuracy">
- <el-select v-model="createTemp.accuracy" :disabled="isRoleEdit==false" filterable :placeholder="$t('processAnalysis.hlzq')" class="filter-item" style="width:100%">
- <el-option v-for="item in accuracyList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <!-- <el-col :span="12">
- <el-form-item label="设备运转标准时间(分钟):" prop="remainOptRate">
- <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item"
- :placeholder="$t('defaultParameter.slfpzb')" type="text" />
- </el-form-item>
- </el-col> -->
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.yxslsjwc')" prop="sprinkleFeedTimeAllow">
- <el-input ref="sprinkleFeedTimeAllow" v-model="createTemp.sprinkleFeedTimeAllow" :disabled="isRoleEdit==false" class="filter-item" :placeholder="$t('defaultParameter.yxslsjwc')" type="text" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.jtymip')" prop="domain">
- <el-input ref="domain" v-model="createTemp.domain" :disabled="isRoleEdit==false" class="filter-item" :placeholder="$t('defaultParameter.jtymip')" type="text" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.tmrrl')" prop="tmrUpper">
- <el-input ref="tmrUpper" v-model="createTemp.tmrUpper" :disabled="isRoleEdit==false" class="filter-item" :placeholder="$t('defaultParameter.tmrrl')" type="number" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.tmrrl1')" prop="tmrUnder">
- <el-input ref="tmrUnder" v-model="createTemp.tmrUnder" :disabled="isRoleEdit==false" class="filter-item" :placeholder="$t('defaultParameter.tmrrl1')" type="number" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.yhlyxwc')" prop="yhfeedtemplet">
- <el-input ref="yhfeedtemplet" v-model="createTemp.yhfeedtemplet" :disabled="isRoleEdit==false" class="filter-item" placeholder="kg" type="number" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- :label="$t('defaultParameter.yhtzys')" prop="yhautosecond">
- <el-select v-model="createTemp.yhautosecond" :disabled="isRoleEdit==false" filterable :placeholder="$t('defaultParameter.yhtzys')" class="filter-item" style="width:100%">
- <el-option v-for="item in yhautosecondList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer" style="bottom: 10px;">
- <el-button v-if="isRoleEdit" class="save" :disabled="isokDisable" @click="handleSave">{{$t('formulationEvaluation.save')}}</el-button>
- <el-button v-if="isRoleEdit" class="warning" :disabled="isokDisable" @click="handleRecovery">{{$t('defaultParameter.hfmr')}}</el-button>
- </div>
- <el-dialog :title="textMap[description.dialogStatus]" :destroy-on-close="true" :visible.sync="description.dialogFormVisible" :close-on-click-modal="false" width="70%">
- <div class="app-description dialogMinHeight">
- <div class="content">
- {{$t('defaultParameter.msg1')}}
- <br>
- {{$t('defaultParameter.msg2')}}
- <br>
- {{$t('defaultParameter.msg3')}}
- <br>
- {{$t('defaultParameter.msg4')}}
- <br>
- {{$t('defaultParameter.msg5')}}
- <br>
- {{$t('defaultParameter.msg6')}}
- <br>
- {{$t('defaultParameter.msg7')}}
- <br>
- {{$t('defaultParameter.msg8')}}
- <br>
- {{$t('defaultParameter.msg9')}}
- <br>
- {{$t('defaultParameter.msg10')}}
- <br>
- {{$t('defaultParameter.msg11')}}
- <br>
- {{$t('defaultParameter.msg12')}}
- <br>
- {{$t('defaultParameter.msg121')}}
- <br>
- {{$t('defaultParameter.msg13')}}
- <br>
- {{$t('defaultParameter.msg14')}}
- <br>
- {{$t('defaultParameter.msg15')}}
- </div>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button class="cancelClose" @click="description.dialogFormVisible = false; ">{{$t('common.closed')}}</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { GetDataByName, GetDataByNames, failproccess, checkButtons, ExecDataByConfig } from '@/api/common'
- import Cookies from 'js-cookie'
- import { MessageBox } from 'element-ui'
- export default {
- name: 'DefaultParameter',
- data() {
- return {
- isRoleEdit: [],
- planBeforeDayList: [{ id: '1',
- name:this.$t('supplier.yes')}, { id: '0',
- name:this.$t('supplier.no') }], // 是否可取前一天计划
- planNextDayList: [{ id: '1',
- name:this.$t('supplier.yes')}, { id: '0',
- name:this.$t('supplier.no') }], // 是否可取后一天计划
- isSupplementList: [{ id: '1',
- name:this.$t('supplier.yes')}, { id: '0',
- name:this.$t('supplier.no') }], // 是否启用补料
- isLeftoverMaterialList: [{ id: '1',
- name:this.$t('supplier.yes')}, { id: '0',
- name:this.$t('supplier.no') }], // 是否启用剩料
- decimalPlacesList: [{ id: '0',
- name:this.$t('supplier.zs') }, { id: '1',
- name:this.$t('supplier.xs1') }, { id: '2',
- name:this.$t('supplier.xs2') }, { id: '3',
- name:this.$t('supplier.xs3') }], // 日计划报表小数点位数
- isLockBullsList: [{ id: '1',
- name:this.$t('supplier.yes')}, { id: '0',
- name:this.$t('supplier.no') }], // 启用饲料锁定牛头数
- disposalList: [], // 剩料处理选项
- numberList: [{ id: '0', name: '1' }, { id: '1', name: '2' }, { id: '2', name: '3' }, { id: '3', name: '4' },{ id: '4', name: '5' },{ id: '5', name: '6' }], // 班次数量
- feedontractList: [{ id: '1',
- name:this.$t('supplier.yes')}, { id: '0',
- name:this.$t('supplier.no') }], // 是否启用饲料合同
- leftoverMaterialList: [{ id: '0',
- name:this.$t('supplier.defb') }, { id: '1',
- name:this.$t('supplier.slfb') }],
- weightDecimalPlacesList: [{ id: '0',
- name:this.$t('supplier.zs') }, { id: '1',
- name:this.$t('supplier.xs1') }, { id: '2',
- name:this.$t('supplier.xs2') }, { id: '3',
- name:this.$t('supplier.xs3') }, { id: '4',
- name:this.$t('supplier.xs4') }], // 重量小数点位数
- rateDecimalPlacesList: [{ id: '0',
- name:this.$t('supplier.zs') }, { id: '1',
- name:this.$t('supplier.xs1') }, { id: '2',
- name:this.$t('supplier.xs2') }],//比例小数点位数
- smallMaterialList: [{ id: '1',
- name:this.$t('supplier.yes')}, { id: '0',
- name:this.$t('supplier.no') }], // 小料是否称量
- dataSynchronizationList: [{ id: '1',
- name:this.$t('supplier.yes')}, { id: '0',
- name:this.$t('supplier.no') }], // 是否启用数据同步
- accuracyList: [{ id: '1',
- name:this.$t('supplier.pfyxwczql') }, { id: '0',
- name:this.$t('supplier.pfyxwczql1') }], //混料准确率
- yhautosecondList:[{ id: '1',
- name:this.$t('supplier.jy') }, { id: '2', name: '3秒' }, { id: '3', name: '6秒' }, { id: '4', name: '9秒' }], //预混跳转延时
- requestParams: [
- { name: 'getRemainFeedList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
- ],
- getdataListParm: {
- name: 'getysoptList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid')
- }
- },
- tableKey: 0,
- listLoading: true,
- createTemp: {},
- rules: {},
- description: {
- dialogFormVisible: false,
- dialogStatus: ''
- },
- textMap: {
-
- description:this.$t('supplier.cssm')
- },
- isokDisable: false,
- requestParam: {}
- }
- },
- created() {
- this.getList()
- this.getButtons()
- this.getDownList()
- },
- methods: {
- getButtons() {
- const Edit = 'DefaultParameter'
- const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
- this.isRoleEdit = isRoleEdit
- },
- getDownList() {
- GetDataByNames(this.requestParams).then(response => {
- this.disposalList = response.data.getRemainFeedList.list
- })
- },
- getList() {
- this.listLoading = true
- GetDataByName(this.getdataListParm).then(response => {
- console.log('table1数据', response.data.list)
- if (response.data.list !== null) {
- this.createTemp = response.data.list[0]
- } else {
- this.list = []
- }
- setTimeout(() => {
- this.listLoading = false
- }, 100)
- })
- },
- handleSave() {
- console.log('点击了保存')
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- if(this.createTemp.anyCar == '' || this.createTemp.anyCar == 0){
- this.$message({ type: 'error', message: '任意车数量不能为空或为0', duration: 2000 })
- }
- this.requestParam.common = { 'returnmap': '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = { 'name': 'updatesysopt', 'type': 'e', 'parammaps': {
- pastureid: this.createTemp.pastureid,
- isGetLastPlan: this.createTemp.isGetLastPlan,
- isGetNextPlan: this.createTemp.isGetNextPlan,
- isEnableSupplyFeed: this.createTemp.isEnableSupplyFeed,
- isEnableRemainFeed: this.createTemp.isEnableRemainFeed,
- reportDigit: this.createTemp.reportDigit,
- isLockCount: this.createTemp.isLockCount,
- remainOpt: this.createTemp.remainOpt,
- waterOpt: this.createTemp.waterOpt,
- overweightWarnRate: this.createTemp.overweightWarnRate,
- overweightBanRate: this.createTemp.overweightBanRate,
- repertoryWarn: this.createTemp.repertoryWarn,
- isfeedstorage: this.createTemp.isfeedstorage,
- times: this.createTemp.times,
- decimalPlaces: this.createTemp.decimalPlaces,
- decimalRate: this.createTemp.decimalRate,
- isEnableContract: this.createTemp.isEnableContract,
- remainOptDis: this.createTemp.remainOptDis,
- remainOptRate: this.createTemp.remainOptRate,
- isSmallMaterial: this.createTemp.isSmallMaterial,
- isDataSync: this.createTemp.isDataSync,
- anyCar:this.createTemp.anyCar,
- accuracy:this.createTemp.accuracy,
- sprinkleFeedTimeAllow:this.createTemp.sprinkleFeedTimeAllow,
- domain:this.createTemp.domain,
- tmrUpper:this.createTemp.tmrUpper,
- tmrUnder:this.createTemp.tmrUnder,
- yhfeedtemplet:this.createTemp.yhfeedtemplet,
- yhautosecond:this.createTemp.yhautosecond,
- }}
- this.requestParam.data[1] = { 'name': 'updateFPbyFTChangeALL', 'type': 'e', 'parammaps': {
- pastureid: this.createTemp.pastureid
- }}
- ExecDataByConfig(this.requestParam).then(response => {
- console.log('保存发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- this.$notify({ title: this.$t('common.succes'), message: this.$t('driver.saveSuccess'), type: 'success', duration: 2000 })
- this.getList()
- } else {
- this.$notify({ title: this.$t('driver.saveFail'), message: response.data, type: 'warning', duration: 2000 })
- }
- })
- },
- handleRecovery() {
- console.log('点击了恢复默认')
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- MessageBox.confirm('是否确认恢复默认设置?', {
- confirmButtonText: this.$t('common.confirm'), confirmButtonText: this.$t('common.cancel'), type: 'warning'
- }).then(() => {
- this.requestParam.common = { 'returnmap': '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = { 'name': 'updatesysoptinit', 'type': 'e', 'parammaps': {
- pastureid: this.createTemp.pastureid
- }}
- this.requestParam.data[1] = { 'name': 'updateFPbyFTChangeALL', 'type': 'e', 'parammaps': {
- pastureid: this.createTemp.pastureid
- }}
- ExecDataByConfig(this.requestParam).then(response => {
- console.log('保存发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- this.$notify({ title: this.$t('common.succes'), message: this.$t('driver.saveSuccess'), type: 'success', duration: 2000 })
- this.getList()
- } else {
- this.$notify({ title: this.$t('driver.saveFail'), message: response.data, type: 'warning', duration: 2000 })
- }
- })
- })
- },
- handleDescription() {
- this.description.dialogStatus = 'description'
- this.description.dialogFormVisible = true
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .app-description{
- display:flex; justify-content: center; align-items: center;font-size: 14px;line-height: 28px;
- .content{
- display:flex;
- }
- }
- </style>
|