e4c6896c2d33d3eb78c677c35406ed66dd845f76.svn-base 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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="handleInitial">初始化库存</el-button>
  6. </div>
  7. <div class="search">
  8. <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
  9. <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="饲料名称" class="filter-item" style="width: 150px;" clearable>
  10. <el-option v-for="item in feedNameList" :key="item.id" :label="item.name" :value="item.name" />
  11. </el-select>
  12. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  13. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  14. </div>
  15. <div class="table">
  16. <el-table
  17. :key="table.tableKey"
  18. v-loading="table.listLoading"
  19. element-loading-text="给我一点时间"
  20. :data="table.list"
  21. border
  22. fit
  23. highlight-current-row
  24. style="width: 100%;"
  25. :row-style="rowStyle"
  26. :cell-style="cellStyle"
  27. class="elTable table-fixed"
  28. >
  29. <el-table-column label="序号" align="center" type="index" width="50px">
  30. <template slot-scope="scope">
  31. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</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.brandName }}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="饲料名称" min-width="130px" align="center">
  40. <template slot-scope="scope">
  41. <span>{{ scope.row.brandName }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="操作重量(kg)" min-width="110px" align="center">
  45. <template slot-scope="scope">
  46. <span>{{ scope.row.brandName }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="批号" min-width="110px" align="center">
  50. <template slot-scope="scope">
  51. <span>{{ scope.row.brandName }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="金额(元)" min-width="110px" align="center">
  55. <template slot-scope="scope">
  56. <span>{{ scope.row.brandName }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="备注" min-width="110px" align="center">
  60. <template slot-scope="scope">
  61. <span>{{ scope.row.brandName }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="创建日期" min-width="110px" align="center">
  65. <template slot-scope="scope">
  66. <span>{{ scope.row.brandName }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="创建人" min-width="110px" align="center">
  70. <template slot-scope="scope">
  71. <span>{{ scope.row.brandName }}</span>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  76. </div>
  77. <!-- 新增入库单 -->
  78. <el-dialog :title="textMap[create.dialogStatus]" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
  79. <div class="app-add">
  80. <el-form ref="createTemp" :rules="create.rules" :model="create.createTemp" label-position="right" label-width="160px" style="width: 90%;margin:0 auto 50px">
  81. <el-row>
  82. <el-col :span="8">
  83. <el-form-item label="入库日期:" prop="location">
  84. <el-date-picker v-model="create.createTemp.location" class="filter-item" type="date" placeholder="入库日期" />
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="8">
  88. <el-form-item label="饲料名称:" prop="location">
  89. <el-select v-model="create.createTemp.enable" placeholder="饲料名称" class="filter-item" style="width: 100%">
  90. <el-option v-for="item in feedNameList" :key="item.id" :label="item.name" :value="item.name" />
  91. </el-select>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="8">
  95. <el-form-item label="操作重量(kg):" prop="location">
  96. <el-input ref="location" v-model="create.createTemp.location" class="filter-item" placeholder="单价" type="text" />
  97. </el-form-item>
  98. </el-col>
  99. </el-row>
  100. <el-row>
  101. <el-col :span="8">
  102. <el-form-item label="金额(元):" prop="location">
  103. <el-input ref="location" v-model="create.createTemp.location" class="filter-item" placeholder="允许误差数" type="text" />
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="8">
  107. <el-form-item label="批号:" prop="location">
  108. <el-input ref="location" v-model="create.createTemp.location" class="filter-item" placeholder="包装单位重量" type="text" />
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="8">
  112. <el-form-item label="备注:" prop="location">
  113. <el-input ref="location" v-model="create.createTemp.location" class="filter-item" placeholder="单价" type="text" />
  114. </el-form-item>
  115. </el-col>
  116. </el-row>
  117. <el-row>
  118. <el-col :span="8">
  119. <el-form-item label="创建日期:" prop="location">
  120. <el-date-picker v-model="create.createTemp.location" class="filter-item" type="date" placeholder="创建日期" disabled />
  121. </el-form-item>
  122. </el-col>
  123. <el-col :span="8">
  124. <el-form-item label="创建人:" prop="location">
  125. <el-input ref="location" v-model="create.createTemp.location" class="filter-item" placeholder="创建人" type="text" disabled />
  126. </el-form-item>
  127. </el-col>
  128. </el-row>
  129. </el-form>
  130. <div slot="footer" class="dialog-footer">
  131. <el-button class="cancel" @click="create.dialogFormVisible = false; ">关闭</el-button>
  132. <el-button class="success" :disabled="isokDisable" @click="createData()">确认</el-button>
  133. </div>
  134. </div>
  135. </el-dialog>
  136. <!-- 初始化库存 -->
  137. <el-dialog :title="textMap[initial.dialogStatus]" :visible.sync="initial.dialogFormVisible" :close-on-click-modal="false" width="30%" height="55%">
  138. <div class="app-add" style="height: 100%;margin: 0 auto 60px;">
  139. <h3 style="font:400 18px/36px '';padding: 0 60px;text-align: center;">初始化操作会将现有库存数量更改,是否确认进行操作:</h3>
  140. <div slot="footer" class="dialog-footer">
  141. <el-button class="cancel" @click="initial.dialogFormVisible = false; ">关闭</el-button>
  142. <el-button class="success" :disabled="isokDisable" @click="initialData()">确认</el-button>
  143. </div>
  144. </div>
  145. </el-dialog>
  146. </div>
  147. </template>
  148. <script>
  149. import { GetDataByName } from '@/api/common'
  150. import Pagination from '@/components/Pagination'
  151. import { MessageBox } from 'element-ui'
  152. export default {
  153. name: 'Warehousing',
  154. components: { Pagination },
  155. data() {
  156. return {
  157. feedNameList: [{ id: 0, name: '羊草' }, { id: 1, name: '小苏打' }], // 饲料名称
  158. table: {
  159. getdataListParm: {
  160. name: 'getAssetList',
  161. page: 1,
  162. offset: 1,
  163. pagecount: 10,
  164. returntype: 'Map',
  165. parammaps: {
  166. enable: '',
  167. inputDatetime: ''
  168. }
  169. },
  170. tableKey: 0,
  171. list: [],
  172. total: 0,
  173. listLoading: true
  174. },
  175. create: {
  176. dialogFormVisible: false,
  177. dialogStatus: '',
  178. createTemp: {},
  179. rules: {}
  180. },
  181. initial: {
  182. dialogFormVisible: false,
  183. dialogStatus: '',
  184. createTemp: {},
  185. rules: {}
  186. },
  187. textMap: {
  188. create: '新增',
  189. initial: '提示'
  190. },
  191. isokDisable: false,
  192. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  193. cellStyle: { padding: 0 + 'px' }
  194. }
  195. },
  196. created() {
  197. this.getList()
  198. },
  199. methods: {
  200. getList() {
  201. this.table.listLoading = true
  202. GetDataByName(this.table.getdataListParm).then(response => {
  203. console.log('table数据', response.data.list)
  204. if (response.data.list !== null) {
  205. this.table.list = response.data.list
  206. this.table.pageNum = response.data.pageNum
  207. this.table.pageSize = response.data.pageSize
  208. this.table.total = response.data.total
  209. } else {
  210. this.table.list = []
  211. }
  212. setTimeout(() => {
  213. this.table.listLoading = false
  214. }, 100)
  215. })
  216. },
  217. handleSearch() {
  218. console.log('点击了查询')
  219. this.getList()
  220. },
  221. handleRefresh() {
  222. console.log('点击了重置')
  223. },
  224. resetCreateTemp() {
  225. },
  226. handleCreate() {
  227. console.log('点击了新增入库单')
  228. this.resetCreateTemp()
  229. this.create.dialogStatus = 'create'
  230. this.create.dialogFormVisible = true
  231. },
  232. createData() {
  233. MessageBox.confirm('是否确认保存当前内容', {
  234. confirmButtonText: '确认',
  235. cancelButtonText: '取消',
  236. type: 'warning'
  237. }).then(() => {
  238. console.log('点击了新增入库单保存')
  239. })
  240. },
  241. handleInitial() {
  242. console.log('点击了初始化库存')
  243. this.initial.dialogStatus = 'initial'
  244. this.initial.dialogFormVisible = true
  245. },
  246. initialData() {
  247. console.log('点击了初始化库存保存')
  248. }
  249. }
  250. }
  251. </script>
  252. <style lang="scss" scoped>
  253. .search{margin-top:10px;}
  254. .table{margin-top:10px;}
  255. </style>