02350736423212e6c76bd0d1df874ae6ec7c15a2.svn-base 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <template>
  2. <div class="app-container">
  3. <!-- 配方模板表 -->
  4. <div ref="template" class="template">
  5. <p class="recipeTemplate" />
  6. <div class="operation">
  7. <el-button class="success" @click="handleCreate">新生成</el-button>
  8. <el-button class="export" style="float: right;margin-right: 80px;" @click="handleHistoryRecord">历史记录</el-button>
  9. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleMaterialPlan">撒料计划</el-button>
  10. <el-button class="export" style="float: right;margin-right: 10px;" @click="handlePremixedPlan">预混计划</el-button>
  11. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleShedFormula">栏舍配方</el-button>
  12. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleRecipeemplate">配方模板</el-button>
  13. </div>
  14. <div class="search">
  15. <el-date-picker v-model="table.getdataListParm.parammaps.date" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeDate" />
  16. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="计划类型" class="filter-item" clearable style="width: 120px;">
  17. <el-option v-for="item in planTypeList" :key="item.value" :label="item.label" :value="item.value" />
  18. </el-select>
  19. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="打印类型" class="filter-item" clearable style="width: 120px;">
  20. <el-option v-for="item in printingTypeList" :key="item.value" :label="item.label" :value="item.value" />
  21. </el-select>
  22. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable>
  23. <el-option v-for="item in frequencyList" :key="item.value" :label="item.label" :value="item.value" />
  24. </el-select>
  25. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="计划维度" class="filter-item" style="width: 120px;" clearable>
  26. <el-option v-for="item in planningDimensionList" :key="item.value" :label="item.label" :value="item.value" />
  27. </el-select>
  28. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="导出类型" class="filter-item" style="width: 120px;" clearable>
  29. <el-option v-for="item in exportTypeList" :key="item.value" :label="item.label" :value="item.value" />
  30. </el-select>
  31. <el-button class="export" @click="handleExport">导出</el-button>
  32. </div>
  33. <!-- 日执行计划 -->
  34. <div class="table">
  35. <el-table
  36. :key="table.tableKey"
  37. v-loading="table.listLoading"
  38. element-loading-text="给我一点时间"
  39. :data="table.list"
  40. border
  41. fit
  42. highlight-current-row
  43. style="width: 98%;"
  44. :row-style="rowStyle"
  45. :cell-style="cellStyle"
  46. class="elTable table-fixed"
  47. @row-click="tableRowClick"
  48. >
  49. <el-table-column label="序号" align="center" type="index" width="50px">
  50. <template slot-scope="scope">
  51. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="计划名称" min-width="130px" align="center">
  55. <template slot-scope="scope">
  56. <span>{{ scope.row.ccname }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="计划类型" prop="weight" min-width="130px" align="center">
  60. <template slot-scope="scope">
  61. <span>{{ scope.row.ccname }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="TMR编号" min-width="130px" align="center">
  65. <template slot-scope="scope">
  66. <span>{{ scope.row.ccname }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="驾驶员" min-width="130px" align="center">
  70. <template slot-scope="scope">
  71. <span>{{ scope.row.ccname }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="已执行" min-width="130px" align="center">
  75. <template slot-scope="scope">
  76. <span>{{ scope.row.ccname }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="班次" min-width="180px" align="center">
  80. <template slot-scope="scope">
  81. <span>{{ scope.row.ccname }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="理论量" min-width="180px" align="center">
  85. <template slot-scope="scope">
  86. <span>{{ scope.row.ccname }}</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="时间" min-width="180px" align="center">
  90. <template slot-scope="scope">
  91. <span>{{ scope.row.ccname }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="发料位" min-width="180px" align="left">
  95. <template slot-scope="scope">
  96. <span style="margin-right: 10px;">{{ scope.row.ccname }}</span>
  97. <span style="margin-right: 10px;">{{ scope.row.ccname }}</span>
  98. </template>
  99. </el-table-column>
  100. </el-table>
  101. </div>
  102. </div>
  103. <!-- 计划内容操作 -->
  104. <div class="content">
  105. <div class="table2">
  106. <p class="contentOperation" />
  107. <div class="content-table">
  108. <el-table
  109. :key="table2.tableKey"
  110. v-loading="table2.listLoading"
  111. element-loading-text="给我一点时间"
  112. :data="table2.list"
  113. fit
  114. highlight-current-row
  115. style="width: 100%;"
  116. height="450"
  117. :row-style="rowStyle"
  118. :cell-style="cellStyle"
  119. class="elTable table-fixed"
  120. >
  121. <el-table-column label="操作序号" min-width="130px" align="center">
  122. <template slot-scope="scope">
  123. <span>{{ scope.row.number }}</span>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="饲料名称" prop="ccname" min-width="130px" align="center">
  127. <template slot-scope="scope">
  128. <span>{{ scope.row.ccname }}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  132. <template slot-scope="scope">
  133. <span>{{ scope.row.weight }}</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="同序号设计重量合计" min-width="150px" align="center">
  137. <template slot-scope="scope">
  138. <span>{{ scope.row.ccname }}</span>
  139. </template>
  140. </el-table-column>
  141. </el-table>
  142. </div>
  143. </div>
  144. <div class="table3">
  145. <p class="stallRetails" />
  146. <div class="content-table">
  147. <el-table
  148. :key="table3.tableKey"
  149. v-loading="table3.listLoading"
  150. element-loading-text="给我一点时间"
  151. :data="table3.list"
  152. height="450"
  153. fit
  154. highlight-current-row
  155. style="width: 100%;"
  156. :row-style="rowStyle"
  157. :cell-style="cellStyle"
  158. class="elTable table-fixed"
  159. >
  160. <el-table-column label=" 操作序号" min-width="130px" align="center">
  161. <template slot-scope="scope">
  162. <span>{{ scope.row.ccname }}</span>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="计划类型" prop="weight" min-width="130px" align="center">
  166. <template slot-scope="scope">
  167. <span>{{ scope.row.ccname }}</span>
  168. </template>
  169. </el-table-column>
  170. <el-table-column label="栏舍编号" min-width="130px" align="center">
  171. <template slot-scope="scope">
  172. <span>{{ scope.row.ccname }}</span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column label="设计重量(KG)" min-width="130px" align="center">
  176. <template slot-scope="scope">
  177. <span>{{ scope.row.ccname }}</span>
  178. </template>
  179. </el-table-column>
  180. </el-table>
  181. </div>
  182. </div>
  183. </div>
  184. <!-- 新生成 -->
  185. <el-dialog :title="textMap[newGeneration.dialogStatus]" :destroy-on-close="true" :visible.sync="newGeneration.dialogFormVisible" :close-on-click-modal="false" width="50%">
  186. <div class="newGeneration">
  187. <el-form ref="temp" :rules="newGeneration.rules" :model="newGeneration.temp" label-position="right" label-width="155px" style="width: 100%;margin:0 auto 50px">
  188. <el-row>
  189. <el-col :span="16">
  190. <el-form-item label="时间范围:" prop="applyDate">
  191. <el-date-picker v-model="newGeneration.temp.inputDatetime" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" />
  192. </el-form-item>
  193. </el-col>
  194. </el-row>
  195. </el-form>
  196. <div slot="footer" class="dialog-footer" style="bottom:10px">
  197. <el-button class="cancel" @click="newGeneration.dialogFormVisible = false;getList()">取消</el-button>
  198. <el-button class="success" :disabled="isokDisable" @click="newGenerationData()">确认</el-button>
  199. </div>
  200. </div>
  201. </el-dialog>
  202. </div>
  203. </template>
  204. <script>
  205. import { GetDataByName, GetDataByNames } from '@/api/common'
  206. import { MessageBox } from 'element-ui'
  207. import Cookies from 'js-cookie'
  208. export default {
  209. name: 'DailyExecutionPlan',
  210. data() {
  211. return {
  212. requestParams: [
  213. // { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] }
  214. ],
  215. planTypeList: [{ lable: '预混计划', value: '0' }, { lable: '发料计划', value: '1' }, { lable: '剩料计划', value: '2' }], // 计划类型
  216. printingTypeList: [{ lable: '所有', value: '0' }, { lable: '精料', value: '1' }, { lable: '铲车', value: '2' }], // 打印类型
  217. frequencyList: [{ value: '0', label: '第一班' }, { value: '1', label: '第二班' }, { value: '2', label: '第三班' }], // 班次
  218. planningDimensionList: [{ lable: '发料顺序', value: '0' }, { lable: 'TMR', value: '1' }], // 发料顺序
  219. exportTypeList: [{ lable: '投料简打', value: '0' }, { lable: '投料简打', value: '1' }], // 导出类型
  220. table: {
  221. getdataListParm: {
  222. name: 'getFTList',
  223. page: 1,
  224. offset: 1,
  225. pagecount: 10,
  226. returntype: 'Map',
  227. parammaps: {
  228. pastureid: Cookies.get('pastureid')
  229. }
  230. },
  231. tableKey: 0,
  232. list: [],
  233. total: 0,
  234. listLoading: false
  235. },
  236. // 计划内容操作详情
  237. table2: {
  238. getdataListParm: {
  239. name: 'getFTList',
  240. page: 1,
  241. offset: 1,
  242. pagecount: 5,
  243. returntype: 'Map',
  244. parammaps: {
  245. pastureid: Cookies.get('pastureid')
  246. }
  247. },
  248. tableKey: 0,
  249. list: [],
  250. total: 0,
  251. listLoading: false
  252. },
  253. // 计划内容 舍栏详情
  254. table3: {
  255. getdataListParm: {
  256. name: 'getFTList',
  257. page: 1,
  258. offset: 1,
  259. pagecount: 5,
  260. returntype: 'Map',
  261. parammaps: {
  262. pastureid: Cookies.get('pastureid')
  263. }
  264. },
  265. tableKey: 0,
  266. list: [],
  267. total: 0,
  268. listLoading: false
  269. },
  270. // 新生成
  271. newGeneration: {
  272. dialogFormVisible: false,
  273. dialogStatus: '',
  274. temp: {},
  275. rules: {}
  276. },
  277. textMap: {
  278. newGeneration: '新生成'
  279. },
  280. isokDisable: false,
  281. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  282. cellStyle: { padding: 0 + 'px' }
  283. }
  284. },
  285. mounted() {
  286. },
  287. created() {
  288. this.getList()
  289. this.getDownList()
  290. },
  291. methods: {
  292. getDownList() {
  293. GetDataByNames(this.requestParams).then(response => {
  294. // this.livestockTypeList = response.data.getDictByName.list
  295. })
  296. },
  297. // -------------------日执行计划-----------------------------
  298. getList() {
  299. this.table.listLoading = true
  300. GetDataByName(this.table.getdataListParm).then(response => {
  301. console.log('table数据', response.data.list)
  302. if (response.data.list !== null) {
  303. this.table.list = response.data.list
  304. this.table.pageNum = response.data.pageNum
  305. this.table.pageSize = response.data.pageSize
  306. this.table.total = response.data.total
  307. this.getList2()
  308. this.getList3()
  309. } else {
  310. this.table.list = []
  311. }
  312. setTimeout(() => {
  313. this.table.listLoading = false
  314. }, 100)
  315. })
  316. },
  317. changeDate(val) {
  318. console.log('选择了日期', val)
  319. this.getList()
  320. },
  321. // 新生成
  322. handleCreate() {
  323. console.log('点击了新生成')
  324. this.newGeneration.dialogStatus = 'newGeneration'
  325. this.newGeneration.dialogFormVisible = true
  326. },
  327. newGenerationData() {
  328. console.log('点击了新生成保存')
  329. },
  330. // 配方模板
  331. handleRecipeemplate() {
  332. console.log('点击了配方模板,页面待画')
  333. },
  334. handleShedFormula() {
  335. console.log('点击了栏舍配方,页面待画')
  336. },
  337. handlePremixedPlan() {
  338. console.log('点击了预混计划,页面待画')
  339. },
  340. handleMaterialPlan() {
  341. console.log('点击了撒料计划,页面待画')
  342. },
  343. handleHistoryRecord() {
  344. console.log('点击了历史记录,页面待画')
  345. },
  346. handleExport() {
  347. console.log('点击了导出')
  348. },
  349. // 日执行计划行点击
  350. tableRowClick(row, column, event) {
  351. console.log(row, column, event)
  352. this.getList2()
  353. },
  354. // 计划内容操作详情
  355. getList2() {
  356. this.table2.listLoading = true
  357. GetDataByName(this.table2.getdataListParm).then(response => {
  358. console.log('table数据', response.data.list)
  359. if (response.data.list !== null) {
  360. this.table2.list = response.data.list
  361. this.table2.list = [
  362. { 'number': 1, 'ccname': '泌乳牛', 'weight': 10, 'fttype': '预混配方', 'id': '3025176272438480391', 'pastureid': '3025176271438480383', 'tcolor': '55', 'tname': '预混1' },
  363. { 'number': 1, 'ccname': '泌乳牛', 'weight': 10, 'fttype': '预混配方', 'id': '3025176272438480390', 'pastureid': '3025176271438480383', 'tcolor': '55', 'tname': '配方2-1' },
  364. { 'number': 2, 'ccname': '泌乳牛', 'weight': 12, 'fttype': '预混配方', 'id': '3025176272438480385', 'pastureid': '3025176271438480383', 'tcolor': '55', 'tname': '配方2' },
  365. { 'number': 2, 'ccname': '水牛', 'weight': 10, 'fttype': '饲喂配方', 'id': '3025176271437480384', 'pastureid': '3025176271438480383', 'tcolor': '55', 'tname': '配方1' },
  366. { 'number': 2, 'ccname': '水牛', 'weight': 10, 'fttype': '饲喂配方', 'id': '3025176271437480384', 'pastureid': '3025176271438480383', 'tcolor': '55', 'tname': '配方1' }
  367. ]
  368. const arr = []
  369. let a = 0
  370. let b = this.table2.list[0].number
  371. let c = 0
  372. for (let i = 0; i < this.table2.list.length; i++) {
  373. if (b !== parseInt(this.table2.list[i].number)) {
  374. b = this.table2.list[i].number
  375. arr.push({ 'number': '小计', 'weight': a })
  376. a = 0
  377. }
  378. a = a + this.table2.list[i].weight
  379. c = c + this.table2.list[i].weight
  380. arr.push(this.table2.list[i])
  381. }
  382. arr.push({ 'number': '小计', 'weight': a })
  383. arr.push({ 'number': '总计', 'weight': c })
  384. this.table2.list = arr
  385. console.log(this.table2.list)
  386. this.table2.pageNum = response.data.pageNum
  387. this.table2.pageSize = response.data.pageSize
  388. this.table2.total = response.data.total
  389. } else {
  390. this.table2.list = []
  391. }
  392. setTimeout(() => {
  393. this.table2.listLoading = false
  394. }, 100)
  395. })
  396. },
  397. // 计划内容栏舍详情
  398. getList3() {
  399. this.table3.listLoading = true
  400. GetDataByName(this.table3.getdataListParm).then(response => {
  401. console.log('table数据', response.data.list)
  402. if (response.data.list !== null) {
  403. this.table3.list = response.data.list
  404. this.table3.pageNum = response.data.pageNum
  405. this.table3.pageSize = response.data.pageSize
  406. this.table3.total = response.data.total
  407. } else {
  408. this.table3.list = []
  409. }
  410. setTimeout(() => {
  411. this.table3.listLoading = false
  412. }, 100)
  413. })
  414. }
  415. }
  416. }
  417. </script>
  418. <style lang="scss" scoped>
  419. .operation{margin-bottom:10px;}
  420. .search{margin-top:10px;}
  421. .table{margin-top:10px;}
  422. .template{
  423. background: #fff;
  424. position: relative;
  425. .recipeTemplate{
  426. width: 72px;
  427. height: 70px;
  428. position: absolute;
  429. background: url(../../../assets/images/bg3.jpg) no-repeat;
  430. right: 0;
  431. top: 0;
  432. margin: 0;
  433. }
  434. }
  435. .table2{
  436. float: left;width: 49%;margin-right: 1%;background: red;
  437. background: #fff;
  438. position: relative;
  439. .contentOperation{
  440. width: 72px;
  441. height: 70px;
  442. position: absolute;
  443. background: url(../../../assets/images/bg4.jpg) no-repeat;
  444. right: 0;
  445. top: 0;
  446. margin: 0;
  447. }
  448. .content-table{margin-top: 70px;}
  449. }
  450. .table3{
  451. float: left;
  452. width: 49%;
  453. background: #fff;
  454. position: relative;
  455. .stallRetails{
  456. width: 72px;
  457. height: 70px;
  458. position: absolute;
  459. background: url(../../../assets/images/bg5.jpg) no-repeat;
  460. right: 0;
  461. top: 0;
  462. margin: 0;
  463. }
  464. .content-table{margin-top: 70px;}
  465. }
  466. </style>