dislogOrderDetails.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. <template>
  2. <div class="orderDetail">
  3. <BaseDialog
  4. width="1200px"
  5. :isShow.sync="isShow"
  6. title="订单详情"
  7. @close="close"
  8. :isShowFooter="false"
  9. >
  10. <div class="head">
  11. 订单号:<span>{{ detailInfo.orderSn }}</span> 退款状态:<span>{{
  12. refundStatus(detailInfo.refundStatus)
  13. }}</span>
  14. <i v-if="orderFrom === 3" style="font-style: normal"
  15. >审核状态:<span>{{ checkStatus(detailInfo.checkStatus) }}</span></i
  16. >
  17. <i
  18. v-if="ShowStatus && detailInfo.checkStatus === 0"
  19. style="float: right"
  20. >
  21. <el-button
  22. type="success"
  23. size="small"
  24. @click="success"
  25. :disabled="orderFrom !== 3"
  26. >订单审核通过</el-button
  27. >
  28. <el-button
  29. type="danger"
  30. size="small"
  31. @click="error"
  32. :disabled="orderFrom !== 3"
  33. >订单审核不通过</el-button
  34. >
  35. </i>
  36. </div>
  37. <div class="mian">
  38. <el-descriptions class="margin-top" :column="3" border>
  39. <el-descriptions-item
  40. :label="desc.label"
  41. v-for="(desc, index) in descList"
  42. :key="index"
  43. >
  44. <div v-if="desc.type">
  45. <el-link
  46. :underline="false"
  47. :disabled="detailInfo['link'] ? false : true"
  48. v-if="desc.type === 'dowm'"
  49. :href="detailInfo['link']"
  50. target="_blank"
  51. >资料下载</el-link
  52. >
  53. <el-image
  54. v-if="desc.type === 'image'"
  55. style="width: 40px; height: 20px"
  56. :src="detailInfo[desc.key][0]"
  57. :preview-src-list="detailInfo[desc.key]"
  58. >
  59. </el-image>
  60. <div v-if="desc.type === 'pretax'">
  61. <span style="margin-right: 20px"
  62. >税前佣金:{{
  63. detailInfo["pretaxBrokerage"] ||
  64. detailInfo["pretaxBrokerage"] == 0
  65. ? detailInfo["pretaxBrokerage"].toFixed(2)
  66. : detailInfo["pretaxBrokerage"]
  67. }}</span
  68. ><span>税占比:{{ detailInfo["pretaxStr"] }}</span>
  69. </div>
  70. <div v-if="desc.type === 'time'">
  71. {{ $methodsTools.onlyForma(detailInfo[desc.key]) }}
  72. </div>
  73. <div v-if="desc.type === 'options'">
  74. <template v-for="(i, k) in desc.options">
  75. <span v-if="i.value === detailInfo[desc.key]">
  76. {{ i.label }}
  77. </span>
  78. </template>
  79. </div>
  80. <div v-if="desc.type === 'money'">
  81. {{
  82. detailInfo[desc.key] || detailInfo[desc.key] === 0
  83. ? detailInfo[desc.key].toFixed(2)
  84. : detailInfo[desc.key]
  85. }}
  86. <span
  87. v-if="desc.key === 'orderProfit'"
  88. :style="{
  89. color: detailInfo[desc.key] > 0 ? '#409eff' : '#f56c6c',
  90. }"
  91. >【{{ detailInfo[desc.key] > 0 ? "盈" : "亏" }}】</span
  92. >
  93. <span
  94. v-if="desc.key === 'orderUncollected'"
  95. :style="{
  96. color: detailInfo[desc.key] > 0 ? '#f56c6c' : '#409eff',
  97. }"
  98. >({{
  99. detailInfo[desc.key] > 0 ? "未结清" : "已结清"
  100. }})</span
  101. >
  102. </div>
  103. </div>
  104. <div v-else>
  105. {{ detailInfo[desc.key] }}
  106. </div>
  107. </el-descriptions-item>
  108. </el-descriptions>
  109. </div>
  110. <student-details
  111. v-if="isShow"
  112. :orderSn="orderSn"
  113. :orderFrom="orderFrom"
  114. :ShowStatus="ShowStatus"
  115. :checkStatus="detailInfo.checkStatus"
  116. ></student-details>
  117. </BaseDialog>
  118. </div>
  119. </template>
  120. <script>
  121. import studentDetails from "./studentDetails.vue";
  122. export default {
  123. name: "dislogOrderDetails",
  124. props: {
  125. dialogVisible: {
  126. type: Boolean,
  127. default: false,
  128. },
  129. orderSn: {
  130. type: String,
  131. },
  132. orderFrom: {
  133. type: Number,
  134. },
  135. ShowStatus: {
  136. type: Boolean,
  137. default: false,
  138. },
  139. },
  140. data() {
  141. return {
  142. descList: [
  143. { label: "机构名称", key: "tenantName" },
  144. { label: "业务员", key: "createUsername" },
  145. { label: "业务号", key: "createNo" },
  146. { label: "业务分类", key: "schemeName" },
  147. { label: "订单来源", key: "orderOrg" },
  148. { label: "申请时间", key: "buyTime", type: "time" },
  149. { label: "盈亏(元)", key: "orderProfit", type: "money" },
  150. { label: "成本(元)", key: "orderCost", type: "money" },
  151. { label: "合同金额(元)", key: "orderPrice", type: "money" },
  152. { label: "已收账款(元)", key: "orderReceived", type: "money" },
  153. { label: "申请退款", key: "orderRefund", type: "money" },
  154. { label: "已退账款(元)", key: "orderRefunded", type: "money" },
  155. { label: "未收账款(元)", key: "orderUncollected", type: "money" },
  156. { label: "实际账款(元)", key: "orderPractical", type: "money" },
  157. { label: "下单企业", key: "tenantName" },
  158. { label: "转账开户名", key: "openingName" },
  159. { label: "转账凭证", key: "attachmentList", type: "image" },
  160. {
  161. label: "发票状态",
  162. key: "invoiceStatus",
  163. type: "options",
  164. options: [
  165. {
  166. label: "未开票",
  167. value: 0,
  168. },
  169. {
  170. label: "已开票",
  171. value: 1,
  172. },
  173. ],
  174. },
  175. { label: "备注", key: "remark" },
  176. { label: "附件", type: "dowm" },
  177. { label: "佣金", key: "pretax", type: "pretax" },
  178. ],
  179. detailInfo: {
  180. attachmentList: [],
  181. },
  182. };
  183. },
  184. mounted() {},
  185. methods: {
  186. //退款状态
  187. refundStatus(i) {
  188. var str = "";
  189. switch (i) {
  190. case 0:
  191. str = "待审核";
  192. break;
  193. case 1:
  194. str = "正常";
  195. break;
  196. case 2:
  197. str = "未退款";
  198. break;
  199. case 3:
  200. str = "已完成";
  201. break;
  202. case 4:
  203. str = "未通过";
  204. break;
  205. case 5:
  206. str = "支付中";
  207. break;
  208. case 6:
  209. str = "支付失败";
  210. break;
  211. default:
  212. break;
  213. }
  214. return str;
  215. },
  216. //审核状态
  217. checkStatus(i) {
  218. var str = "";
  219. switch (i) {
  220. case 0:
  221. str = "待审核";
  222. break;
  223. case 1:
  224. str = "已通过";
  225. break;
  226. case 2:
  227. str = "未通过";
  228. break;
  229. case 3:
  230. str = "已撤销";
  231. break;
  232. default:
  233. break;
  234. }
  235. return str;
  236. },
  237. init() {
  238. this.getOrderDetail();
  239. },
  240. getOrderDetail() {
  241. this.$api.systemtoporderid(this.orderSn).then((res) => {
  242. if (res.data.attachmentList?.length > 0) {
  243. let a1 = [];
  244. for (let i = 0; i < res.data.attachmentList.length; i++) {
  245. if (res.data.attachmentList[i].attachmentType === 1) {
  246. a1.push(res.data.attachmentList[i].attachmentUrl);
  247. }
  248. if (res.data.attachmentList[i].attachmentType === 2) {
  249. res.data.link = res.data.attachmentList[i].attachmentUrl;
  250. }
  251. }
  252. res.data.attachmentList = a1;
  253. } else {
  254. res.data.attachmentList = [];
  255. }
  256. console.log(res.data);
  257. this.detailInfo = res.data;
  258. });
  259. },
  260. close() {},
  261. submit() {},
  262. submitForm() {
  263. this.isShow = false;
  264. this.$emit("search");
  265. },
  266. success() {
  267. this.$confirm("确定审核通过吗?", "提示", {
  268. confirmButtonText: "确定",
  269. cancelButtonText: "取消",
  270. type: "warning",
  271. })
  272. .then(() => {
  273. this.$api
  274. .systemtopordercheck({
  275. checkStatus: 1,
  276. orderSn: this.orderSn,
  277. })
  278. .then((res) => {
  279. this.$message.success("操作成功");
  280. this.submitForm();
  281. });
  282. })
  283. .catch(() => {});
  284. },
  285. error() {
  286. this.$prompt("确定审核不通过吗?", "提示", {
  287. confirmButtonText: "确定",
  288. cancelButtonText: "取消",
  289. inputPlaceholder: "输入不通过原因",
  290. })
  291. .then(({ value }) => {
  292. this.$api
  293. .systemtopordercheck({
  294. checkReason: value || "",
  295. checkStatus: 2,
  296. orderSn: this.orderSn,
  297. })
  298. .then((res) => {
  299. this.$message.success("操作成功");
  300. this.submitForm();
  301. });
  302. })
  303. .catch(() => {});
  304. },
  305. },
  306. computed: {
  307. isShow: {
  308. get() {
  309. if (this.dialogVisible) {
  310. this.init();
  311. }
  312. return this.dialogVisible;
  313. },
  314. set(val) {
  315. this.$emit("update:dialogVisible", false);
  316. },
  317. },
  318. },
  319. components: { studentDetails },
  320. };
  321. </script>
  322. <style lang="scss" scoped>
  323. .orderDetail {
  324. .head {
  325. margin-bottom: 20px;
  326. span {
  327. padding-right: 20px;
  328. color: #409eff;
  329. }
  330. }
  331. }
  332. </style>