dialogExamine.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. <template>
  2. <div class="">
  3. <BaseDialog
  4. width="1000px"
  5. :isShow.sync="isShow"
  6. title="审核"
  7. :isShowFooter="false"
  8. >
  9. <div>
  10. <h2 class="h_top">
  11. 订单详情
  12. <el-button type="text" style="margin-left: 20px" @click="orderDetail"
  13. >查看</el-button
  14. >
  15. </h2>
  16. <div class="li_box">
  17. 订单编号:<span>{{ orderInfo.handleOrderSn }}</span
  18. >商品类型:<span>{{
  19. orderInfo.goodsType == 1
  20. ? "课程"
  21. : orderInfo.goodsType == 2
  22. ? "题库"
  23. : ""
  24. }}</span
  25. >教育类型:<span>{{ orderInfo.educationName }}</span
  26. >培训项目:<span>{{
  27. orderInfo.projectName + " - " + orderInfo.businessName
  28. }}</span
  29. ><br />
  30. <!-- 订购人数:<span>{{ orderInfo.userNum || 0 }} 位</span
  31. >订购数量:<span>{{ orderInfo.goodsNum }} 个</span> -->
  32. 下单金额:<span>¥{{ orderInfo.orderPrice | formatPrice }}</span
  33. >退款金额:<span
  34. >¥<span v-if="orderInfo.refundPrice">{{
  35. orderInfo.refundPrice | formatPrice
  36. }}</span
  37. ><span v-else>0.00</span></span
  38. >实际金额:<span>¥{{ orderInfo.realPrice | formatPrice }}</span>
  39. </div>
  40. </div>
  41. <div>
  42. <h2 class="h_top">申请信息</h2>
  43. <div class="li_box">
  44. 申请时间:<span>{{
  45. $methodsTools.onlyForma(invoiceInfo.applyTime)
  46. }}</span
  47. ><br />发票类型:<span>{{
  48. invoiceInfo.type == 1
  49. ? "普通发票"
  50. : invoiceInfo.type == 2
  51. ? "增值税专用发票"
  52. : ""
  53. }}</span
  54. >发票主体:<span>{{
  55. invoiceInfo.subject == 1
  56. ? "个人"
  57. : invoiceInfo.subject == 2
  58. ? "企业"
  59. : ""
  60. }}</span>
  61. {{ invoiceInfo.subject == 1 ? "姓名:" : "企业全称:"
  62. }}<span>{{ invoiceInfo.invoiceTitle }}</span
  63. >{{ invoiceInfo.subject == 1 ? "身份证号:" : "纳税人号:"
  64. }}<span>{{ invoiceInfo.taxRegistryNumber }}</span
  65. ><br />开票备注:<span>{{ invoiceInfo.openRemark }}</span
  66. ><template v-if="checkList.includes('2')">
  67. 收票邮箱:<span>{{ invoiceInfo.email }}</span></template
  68. >
  69. <template v-if="checkList.includes('3')">
  70. 收票姓名:<span>{{ invoiceInfo.consignee }}</span
  71. >收票电话:<span>{{ invoiceInfo.collectionTelephone }}</span
  72. >收票地址:<span>{{ invoiceInfo.shippingAddress }}</span></template
  73. >
  74. </div>
  75. </div>
  76. <div>
  77. <h2 class="h_top">开票信息</h2>
  78. <div class="li_box">
  79. <p style="margin-top: 0px">
  80. 本次申请开票金额:<span
  81. style="color: red; font-weight: bold; font-size: 16px"
  82. >¥{{ invoiceInfo.amount | formatPrice }}</span
  83. >
  84. </p>
  85. <el-upload
  86. ref="uploadFile"
  87. class="upload-demo"
  88. action="#"
  89. :http-request="uploadFile"
  90. :file-list="fileList"
  91. list-type="picture-card"
  92. multiple
  93. >
  94. <div slot="default">
  95. <el-button type="text" style="line-height: 22px"
  96. >+上传发票<br /><span style="color: #999"
  97. >支持PNG/JPG/PDF</span
  98. ></el-button
  99. >
  100. </div>
  101. <!-- <i slot="default" class="el-icon-plus"></i> -->
  102. <div slot="file" slot-scope="{ file }">
  103. <div>
  104. <img
  105. v-if="file.name.toLowerCase().split('.').splice(-1)[0] !== 'pdf' "
  106. class="el-upload-list__item-thumbnail"
  107. :src="file.url"
  108. alt=""
  109. />
  110. <span class="el-upload-list__item-actions">
  111. <span
  112. v-if="file.name.toLowerCase().split('.').splice(-1)[0] !== 'pdf'"
  113. class="el-upload-list__item-preview"
  114. @click="handlePictureCardPreview(file)"
  115. >
  116. <i class="el-icon-zoom-in"></i>
  117. </span>
  118. <span
  119. v-if="!disabled"
  120. class="el-upload-list__item-delete"
  121. @click="beforeRemove(file)"
  122. >
  123. <i class="el-icon-delete"></i>
  124. </span>
  125. </span>
  126. </div>
  127. <div
  128. v-if="file.name.toLowerCase().split('.').splice(-1)[0] == 'pdf'"
  129. style="text-align: center; line-height: 145px"
  130. >
  131. {{ file.name }}
  132. </div>
  133. </div>
  134. </el-upload>
  135. </div>
  136. </div>
  137. <div>
  138. <h2 class="h_top">收票方式</h2>
  139. <div class="li_box">
  140. <el-checkbox-group :value="checkList">
  141. <el-checkbox label="1">在线下载</el-checkbox>
  142. <el-checkbox label="2">邮件接收</el-checkbox>
  143. <el-checkbox label="3">纸质快递</el-checkbox>
  144. </el-checkbox-group>
  145. <el-input
  146. style="margin-top: 14px"
  147. :rows="4"
  148. type="textarea"
  149. v-model="handleRemark"
  150. placeholder="请输入备注"
  151. ></el-input>
  152. </div>
  153. </div>
  154. <el-divider></el-divider>
  155. <div>
  156. <el-button size="small" type="primary" @click="submit"
  157. >审核通过</el-button
  158. >
  159. <el-button size="small" type="warning" @click="close"
  160. >审核不通过</el-button
  161. >
  162. </div>
  163. </BaseDialog>
  164. <el-dialog :visible.sync="dialogVisible">
  165. <img width="100%" :src="dialogImageUrl" alt="" />
  166. </el-dialog>
  167. <order-detail ref="orderDetail" />
  168. </div>
  169. </template>
  170. <script>
  171. import orderDetail from "../orderManage/orderDetail.vue";
  172. export default {
  173. components: { orderDetail },
  174. data() {
  175. return {
  176. dialogImageUrl: "",
  177. dialogVisible: false,
  178. isShow: false,
  179. invoiceInfo: {},
  180. fileList: [],
  181. checkList: [],
  182. handleRemark: "",
  183. orderInfo: {},
  184. };
  185. },
  186. mounted() {},
  187. methods: {
  188. //查看详情
  189. orderDetail() {
  190. this.$refs.orderDetail.openBoxs(this.orderInfo.handleOrderSn);
  191. },
  192. openBoxs(row) {
  193. this.invoiceInfo = {};
  194. this.fileList = [];
  195. this.checkList = [];
  196. this.handleRemark = "";
  197. this.isShow = true;
  198. this.orderInfo = {};
  199. this.$api
  200. .orderhandledetail({ handleOrderSn: row.orderSn })
  201. .then((res) => {
  202. this.orderInfo = res.data;
  203. });
  204. this.$api.orderinvoicecompanydetail(row.invoiceId).then((res) => {
  205. this.invoiceInfo = res.data || {};
  206. this.checkList = res.data.invoiceMode.split(",");
  207. this.handleRemark = res.data.handleRemark || "";
  208. });
  209. },
  210. handlePictureCardPreview(file) {
  211. this.dialogImageUrl = file.url;
  212. this.dialogVisible = true;
  213. },
  214. uploadFile(fileObj) {
  215. let file = fileObj.file;
  216. var type = file.name.toLowerCase().split(".").splice(-1);
  217. let typeList = ["jpg", "png", "pdf"];
  218. if (!typeList.includes(type[0])) {
  219. this.$message.error("上传格式需为:.jpg/.png/.pdf");
  220. const idx = this.$refs.uploadFile.uploadFiles.findIndex(
  221. (item) => item.uid === file.uid
  222. );
  223. this.$refs.uploadFile.uploadFiles.splice(idx, 1);
  224. return;
  225. }
  226. if (file.size > 1 * 1024 * 1024) {
  227. this.$message.error("文件不得大于1MB");
  228. const idx = this.$refs.uploadFile.uploadFiles.findIndex(
  229. (item) => item.uid === file.uid
  230. );
  231. this.$refs.uploadFile.uploadFiles.splice(idx, 1);
  232. return;
  233. }
  234. this.$upload
  235. .upload(file, 2)
  236. .then((res) => {
  237. this.fileList.push({
  238. name: file.name,
  239. uid: file.uid, //带上上传前的uid作为标识
  240. url: this.$methodsTools.splitImgHost(res),
  241. deletable: true,
  242. imageFit: "contain",
  243. previewSize: 80,
  244. baseUrl: res,
  245. });
  246. })
  247. .catch(() => {
  248. this.$message.error("上传失败");
  249. const idx = this.$refs.uploadFile.uploadFiles.findIndex(
  250. (item) => item.uid === file.uid
  251. );
  252. this.$refs.uploadFile.uploadFiles.splice(idx, 1);
  253. });
  254. },
  255. beforeRemove(file) {
  256. this.fileList = this.fileList.filter((i) => i.uid != file.uid);
  257. },
  258. close() {
  259. this.$prompt("输入不通过原因", "确定审核不通过吗?", {
  260. confirmButtonText: "确定",
  261. cancelButtonText: "取消",
  262. inputPattern: /^.{1,10000}$/,
  263. inputErrorMessage: "请输入不通过原因",
  264. })
  265. .then(({ value }) => {
  266. let formData = {
  267. checkReason: value,
  268. checkResult: 2,
  269. invoiceId: this.invoiceInfo.invoiceId,
  270. };
  271. this.$api.orderinvoicecompanycheck(formData).then((res) => {
  272. this.$message.success("操作成功");
  273. this.isShow = false;
  274. this.$parent.search();
  275. });
  276. })
  277. .catch(() => {});
  278. },
  279. submit() {
  280. if (this.fileList.length == 0) {
  281. this.$message.error("请上传发票");
  282. return;
  283. }
  284. this.$confirm("确定审核通过吗", "提示", {
  285. confirmButtonText: "确定",
  286. cancelButtonText: "取消",
  287. type: "warning",
  288. })
  289. .then(() => {
  290. let imgList = this.fileList.map((i) => i.baseUrl).join();
  291. let formData = {
  292. checkResult: 1,
  293. handleRemark: this.handleRemark,
  294. invoiceId: this.invoiceInfo.invoiceId,
  295. invoiceUrlList: imgList,
  296. };
  297. this.$api.orderinvoicecompanycheck(formData).then((res) => {
  298. this.$message.success("审核成功");
  299. this.isShow = false;
  300. this.$parent.search();
  301. });
  302. })
  303. .catch(() => {});
  304. },
  305. },
  306. };
  307. </script>
  308. <style lang="scss" scoped>
  309. /deep/ .el-dialog__body {
  310. padding: 8px 20px !important;
  311. }
  312. .h_top {
  313. color: #000;
  314. font-weight: bold;
  315. font-size: 14px;
  316. }
  317. .li_box {
  318. padding: 20px;
  319. background-color: #f9fafb;
  320. line-height: 28px;
  321. border-radius: 8px;
  322. & > span {
  323. color: #000;
  324. margin-right: 28px;
  325. }
  326. }
  327. </style>