OperatorsPopup.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. <div class="table-page-search-wrapper">
  13. <a-form layout="inline" @keyup.enter.native="searchQuery">
  14. <a-row :gutter="24">
  15. <a-col :md="8" :sm="24">
  16. <a-form-item label="名称">
  17. <a-input placeholder="请输入" v-model="queryParam.name" ></a-input>
  18. </a-form-item>
  19. </a-col>
  20. <a-col :md="8" :sm="24">
  21. <a-form-item label="编码">
  22. <a-input placeholder="请输入" v-model="queryParam.code" ></a-input>
  23. </a-form-item>
  24. </a-col>
  25. <a-col :md="8" :sm="24">
  26. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  27. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  28. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  29. <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
  30. {{ toggleSearchStatus ? '收起' : '展开' }}
  31. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  32. </a> -->
  33. </span>
  34. </a-col>
  35. </a-row>
  36. </a-form>
  37. </div>
  38. <a-form-model ref="formRef">
  39. <a-table
  40. ref="table"
  41. size="middle"
  42. bordered
  43. id='sonList1'
  44. :columns="columns"
  45. rowKey="rowIndex"
  46. :dataSource="dataSource"
  47. :pagination="pagination"
  48. :scroll="{ x: 800, y: 300 }"
  49. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  50. @change="handleTableChange"
  51. :customRow ="clickRow"
  52. >
  53. </a-table>
  54. </a-form-model>
  55. </a-card >
  56. </a-modal>
  57. </template>
  58. <script>
  59. import { FormTypes } from '@/utils/JEditableTableUtil'
  60. import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin'
  61. import moment from "moment"
  62. import { httpAction ,getAction,postAction,putAction} from '@/api/manage'
  63. export default {
  64. name: 'OperatorsPopup',
  65. mixins: [JEditableTableModelMixin],
  66. components: {
  67. },
  68. data() {
  69. return {
  70. visible:false,
  71. selectedRowKeys:[],
  72. selectedRows:[],
  73. dataSource:[],
  74. pagination:{
  75. current: 1,
  76. pageSize: 5,
  77. pageSizeOptions: ['5', '10', '20','50'],
  78. showTotal: (total, range) => {
  79. return range[0] + "-" + range[1] + " 共" + total + "条"
  80. },
  81. showQuickJumper: true,
  82. showSizeChanger: true,
  83. total: 0
  84. },
  85. queryParam:{
  86. pageNo:1
  87. },
  88. columns:[
  89. {
  90. title: '行号',
  91. dataIndex: '',
  92. key: 'rowIndex',
  93. width: 60,
  94. align: "center",
  95. customRender:function (t, r, index) {
  96. return parseInt(index)+1;
  97. }
  98. },
  99. {
  100. title: '名称',
  101. align:"center",
  102. dataIndex: 'Name',
  103. ellipsis: true,
  104. },
  105. {
  106. title: '编码',
  107. align:"center",
  108. dataIndex: 'Code',
  109. ellipsis: true,
  110. },
  111. {
  112. title: '部门',
  113. align:"center",
  114. dataIndex: 'DeptName',
  115. ellipsis: true,
  116. },
  117. ]
  118. }
  119. },
  120. created() {
  121. },
  122. methods: {
  123. handleCancel(){
  124. this.visible=false
  125. this.dataSource = []
  126. this.selectedRowKeys = []
  127. this.selectedRows = []
  128. },
  129. handleOk(){
  130. if(this.selectedRowKeys.length!==1){
  131. this.$message.warning('请选择一条数据!')
  132. }else{
  133. this.$emit('okData',this.selectedRows[0])
  134. this.handleCancel()
  135. }
  136. },
  137. getData(data,dept){
  138. this.queryParam.Org = data
  139. this.queryParam.DeptId = dept
  140. this.selectedRowKeys = []
  141. this.selectedRows = []
  142. getAction('/production/safetyStock/selectOperators',this.queryParam).then(res=>{
  143. if(res.success){
  144. this.dataSource = res.result.records
  145. this.pagination = {
  146. total: res.result.total,
  147. current: res.result.current,
  148. pageSize: res.result.size
  149. }
  150. }else{
  151. this.$message.error(res.message);
  152. }
  153. })
  154. },
  155. handleTableChange(pagination, filters, sorter) {
  156. this.queryParam.pageNo = pagination.current
  157. this.queryParam.pageSize = pagination.pageSize
  158. this.getData(this.queryParam.Org,this.queryParam.DeptId)
  159. },
  160. searchQuery(){
  161. this.queryParam.pageNo = 1
  162. this.getData(this.queryParam.Org,this.queryParam.DeptId)
  163. },
  164. searchReset(){
  165. this.queryParam.name = ''
  166. this.queryParam.code = ''
  167. this.getData(this.queryParam.Org,this.queryParam.DeptId)
  168. },
  169. onSelectChange(selectedRowKeys, selectionRows) {
  170. this.selectedRowKeys = selectedRowKeys;
  171. this.selectedRows = selectionRows;
  172. },
  173. clickRow(record, index){
  174. return {
  175. on: {
  176. click: () => {
  177. this.selectedRowKeys=[]
  178. this.selectedRows=[]
  179. this.selectedRowKeys.push(index)
  180. this.selectedRows.push(record)
  181. },
  182. }
  183. }
  184. },
  185. }
  186. }
  187. </script>
  188. <style scoped lang="less">
  189. /* @import '~@assets/less/common.less' */
  190. /deep/.ant-input{
  191. height:29px;
  192. }
  193. /deep/.ant-select-selection--single {
  194. height: 29px;
  195. }
  196. /deep/.ant-select{
  197. font-size: 12px;
  198. }
  199. /deep/.ant-form label{
  200. font-size: 12px;
  201. }
  202. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  203. margin-bottom:9px
  204. }
  205. /deep/.moddle>.ant-card-body{
  206. padding-bottom:0px;
  207. padding-top: 12px;
  208. }
  209. /deep/.top>.ant-card-body{
  210. padding-bottom: 12px;
  211. padding-top: 12px;
  212. }
  213. /deep/.ant-btn{
  214. height:28px
  215. }
  216. /deep/.ant-modal-body{
  217. padding-bottom: 0px;
  218. padding-top: 0px;
  219. }
  220. // /deep/.ant-modal-body{
  221. // background: #f0f2f5;
  222. // }
  223. /deep/.ant-modal-content{
  224. background: #f0f2f5;
  225. }
  226. /deep/.ant-card-body .table-operator {
  227. margin-bottom: 0px;
  228. }
  229. /deep/.three>.ant-card-body{
  230. padding-bottom:12px;
  231. padding-top: 12px;
  232. }
  233. /deep/.bottom>.ant-card-body{
  234. padding-bottom:0px;
  235. padding-top: 12px;
  236. }
  237. /deep/.ant-calendar-picker{
  238. min-width: 0px !important;
  239. }
  240. /deep/.sonItem {
  241. margin-bottom:0px !important
  242. }
  243. /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 {
  244. padding: 8px 8px !important;
  245. }
  246. /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
  247. width: calc(100% + 9px);//减去滚动条的宽度
  248. }
  249. </style>