index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <el-dialog title="发票验真" :visible.sync="open" width="1050px" append-to-body>
  3. <el-row class="zap-bill-dialog" type="flex">
  4. <div width="224px" style="background-color: white;flex: 0 0 224px;">
  5. <el-button style="width: 224px;" type="primary" @click="openUploadInvoice">上传发票</el-button>
  6. <div class="zap-bill-dialog__main">
  7. <div class="zap-bill-dialog__title">
  8. <el-checkbox :indeterminate="isIndeterminate" @change="handleCheckAllChange">全选</el-checkbox>
  9. <label>已上传发票列表</label>
  10. </div>
  11. <div class="zap-bill-dialog__item" :style="
  12. item.ziiCheckStt == '1'
  13. ? { 'background-color': '#a8f87f' }
  14. : {}
  15. " v-for="(item, index) in fileList" :label="item" :key="index">
  16. <i class="el-icon-question" style="color: blue" v-if="item.ziiCheckStt == '0'"><label @click="changeInvoice(item)">
  17. <el-link :underline="false">{{
  18. item.name
  19. }}</el-link>
  20. </label></i>
  21. <i class="el-icon-success" style="color: green" v-if="item.ziiCheckStt == '1'"><label @click="changeInvoice(item)">
  22. <el-link :underline="false">{{
  23. item.name
  24. }}</el-link>
  25. </label></i>
  26. <i class="el-icon-error" style="color: red" v-if="item.ziiCheckStt == '2' || item.ziiCheckStt == '3'"><label @click="changeInvoice(item)">
  27. <el-link :underline="false">{{
  28. item.name
  29. }}</el-link>
  30. </label><label>{{ checkSttFormat(item) }}</label></i>
  31. <el-link style="float: right" type="primary" :underline="false" @click="delInvoice(item)">删除</el-link>
  32. </div>
  33. </div>
  34. <div style="text-align: center; margin-top: 20px">
  35. <el-button type="primary" @click="toCheckAgian()">再次验证</el-button>
  36. <el-button type="primary" @click="submitCheck()">保存并上传</el-button>
  37. </div>
  38. </div>
  39. <div style="margin-left: 32px;">
  40. <el-row height="232px">
  41. <el-image style="width: 700px; height: 232px" :src="invoice.url" fit="scale-down" @click="invoicePictureCardPreview(invoice)"></el-image>
  42. <p v-if="invoice.zbiName && invoice.ziiCheckStt == '3'" style="text-align: center; color: red">
  43. 发票重复,已存在名称为“{{ invoice.zbiName }}”的往来账款中!
  44. </p>
  45. </el-row>
  46. <el-row class="mt20">
  47. <el-form ref="invoice" label-width="auto" :disabled="invoice.ziiCheckStt == '1'">
  48. <el-col :span="12">
  49. <el-form-item label="发票代码:">
  50. <el-input class="zap-bill-dialog__input" v-model="invoice.ziiNo" maxlength="20" />
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="12">
  54. <el-form-item label="发票号码:">
  55. <el-input class="zap-bill-dialog__input" v-model="invoice.ziiNumber" maxlength="20" />
  56. </el-form-item>
  57. </el-col>
  58. <el-col :span="12">
  59. <el-form-item label="开票日期:">
  60. <el-date-picker class="zap-bill-dialog__input" v-model="invoice.ziiDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期">
  61. </el-date-picker>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="12">
  65. <el-form-item label="购货纳税人编号:">
  66. <el-input class="zap-bill-dialog__input" v-model="invoice.ziiPurchaserNo" maxlength="20" />
  67. </el-form-item>
  68. </el-col>
  69. <el-col :span="12">
  70. <el-form-item label="销货纳税人编号:">
  71. <el-input class="zap-bill-dialog__input" v-model="invoice.ziiSellerNo" maxlength="20" />
  72. </el-form-item>
  73. </el-col>
  74. <el-col :span="12">
  75. <el-form-item label="发票金额:">
  76. <el-input class="zap-bill-dialog__input" v-model="invoice.ziiTotalAmount" maxlength="16" @input.native="changeRate($event,invoice.ziiTotalAmount,'0')" />
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="12">
  80. <el-form-item label="税价金额:">
  81. <el-input class="zap-bill-dialog__input" v-model="invoice.ziiAmount" maxlength="16" @input.native="changeRate($event,invoice.ziiAmount,'1')" />
  82. </el-form-item>
  83. </el-col>
  84. </el-form>
  85. </el-row>
  86. <el-footer>
  87. <el-button type="primary" @click="queryDouble()" style="float: right">确定</el-button>
  88. </el-footer>
  89. </div>
  90. </el-row>
  91. </el-dialog>
  92. </template>
  93. <script>
  94. export default {
  95. name: "InvoiceVerification",
  96. props: ['open', 'isIndeterminate', 'fileList', 'invoice'],
  97. methods: {
  98. openUploadInvoice() {
  99. this.$emit('openUploadInvoice')
  100. },
  101. handleCheckAllChange(val) {
  102. this.$emit('handleCheckAllChange', val)
  103. },
  104. changeInvoice(item) {
  105. this.$emit('changeInvoice', item)
  106. },
  107. delInvoice(item) {
  108. this.$emit('delInvoice', item)
  109. },
  110. toCheckAgian() {
  111. this.$emit('toCheckAgian')
  112. },
  113. submitCheck() {
  114. this.$emit('submitCheck')
  115. },
  116. invoicePictureCardPreview(invoice) {
  117. this.$emit('invoicePictureCardPreview', invoice)
  118. },
  119. queryDouble () {
  120. this.$emit('queryDouble')
  121. },
  122. //金额校验格式
  123. changeRate(e, input, type) {
  124. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  125. this.input = e.target.value;
  126. if ("0" == type) {
  127. this.invoice.ziiTotalAmount = e.target.value;
  128. } else if ("1" == type) {
  129. this.invoice.ziiAmount = e.target.value;
  130. }
  131. },
  132. //校验结果字典
  133. checkSttFormat(row, column) {
  134. return this.selectDictLabel(this.checkSttOptions, row.ziiCheckStt);
  135. },
  136. }
  137. }
  138. </script>
  139. <style lang="scss">
  140. .zap-bill-dialog {
  141. padding: 25px 40px 35px;
  142. }
  143. .zap-bill-dialog__main {
  144. height: 408px;
  145. margin-top: 16px;
  146. border-radius: 4px;
  147. border: 1px dashed #4280F2;
  148. }
  149. .zap-bill-dialog__title {
  150. height: 32px;
  151. line-height: 32px;
  152. text-align: center;
  153. font-size: 12px;
  154. color: #4280F2;
  155. background-color: #EBF3FF;
  156. }
  157. .zap-bill-dialog__input {
  158. width: 200px !important;
  159. }
  160. .zap-bill-dialog__item {
  161. padding: 18px 16px;
  162. font-size: 14px;
  163. }
  164. </style>