4417ccc3eabca750f0845b18ad1f5ab5e151c67c.svn-base 14 KB

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