36e3e84d87edf51a324a749b361de90679ddf972.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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="250px" style="margin-top: 40px;margin-bottom:30px;">
  5. <el-row>
  6. <el-col :span="12">
  7. <el-form-item label="是否可取前一天计划:" prop="isGetLastPlan">
  8. <el-select v-model="createTemp.isGetLastPlan" :disabled="isRoleEdit==false" filterable placeholder="是否可取前一天计划" class="filter-item" style="width:100%">
  9. <el-option v-for="item in planBeforeDayList" :key="item.id" :label="item.name" :value="item.id" />
  10. </el-select>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :span="12">
  14. <el-form-item label="是否可取后一天计划:" prop="isGetNextPlan">
  15. <el-select v-model="createTemp.isGetNextPlan" :disabled="isRoleEdit==false" filterable placeholder="是否可取后一天计划" class="filter-item" style="width:100%">
  16. <el-option v-for="item in planNextDayList" :key="item.id" :label="item.name" :value="item.id" />
  17. </el-select>
  18. </el-form-item>
  19. </el-col>
  20. </el-row>
  21. <el-row>
  22. <el-col :span="12">
  23. <el-form-item label="班次数量:" prop="times">
  24. <el-select v-model="createTemp.times" :disabled="isRoleEdit==false" filterable placeholder="水分调节选项" class="filter-item" style="width:100%">
  25. <el-option v-for="item in numberList" :key="item.id" :label="item.name" :value="item.name" />
  26. </el-select>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="12">
  30. <el-form-item label="重量小数点位数:" prop="decimalPlaces">
  31. <el-select v-model="createTemp.decimalPlaces" :disabled="isRoleEdit==false" filterable placeholder="重量小数点位数" class="filter-item" style="width:100%">
  32. <el-option v-for="item in weightDecimalPlacesList" :key="item.id" :label="item.name" :value="item.id" />
  33. </el-select>
  34. </el-form-item>
  35. </el-col>
  36. </el-row>
  37. <el-row>
  38. <el-col :span="12">
  39. <el-form-item label="是否启用饲料合同:" prop="isEnableContract">
  40. <el-select v-model="createTemp.isEnableContract" :disabled="isRoleEdit==false" filterable placeholder="启用饲料合同" class="filter-item" style="width:100%">
  41. <el-option v-for="item in feedontractList" :key="item.id" :label="item.name" :value="item.id" />
  42. </el-select>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :span="12">
  46. <el-form-item label="启用饲料锁定牛头数:" prop="isLockCount">
  47. <el-select v-model="createTemp.isLockCount" :disabled="isRoleEdit==false" filterable placeholder="启用饲料锁定牛头数" class="filter-item" style="width:100%">
  48. <el-option v-for="item in isLockBullsList" :key="item.id" :label="item.name" :value="item.id" />
  49. </el-select>
  50. </el-form-item>
  51. </el-col>
  52. </el-row>
  53. <el-row>
  54. <el-col :span="12">
  55. <el-form-item label="车辆载重超出重量提醒比例(%):" 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="车辆载重超出重量禁止比例(%):" 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="isEnableSupplyFeed">
  68. <el-select v-model="createTemp.isEnableSupplyFeed" :disabled="isRoleEdit==false" filterable placeholder="是否启用补料" class="filter-item" style="width:100%">
  69. <el-option v-for="item in isSupplementList" :key="item.id" :label="item.name" :value="item.id" />
  70. </el-select>
  71. </el-form-item>
  72. </el-col>
  73. <el-col :span="12">
  74. <el-form-item label="是否启用剩料:" prop="isEnableRemainFeed">
  75. <el-select v-model="createTemp.isEnableRemainFeed" :disabled="isRoleEdit==false" filterable placeholder="是否启用剩料" class="filter-item" style="width:100%">
  76. <el-option v-for="item in isLeftoverMaterialList" :key="item.id" :label="item.name" :value="item.id" />
  77. </el-select>
  78. </el-form-item>
  79. </el-col>
  80. </el-row>
  81. <el-row>
  82. <el-col :span="12">
  83. <el-form-item label="剩料处理选项:" prop="remainOpt">
  84. <el-select v-model="createTemp.remainOpt" :disabled="isRoleEdit==false" filterable placeholder="剩料处理选项" class="filter-item" style="width:100%">
  85. <el-option v-for="item in disposalList" :key="item.id" :label="item.fname" :value="item.id" />
  86. </el-select>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="12">
  90. <el-form-item label="剩料分配方式:" prop="remainOptDis">
  91. <el-select v-model="createTemp.remainOptDis" :disabled="isRoleEdit==false" filterable placeholder="剩料分配方式" class="filter-item" style="width:100%">
  92. <el-option v-for="item in leftoverMaterialList" :key="item.id" :label="item.name" :value="item.name" />
  93. </el-select>
  94. </el-form-item>
  95. </el-col>
  96. </el-row>
  97. <el-row>
  98. <el-col :span="12">
  99. <el-form-item label="剩料分配占比原料(%):" prop="remainOptRate">
  100. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  101. </el-form-item>
  102. </el-col>
  103. <el-col :span="12">
  104. <el-form-item label="小料是否称量:" prop="isSmallMaterial">
  105. <el-select v-model="createTemp.isSmallMaterial" :disabled="isRoleEdit==false" filterable placeholder="小料是否称量" class="filter-item" style="width:100%">
  106. <el-option v-for="item in smallMaterialList" :key="item.id" :label="item.name" :value="item.id" />
  107. </el-select>
  108. </el-form-item>
  109. </el-col>
  110. </el-row>
  111. <el-row>
  112. <!-- <el-col :span="12">
  113. <el-form-item label="设备运转标准时间(分钟):" prop="remainOptRate">
  114. <el-input ref="remainOptRate" v-model="createTemp.remainOptRate" :disabled="isRoleEdit==false" class="filter-item" placeholder="剩料分配占比原混料" type="text" />
  115. </el-form-item>
  116. </el-col> -->
  117. <el-col :span="12">
  118. <el-form-item label="是否启用数据同步:" prop="isDataSync">
  119. <el-select v-model="createTemp.isDataSync" :disabled="isRoleEdit==false" filterable placeholder="是否启用数据同步" class="filter-item" style="width:100%">
  120. <el-option v-for="item in dataSynchronizationList" :key="item.id" :label="item.name" :value="item.id" />
  121. </el-select>
  122. </el-form-item>
  123. </el-col>
  124. </el-row>
  125. </el-form>
  126. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  127. <el-button v-if="isRoleEdit" class="save" :disabled="isokDisable" @click="handleSave">保存</el-button>
  128. <el-button v-if="isRoleEdit" class="warning" :disabled="isokDisable" @click="handleRecovery">恢复默认</el-button>
  129. </div>
  130. <el-dialog :title="textMap[description.dialogStatus]" :destroy-on-close="true" :visible.sync="description.dialogFormVisible" :close-on-click-modal="false" width="70%">
  131. <div class="app-description dialogMinHeight">
  132. <div class="content">
  133. 1、是否可取前一天计划:若选择是,代表在当天过了凌晨12点仍可以取到昨天的料。
  134. <br>
  135. 2、是否可取后一天计划:若当天做完全部的料需要预备第二天的料的时候可以选择是。
  136. <br>
  137. 3、班次数量:控制栏舍配方,计划等页面班次数量。
  138. <br>
  139. 4、重量小数点位数:控制栏舍配方、撒料计划等页面重量小数位数。
  140. <br>
  141. 5、是否启用饲料合同:若选择是,则开启库存管理中饲料合同页面。
  142. <br>
  143. 6、启用饲料锁定牛头数:开启后则配方模板中饲料表显示此字段。
  144. <br>
  145. 7、车辆载重超出重量提醒比例:撒料计划中车次分配栏舍重量,当分配的合计重量超出车辆最大重量*此比例时,进行提示。限制输入正整数。
  146. <br>
  147. 8、车辆载重超出重量禁止比例:撒料计划中车次分配栏舍重量,当分配的合计重量超出车辆最大重量*此比例时,禁止分配。限制输入正整数。
  148. <br>
  149. 9、是否启用补料:若选择是,则栏舍配方中启用此字段。
  150. <br>
  151. 10、是否启用剩料:若选择否则剩料计划不可用,剩料量不影响原计划。
  152. <br>
  153. 11、剩料处理选项:①若选择转为饲料,按饲料配方整体替换扣减;②如果选择替换某饲料,则此剩料替换待饲喂中的对应饲料量,扣完为止;③不处理:不做剩料计算处理。
  154. <br>
  155. 12、剩料分配方式:①顶额分配:按栏舍原撒料量的百分比进行计算,剩料分配为此值,依次计算分配满栏舍,若剩料量未分配完,则剩余剩料不计入内;
  156. <br>
  157. ②平均分配,按收集的总剩料量平均分配值,若分配值超出栏舍原料量的百分比,剩余值累加到未分配满的栏舍中,最终剩余剩料不计入内。
  158. <br>
  159. 13、剩料分配占比原料:剩料应分配量不超出此比例计算出的值,与剩料分配方式关联使用。限制输入正整数。
  160. <br>
  161. 14、小料是否称量:若选择是,则饲料表中饲料可选小料称,撒料计划中可设置是否提前称量。
  162. <br>
  163. 15、是否启用数据同步:启用后日执行页面开启数据同步按钮,用于与第三方系统数据对接。
  164. </div>
  165. </div>
  166. <div slot="footer" class="dialog-footer">
  167. <el-button class="cancelClose" @click="description.dialogFormVisible = false; ">关闭</el-button>
  168. </div>
  169. </el-dialog>
  170. </div>
  171. </template>
  172. <script>
  173. import { GetDataByName, GetDataByNames, failproccess, checkButtons, ExecDataByConfig } from '@/api/common'
  174. import Cookies from 'js-cookie'
  175. import { MessageBox } from 'element-ui'
  176. export default {
  177. name: 'DefaultParameter',
  178. data() {
  179. return {
  180. isRoleEdit: [],
  181. planBeforeDayList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否可取前一天计划
  182. planNextDayList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否可取后一天计划
  183. isSupplementList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用补料
  184. isLeftoverMaterialList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用剩料
  185. decimalPlacesList: [{ id: '0', name: '整数' }, { id: '1', name: '一位小数' }, { id: '2', name: '两位小数' }, { id: '3', name: '三位小数' }], // 日计划报表小数点位数
  186. isLockBullsList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 启用饲料锁定牛头数
  187. disposalList: [], // 剩料处理选项
  188. numberList: [{ id: '0', name: '1' }, { id: '1', name: '2' }, { id: '2', name: '3' }, { id: '3', name: '4' }], // 班次数量
  189. feedontractList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用饲料合同
  190. leftoverMaterialList: [{ id: '0', name: '顶额分配' }, { id: '1', name: '剩料分配' }],
  191. weightDecimalPlacesList: [{ id: '0', name: '整数' }, { id: '1', name: '一位小数' }, { id: '2', name: '两位小数' }, { id: '3', name: '三位小数' }], // 重量小数点位数
  192. smallMaterialList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 小料是否称量
  193. dataSynchronizationList: [{ id: '1', name: '是' }, { id: '0', name: '否' }], // 是否启用数据同步
  194. requestParams: [
  195. { name: 'getRemainFeedList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
  196. ],
  197. getdataListParm: {
  198. name: 'getysoptList',
  199. page: 1,
  200. offset: 1,
  201. pagecount: 10,
  202. returntype: 'Map',
  203. parammaps: {
  204. pastureid: Cookies.get('pastureid')
  205. }
  206. },
  207. tableKey: 0,
  208. listLoading: true,
  209. createTemp: {},
  210. rules: {},
  211. description: {
  212. dialogFormVisible: false,
  213. dialogStatus: ''
  214. },
  215. textMap: {
  216. description: '参数说明'
  217. },
  218. isokDisable: false,
  219. requestParam: {}
  220. }
  221. },
  222. created() {
  223. this.getList()
  224. this.getButtons()
  225. this.getDownList()
  226. },
  227. methods: {
  228. getButtons() {
  229. const Edit = 'DefaultParameter'
  230. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  231. this.isRoleEdit = isRoleEdit
  232. },
  233. getDownList() {
  234. GetDataByNames(this.requestParams).then(response => {
  235. this.disposalList = response.data.getRemainFeedList.list
  236. })
  237. },
  238. getList() {
  239. this.listLoading = true
  240. GetDataByName(this.getdataListParm).then(response => {
  241. console.log('table1数据', response.data.list)
  242. if (response.data.list !== null) {
  243. this.createTemp = response.data.list[0]
  244. } else {
  245. this.list = []
  246. }
  247. setTimeout(() => {
  248. this.listLoading = false
  249. }, 100)
  250. })
  251. },
  252. handleSave() {
  253. console.log('点击了保存')
  254. this.isokDisable = true
  255. setTimeout(() => {
  256. this.isokDisable = false
  257. }, 1000)
  258. this.requestParam.common = { 'returnmap': '0' }
  259. this.requestParam.data = []
  260. this.requestParam.data[0] = { 'name': 'updatesysopt', 'type': 'e', 'parammaps': {
  261. pastureid: this.createTemp.pastureid,
  262. isGetLastPlan: this.createTemp.isGetLastPlan,
  263. isGetNextPlan: this.createTemp.isGetNextPlan,
  264. isEnableSupplyFeed: this.createTemp.isEnableSupplyFeed,
  265. isEnableRemainFeed: this.createTemp.isEnableRemainFeed,
  266. reportDigit: this.createTemp.reportDigit,
  267. isLockCount: this.createTemp.isLockCount,
  268. remainOpt: this.createTemp.remainOpt,
  269. waterOpt: this.createTemp.waterOpt,
  270. overweightWarnRate: this.createTemp.overweightWarnRate,
  271. overweightBanRate: this.createTemp.overweightBanRate,
  272. repertoryWarn: this.createTemp.repertoryWarn,
  273. isfeedstorage: this.createTemp.isfeedstorage,
  274. times: this.createTemp.times,
  275. decimalPlaces: this.createTemp.decimalPlaces,
  276. isEnableContract: this.createTemp.isEnableContract,
  277. remainOptDis: this.createTemp.remainOptDis,
  278. remainOptRate: this.createTemp.remainOptRate,
  279. isSmallMaterial: this.createTemp.isSmallMaterial,
  280. isDataSync: this.createTemp.isDataSync
  281. }}
  282. this.requestParam.data[1] = { 'name': 'updateFPbyFTChangeALL', 'type': 'e', 'parammaps': {
  283. pastureid: this.createTemp.pastureid
  284. }}
  285. ExecDataByConfig(this.requestParam).then(response => {
  286. console.log('保存发送参数', this.requestParam)
  287. if (response.msg !== 'fail') {
  288. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  289. this.getList()
  290. } else {
  291. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  292. }
  293. })
  294. },
  295. handleRecovery() {
  296. console.log('点击了恢复默认')
  297. this.isokDisable = true
  298. setTimeout(() => {
  299. this.isokDisable = false
  300. }, 1000)
  301. MessageBox.confirm('是否确认恢复默认设置?', {
  302. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  303. }).then(() => {
  304. this.requestParam.common = { 'returnmap': '0' }
  305. this.requestParam.data = []
  306. this.requestParam.data[0] = { 'name': 'updatesysoptinit', 'type': 'e', 'parammaps': {
  307. pastureid: this.createTemp.pastureid
  308. }}
  309. this.requestParam.data[1] = { 'name': 'updateFPbyFTChangeALL', 'type': 'e', 'parammaps': {
  310. pastureid: this.createTemp.pastureid
  311. }}
  312. ExecDataByConfig(this.requestParam).then(response => {
  313. console.log('保存发送参数', this.requestParam)
  314. if (response.msg !== 'fail') {
  315. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  316. this.getList()
  317. } else {
  318. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  319. }
  320. })
  321. })
  322. },
  323. handleDescription() {
  324. this.description.dialogStatus = 'description'
  325. this.description.dialogFormVisible = true
  326. }
  327. }
  328. }
  329. </script>
  330. <style lang="scss" scoped>
  331. .app-description{
  332. display:flex; justify-content: center; align-items: center;font-size: 14px;line-height: 28px;
  333. .content{
  334. display:flex;
  335. }
  336. }
  337. </style>