582a9ada7b99d9f355e93a92ea641070fed4edc2.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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.name" :value="item.name" />
  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. @cell-click="tabClick"
  24. >
  25. <el-table-column label="序号" align="center" type="index" width="50px">
  26. <template slot-scope="scope">
  27. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  28. </template>
  29. </el-table-column>
  30. <el-table-column label="饲料名称" min-width="130px" align="center">
  31. <template slot-scope="scope">
  32. <span>{{ scope.row.brandName }}</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="批号" min-width="130px" align="center">
  36. <template slot-scope="scope">
  37. <span>{{ scope.row.brandName }}</span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="当前库存重量(kg)" min-width="110px" align="center">
  41. <template slot-scope="scope">
  42. <span>{{ scope.row.brandName }}</span>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="金额(元)" min-width="110px" align="center">
  46. <template slot-scope="scope">
  47. <span>{{ scope.row.brandName }}</span>
  48. </template>
  49. </el-table-column>
  50. </el-table>
  51. <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  52. </div>
  53. <el-dialog :title="textMap[see.dialogStatus]" :visible.sync="see.dialogFormVisible" :close-on-click-modal="false" width="90%">
  54. <div class="app-see">
  55. <el-tabs v-model="see.activeName" @tab-click="handleTabClick">
  56. <el-tab-pane label="入库记录" name="first">
  57. <div class="search">
  58. <el-date-picker v-model="see.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
  59. <el-button class="successBorder" @click="handleSearch1">查询</el-button>
  60. </div>
  61. <div class="table">
  62. <el-table
  63. :key="see.tableKey"
  64. v-loading="see.listLoading"
  65. element-loading-text="给我一点时间"
  66. :data="see.list"
  67. border
  68. fit
  69. highlight-current-row
  70. style="width: 100%;"
  71. :row-style="rowStyle"
  72. :cell-style="cellStyle"
  73. class="elTable table-fixed"
  74. >
  75. <el-table-column label="序号" align="center" type="index" width="50px">
  76. <template slot-scope="scope">
  77. <span>{{ scope.$index + (see.pageNum-1) * see.pageSize + 1 }}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="入库日期" min-width="130px" align="center">
  81. <template slot-scope="scope">
  82. <span>{{ scope.row.brandName }}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="操作重量(kg)" min-width="130px" align="center">
  86. <template slot-scope="scope">
  87. <span>{{ scope.row.brandName }}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="金额(元)" min-width="110px" align="center">
  91. <template slot-scope="scope">
  92. <span> {{ scope.row.pastureName }}</span>
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="备注" min-width="110px" align="center">
  96. <template slot-scope="scope">
  97. <span>{{ scope.row.brandName }}</span>
  98. </template>
  99. </el-table-column>
  100. </el-table>
  101. </div>
  102. <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" />
  103. </el-tab-pane>
  104. <el-tab-pane label="出库记录" name="second">
  105. <div class="search">
  106. <el-select v-model="see.getdataListParm2.parammaps.enable" placeholder="出库类型" class="filter-item" style="width: 150px;" clearable>
  107. <el-option v-for="item in deliveryTypeList" :key="item.id" :label="item.name" :value="item.name" />
  108. </el-select>
  109. <el-date-picker v-model="see.getdataListParm2.parammaps.inputDatetime" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
  110. <el-button class="successBorder" @click="handleSearch2">查询</el-button>
  111. </div>
  112. <div class="table">
  113. <el-table
  114. :key="see.tableKey2"
  115. v-loading="see.listLoading2"
  116. element-loading-text="给我一点时间"
  117. :data="see.list2"
  118. border
  119. fit
  120. highlight-current-row
  121. style="width: 100%;"
  122. :row-style="rowStyle"
  123. :cell-style="cellStyle"
  124. class="elTable table-fixed"
  125. >
  126. <el-table-column label="序号" align="center" type="index" width="50px">
  127. <template slot-scope="scope">
  128. <span>{{ scope.$index + (see.pageNum2-1) * see.pageSize2 + 1 }}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="出库日期" min-width="130px" align="center">
  132. <template slot-scope="scope">
  133. <span>{{ scope.row.brandName }}</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="出库类型" min-width="130px" align="center">
  137. <template slot-scope="scope">
  138. <span>{{ scope.row.brandName }}</span>
  139. </template>
  140. </el-table-column>
  141. <el-table-column label="牲畜类别" min-width="110px" align="center">
  142. <template slot-scope="scope">
  143. <span> {{ scope.row.pastureName }}</span>
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="剩余使用天数" min-width="110px" align="center">
  147. <template slot-scope="scope">
  148. <span>{{ scope.row.brandName }}</span>
  149. </template>
  150. </el-table-column>
  151. <el-table-column label="操作重量(kg)" min-width="110px" align="center">
  152. <template slot-scope="scope">
  153. <span> {{ scope.row.pastureName }}</span>
  154. </template>
  155. </el-table-column>
  156. <el-table-column label="备注" min-width="110px" align="center">
  157. <template slot-scope="scope">
  158. <span>{{ scope.row.brandName }}</span>
  159. </template>
  160. </el-table-column>
  161. </el-table>
  162. </div>
  163. <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" />
  164. </el-tab-pane>
  165. </el-tabs>
  166. <div slot="footer" class="dialog-footer">
  167. <el-button class="cancel" @click="see.dialogFormVisible = false; ">关闭</el-button>
  168. </div>
  169. </div>
  170. </el-dialog>
  171. </div>
  172. </template>
  173. <script>
  174. import { GetDataByName } from '@/api/common'
  175. import Pagination from '@/components/Pagination'
  176. export default {
  177. name: 'Statistics',
  178. components: { Pagination },
  179. data() {
  180. return {
  181. feedNameList: [{ id: 0, name: '羊草' }, { id: 1, name: '小苏打' }], // 饲料名称
  182. deliveryTypeList: [{ id: 0, name: '设备部门' }, { id: 1, name: '采购部门' }, { id: 2, name: '牧场办公室' }], // 出库类型
  183. table: {
  184. getdataListParm: {
  185. name: 'getAssetList',
  186. page: 1,
  187. offset: 1,
  188. pagecount: 10,
  189. returntype: 'Map',
  190. parammaps: {
  191. enable: '',
  192. inputDatetime: ''
  193. }
  194. },
  195. tableKey: 0,
  196. list: [],
  197. total: 0,
  198. listLoading: true
  199. },
  200. textMap: {
  201. see: '库存'
  202. },
  203. see: {
  204. dialogFormVisible: false,
  205. dialogStatus: '',
  206. temp: {},
  207. rules: {},
  208. getdataListParm: {
  209. name: 'getAssetList',
  210. page: 1,
  211. offset: 1,
  212. pagecount: 10,
  213. returntype: 'Map',
  214. parammaps: {
  215. enable: '',
  216. inputDatetime: ''
  217. }
  218. },
  219. tableKey: 0,
  220. list: [],
  221. total: 0,
  222. listLoading: true,
  223. activeName: 'first',
  224. getdataListParm2: {
  225. name: 'getAssetList',
  226. page: 1,
  227. offset: 1,
  228. pagecount: 10,
  229. returntype: 'Map',
  230. parammaps: {
  231. enable: '',
  232. inputDatetime: ''
  233. }
  234. },
  235. tableKey2: 0,
  236. list2: [],
  237. total2: 0,
  238. listLoading2: true
  239. },
  240. isokDisable: false,
  241. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  242. cellStyle: { padding: 0 + 'px' }
  243. }
  244. },
  245. created() {
  246. this.getList()
  247. },
  248. methods: {
  249. getList() {
  250. this.table.listLoading = true
  251. GetDataByName(this.table.getdataListParm).then(response => {
  252. console.log('table数据', response.data.list)
  253. if (response.data.list !== null) {
  254. this.table.list = response.data.list
  255. this.table.pageNum = response.data.pageNum
  256. this.table.pageSize = response.data.pageSize
  257. is.table.total = response.data.total
  258. } else {
  259. this.table.list = []
  260. }
  261. setTimeout(() => {
  262. this.table.listLoading = false
  263. }, 100)
  264. })
  265. },
  266. handleSearch() {
  267. console.log('点击了查询')
  268. this.getList()
  269. },
  270. handleRefresh() {
  271. console.log('点击了重置')
  272. },
  273. tabClick(row, column) {
  274. this.see.dialogStatus = 'see'
  275. this.see.dialogFormVisible = true
  276. this.see.list = []
  277. this.see.getdataListParm.offset = 1
  278. this.see.getdataListParm2.offset = 1
  279. this.see.activeName = 'first'
  280. this.getSeeList()
  281. },
  282. getSeeList() {
  283. this.see.listLoading = true
  284. GetDataByName(this.see.getdataListParm).then(response => {
  285. console.log('table数据', response.data.list)
  286. if (response.data.list !== null) {
  287. this.see.list = response.data.list
  288. this.see.pageNum = response.data.pageNum
  289. this.see.pageSize = response.data.pageSize
  290. thi.see.total = response.data.total
  291. } else {
  292. this.see.list = []
  293. }
  294. setTimeout(() => {
  295. this.see.listLoading = false
  296. }, 100)
  297. })
  298. },
  299. getSeeList2() {
  300. this.see.listLoading2 = true
  301. GetDataByName(this.see.getdataListParm2).then(response => {
  302. console.log('table数据2', response.data.list)
  303. if (response.data.list !== null) {
  304. this.see.list2 = response.data.list
  305. this.see.pageNum2 = response.data.pageNum
  306. this.see.pageSize2 = response.data.pageSize
  307. this.see.total2 = response.data.total
  308. } else {
  309. this.see.list2 = []
  310. }
  311. setTimeout(() => {
  312. this.see.listLoading2 = false
  313. }, 100)
  314. })
  315. },
  316. handleTabClick(val) {
  317. if (val.name === 'first') {
  318. this.getSeeList()
  319. } else if (val.name === 'second') {
  320. this.getSeeList2()
  321. }
  322. },
  323. handleSearch1() {
  324. console.log('点击了库存入库记录查询')
  325. this.getSeeList()
  326. },
  327. handleSearch2() {
  328. console.log('点击了库存出库记录查询')
  329. this.getSeeList2()
  330. }
  331. }
  332. }
  333. </script>
  334. <style lang="scss" scoped>
  335. .search{margin-top:10px;}
  336. .table{margin-top:10px;}
  337. </style>