HlwInvoiceList.vue 7.8 KB

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