85e9e9c50756b3001321d9831502514811efac85.svn-base 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <div class="app-container">
  3. <div class="operation">
  4. <el-button class="success" @click="handleCreate">新增盘点单</el-button>
  5. <el-button class="success" @click="handleInventoryList">下载盘点单</el-button>
  6. </div>
  7. <div class="search">
  8. <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
  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-column label="金额(元)" min-width="110px" align="center">
  51. <template slot-scope="scope">
  52. <span>{{ scope.row.brandName }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="备注" min-width="110px" align="center">
  56. <template slot-scope="scope">
  57. <span>{{ scope.row.brandName }}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="创建日期" min-width="110px" align="center">
  61. <template slot-scope="scope">
  62. <span>{{ scope.row.brandName }}</span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="创建人" min-width="110px" align="center">
  66. <template slot-scope="scope">
  67. <span>{{ scope.row.brandName }}</span>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  72. </div>
  73. <!-- 新增盘点单 -->
  74. <el-dialog :title="textMap[create.dialogStatus]" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
  75. <div class="app-add">
  76. <el-form ref="createTemp" :rules="create.rules" :model="create.createTemp" label-position="right" label-width="160px" style="width: 90%;margin:0 auto">
  77. <el-row>
  78. <el-col :span="8">
  79. <el-form-item label="盘点日期:" prop="location">
  80. <el-date-picker v-model="create.createTemp.location" class="filter-item" type="date" placeholder="入库日期" :disabled="create.dialogStatus==='see'" />
  81. </el-form-item>
  82. </el-col>
  83. <el-col :span="8">
  84. <el-form-item label="盘点人:" prop="location">
  85. <el-input ref="location" v-model="create.createTemp.location" class="filter-item" placeholder="盘点人" type="text" :disabled="create.dialogStatus==='see'" />
  86. </el-form-item>
  87. </el-col>
  88. <el-col :span="8">
  89. <el-form-item label="备注:" prop="location">
  90. <el-input ref="location" v-model="create.createTemp.location" class="filter-item" placeholder="备注" type="text" :disabled="create.dialogStatus==='see'" />
  91. </el-form-item>
  92. </el-col>
  93. </el-row>
  94. </el-form>
  95. <el-table
  96. :key="create.tableKey"
  97. v-loading="create.listLoading"
  98. element-loading-text="给我一点时间"
  99. :data="create.list"
  100. border
  101. fit
  102. highlight-current-row
  103. style="width: 100%;margin-bottom: 50px;"
  104. :row-style="rowStyle"
  105. :cell-style="cellStyle"
  106. class="elTable table-fixed"
  107. >
  108. <el-table-column label="饲料名称" min-width="130px" align="center">
  109. <template slot-scope="scope">
  110. <span>{{ scope.row.brandName }}</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column label="库存重量(kg)" min-width="130px" align="center">
  114. <template slot-scope="scope">
  115. <span>{{ scope.row.brandName }}</span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="实际重量(kg)" min-width="110px" align="center">
  119. <template slot-scope="scope">
  120. <el-input v-if="create.dialogStatus==='create'" ref="input" v-model="scope.row.pastureName" style="width:80%;padding:10px 0;" />
  121. <span v-else> {{ scope.row.pastureName }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="差值(kg)" min-width="110px" align="center">
  125. <template slot-scope="scope">
  126. <span>{{ scope.row.brandName }}</span>
  127. </template>
  128. </el-table-column>
  129. </el-table>
  130. <div slot="footer" class="dialog-footer">
  131. <el-button class="cancel" @click="create.dialogFormVisible = false; ">关闭</el-button>
  132. <el-button v-if="create.dialogStatus==='create'" class="success" :disabled="isokDisable" @click="createData()">确认</el-button>
  133. </div>
  134. </div>
  135. </el-dialog>
  136. </div>
  137. </template>
  138. <script>
  139. import { GetDataByName } from '@/api/common'
  140. import Pagination from '@/components/Pagination'
  141. export default {
  142. name: 'InventoryList',
  143. components: { Pagination },
  144. data() {
  145. return {
  146. table: {
  147. getdataListParm: {
  148. name: 'getAssetList',
  149. page: 1,
  150. offset: 1,
  151. pagecount: 10,
  152. returntype: 'Map',
  153. parammaps: {
  154. enable: '',
  155. inputDatetime: ''
  156. }
  157. },
  158. tableKey: 0,
  159. list: [],
  160. total: 0,
  161. listLoading: true
  162. },
  163. textMap: {
  164. create: '新增',
  165. see: '查看盘点单'
  166. },
  167. create: {
  168. dialogFormVisible: false,
  169. dialogStatus: '',
  170. createTemp: {},
  171. rules: {},
  172. getdataListParm: {
  173. name: 'getAssetList',
  174. page: 1,
  175. offset: 1,
  176. pagecount: 10,
  177. returntype: 'Map',
  178. parammaps: {
  179. enable: '',
  180. inputDatetime: ''
  181. }
  182. },
  183. tableKey: 0,
  184. list: [],
  185. total: 0,
  186. listLoading: true
  187. },
  188. isokDisable: false,
  189. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  190. cellStyle: { padding: 0 + 'px' }
  191. }
  192. },
  193. created() {
  194. this.getList()
  195. },
  196. methods: {
  197. getList() {
  198. this.table.listLoading = true
  199. GetDataByName(this.table.getdataListParm).then(response => {
  200. console.log('table数据', response.data.list)
  201. if (response.data.list !== null) {
  202. this.table.list = response.data.list
  203. this.table.pageNum = response.data.pageNum
  204. this.table.pageSize = response.data.pageSize
  205. this.table.total = response.data.total
  206. } else {
  207. this.table.list = []
  208. }
  209. setTimeout(() => {
  210. this.table.listLoading = false
  211. }, 100)
  212. })
  213. },
  214. resetCreateTemp() {},
  215. handleCreate() {
  216. console.log('点击了新增盘点单')
  217. this.resetCreateTemp()
  218. this.create.dialogStatus = 'create'
  219. this.create.dialogFormVisible = true
  220. this.getCreateList()
  221. },
  222. getCreateList() {
  223. this.create.listLoading = true
  224. GetDataByName(this.create.getdataListParm).then(response => {
  225. console.log('table数据', response.data.list)
  226. if (response.data.list !== null) {
  227. this.create.list = response.data.list
  228. this.create.pageNum = response.data.pageNum
  229. this.create.pageSize = response.data.pageSize
  230. this.create.total = response.data.total
  231. } else {
  232. this.create.list = []
  233. }
  234. setTimeout(() => {
  235. this.create.listLoading = false
  236. }, 100)
  237. })
  238. },
  239. createData() {
  240. console.log('点击了新增盘点单保存')
  241. },
  242. tabClick(row, column) {
  243. this.create.dialogStatus = 'see'
  244. this.create.dialogFormVisible = true
  245. this.getCreateList()
  246. },
  247. handleInventoryList() {
  248. console.log('点击了下载盘点单')
  249. }
  250. }
  251. }
  252. </script>
  253. <style lang="scss" scoped>
  254. .search{margin-top:10px;}
  255. .table{margin-top:10px;}
  256. </style>
  257. <style>
  258. .inputDatetime .el-range-separator{ padding: 0; margin: 0 10px; }
  259. </style>