inventoryPopup.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <a-modal
  3. title="存货列表"
  4. width="60%"
  5. :visible="visible"
  6. :maskClosable="false"
  7. switchFullscreen
  8. @cancel="handleCancel"
  9. @ok='handleOk'
  10. >
  11. <a-card :bordered="false" class="top" style="margin-bottom:1%;margin-top:1%">
  12. <a-form-model ref="formRef">
  13. <a-table
  14. ref="table"
  15. size="middle"
  16. bordered
  17. id='sonList1'
  18. :columns="columns"
  19. rowKey="rowIndex"
  20. :dataSource="dataSource"
  21. :pagination="pagination"
  22. :scroll="{ x: 800, y: 300 }"
  23. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  24. @change="handleTableChange"
  25. >
  26. </a-table>
  27. </a-form-model>
  28. </a-card >
  29. </a-modal>
  30. </template>
  31. <script>
  32. import { FormTypes } from '@/utils/JEditableTableUtil'
  33. import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin'
  34. import moment from "moment"
  35. import { httpAction ,getAction,postAction,putAction} from '@/api/manage'
  36. export default {
  37. name: 'inventoryPopup',
  38. mixins: [JEditableTableModelMixin],
  39. components: {
  40. },
  41. data() {
  42. return {
  43. visible:false,
  44. selectedRowKeys:[],
  45. selectedRows:[],
  46. dataSource:[],
  47. pagination:{
  48. current: 1,
  49. pageSize: 5,
  50. pageSizeOptions: ['5', '10', '20'],
  51. showTotal: (total, range) => {
  52. return range[0] + "-" + range[1] + " 共" + total + "条"
  53. },
  54. showQuickJumper: true,
  55. showSizeChanger: true,
  56. total: 0
  57. },
  58. queryParam:{
  59. pageNo:1
  60. },
  61. record:{},
  62. columns:[
  63. {
  64. title: '#',
  65. dataIndex: '',
  66. key: 'rowIndex',
  67. width: 60,
  68. align: "center",
  69. customRender:function (t, r, index) {
  70. return parseInt(index)+1;
  71. }
  72. },
  73. {
  74. title: '存货名称',
  75. align:"center",
  76. dataIndex: 'Name',
  77. ellipsis: true,
  78. },
  79. {
  80. title: '存货编码',
  81. align:"center",
  82. dataIndex: 'Code',
  83. ellipsis: true,
  84. },
  85. {
  86. title: '规格',
  87. align:"center",
  88. dataIndex: 'SPECS',
  89. ellipsis: true,
  90. },
  91. {
  92. title: '主单位',
  93. align:"center",
  94. dataIndex: 'unit',
  95. ellipsis: true,
  96. },
  97. {
  98. title: '辅单位',
  99. align:"center",
  100. dataIndex: 'auxiliaryUnit',
  101. ellipsis: true,
  102. },
  103. ]
  104. }
  105. },
  106. created() {
  107. },
  108. methods: {
  109. handleCancel(){
  110. this.visible=false
  111. this.dataSource = []
  112. this.selectedRowKeys = []
  113. this.selectedRows = []
  114. },
  115. handleOk(){
  116. if(this.selectedRowKeys.length!==1){
  117. this.$message.warning('请选择一条数据!')
  118. }else{
  119. this.$emit('okData',this.selectedRows[0],this.record)
  120. this.handleCancel()
  121. }
  122. },
  123. getData(){
  124. getAction('/production/safetyStock/selectItemMaster',this.queryParam).then(res=>{
  125. if(res.success){
  126. this.dataSource = res.result.records
  127. this.pagination = {
  128. total: res.result.total,
  129. current: res.result.current,
  130. pageSize: res.result.size
  131. }
  132. }else{
  133. this.$message.error(res.message);
  134. }
  135. })
  136. },
  137. handleTableChange(pagination, filters, sorter) {
  138. this.queryParam.pageNo = pagination.current
  139. this.queryParam.pageSize = pagination.pageSize
  140. this.getData()
  141. },
  142. onSelectChange(selectedRowKeys, selectionRows) {
  143. this.selectedRowKeys = selectedRowKeys;
  144. this.selectedRows = selectionRows;
  145. },
  146. }
  147. }
  148. </script>
  149. <style scoped lang="less">
  150. /* @import '~@assets/less/common.less' */
  151. /deep/.ant-input{
  152. height:29px;
  153. }
  154. /deep/.ant-select-selection--single {
  155. height: 29px;
  156. }
  157. /deep/.ant-select{
  158. font-size: 12px;
  159. }
  160. /deep/.ant-form label{
  161. font-size: 12px;
  162. }
  163. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  164. margin-bottom:9px
  165. }
  166. /deep/.moddle>.ant-card-body{
  167. padding-bottom:0px;
  168. padding-top: 12px;
  169. }
  170. /deep/.top>.ant-card-body{
  171. padding-bottom: 12px;
  172. padding-top: 12px;
  173. }
  174. /deep/.ant-btn{
  175. height:28px
  176. }
  177. /deep/.ant-modal-body{
  178. padding-bottom: 0px;
  179. padding-top: 0px;
  180. }
  181. // /deep/.ant-modal-body{
  182. // background: #f0f2f5;
  183. // }
  184. /deep/.ant-modal-content{
  185. background: #f0f2f5;
  186. }
  187. /deep/.ant-card-body .table-operator {
  188. margin-bottom: 0px;
  189. }
  190. /deep/.three>.ant-card-body{
  191. padding-bottom:12px;
  192. padding-top: 12px;
  193. }
  194. /deep/.bottom>.ant-card-body{
  195. padding-bottom:0px;
  196. padding-top: 12px;
  197. }
  198. /deep/.ant-calendar-picker{
  199. min-width: 0px !important;
  200. }
  201. /deep/.sonItem {
  202. margin-bottom:0px !important
  203. }
  204. /deep/#sonList1>.ant-spin-nested-loading>.ant-spin-container>.ant-table>.ant-table-content>.ant-table-scroll>.ant-table-body>.ant-table-fixed>.ant-table-tbody > tr > td {
  205. padding: 8px 8px !important;
  206. }
  207. /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
  208. width: calc(100% + 9px);//减去滚动条的宽度
  209. }
  210. </style>