listModal.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="width"
  5. :visible="visible"
  6. switchFullscreen
  7. :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  8. @cancel="handleCancel"
  9. cancelText="关闭">
  10. <a-table
  11. ref="table"
  12. size="middle"
  13. :scroll="{x:true}"
  14. bordered
  15. rowKey="id"
  16. :columns="columns"
  17. :dataSource="dataSource"
  18. :pagination="ipagination"
  19. :loading="loading"
  20. class="j-table-force-nowrap">
  21. </a-table>
  22. <!-- <list-modal-list :listData = "dataXQ"></list-modal-list> -->
  23. <template slot="footer">
  24. <a-button @click="handleCancel">取消</a-button>
  25. </template>
  26. </j-modal>
  27. </template>
  28. <script>
  29. // import ListModalList from './listModalList.vue'
  30. import { httpAction, getAction, postAction } from '@/api/manage'
  31. import { filterObj } from '@/utils/util';
  32. export default {
  33. name: 'ListModal',
  34. props: {
  35. listData: {
  36. type: Object,
  37. default: function(){
  38. return {} // 使用工厂函数返回默认值
  39. }
  40. }
  41. },
  42. components: {
  43. // ListModalList
  44. },
  45. data () {
  46. return {
  47. title:'',
  48. width:1200,
  49. visible: false,
  50. disableSubmit: false,
  51. dataXQ: {},
  52. columns: [],
  53. dataSource: [],
  54. ipagination: {
  55. current: 1,
  56. pageSize: 10,
  57. pageSizeOptions: ['10', '20', '30'],
  58. showTotal: (total, range) => {
  59. return range[0] + "-" + range[1] + " 共" + total + "条"
  60. },
  61. showQuickJumper: true,
  62. showSizeChanger: true,
  63. total: 0
  64. },
  65. loading: false,
  66. url: {
  67. htelist: "/index/getDetailIncome",
  68. skelist: "/index/getDetailReceived",
  69. zcelist: "",
  70. lrelist: "",
  71. },
  72. }
  73. },
  74. watch: {
  75. listData: {
  76. handler(newValue, oldValue){
  77. // console.log(66666,newValue, oldValue)
  78. this.dataXQ = newValue
  79. this.getList()
  80. },
  81. immediate: true,
  82. deep: true
  83. }
  84. },
  85. methods: {
  86. getList () {
  87. console.log(99999,this.dataXQ)
  88. this.title = this.dataXQ.title
  89. this.loading = true
  90. var params = this.getQueryParams();//查询条件
  91. if (this.dataXQ.hdValue) {
  92. if (this.dataXQ.hdValue == 'hte') {
  93. this.columns= [
  94. {
  95. title: '序号',
  96. dataIndex: '',
  97. key:'rowIndex',
  98. width:60,
  99. align:"center",
  100. customRender:function (t,r,index) {
  101. return parseInt(index)+1;
  102. }
  103. },
  104. {
  105. title:'任务编号',
  106. align:"center",
  107. dataIndex: 'rwbh'
  108. },
  109. {
  110. title:'合同名称',
  111. align:"center",
  112. dataIndex: 'htmc'
  113. },
  114. {
  115. title:'合同分配额',
  116. align:"center",
  117. dataIndex: 'htfpe'
  118. },
  119. {
  120. title:'签署日期',
  121. align:"center",
  122. dataIndex: 'qsrq'
  123. },
  124. ]
  125. getAction(this.url.htelist, params).then((response) => {
  126. console.log(7777,response.result)
  127. this.dataSource = response.result.records
  128. this.ipagination.total = response.result.total
  129. this.loading = false
  130. })
  131. }
  132. if (this.dataXQ.hdValue == 'ske') {
  133. this.columns= [
  134. {
  135. title: '序号',
  136. dataIndex: '',
  137. key:'rowIndex',
  138. width:60,
  139. align:"center",
  140. customRender:function (t,r,index) {
  141. return parseInt(index)+1;
  142. }
  143. },
  144. {
  145. title:'任务编号',
  146. align:"center",
  147. dataIndex: 'rwbh'
  148. },
  149. {
  150. title:'任务收款金额',
  151. align:"center",
  152. dataIndex: 'rwskje'
  153. },
  154. {
  155. title:'到款日期/汇票到期日期',
  156. align:"center",
  157. dataIndex: 'dkhpdqrq'
  158. },
  159. ]
  160. getAction(this.url.skelist, params).then((response) => {
  161. console.log(7777,response.result.records)
  162. this.dataSource = response.result.records
  163. this.ipagination.total = response.result.total
  164. this.loading = false
  165. })
  166. }
  167. if (this.dataXQ.hdValue == 'zce') {
  168. }
  169. if (this.dataXQ.hdValue == 'lre') {
  170. }
  171. this.visible=true
  172. } else {
  173. this.visible=false
  174. }
  175. },
  176. getQueryParams() {
  177. //获取查询条件
  178. let sqp = {}
  179. if(this.superQueryParams){
  180. sqp['superQueryParams']=encodeURI(this.superQueryParams)
  181. sqp['superQueryMatchType'] = this.superQueryMatchType
  182. }
  183. var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
  184. param.pageNo = this.ipagination.current;
  185. param.pageSize = this.ipagination.pageSize;
  186. return filterObj(param);
  187. },
  188. close () {
  189. this.columns= []
  190. this.visible = false;
  191. },
  192. handleOk () {
  193. this.$refs.realForm.submitForm();
  194. },
  195. submitCallback(){
  196. this.$emit('ok');
  197. this.visible = false;
  198. },
  199. handleCancel () {
  200. this.close()
  201. }
  202. }
  203. }
  204. </script>