detail.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div class="purchaseOrderDetail pagePadding">
  3. <div
  4. style="width: 100%"
  5. v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
  6. >
  7. <div class="tr" style="height: 50px; padding: 10px 0 0 0">
  8. <el-button
  9. class="fr"
  10. type="primary"
  11. plain
  12. :size="'mini'"
  13. style="margin: 0 0 0 10px"
  14. @click="showModel = true"
  15. >新建售后申请单
  16. </el-button>
  17. </div>
  18. <status-bar
  19. v-if="newTime !== ''"
  20. :newTime="newTime"
  21. :options="statusOptions"
  22. :status="status"
  23. />
  24. <el-collapse v-model="activeNames">
  25. <el-collapse-item title="咨询出库单详情" name="1">
  26. <add-edit-form
  27. :sitem="sitem"
  28. :newTime="newTime"
  29. v-if="newTime != ''"
  30. ></add-edit-form>
  31. </el-collapse-item>
  32. <el-collapse-item title="填写物流" name="2">
  33. <logistics-form
  34. :sitem="sitem"
  35. :newTime="newTime"
  36. v-if="newTime != ''"
  37. @refresh="initData()"
  38. />
  39. </el-collapse-item>
  40. <el-collapse-item title="客户验收" name="3">
  41. <div class="tr" style="padding: 0 20px 20px 0">
  42. <el-button
  43. type="primary"
  44. plain
  45. :size="'mini'"
  46. @click="customerCheck"
  47. >客户已收到货</el-button
  48. >
  49. </div>
  50. </el-collapse-item>
  51. <el-collapse-item title="审批记录" name="10">
  52. <process-time-line
  53. v-if="newTime !== ''"
  54. :newTime="newTime"
  55. :type="'SHD'"
  56. :orderCode="orderCode"
  57. />
  58. </el-collapse-item>
  59. </el-collapse>
  60. <div>
  61. <add-Edit-A
  62. :id="'add'"
  63. :sitem="sitem"
  64. :show-model="showModel"
  65. :is-detail="false"
  66. @refresh="initData"
  67. @cancel="showModel = false"
  68. />
  69. </div>
  70. </div>
  71. <div v-else>
  72. <no-auth></no-auth>
  73. </div>
  74. </div>
  75. </template>
  76. <script>
  77. import mixinPage from "@/mixins/elPaginationHandle";
  78. import resToken from "@/mixins/resToken";
  79. import asyncRequest from "@/apis/service/sheetOrder/zxoutOrder";
  80. import addEditForm from "./components/addEditForm.vue";
  81. import logisticsForm from "./components/logisticsForm";
  82. import addEditA from "./components/addEditA";
  83. export default {
  84. name: "zxoutOrderDetail",
  85. mixins: [mixinPage, resToken],
  86. components: {
  87. addEditForm,
  88. addEditA,
  89. logisticsForm,
  90. },
  91. computed: {
  92. powers() {
  93. let tran =
  94. this.$store.getters.btnList.find(
  95. (item) => item.menu_route == "zxoutOrderDetail"
  96. ) || {};
  97. if (tran && tran.action && tran.action.length > 0) {
  98. return tran.action;
  99. } else {
  100. return [];
  101. }
  102. },
  103. },
  104. data() {
  105. return {
  106. activeNames: ["0", "1", "2", "3", "4", "10"],
  107. status: "", //存储详情接口状态
  108. statusList: [],
  109. sitem: null,
  110. newTime: "",
  111. showModel: false,
  112. loading: false,
  113. statusOptions: [
  114. { value: "0", label: "待发货" },
  115. { value: "1", label: "待验收" },
  116. { value: "2", label: "已完成" },
  117. // { value: "3", label: "已完成" },
  118. ],
  119. code: "",
  120. };
  121. },
  122. mounted() {
  123. this.code = this.$route.query.id;
  124. console.log(this.code);
  125. this.initData();
  126. },
  127. methods: {
  128. getNewTime() {
  129. this.newTime = new Date().valueOf();
  130. },
  131. async setstatus() {
  132. const model = {
  133. orderCode: "",
  134. status: "",
  135. outCode: this.code,
  136. };
  137. let res = await asyncRequest.status(model);
  138. if (res && res.code === 0) {
  139. this.$notify.success({
  140. title: "修改成功!",
  141. message: "",
  142. });
  143. await this.initData();
  144. } else if (res && res.code >= 100 && res.code <= 104) {
  145. await this.logout();
  146. } else {
  147. this.$message.warning(res.message);
  148. }
  149. },
  150. async initData() {
  151. let model = {
  152. outCode: this.code,
  153. };
  154. const res = await asyncRequest.detail(model);
  155. if (res && res.code === 0 && res.data) {
  156. this.sitem = res.data;
  157. const { can } = this.sitem;
  158. this.sitem.class_cat = "";
  159. if (can && can.length > 0) {
  160. can.forEach((x, i) => {
  161. this.sitem.class_cat += i === 0 ? x.name : "/" + x.name;
  162. });
  163. }
  164. const { status } = res.data;
  165. this.status = status;
  166. this.getNewTime();
  167. } else if (res && res.code >= 100 && res.code <= 104) {
  168. await this.logout();
  169. } else {
  170. this.$message.warning(res.message);
  171. }
  172. },
  173. async customerCheck() {
  174. let model = {
  175. outCode: this.code,
  176. orderCode: this.sitem.orderCode,
  177. status: "3",
  178. };
  179. const res = await asyncRequest.status(model);
  180. if (res && res.code === 0) {
  181. await this.initData();
  182. } else if (res && res.code >= 100 && res.code <= 104) {
  183. await this.logout();
  184. } else {
  185. this.$message.warning(res.message);
  186. }
  187. },
  188. },
  189. };
  190. </script>