invoiceManage.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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 v-if="scope.row.sendStatus === '0'" type="text" size="mini" @click="handleInvoice(scope.row)">推送</el-button>
  155. <el-button size="mini" type="text" @click="handleView(scope.row)">查看</el-button>
  156. </template>
  157. </el-table-column>
  158. </el-table>
  159. <div class="table-page">
  160. <el-pagination
  161. :current-page.sync="currentPage"
  162. :page-sizes="[10, 20, 50, 100]"
  163. :page-size="pageSize"
  164. background
  165. layout="total, sizes, prev, pager, next, jumper"
  166. :total="allpage"
  167. @size-change="handleSizeChange"
  168. @current-change="handleCurrentChange"
  169. />
  170. </div>
  171. </el-col>
  172. </el-row>
  173. <!--新增预收款发票-->
  174. <el-dialog
  175. :visible.sync="dialogVisible"
  176. :close-on-click-modal="false"
  177. :close-on-press-escape="false"
  178. :title="dialogTitle"
  179. width="90%"
  180. top="20px"
  181. class="statistic_base"
  182. :append-to-body="true"
  183. :modal-append-to-body="true"
  184. custom-class="tagdialog"
  185. @close="getData"
  186. >
  187. <add-invoice v-if="dialogVisible" ref="addInvoice" @cancel="cancel" />
  188. </el-dialog>
  189. </div>
  190. </template>
  191. <script>
  192. import Base from '@/views/base/base'
  193. import BaseData from '@/views/base/baseData'
  194. import AddInvoice from '@/views/invoice/components/addInvoice.vue'
  195. import constant from '@/static/utils/constant'
  196. export default {
  197. name: 'InvoiceManage',
  198. components: { AddInvoice },
  199. mixins: [Base, BaseData],
  200. data() {
  201. return {
  202. dc_key: ['INVOICE_STATUS', 'SEND_STATUS', 'HOUSE_PAYMENT_STATUS'],
  203. // 列表相关
  204. search: {
  205. sendStatus: ''
  206. },
  207. AllData: [],
  208. loading: false,
  209. // 弹框相关
  210. dialogVisible: false,
  211. dialogTitle: '新增'
  212. }
  213. },
  214. mounted() {
  215. this.initDict(this.dc_key).then((res) => {
  216. this.getData()
  217. })
  218. },
  219. methods: {
  220. getData: function() {
  221. const _this = this
  222. _this.loading = true
  223. _this.AllData = []
  224. this.search.pageNum = this.currentPage
  225. this.search.pageSize = this.pageSize
  226. this.baseRequest('advancePaymentInvoiceList', this.search).then((res) => {
  227. if (res.data.rows) {
  228. res.data.rows.forEach(function(item) {
  229. const json = _this.getItemJson(item)
  230. _this.AllData.push(json)
  231. })
  232. _this.allpage = res.data.total
  233. }
  234. _this.loading = false
  235. }).catch((e) => {
  236. // console.log(e)
  237. })
  238. // this.initOutData()
  239. },
  240. handleSearch: function() {
  241. this.getData()
  242. },
  243. handleReset: function() {
  244. for (const i in this.search) {
  245. if (i !== 'pageNum' && i !== 'pageSize') {
  246. this.search[i] = ''
  247. }
  248. }
  249. this.handleSearch()
  250. },
  251. getItemJson: function(item) {
  252. item.invoiceStatusStr = this.dc_map.INVOICE_STATUS[item.invoiceStatus]
  253. item.sendStatusStr = this.dc_map.SEND_STATUS[item.sendStatus]
  254. item.collectionStatusStr = this.dc_map.HOUSE_PAYMENT_STATUS[item.collectionStatus]
  255. return item
  256. },
  257. handleAdd() {
  258. this.dialogVisible = true
  259. this.dialogTitle = ''
  260. const val = {
  261. isView: false
  262. }
  263. // 新vue时调用的方法
  264. this.$nextTick(() => {
  265. this.$refs.addInvoice.initData(val)
  266. })
  267. },
  268. handleInvoice(row) {
  269. this.dialogVisible = true
  270. this.dialogTitle = ''
  271. row.isView = false
  272. // 新vue时调用的方法
  273. this.$nextTick(() => {
  274. this.$refs.addInvoice.initData(row)
  275. })
  276. },
  277. handleView(val) {
  278. this.dialogVisible = true
  279. this.dialogTitle = ''
  280. val.isView = true
  281. // 新vue时调用的方法
  282. this.$nextTick(() => {
  283. this.$refs.addInvoice.initData(val)
  284. })
  285. },
  286. cancel: function() {
  287. this.dialogVisible = false
  288. },
  289. baseRequest(opUrl, postData) {
  290. return this.$channel.globeRequest('InvoiceManageController', opUrl, postData, 'project')
  291. }
  292. }
  293. }
  294. </script>
  295. <style scoped>
  296. .ch-input .el-input__inner {
  297. border-color: #32323A;
  298. }
  299. .ch-input-size {
  300. width: 150px;
  301. }
  302. .ch-button {
  303. border-color: #32323A;
  304. background-color: #32323A;
  305. color: #fff;
  306. }
  307. .ch-button-warning {
  308. margin-left: 10px;
  309. border-color: #E6A23C;
  310. background-color: #E6A23C;
  311. color: #fff;
  312. }
  313. .ch-button-export {
  314. margin-left: 10px;
  315. border-color: #98CC1F;
  316. background-color: #98CC1F;
  317. color: #fff;
  318. }
  319. /deep/.el-dialog__header {
  320. padding: 10px 20px;
  321. }
  322. /deep/.el-dialog__body {
  323. padding: 10px 20px;
  324. }
  325. </style>