e66c7e0612d2e0ac7a873f2c0a6df699ba541a05.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <template>
  2. <div class="app-container">
  3. <div class="search">
  4. <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="饲料名称" class="filter-item" style="width: 150px;" clearable>
  5. <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.id" />
  6. </el-select>
  7. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  8. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  9. </div>
  10. <div class="table">
  11. <el-table
  12. :key="table.tableKey"
  13. v-loading="table.listLoading"
  14. element-loading-text="给我一点时间"
  15. :data="table.list"
  16. border
  17. fit
  18. highlight-current-row
  19. style="width: 100%;"
  20. :row-style="rowStyle"
  21. :cell-style="cellStyle"
  22. class="elTable table-fixed"
  23. >
  24. <el-table-column label="序号" align="center" type="index" width="50px">
  25. <template slot-scope="scope">
  26. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="饲料名称" min-width="130px" align="center">
  30. <template slot-scope="scope">
  31. <span>{{ scope.row.feedname }}</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="批号" min-width="130px" align="center">
  35. <template slot-scope="scope">
  36. <span>{{ scope.row.pcpde }}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="当前库存重量(kg)" min-width="110px" align="center">
  40. <template slot-scope="scope">
  41. <span>{{ scope.row.stockweight }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="金额(元)" min-width="110px" align="center">
  45. <template slot-scope="scope">
  46. <span>{{ scope.row.sumprice }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
  50. <template slot-scope="{row}">
  51. <el-button class="miniSuccess" :disabled="isokDisable" @click="handleSee(row)">查看</el-button>
  52. </template>
  53. </el-table-column>
  54. </el-table>
  55. <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  56. </div>
  57. <el-dialog :title="textMap[see.dialogStatus]" :visible.sync="see.dialogFormVisible" :close-on-click-modal="false" width="90%">
  58. <div class="app-see">
  59. <el-tabs v-model="see.activeName" @tab-click="handleTabClick">
  60. <el-tab-pane label="入库记录" name="first">
  61. <div class="search">
  62. <el-date-picker v-model="see.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
  63. <el-button class="successBorder" @click="handleSearch1">查询</el-button>
  64. </div>
  65. <div class="table">
  66. <el-table
  67. :key="see.tableKey"
  68. v-loading="see.listLoading"
  69. element-loading-text="给我一点时间"
  70. :data="see.list"
  71. border
  72. fit
  73. highlight-current-row
  74. style="width: 100%;"
  75. :row-style="rowStyle"
  76. :cell-style="cellStyle"
  77. class="elTable table-fixed"
  78. >
  79. <el-table-column label="序号" align="center" type="index" width="50px">
  80. <template slot-scope="scope">
  81. <span>{{ scope.$index + (see.pageNum-1) * see.pageSize + 1 }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="入库日期" min-width="130px" align="center">
  85. <template slot-scope="scope">
  86. <span>{{ scope.row.laiddate }}</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="操作重量(kg)" min-width="130px" align="center">
  90. <template slot-scope="scope">
  91. <span>{{ scope.row.operateweight }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="金额(元)" min-width="110px" align="center">
  95. <template slot-scope="scope">
  96. <span> {{ scope.row.sumprice }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="备注" min-width="110px" align="center">
  100. <template slot-scope="scope">
  101. <span>{{ scope.row.remark }}</span>
  102. </template>
  103. </el-table-column>
  104. </el-table>
  105. </div>
  106. <pagination v-show="see.total>=0" style="margin-bottom: 50px;" :total="see.total" :page.sync="see.getdataListParm.offset" :limit.sync="see.getdataListParm.pagecount" @pagination="getSeeList" />
  107. </el-tab-pane>
  108. <el-tab-pane label="出库记录" name="second">
  109. <div class="search">
  110. <el-select v-model="see.getdataListParm2.parammaps.usetype" placeholder="出库类型" class="filter-item" style="width: 150px;" clearable>
  111. <el-option v-for="item in deliveryTypeList" :key="item.id" :label="item.label" :value="item.value" />
  112. </el-select>
  113. <el-date-picker v-model="see.getdataListParm2.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
  114. <el-button class="successBorder" @click="handleSearch2">查询</el-button>
  115. </div>
  116. <div class="table">
  117. <el-table
  118. :key="see.tableKey2"
  119. v-loading="see.listLoading2"
  120. element-loading-text="给我一点时间"
  121. :data="see.list2"
  122. border
  123. fit
  124. highlight-current-row
  125. style="width: 100%;"
  126. :row-style="rowStyle"
  127. :cell-style="cellStyle"
  128. class="elTable table-fixed"
  129. >
  130. <el-table-column label="序号" align="center" type="index" width="50px">
  131. <template slot-scope="scope">
  132. <span>{{ scope.$index + (see.pageNum2-1) * see.pageSize2 + 1 }}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="出库日期" min-width="130px" align="center">
  136. <template slot-scope="scope">
  137. <span>{{ scope.row.usedate }}</span>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="出库类型" min-width="130px" align="center">
  141. <template slot-scope="scope">
  142. <span>{{ scope.row.usetype }}</span>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="牲畜类别" min-width="110px" align="center">
  146. <template slot-scope="scope">
  147. <span> {{ scope.row.cowclass }}</span>
  148. </template>
  149. </el-table-column>
  150. <el-table-column label="操作重量(kg)" min-width="110px" align="center">
  151. <template slot-scope="scope">
  152. <span> {{ scope.row.operateweight }}</span>
  153. </template>
  154. </el-table-column>
  155. <el-table-column label="备注" min-width="110px" align="center">
  156. <template slot-scope="scope">
  157. <span>{{ scope.row.remark }}</span>
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. </div>
  162. <pagination v-show="see.total2>=0" style="margin-bottom: 50px;" :total="see.total2" :page.sync="see.getdataListParm2.offset" :limit.sync="see.getdataListParm2.pagecount" @pagination="getSeeList2" />
  163. </el-tab-pane>
  164. </el-tabs>
  165. <div slot="footer" class="dialog-footer">
  166. <el-button class="cancel" @click="see.dialogFormVisible = false; ">关闭</el-button>
  167. </div>
  168. </div>
  169. </el-dialog>
  170. </div>
  171. </template>
  172. <script>
  173. import { GetDataByName, GetDataByNames, checkButtons } from '@/api/common'
  174. import Pagination from '@/components/Pagination'
  175. import Cookies from 'js-cookie'
  176. import { parseTime } from '@/utils/index.js'
  177. export default {
  178. name: 'Statistics',
  179. components: { Pagination },
  180. data() {
  181. return {
  182. isRoleEdit: [],
  183. requestParams: [
  184. { name: 'getFeedListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
  185. { name: 'getDictByNameUse', offset: 0, pagecount: 0, params: ['人工用量操作类型'] }
  186. ],
  187. feedNameList: [], // 饲料名称
  188. deliveryTypeList: [], // 出库类型
  189. table: {
  190. getdataListParm: {
  191. name: 'getFeedstorageList',
  192. page: 1,
  193. offset: 1,
  194. pagecount: 10,
  195. returntype: 'Map',
  196. parammaps: {
  197. pastureid: Cookies.get('pastureid'),
  198. feedid: ''
  199. }
  200. },
  201. tableKey: 0,
  202. list: [],
  203. total: 0,
  204. listLoading: true
  205. },
  206. textMap: {
  207. see: '库存'
  208. },
  209. see: {
  210. dialogFormVisible: false,
  211. dialogStatus: '',
  212. temp: {},
  213. rules: {},
  214. getdataListParm: {
  215. name: 'getFsLaidList',
  216. page: 1,
  217. offset: 1,
  218. pagecount: 10,
  219. returntype: 'Map',
  220. parammaps: {
  221. pastureid: '',
  222. feedid: '',
  223. inputDatetime: '',
  224. startTime: '',
  225. stopTime: ''
  226. }
  227. },
  228. tableKey: 0,
  229. list: [],
  230. total: 0,
  231. listLoading: true,
  232. activeName: 'first',
  233. getdataListParm2: {
  234. name: 'getFsUseList',
  235. page: 1,
  236. offset: 1,
  237. pagecount: 10,
  238. returntype: 'Map',
  239. parammaps: {
  240. pastureid: '',
  241. feedid: '',
  242. inputDatetime: '',
  243. startTime: '',
  244. stopTime: '',
  245. usetype: ''
  246. }
  247. },
  248. tableKey2: 0,
  249. list2: [],
  250. total2: 0,
  251. listLoading2: true
  252. },
  253. requestParam: {},
  254. isokDisable: false,
  255. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  256. cellStyle: { padding: 0 + 'px' }
  257. }
  258. },
  259. created() {
  260. this.getButtons()
  261. this.getDownList()
  262. this.getList()
  263. },
  264. methods: {
  265. getButtons() {
  266. const Edit = 'Statistics'
  267. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  268. this.isRoleEdit = isRoleEdit
  269. },
  270. getDownList() {
  271. GetDataByNames(this.requestParams).then(response => {
  272. this.feedNameList = response.data.getFeedListEnable.list
  273. this.deliveryTypeList = response.data.getDictByNameUse.list
  274. })
  275. },
  276. getList() {
  277. this.table.listLoading = true
  278. GetDataByName(this.table.getdataListParm).then(response => {
  279. console.log('table数据', response.data.list)
  280. if (response.data.list !== null) {
  281. this.table.list = response.data.list
  282. this.table.pageNum = response.data.pageNum
  283. this.table.pageSize = response.data.pageSize
  284. this.table.total = response.data.total
  285. } else {
  286. this.table.list = []
  287. }
  288. setTimeout(() => {
  289. this.table.listLoading = false
  290. }, 100)
  291. })
  292. },
  293. handleSearch() {
  294. console.log('点击了查询')
  295. this.getList()
  296. },
  297. handleRefresh() {
  298. console.log('点击了重置')
  299. },
  300. handleSee(row) {
  301. this.see.dialogStatus = 'see'
  302. this.see.dialogFormVisible = true
  303. this.see.list = []
  304. this.see.getdataListParm.offset = 1
  305. this.see.getdataListParm2.offset = 1
  306. this.see.getdataListParm.parammaps.pastureid = row.pastureid
  307. this.see.getdataListParm.parammaps.feedid = row.feedid
  308. this.see.getdataListParm2.parammaps.pastureid = row.pastureid
  309. this.see.getdataListParm2.parammaps.feedid = row.feedid
  310. this.see.activeName = 'first'
  311. this.getSeeList()
  312. this.getSeeList2()
  313. },
  314. getSeeList() {
  315. this.see.listLoading = true
  316. GetDataByName(this.see.getdataListParm).then(response => {
  317. console.log('table数据', response.data.list)
  318. if (response.data.list !== null) {
  319. this.see.list = response.data.list
  320. this.see.pageNum = response.data.pageNum
  321. this.see.pageSize = response.data.pageSize
  322. this.see.total = response.data.total
  323. } else {
  324. this.see.list = []
  325. }
  326. setTimeout(() => {
  327. this.see.listLoading = false
  328. }, 100)
  329. })
  330. },
  331. getSeeList2() {
  332. this.see.listLoading2 = true
  333. GetDataByName(this.see.getdataListParm2).then(response => {
  334. console.log('table数据2', response.data.list)
  335. if (response.data.list !== null) {
  336. this.see.list2 = response.data.list
  337. this.see.pageNum2 = response.data.pageNum
  338. this.see.pageSize2 = response.data.pageSize
  339. this.see.total2 = response.data.total
  340. } else {
  341. this.see.list2 = []
  342. }
  343. setTimeout(() => {
  344. this.see.listLoading2 = false
  345. }, 100)
  346. })
  347. },
  348. handleTabClick(val) {
  349. if (val.name === 'first') {
  350. this.getSeeList()
  351. } else if (val.name === 'second') {
  352. this.getSeeList2()
  353. }
  354. },
  355. handleSearch1() {
  356. console.log('点击了库存入库记录查询')
  357. if (this.see.getdataListParm.parammaps.inputDatetime !== '' && this.see.getdataListParm.parammaps.inputDatetime !== null) {
  358. this.see.getdataListParm.parammaps.startTime = parseTime(this.see.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  359. this.see.getdataListParm.parammaps.stopTime = parseTime(this.see.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  360. } else {
  361. this.see.getdataListParm.parammaps.inputDatetime = ''
  362. this.see.getdataListParm.parammaps.startTime = ''
  363. this.see.getdataListParm.parammaps.stopTime = ''
  364. }
  365. this.getSeeList()
  366. },
  367. handleSearch2() {
  368. console.log('点击了库存出库记录查询')
  369. if (this.see.getdataListParm2.parammaps.inputDatetime !== '' && this.see.getdataListParm2.parammaps.inputDatetime !== null) {
  370. this.see.getdataListParm2.parammaps.startTime = parseTime(this.see.getdataListParm2.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  371. this.see.getdataListParm2.parammaps.stopTime = parseTime(this.see.getdataListParm2.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  372. } else {
  373. this.see.getdataListParm2.parammaps.inputDatetime = ''
  374. this.see.getdataListParm2.parammaps.startTime = ''
  375. this.see.getdataListParm2.parammaps.stopTime = ''
  376. }
  377. this.getSeeList2()
  378. }
  379. }
  380. }
  381. </script>
  382. <style lang="scss" scoped>
  383. .search{margin-top:10px;}
  384. .table{margin-top:10px;}
  385. </style>