main.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div>
  3. <show-data-table
  4. :newTime="newTime"
  5. v-if="newTime !== '' && 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. (statusOptions.find((item) => item.id === sitem.status) || {})
  15. .label || '--'
  16. "
  17. ></el-tag>
  18. </template>
  19. <template slot="order_type">
  20. <el-tag
  21. :size="'mini'"
  22. v-text="
  23. (
  24. cg_order_type_options.find(
  25. (item) => item.id === sitem.order_type
  26. ) || {}
  27. ).label || '--'
  28. "
  29. ></el-tag>
  30. </template>
  31. <template slot="diff_is_act">
  32. <el-tag
  33. :size="'mini'"
  34. v-text="
  35. (
  36. is_act_options.find((item) => item.value === sitem.diff_is_act) ||
  37. {}
  38. ).label || '--'
  39. "
  40. ></el-tag>
  41. </template>
  42. <template slot="diff_customer_remark">
  43. <el-tag
  44. :size="'mini'"
  45. v-if="sitem.diff_is_act === '1'"
  46. v-text="
  47. (
  48. customer_remark_options.find(
  49. (item) => item.value === sitem.diff_customer_remark
  50. ) || {}
  51. ).label || '--'
  52. "
  53. ></el-tag>
  54. <el-tag :size="'mini'" v-else v-text="'--'"></el-tag>
  55. </template>
  56. </show-data-table>
  57. </div>
  58. </template>
  59. <script>
  60. import { columns, statusOptions } from "./columns";
  61. import { cg_order_type_options } from "@/assets/js/statusList";
  62. //————————————————
  63. import mixinPage from "@/mixins/elPaginationHandle";
  64. import resToken from "@/mixins/resToken";
  65. import asyncRequest from "@/apis/service/purchaseIn/purchaseDiffOrder";
  66. export default {
  67. mixins: [mixinPage, resToken],
  68. props: ["queryId"],
  69. data() {
  70. return {
  71. cg_order_type_options,
  72. statusOptions,
  73. status: "",
  74. orderCode:"",
  75. customer_remark_options: [
  76. {
  77. value: "1",
  78. label: "竞价订单减工差",
  79. },
  80. {
  81. value: "2",
  82. label: "竞价订单不减工差",
  83. },
  84. ],
  85. is_act_options: [
  86. {
  87. value: "1",
  88. label: "接受工差",
  89. },
  90. {
  91. value: "2",
  92. label: "不接受工差-退回重做",
  93. },
  94. ],
  95. //——————————————————————
  96. columns,
  97. newTime: "",
  98. sitem: null,
  99. loading: false,
  100. };
  101. },
  102. mounted() {
  103. this.initData();
  104. },
  105. methods: {
  106. getNewTime() {
  107. this.newTime = new Date().valueOf();
  108. },
  109. async initData() {
  110. this.loading = true;
  111. const res = await asyncRequest.detail({ id: this.queryId });
  112. if (res && res.code === 0 && res.data) {
  113. this.sitem = res.data;
  114. const { can, status, cgdNo } = this.sitem;
  115. this.status = status;
  116. this.orderCode = cgdNo;
  117. if (can && can.length > 0) {
  118. this.sitem.class_cat = "";
  119. can.forEach((x, i) => {
  120. this.sitem.class_cat += i === 0 ? x.name : "/" + x.name;
  121. });
  122. }
  123. this.getNewTime();
  124. // if (this.order_type === "2") {
  125. // this.order_type = res.data.cgdNo;
  126. // this.statusOptions.unshift({ value: "0", label: "竞价单" });
  127. // }
  128. // this.order_type === "1" ? "CGGCD" : "ZXGCD";
  129. // this.order_type = res.data.order_type;
  130. } else if (res && res.code >= 100 && res.code <= 104) {
  131. await this.logout();
  132. } else {
  133. this.$message.warning(res.message);
  134. }
  135. this.loading = false;
  136. },
  137. },
  138. };
  139. </script>
  140. <style>
  141. </style>