invoiceManage.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <div>
  3. <el-row class="handle-box" style="margin-bottom: 10px">
  4. <el-col :span="2" class="col-txt">
  5. <span>买受人</span>
  6. </el-col>
  7. <el-col :span="4" class="col-input">
  8. <el-input v-model="search.buyerName" style="width: 100%" @keyup.enter.native="handleSearch()" />
  9. </el-col>
  10. <el-col :span="2" class="col-txt">
  11. <span>房屋</span>
  12. </el-col>
  13. <el-col :span="4" class="col-input">
  14. <el-input v-model="search.houseName" style="width: 100%" @keyup.enter.native="handleSearch()" />
  15. </el-col>
  16. <el-col :span="2" class="col-txt">
  17. <span>推送状态</span>
  18. </el-col>
  19. <el-col :span="4" class="col-input">
  20. <el-select v-model="search.sendStatus" style="width: 100%" placeholder="请选择" popper-class="statistic_base">
  21. <el-option
  22. v-for="item in dc_data.SEND_STATUS"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value"
  26. />
  27. </el-select>
  28. </el-col>
  29. <el-col :span="2" class="col-txt">
  30. <span>开票状态</span>
  31. </el-col>
  32. <el-col :span="4" class="col-input">
  33. <el-select
  34. v-model="search.invoiceStatus"
  35. style="width: 100%"
  36. filterable
  37. popper-class="statistic_base"
  38. >
  39. <el-option
  40. v-for="item in dc_data.INVOICE_STATUS"
  41. :key="item.value"
  42. :label="item.label"
  43. :value="item.value"
  44. />
  45. </el-select>
  46. </el-col>
  47. </el-row>
  48. <el-row class="handle-box" style="margin-bottom: 10px">
  49. <el-col :span="2" class="col-txt">
  50. <span>推送日期</span>
  51. </el-col>
  52. <el-col :span="4" class="col-input">
  53. <el-date-picker
  54. v-model="search.sendDateFrom"
  55. style="width: 100%"
  56. popper-class="statistic_base"
  57. type="date"
  58. placeholder="年月日"
  59. value-format="yyyy-MM-dd"
  60. />
  61. </el-col>
  62. <el-col :span="1">
  63. <div style="width: 100%;text-align: center">至</div>
  64. </el-col>
  65. <el-col :span="4" class="col-input">
  66. <el-date-picker
  67. v-model="search.sendDateTo"
  68. style="width: 100%"
  69. popper-class="statistic_base"
  70. type="date"
  71. placeholder="年月日"
  72. value-format="yyyy-MM-dd"
  73. />
  74. </el-col>
  75. <el-col :span="2" class="col-txt">
  76. <span>开票日期</span>
  77. </el-col>
  78. <el-col :span="4" class="col-input">
  79. <el-date-picker
  80. v-model="search.invoiceDateFrom"
  81. popper-class="statistic_base"
  82. type="date"
  83. style="width: 100%"
  84. placeholder="年月日"
  85. value-format="yyyy-MM-dd"
  86. />
  87. </el-col>
  88. <el-col :span="1">
  89. <div style="width: 100%;text-align: center">至</div>
  90. </el-col>
  91. <el-col :span="4" class="col-input">
  92. <el-date-picker
  93. v-model="search.invoiceDateTo"
  94. popper-class="statistic_base"
  95. type="date"
  96. style="width: 100%"
  97. placeholder="年月日"
  98. value-format="yyyy-MM-dd"
  99. />
  100. </el-col>
  101. </el-row>
  102. <el-row class="handle-box" style="margin-bottom: 10px;text-align: right">
  103. <el-col :span="24" style="margin-top: 20px">
  104. <el-button class="ch-button" size="small" @click="handleSearch()"><i class="el-icon-search" />&nbsp;查询</el-button>
  105. <el-button class="ch-button-warning" size="small" @click="handleReset()"><i class="el-icon-search" />&nbsp;重置</el-button>
  106. <el-button class="ch-button-add" size="small" @click="handleAdd()"><i class="el-icon-menu" />&nbsp;新增</el-button>
  107. </el-col>
  108. </el-row>
  109. <el-row class="handle-box">
  110. <el-col :span="24">
  111. <el-table
  112. v-loading="loading"
  113. :data="AllData"
  114. row-class-name="g_table_row"
  115. border
  116. :header-cell-style="{background:'#f2f2f2'}"
  117. >
  118. <el-table-column type="index" width="60" />
  119. <el-table-column label="合同编号" prop="contractNumber" />
  120. <el-table-column label="网签备案号" prop="recordNumber" />
  121. <el-table-column label="买受人" prop="buyerName" width="200" />
  122. <el-table-column label="房屋" prop="houseName" width="200" />
  123. <el-table-column label="应收(元)" prop="receivableMoney" width="100" />
  124. <el-table-column label="已收(元)" prop="receivedMoney" width="100" />
  125. <el-table-column label="收款状态" prop="collectionStatusStr" width="110">
  126. <template scope="scope">
  127. <span
  128. :style="{'color':scope.row.collectionStatusStr==='已退款'?'red':scope.row.collectionStatusStr==='完全收款'?'green':'gray'}"
  129. >
  130. {{ scope.row.collectionStatusStr }}
  131. </span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="推送状态" prop="sendStatusStr">
  135. <template scope="scope">
  136. <span
  137. style="color: green"
  138. >
  139. {{ scope.row.sendStatusStr }}
  140. </span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="开票状态" prop="invoiceStatusStr">
  144. <template scope="scope">
  145. <span
  146. :style="{'color':scope.row.invoiceStatusStr==='已红冲'?'red':scope.row.invoiceStatusStr==='待开票'?'green':'gray'}"
  147. >
  148. {{ scope.row.invoiceStatusStr }}
  149. </span>
  150. </template>
  151. </el-table-column>
  152. <el-table-column header-align="center" label="操作" width="180">
  153. <template scope="scope">
  154. <el-button size="mini" type="text" @click="handleView(scope.row)">查看</el-button>
  155. </template>
  156. </el-table-column>
  157. </el-table>
  158. <div class="table-page">
  159. <el-pagination
  160. :current-page.sync="currentPage"
  161. :page-sizes="[10, 20, 50, 100]"
  162. :page-size="pageSize"
  163. background
  164. layout="total, sizes, prev, pager, next, jumper"
  165. :total="allpage"
  166. @size-change="handleSizeChange"
  167. @current-change="handleCurrentChange"
  168. />
  169. </div>
  170. </el-col>
  171. </el-row>
  172. <!--新增预收款发票-->
  173. <el-dialog
  174. :visible.sync="dialogVisible"
  175. :close-on-click-modal="false"
  176. :close-on-press-escape="false"
  177. :title="dialogTitle"
  178. width="90%"
  179. top="20px"
  180. class="statistic_base"
  181. :append-to-body="true"
  182. :modal-append-to-body="true"
  183. custom-class="tagdialog"
  184. @close="getData"
  185. >
  186. <add-invoice v-if="dialogVisible" ref="addInvoice" @cancel="cancel" />
  187. </el-dialog>
  188. </div>
  189. </template>
  190. <script>
  191. import Base from '@/views/base/base'
  192. import BaseData from '@/views/base/baseData'
  193. import AddInvoice from '@/views/invoice/components/addInvoice.vue'
  194. import constant from '@/static/utils/constant'
  195. export default {
  196. name: 'InvoiceManage',
  197. components: { AddInvoice },
  198. mixins: [Base, BaseData],
  199. data() {
  200. return {
  201. dc_key: ['INVOICE_STATUS', 'SEND_STATUS', 'HOUSE_PAYMENT_STATUS'],
  202. // 列表相关
  203. search: {
  204. sendStatus: ''
  205. },
  206. AllData: [],
  207. loading: false,
  208. // 弹框相关
  209. dialogVisible: false,
  210. dialogTitle: '新增'
  211. }
  212. },
  213. mounted() {
  214. this.initDict(this.dc_key).then((res) => {
  215. this.getData()
  216. })
  217. },
  218. methods: {
  219. getData: function() {
  220. const _this = this
  221. _this.loading = true
  222. _this.AllData = []
  223. this.search.pageNum = this.currentPage
  224. this.search.pageSize = this.pageSize
  225. this.baseRequest('advancePaymentInvoiceList', this.search).then((res) => {
  226. if (res.data.rows) {
  227. res.data.rows.forEach(function(item) {
  228. const json = _this.getItemJson(item)
  229. _this.AllData.push(json)
  230. })
  231. _this.allpage = res.data.total
  232. }
  233. _this.loading = false
  234. }).catch((e) => {
  235. // console.log(e)
  236. })
  237. // this.initOutData()
  238. },
  239. handleSearch: function() {
  240. this.getData()
  241. },
  242. handleReset: function() {
  243. for (const i in this.search) {
  244. if (i !== 'pageNum' && i !== 'pageSize') {
  245. this.search[i] = ''
  246. }
  247. }
  248. this.handleSearch()
  249. },
  250. getItemJson: function(item) {
  251. item.invoiceStatusStr = this.dc_map.INVOICE_STATUS[item.invoiceStatus]
  252. item.sendStatusStr = this.dc_map.SEND_STATUS[item.sendStatus]
  253. item.collectionStatusStr = this.dc_map.HOUSE_PAYMENT_STATUS[item.collectionStatus]
  254. return item
  255. },
  256. handleAdd() {
  257. this.dialogVisible = true
  258. this.dialogTitle = ''
  259. const val = {
  260. isView: false
  261. }
  262. // 新vue时调用的方法
  263. this.$nextTick(() => {
  264. this.$refs.addInvoice.initData(val)
  265. })
  266. },
  267. handleView(val) {
  268. this.dialogVisible = true
  269. this.dialogTitle = ''
  270. val.isView = true
  271. // 新vue时调用的方法
  272. this.$nextTick(() => {
  273. this.$refs.addInvoice.initData(val)
  274. })
  275. },
  276. cancel: function() {
  277. this.dialogVisible = false
  278. },
  279. baseRequest(opUrl, postData) {
  280. return this.$channel.globeRequest('InvoiceManageController', opUrl, postData, 'project')
  281. }
  282. }
  283. }
  284. </script>
  285. <style scoped>
  286. .ch-input .el-input__inner {
  287. border-color: #32323A;
  288. }
  289. .ch-input-size {
  290. width: 150px;
  291. }
  292. .ch-button {
  293. border-color: #32323A;
  294. background-color: #32323A;
  295. color: #fff;
  296. }
  297. .ch-button-warning {
  298. margin-left: 10px;
  299. border-color: #E6A23C;
  300. background-color: #E6A23C;
  301. color: #fff;
  302. }
  303. .ch-button-export {
  304. margin-left: 10px;
  305. border-color: #98CC1F;
  306. background-color: #98CC1F;
  307. color: #fff;
  308. }
  309. /deep/.el-dialog__header {
  310. padding: 10px 20px;
  311. }
  312. /deep/.el-dialog__body {
  313. padding: 10px 20px;
  314. }
  315. </style>