fbaa7ef14a2e76eb1848f6f225e66562d91b556d.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <div class="app-container" style="width: 90%;">
  3. <h3>预警参数</h3>
  4. <div class="el-icon-info" style="font-size: 30px;float: right;color: #409EFF;" @click="handleDescription" />
  5. <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="270px" style="margin-top: 40px;margin-bottom:30px;">
  6. <el-row>
  7. <el-col :span="12">
  8. <el-form-item label="计划准确率预警值(%):" prop="remainOptRate">
  9. <el-input ref="remainOptRate" v-model.number="createTemp.remainOptRate" type="number" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" />
  10. </el-form-item>
  11. </el-col>
  12. <el-col :span="12">
  13. <el-form-item label="配方准确率预警值(%):" prop="remainOptRate">
  14. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  15. </el-form-item>
  16. </el-col>
  17. </el-row>
  18. <el-row>
  19. <el-col :span="12">
  20. <el-form-item label="牛群准确率预警值(%):" prop="remainOptRate">
  21. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  22. </el-form-item>
  23. </el-col>
  24. <el-col :span="12">
  25. <el-form-item label="车次准确率预警值(%):" prop="remainOptRate">
  26. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  27. </el-form-item>
  28. </el-col>
  29. </el-row>
  30. <el-row>
  31. <el-col :span="12">
  32. <el-form-item label="混料自动跳转准确率预警值(%):" prop="remainOptRate">
  33. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="12">
  37. <el-form-item label="混料手动跳转准确率预警值(%):" prop="remainOptRate">
  38. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  39. </el-form-item>
  40. </el-col>
  41. </el-row>
  42. <el-row>
  43. <el-col :span="12">
  44. <el-form-item label="泌乳牛采食量平均值偏差预警值(kg):" prop="remainOptRate">
  45. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="12">
  49. <el-form-item label="泌乳牛产奶量平均值偏差预警值(kg):" prop="remainOptRate">
  50. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  51. </el-form-item>
  52. </el-col>
  53. </el-row>
  54. <el-row>
  55. <el-col :span="12">
  56. <el-form-item label="撒料时间偏差预警值(min):" prop="remainOptRate">
  57. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  58. </el-form-item>
  59. </el-col>
  60. <el-col :span="12">
  61. <el-form-item label="超出平均混料时间预警值(min):" prop="remainOptRate">
  62. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  63. </el-form-item>
  64. </el-col>
  65. </el-row>
  66. <el-row>
  67. <el-col :span="12">
  68. <el-form-item label="超出平均转化率预警值(%):" prop="remainOptRate">
  69. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="12">
  73. <el-form-item label="超出平均公斤奶饲料成本(%):" prop="remainOptRate">
  74. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  75. </el-form-item>
  76. </el-col>
  77. </el-row>
  78. <el-row>
  79. <el-col :span="12">
  80. <el-form-item label="牛栏剩料率超出预警值(%):" prop="remainOptRate">
  81. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  82. </el-form-item>
  83. </el-col>
  84. <el-col :span="12">
  85. <el-form-item label="库存预警天数:" prop="remainOptRate">
  86. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  87. </el-form-item>
  88. </el-col>
  89. </el-row>
  90. </el-form>
  91. <div slot="footer" class="dialog-footer" style="bottom: 0;">
  92. <el-button v-if="isRoleEdit" class="success" :disabled="isokDisable" @click="handleSave">保存</el-button>
  93. <el-button v-if="isRoleEdit" class="warning" :disabled="isokDisable" @click="handleRecovery">恢复默认</el-button>
  94. </div>
  95. <el-dialog :title="textMap[description.dialogStatus]" :destroy-on-close="true" :visible.sync="description.dialogFormVisible" :close-on-click-modal="false" width="70%">
  96. <div class="app-description dialogMinHeight">
  97. <div class="content">
  98. 1、计划准确率预警值:计划准确率低于此预警值则统计在统计报告中。
  99. <br>
  100. 2、配方准确率预警值:配方准确率低于此预警值则统计在统计报告中。
  101. <br>
  102. 3、牛群准确率预警值:牛群准确率低于此预警值则统计在统计报告中。
  103. <br>
  104. 4、车次准确率预警值:车次准确率低于此预警值则统计在统计报告中。
  105. <br>
  106. 5、混料自动跳转准确率预警值:混料自动跳转准确率低于此预警值则统计在统计报告中。
  107. <br>
  108. 6、混料手动跳转准确率预警值:混料手动跳转准确率低于此预警值则统计在统计报告中。
  109. <br>
  110. 7、泌乳牛采食量平均值偏差预警值:泌乳牛采食量平均值偏差高于此预警值则统计在统计报告中。
  111. <br>
  112. 8、泌乳牛产奶量平均值偏差预警值:泌乳牛产奶量平均值偏差高于此预警值则统计在统计报告中。
  113. <br>
  114. 9、撒料时间偏差预警值:撒料时间偏差高于此预警值则统计在统计报告中。
  115. <br>
  116. 10、超出平均混料时间预警值:平均混料时间高于此预警值则统计在统计报告中。
  117. <br>
  118. 11、超出平均转化率预警值:平均转换率高于此预警值则统计在统计报告中。
  119. <br>
  120. 12、超出平均公斤奶饲料成本:平均公斤奶饲料成本高于此预警值则统计在统计报告中。
  121. <br>
  122. 13、牛栏剩料率超出预警值:牛栏剩料率高于此预警值则统计在统计报告中。
  123. <br>
  124. 14、库存预警天数:库存预警模块根据设置天数进行统计。限制正整数。
  125. </div>
  126. </div>
  127. <div slot="footer" class="dialog-footer">
  128. <el-button class="cancelClose" @click="description.dialogFormVisible = false; ">关闭</el-button>
  129. </div>
  130. </el-dialog>
  131. </div>
  132. </template>
  133. <script>
  134. import { GetDataByName, PostDataByName, GetDataByNames, failproccess, checkButtons, ExecDataByConfig } from '@/api/common'
  135. import Cookies from 'js-cookie'
  136. import { MessageBox } from 'element-ui'
  137. export default {
  138. name: 'DefaultParameter',
  139. data() {
  140. return {
  141. isRoleEdit: [],
  142. planBeforeDayList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否可取前一天计划
  143. planNextDayList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否可取后一天计划
  144. isSupplementList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用补料
  145. isLeftoverMaterialList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用剩料
  146. decimalPlacesList: [{ id: '0', name: '整数' }, { id: '1', name: '一位小数' }, { id: '2', name: '两位小数' }, { id: '3', name: '三位小数' }], // 日计划报表小数点位数
  147. isLockBullsList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 启用饲料锁定牛头数
  148. disposalList: [], // 剩料处理选项
  149. waterConditioningList: [{ id: '0', name: '青贮' }, { id: '1', name: '总日粮饲喂量' }, { id: '2', name: '不处理' }], // 水分调节选项
  150. priceCalculationList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用库存管理
  151. numberList: [{ id: '0', name: '1' }, { id: '1', name: '2' }, { id: '2', name: '3' }, { id: '3', name: '4' }], // 班次数量
  152. feedontractList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用饲料合同
  153. leftoverMaterialList: [{ id: '0', name: '顶额分配' }, { id: '1', name: '剩料分配' }],
  154. requestParams: [
  155. { name: 'getRemainFeedList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
  156. ],
  157. getdataListParm: {
  158. name: 'getysoptList',
  159. page: 1,
  160. offset: 1,
  161. pagecount: 10,
  162. returntype: 'Map',
  163. parammaps: {
  164. pastureid: Cookies.get('pastureid')
  165. }
  166. },
  167. tableKey: 0,
  168. listLoading: true,
  169. createTemp: {},
  170. rules: {},
  171. isokDisable: false,
  172. description: {
  173. dialogFormVisible: false,
  174. dialogStatus: ''
  175. },
  176. textMap: {
  177. description: '参数说明'
  178. },
  179. requestParam: {}
  180. }
  181. },
  182. created() {
  183. this.getList()
  184. this.getButtons()
  185. this.getDownList()
  186. },
  187. methods: {
  188. getButtons() {
  189. const Edit = 'DefaultParameter'
  190. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  191. this.isRoleEdit = isRoleEdit
  192. },
  193. getDownList() {
  194. GetDataByNames(this.requestParams).then(response => {
  195. this.disposalList = response.data.getRemainFeedList.list
  196. })
  197. },
  198. getList() {
  199. this.listLoading = true
  200. GetDataByName(this.getdataListParm).then(response => {
  201. console.log('table1数据', response.data.list)
  202. if (response.data.list !== null) {
  203. this.createTemp = response.data.list[0]
  204. } else {
  205. this.list = []
  206. }
  207. setTimeout(() => {
  208. this.listLoading = false
  209. }, 100)
  210. })
  211. },
  212. handleSave() {
  213. console.log('点击了保存')
  214. this.isokDisable = true
  215. setTimeout(() => {
  216. this.isokDisable = false
  217. }, 1000)
  218. this.requestParam.common = { 'returnmap': '0' }
  219. this.requestParam.data = []
  220. this.requestParam.data[0] = { 'name': 'updatesysopt', 'type': 'e', 'parammaps': {
  221. pastureid: this.createTemp.pastureid,
  222. isGetLastPlan: this.createTemp.isGetLastPlan,
  223. isGetNextPlan: this.createTemp.isGetNextPlan,
  224. isEnableSupplyFeed: this.createTemp.isEnableSupplyFeed,
  225. isEnableRemainFeed: this.createTemp.isEnableRemainFeed,
  226. reportDigit: this.createTemp.reportDigit,
  227. isLockCount: this.createTemp.isLockCount,
  228. remainOpt: this.createTemp.remainOpt,
  229. waterOpt: this.createTemp.waterOpt,
  230. overweightWarnRate: this.createTemp.overweightWarnRate,
  231. overweightBanRate: this.createTemp.overweightBanRate,
  232. repertoryWarn: this.createTemp.repertoryWarn,
  233. isfeedstorage: this.createTemp.isfeedstorage,
  234. times: this.createTemp.times,
  235. isEnableContract: this.createTemp.isEnableContract,
  236. remainOptDis: this.createTemp.remainOptDis,
  237. remainOptRate: this.createTemp.remainOptRate
  238. }}
  239. this.requestParam.data[1] = { 'name': 'updateFPbyFTChangeALL', 'type': 'e', 'parammaps': {
  240. pastureid: this.createTemp.pastureid
  241. }}
  242. ExecDataByConfig(this.requestParam).then(response => {
  243. console.log('保存发送参数', this.requestParam)
  244. if (response.msg !== 'fail') {
  245. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  246. this.getList()
  247. } else {
  248. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  249. }
  250. })
  251. },
  252. handleRecovery() {
  253. console.log('点击了恢复默认')
  254. this.isokDisable = true
  255. setTimeout(() => {
  256. this.isokDisable = false
  257. }, 1000)
  258. MessageBox.confirm('是否确认恢复默认设置?', {
  259. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  260. }).then(() => {
  261. this.requestParam.common = { 'returnmap': '0' }
  262. this.requestParam.data = []
  263. this.requestParam.data[0] = { 'name': 'updatesysoptinit', 'type': 'e', 'parammaps': {
  264. pastureid: this.createTemp.pastureid
  265. }}
  266. this.requestParam.data[1] = { 'name': 'updateFPbyFTChangeALL', 'type': 'e', 'parammaps': {
  267. pastureid: this.createTemp.pastureid
  268. }}
  269. ExecDataByConfig(this.requestParam).then(response => {
  270. console.log('保存发送参数', this.requestParam)
  271. if (response.msg !== 'fail') {
  272. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  273. this.getList()
  274. } else {
  275. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  276. }
  277. })
  278. })
  279. },
  280. handleDescription() {
  281. this.description.dialogStatus = 'description'
  282. this.description.dialogFormVisible = true
  283. }
  284. }
  285. }
  286. </script>
  287. <style lang="scss" scoped>
  288. .app-description{
  289. display:flex; justify-content: center; align-items: center;font-size: 14px;line-height: 28px;
  290. .content{
  291. display:flex;
  292. }
  293. }
  294. </style>