main.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div>
  3. <detailDatatable
  4. :newTime="newTime"
  5. v-if="sitem"
  6. :sitem="sitem"
  7. :columns="columns"
  8. >
  9. <template slot="status">
  10. <el-tag
  11. :size="'mini'"
  12. :type="sitem.status == '0' ? 'warning' : ''"
  13. v-text="
  14. (
  15. (sitem.is_receive === '0' ? status2Options : status1Options).find(
  16. (item) => item.id === sitem.status
  17. ) || {}
  18. ).label || '--'
  19. "
  20. ></el-tag>
  21. </template>
  22. <template slot="order_type">
  23. <el-tag
  24. :size="'mini'"
  25. v-text="
  26. (
  27. xs_order_type_options.find(
  28. (item) => item.id == sitem.order_type
  29. ) || {}
  30. ).label || '--'
  31. "
  32. ></el-tag>
  33. </template>
  34. <template slot="is_receive">
  35. <el-tag :size="'mini'" :type="''">{{
  36. sitem.is_receive === "1"
  37. ? "已收到货"
  38. : sitem.is_receive === "0"
  39. ? "未收到"
  40. : "--"
  41. }}</el-tag>
  42. </template>
  43. <template slot="except_code">
  44. <el-tag
  45. :size="'mini'"
  46. v-text="
  47. (
  48. expect_options.find((item) => item.value == sitem.except_code) ||
  49. {}
  50. ).label || '--'
  51. "
  52. ></el-tag>
  53. </template>
  54. <template slot="error_img">
  55. <img
  56. class="fl hover"
  57. style="width: 23px; height: 23px; margin: 0 5px 0 0"
  58. v-viewer
  59. v-for="(si, i) in sitem.error_img"
  60. :src="si"
  61. :key="si + i"
  62. />
  63. </template>
  64. </detailDatatable>
  65. </div>
  66. </template>
  67. <script>
  68. import { columns, statusOptions } from "./columns";
  69. // import { cg_order_type_options } from "@/assets/js/statusList";
  70. //————————————————
  71. import mixinPage from "@/mixins/elPaginationHandle";
  72. import resToken from "@/mixins/resToken";
  73. import asyncRequest from "@/apis/service/sellOut/sellAfterApply";
  74. import { xs_order_type_options } from "@/assets/js/statusList";
  75. import { mapGetters } from "vuex";
  76. import detailDatatable from "../detail-data-table";
  77. export default {
  78. mixins: [mixinPage, resToken],
  79. computed: {
  80. ...mapGetters(["tablebtnSize", "searchSize", "size", "private_field"]),
  81. powers() {
  82. let tran =
  83. this.$store.getters.btnList.find(
  84. (item) => item.menu_route == "standingBookDetail"
  85. ) || {};
  86. if (tran && tran.action && tran.action.length > 0) {
  87. return tran.action;
  88. } else {
  89. return [];
  90. }
  91. },
  92. },
  93. components:{
  94. detailDatatable
  95. },
  96. props: ["queryId"],
  97. data() {
  98. return {
  99. // cg_order_type_options,
  100. xs_order_type_options,
  101. activeTabs: "1",
  102. expect_options: [],
  103. expect_options1: [
  104. {
  105. value: "1",
  106. label: "退货",
  107. },
  108. {
  109. value: "2",
  110. label: "换货",
  111. },
  112. ],
  113. expect_options0: [
  114. {
  115. value: "1",
  116. label: "退货",
  117. },
  118. {
  119. value: "2",
  120. label: "补发",
  121. },
  122. ],
  123. activeNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
  124. status: "", //存储详情接口状态
  125. statusList: [],
  126. sitem: null,
  127. newTime: "",
  128. loading: false,
  129. // 收到货状态
  130. status1Options: [
  131. { id: "1", label: "待业务审核" },
  132. { id: "2", label: "待采购审核" },
  133. { id: "3", label: "待设置仓库" },
  134. { id: "4", label: "待客户退货" },
  135. { id: "5", label: "售后已完成" },
  136. { id: "6", label: "业务已驳回" },
  137. { id: "7", label: "采购已驳回" },
  138. { id: "8", label: "申请已取消" },
  139. ],
  140. // 未收到货状态
  141. status2Options: [
  142. { id: "1", label: "待业务审核" },
  143. { id: "2", label: "待采购审核" },
  144. { id: "3", label: "待同意退货" },
  145. { id: "5", label: "售后已完成" },
  146. { id: "6", label: "业务已驳回" },
  147. { id: "7", label: "采购已驳回" },
  148. { id: "8", label: "申请已取消" },
  149. ],
  150. orderCode: "",
  151. return_code: "",
  152. code: "",
  153. // cost_detailArr: [],
  154. //——————————————————————
  155. columns,
  156. };
  157. },
  158. mounted() {
  159. this.initData();
  160. },
  161. methods: {
  162. getNewTime() {
  163. this.newTime = new Date().valueOf();
  164. },
  165. async initData() {
  166. let model = {
  167. returnCode: this.queryId,
  168. };
  169. const res = await asyncRequest.detail(model);
  170. if (res && res.code === 0 && res.data) {
  171. this.sitem = res.data;
  172. const { status, can, returnCode } = this.sitem;
  173. this.status = status;
  174. this.orderCode = returnCode;
  175. this.sitem.error_img = this.sitem.error_img.split(",");
  176. this.expect_options = JSON.parse(
  177. JSON.stringify(
  178. this.sitem.is_receive === "1"
  179. ? this.expect_options1
  180. : this.expect_options0
  181. )
  182. );
  183. this.getNewTime();
  184. } else if (res && res.code >= 100 && res.code <= 104) {
  185. await this.logout();
  186. } else {
  187. this.$message.warning(res.message);
  188. }
  189. },
  190. },
  191. };
  192. </script>
  193. <style>
  194. </style>