invoice_audit.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <div>
  3. <div class="t-title">
  4. <span>验证发票</span>
  5. </div>
  6. <div class="t-title">
  7. <span>发票图片</span> <span> <el-link @click="downloadIamge(invoiceRow.invoice_url,'invoice')" type="primary">下载发票原件</el-link></span>
  8. </div>
  9. <div>
  10. <el-image
  11. style="width: 700px; height: 350px"
  12. :src="invoiceRow.invoice_url"
  13. :preview-src-list="srcList">
  14. </el-image>
  15. </div>
  16. <div class="t-title">
  17. <span>审核金额:{{invoiceRow.amount}}</span>
  18. </div>
  19. <div>
  20. <div class="t-title">
  21. <span>发票图片审核 </span>
  22. <span v-if="invoiceRow.picture_verify_status === '0'"><el-tag type="info">待审核</el-tag></span>
  23. <span v-else-if="invoiceRow.picture_verify_status === '1'" style="color: green"> <el-tag type="success">审核通过</el-tag></span>
  24. <span v-else-if="invoiceRow.picture_verify_status === '2'" style="color: red"> <el-tag type="danger">审核不通过</el-tag> </span>
  25. <span v-else>--</span>
  26. </div>
  27. <div v-if="invoiceRow.paper_verify_status == '0'">
  28. <el-button type="primary" @click="onPictureAudit(true)" v-if="invoiceRow.picture_verify_status === '0'">验证通过
  29. </el-button>
  30. <el-button type="danger" @click="onAudit('picture')">验证不通过</el-button>
  31. </div>
  32. </div>
  33. <div v-if="invoiceRow.picture_verify_status === '1'">
  34. <div class="t-title">
  35. <span>纸质发票审核 </span>
  36. <span v-if="invoiceRow.paper_verify_status === '0'"> <el-tag type="info">待审核</el-tag></span>
  37. <span v-else-if="invoiceRow.paper_verify_status === '1'" style="color: green"> <el-tag type="success">审核通过</el-tag></span>
  38. <span v-else-if="invoiceRow.paper_verify_status === '2'" style="color: red"> <el-tag type="danger">审核不通过</el-tag></span>
  39. <span v-else>--</span>
  40. </div>
  41. <div v-if="invoiceRow.paper_verify_status == '0'">
  42. <el-button type="primary" @click="onPaperAudit(true)">验证通过</el-button>
  43. <el-button type="danger" @click="onAudit('paper')">验证不通过</el-button>
  44. </div>
  45. </div>
  46. <div>
  47. <div class="t-title">
  48. <span>审核记录 </span>
  49. </div>
  50. <div style="margin-top:5px" v-for="item in auditData">
  51. <el-card shadow="never">
  52. <el-row>
  53. <el-col :span="12" >
  54. <div :style="{'font-weight':700,'color':(item.status_name==='审核通过'?'green':'red')}" >{{item.status_name}}</div>
  55. </el-col>
  56. <el-col :span="10" :offset="2">
  57. <div><span class="lblue point" @click="openUser(item.audit_uid)">{{item.nickname}}</span> {{item.audit_date}}</div>
  58. </el-col>
  59. </el-row>
  60. <el-row style="margin-top: 10px">
  61. <el-col :span="12" v-if="item.audit_data">
  62. <div style="font-weight: 700">消息通知:</div>
  63. <div style="padding: 5px">
  64. &nbsp;&nbsp;{{item.audit_data.reason || ''}}
  65. </div>
  66. </el-col>
  67. </el-row>
  68. </el-card>
  69. </div>
  70. </div>
  71. <el-dialog
  72. title="请输入发票图片审核不通过的原因"
  73. :visible.sync="pictureAuditModel"
  74. width="30%"
  75. >
  76. <div>
  77. <el-input v-model="pictureReason"></el-input>
  78. </div>
  79. <span slot="footer" class="dialog-footer">
  80. <el-button @click="pictureAuditModel = false">取 消</el-button>
  81. <el-button type="primary" @click="onPictureAudit(false)">确 定</el-button>
  82. </span>
  83. </el-dialog>
  84. <el-dialog
  85. title="请输入纸质发票审核不通过的原因"
  86. :visible.sync="paperAuditModel"
  87. width="30%"
  88. >
  89. <div>
  90. <el-input v-model="paperReason"></el-input>
  91. </div>
  92. <span slot="footer" class="dialog-footer">
  93. <el-button @click="paperAuditModel = false">取 消</el-button>
  94. <el-button type="primary" @click="onPaperAudit(false)">确 定</el-button>
  95. </span>
  96. </el-dialog>
  97. </div>
  98. </template>
  99. <script>
  100. export default {
  101. name: "invoice_audit",
  102. data() {
  103. return {
  104. ids: 0,
  105. srcList: [],
  106. invoiceRow: {},
  107. paperReason: '',
  108. pictureReason: '',
  109. paperAuditModel: false,
  110. pictureAuditModel: false,
  111. auditData: []
  112. };
  113. },
  114. mounted() {
  115. this.getInvoiceDetail();
  116. },
  117. methods: {
  118. async getInvoiceDetail() {
  119. let id = this.ids;
  120. if (id === 0) {
  121. this.$message.error('id不存在');
  122. return false;
  123. }
  124. let res = await this.$post("/api/admin/kaifabao/getInvoiceAuditInfo", {id: id});
  125. if (res && res.status === 1) {
  126. this.invoiceRow = res.data.invoice;
  127. this.srcList = [res.data.invoice.invoice_url];
  128. this.auditData = res.data.auditData || [];
  129. this.auditData.audit_data = res.data.auditData.audit_data || {};
  130. }
  131. },
  132. onAudit(action) {
  133. //图片发票 纸质发票
  134. if (action === 'picture') {
  135. this.pictureAuditModel = true;
  136. } else if (action === 'paper') {
  137. this.paperAuditModel = true;
  138. }
  139. },
  140. //图片
  141. async onPictureAudit(isTrue) {
  142. let data = {};
  143. //图片审核
  144. if (isTrue) {
  145. data = {
  146. invoiceId: this.ids,
  147. action: 'approve'
  148. };
  149. } else {
  150. if (!this.pictureReason) {
  151. this.$message.error('原因不能为空');
  152. return false;
  153. }
  154. data = {
  155. invoiceId: this.ids,
  156. action: 'reject',
  157. reason: this.pictureReason
  158. };
  159. }
  160. let res = await this.$post("/api/admin/kaifabao/auditInvoiceWithdrawalPicture", data);
  161. if (res && res.status === 1) {
  162. this.$message({
  163. type: "success",
  164. message: "操作成功!"
  165. });
  166. this.pictureAuditModel = false;
  167. this.getInvoiceDetail();
  168. }
  169. },
  170. //纸质
  171. async onPaperAudit(isTrue) {
  172. let data = {};
  173. //纸质发票审核
  174. if (isTrue) {
  175. data = {
  176. invoiceId: this.ids,
  177. action: 'approve'
  178. };
  179. } else {
  180. if (!this.paperReason) {
  181. this.$message.error('原因不能为空');
  182. return false;
  183. }
  184. data = {
  185. invoiceId: this.ids,
  186. action: 'reject',
  187. reason: this.paperReason
  188. };
  189. }
  190. let res = await this.$post("/api/admin/kaifabao/auditInvoiceWithdrawalPaper", data);
  191. if (res && res.status === 1) {
  192. this.$message({
  193. type: "success",
  194. message: "操作成功!"
  195. });
  196. this.paperAuditModel = false;
  197. this.getInvoiceDetail();
  198. }
  199. },
  200. getUrlParam(name) {
  201. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
  202. var r = window.location.search.substr(1).match(reg); //匹配目标参数
  203. if (r != null) return decodeURI(r[2]);
  204. return null; //返回参数值
  205. },
  206. downloadIamge(imgsrc, name) {//下载图片地址和图片名
  207. var a = document.createElement('a')
  208. a.download = name || 'pic';
  209. // 设置图片地址
  210. a.href = imgsrc;
  211. a.click();
  212. },
  213. openUser(uid){
  214. window.open(
  215. this.$store.state.domainConfig.siteUrl + `/rooter/user/${uid}`
  216. );
  217. }
  218. },
  219. created() {
  220. this.ids = this.getUrlParam("id");
  221. }
  222. }
  223. </script>
  224. <style scoped>
  225. .t-title {
  226. font-size: 20px;
  227. font-weight: 500;
  228. margin: 10px 0 5px 0;
  229. }
  230. .image {
  231. width: 100%;
  232. height: 100%;
  233. /*display: block;*/
  234. }
  235. .box-card {
  236. width: 480px;
  237. height: 300px;
  238. }
  239. </style>