HlwInvoiceList.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :md="6" :sm="8">
  8. <a-form-item label="批次单号">
  9. <a-input placeholder="请输入批次单号" v-model="queryParam.paymentCode"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="8">
  13. <a-form-item label="服务商">
  14. <a-input placeholder="请输入服务商名称" v-model="queryParam.subcontractorName"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :md="6" :sm="8">
  18. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  19. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21. <!--<a @click="handleToggleSearch" style="margin-left: 8px">-->
  22. <!--{{ toggleSearchStatus ? '收起' : '展开' }}-->
  23. <!--<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
  24. <!--</a>-->
  25. </span>
  26. </a-col>
  27. </a-row>
  28. </a-form>
  29. </div>
  30. <!-- 查询区域-END -->
  31. <!-- 操作按钮区域 -->
  32. <div class="table-operator">
  33. <a-button v-has="'hcwinvoice:invoicePayment'" @click="invoicePayment()" type="primary" icon="plus" >申请开票</a-button>
  34. </div>
  35. <!-- table区域-begin -->
  36. <div>
  37. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  38. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  39. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  40. </div>
  41. <a-table
  42. ref="table"
  43. size="middle"
  44. bordered
  45. rowKey="id"
  46. :columns="columns"
  47. :dataSource="dataSource"
  48. :pagination="ipagination"
  49. :loading="loading"
  50. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,getCheckboxProps:getCheckboxProps}"
  51. class="j-table-force-nowrap"
  52. @change="handleTableChange">
  53. <span slot="action" slot-scope="text, record">
  54. <a v-has="'hcwinvoice:paymentDetail'" @click="paymentDetail(record)" >创客付款单</a>
  55. </span>
  56. </a-table>
  57. </div>
  58. <hlw-invoice-modal ref="modalForm" @ok="modalFormOk"></hlw-invoice-modal>
  59. </a-card>
  60. </template>
  61. <script>
  62. import { httpAction ,getAction,putAction} from '@/api/manage'
  63. import '@/assets/less/TableExpand.less'
  64. import { mixinDevice } from '@/utils/mixin'
  65. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  66. import HlwInvoiceModal from './modules/HlwInvoiceModal'
  67. const invoicePayment = (params) => putAction('/wisdom/hlwInvoice/invoicePayment', params)
  68. export default {
  69. name: "HlwInvoiceList",
  70. mixins:[JeecgListMixin, mixinDevice],
  71. components: {
  72. HlwInvoiceModal,
  73. },
  74. data () {
  75. return {
  76. queryParam: {},
  77. selectedRowKeys: [],
  78. selectedRows: [],
  79. description: '未开票申请',
  80. // 表头
  81. columns: [
  82. {
  83. title:'批次单号',
  84. align:"center",
  85. dataIndex: 'paymentCode'
  86. },
  87. {
  88. title:'任务名称',
  89. align:"center",
  90. dataIndex: 'requirementName',
  91. },
  92. {
  93. title:'企业名称',
  94. align:"center",
  95. dataIndex: 'companyName',
  96. customRender:function (text) {
  97. return text
  98. }
  99. },
  100. {
  101. title:'服务商',
  102. align:"center",
  103. dataIndex: 'subcontractorName'
  104. },
  105. {
  106. title:'付款人数',
  107. align:"center",
  108. dataIndex: 'paymentNumber'
  109. },
  110. {
  111. title:'创客佣金',
  112. align:"center",
  113. dataIndex: 'amount',
  114. customRender:function (text,record) {
  115. return record.isThroughPlatform==1?record.cpAmount: record.amount;
  116. }
  117. },
  118. {
  119. title:'服务费',
  120. align:"center",
  121. dataIndex: 'serviceFee',
  122. customRender:function (text,record) {
  123. return record.isThroughPlatform==1?record.cpServiceFee: record.serviceFee;
  124. }
  125. },
  126. {
  127. title:'付款总金额',
  128. align:"center",
  129. dataIndex: 'totalPayment',
  130. customRender:function (text,record) {
  131. return record.isThroughPlatform==1?record.serviceAmount: record.totalPayment;
  132. }
  133. },
  134. {
  135. title:'任务单号',
  136. align:"center",
  137. dataIndex: 'requirementCode'
  138. },
  139. {
  140. title: '操作',
  141. dataIndex: 'action',
  142. align:"center",
  143. fixed:"right",
  144. width:147,
  145. scopedSlots: { customRender: 'action' }
  146. }
  147. ],
  148. url: {
  149. list: "/wisdom/hlwInvoice/list",
  150. },
  151. dictOptions:{},
  152. }
  153. },
  154. computed: {
  155. importExcelUrl: function(){
  156. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  157. },
  158. },
  159. methods: {
  160. initDictConfig(){
  161. },
  162. //监听checkbox属性
  163. getCheckboxProps(record) {
  164. var b=false;
  165. if(record.invoiceId !=null || record.applyTime!=null){
  166. b=true;
  167. }
  168. return {
  169. props: {
  170. disabled: b,
  171. }
  172. }
  173. },
  174. onSelectChange (selectedRowKeys,selectedRows) {
  175. this.selectedRowKeys = selectedRowKeys;
  176. this.selectedRows = selectedRows;
  177. },
  178. invoicePayment(){
  179. if(this.selectedRowKeys.length==0){
  180. this.$message.warning('请先选择付款数据')
  181. return
  182. }
  183. var list=[]
  184. for(var i=0;i<this.selectedRowKeys.length;i++){
  185. list.push(this.selectedRowKeys[i])
  186. }
  187. let that = this
  188. const modal = that.$confirm({
  189. title: '申请开票',
  190. closable: true,
  191. keyboard: false,
  192. maskClosable: true,
  193. content: '确定将当前选中的项申请开票吗',
  194. okText: '确定',
  195. cancelText: '取消',
  196. onOk: function() {
  197. that.loading = true;
  198. invoicePayment(
  199. {idsList:list}
  200. ).then((res) => {
  201. if (res.success) {
  202. that.selectedRowKeys = [];
  203. that.selectedRows = [];
  204. that.loading = false
  205. res.result.totalNum=list.length
  206. that.$refs.modalForm.edit(res.result)
  207. that.$refs.modalForm.title = '开票'
  208. that.$refs.modalForm.disableSubmit = false
  209. } else {
  210. that.$error({
  211. title: '错误提示',
  212. content: res.message,
  213. okText: '确定',
  214. centered:true,
  215. onOk: () => {
  216. that.loading = false;
  217. }
  218. })
  219. }
  220. })
  221. },
  222. onCancel() {
  223. modal.destroy()
  224. }
  225. })
  226. },
  227. paymentDetail(record){
  228. this.$router.push({ path: '/wisdom/hlwInvoice/add',query:{record:JSON.stringify(record) }})
  229. }
  230. }
  231. }
  232. </script>
  233. <style scoped>
  234. @import '~@assets/less/common.less';
  235. </style>