OperatorsPopup.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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: 'OperatorsPopup',
  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. columns:[
  62. {
  63. title: '行号',
  64. dataIndex: '',
  65. key: 'rowIndex',
  66. width: 60,
  67. align: "center",
  68. customRender:function (t, r, index) {
  69. return parseInt(index)+1;
  70. }
  71. },
  72. {
  73. title: '名称',
  74. align:"center",
  75. dataIndex: 'Name',
  76. ellipsis: true,
  77. },
  78. {
  79. title: 'Code',
  80. align:"center",
  81. dataIndex: 'Code',
  82. ellipsis: true,
  83. },
  84. ]
  85. }
  86. },
  87. created() {
  88. },
  89. methods: {
  90. handleCancel(){
  91. this.visible=false
  92. this.dataSource = []
  93. this.selectedRowKeys = []
  94. this.selectedRows = []
  95. },
  96. handleOk(){
  97. if(this.selectedRowKeys.length!==1){
  98. this.$message.warning('请选择一条数据!')
  99. }else{
  100. this.$emit('okData',this.selectedRows[0])
  101. this.handleCancel()
  102. }
  103. },
  104. getData(data){
  105. this.queryParam.Org = data
  106. getAction('/production/safetyStock/selectOperators',this.queryParam).then(res=>{
  107. if(res.success){
  108. this.dataSource = res.result.records
  109. this.pagination = {
  110. total: res.result.total,
  111. current: res.result.current,
  112. pageSize: res.result.size
  113. }
  114. }else{
  115. this.$message.error(res.message);
  116. }
  117. })
  118. },
  119. handleTableChange(pagination, filters, sorter) {
  120. this.queryParam.pageNo = pagination.current
  121. this.queryParam.pageSize = pagination.pageSize
  122. this.getData()
  123. },
  124. onSelectChange(selectedRowKeys, selectionRows) {
  125. this.selectedRowKeys = selectedRowKeys;
  126. this.selectedRows = selectionRows;
  127. },
  128. }
  129. }
  130. </script>
  131. <style scoped lang="less">
  132. /* @import '~@assets/less/common.less' */
  133. /deep/.ant-input{
  134. height:29px;
  135. }
  136. /deep/.ant-select-selection--single {
  137. height: 29px;
  138. }
  139. /deep/.ant-select{
  140. font-size: 12px;
  141. }
  142. /deep/.ant-form label{
  143. font-size: 12px;
  144. }
  145. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  146. margin-bottom:9px
  147. }
  148. /deep/.moddle>.ant-card-body{
  149. padding-bottom:0px;
  150. padding-top: 12px;
  151. }
  152. /deep/.top>.ant-card-body{
  153. padding-bottom: 12px;
  154. padding-top: 12px;
  155. }
  156. /deep/.ant-btn{
  157. height:28px
  158. }
  159. /deep/.ant-modal-body{
  160. padding-bottom: 0px;
  161. padding-top: 0px;
  162. }
  163. // /deep/.ant-modal-body{
  164. // background: #f0f2f5;
  165. // }
  166. /deep/.ant-modal-content{
  167. background: #f0f2f5;
  168. }
  169. /deep/.ant-card-body .table-operator {
  170. margin-bottom: 0px;
  171. }
  172. /deep/.three>.ant-card-body{
  173. padding-bottom:12px;
  174. padding-top: 12px;
  175. }
  176. /deep/.bottom>.ant-card-body{
  177. padding-bottom:0px;
  178. padding-top: 12px;
  179. }
  180. /deep/.ant-calendar-picker{
  181. min-width: 0px !important;
  182. }
  183. /deep/.sonItem {
  184. margin-bottom:0px !important
  185. }
  186. /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 {
  187. padding: 8px 8px !important;
  188. }
  189. /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
  190. width: calc(100% + 9px);//减去滚动条的宽度
  191. }
  192. </style>