main.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <div>
  3. <el-dialog title="详情" :visible.sync="dialogTableVisible" width="1280px">
  4. <detailDatatable
  5. :newTime="newTime"
  6. v-if="newTime !== ''"
  7. :sitem="sitem"
  8. :columns="columns"
  9. :border="true"
  10. >
  11. <template slot="status">
  12. <el-tag
  13. :size="'mini'"
  14. :type="sitem.status == '0' ? 'warning' : ''"
  15. v-text="
  16. (statusOptions.find((item) => item.value == sitem.status) || {}).label ||
  17. '--'
  18. "
  19. ></el-tag>
  20. </template>
  21. </detailDatatable>
  22. </el-dialog>
  23. <ex-table
  24. v-loading="loading"
  25. :table="table"
  26. :data="tableData"
  27. :columns="listColumens"
  28. :page="pageInfo"
  29. :size="size"
  30. @page-curr-change="handlePageChange"
  31. @page-size-change="handleSizeChange"
  32. @screen-reset="
  33. pageInfo.curr = 1;
  34. parmValue.page = 1;
  35. searchList();
  36. "
  37. @screen-submit="
  38. pageInfo.curr = 1;
  39. parmValue.page = 1;
  40. searchList();
  41. "
  42. >
  43. <template #status="{ scope }">
  44. <el-tag
  45. :size="tablebtnSize"
  46. :type="scope.row.status == '0' ? 'warning' : ''"
  47. v-text="
  48. (statusList.find((item) => item.value == scope.row.status) || {}).label ||
  49. '--'
  50. "
  51. ></el-tag>
  52. </template>
  53. <template #operation="{ scope }">
  54. <el-tooltip effect="dark" content="详情" placement="top">
  55. <i class="el-icon-view tb-icon" @click="dilog(scope.row.thNo)"></i>
  56. </el-tooltip>
  57. </template>
  58. </ex-table>
  59. </div>
  60. </template>
  61. <script>
  62. import { columns, statusOptions, listColumens } from "./columns";
  63. // import { cg_order_type_options } from "@/assets/js/statusList";
  64. //————————————————
  65. import mixinPage from "@/mixins/elPaginationHandle";
  66. import resToken from "@/mixins/resToken";
  67. import asyncRequest from "@/apis/service/sellOut/returnOrder";
  68. import { mapGetters } from "vuex";
  69. import detailDatatable from "../detail-data-table";
  70. export default {
  71. components: {
  72. detailDatatable,
  73. },
  74. mixins: [mixinPage, resToken],
  75. computed: {
  76. ...mapGetters(["tablebtnSize", "searchSize", "size", "private_field"]),
  77. powers() {
  78. const tran =
  79. this.$store.getters.btnList.find(
  80. (item) => item.menu_route == "standingBookDetail"
  81. ) || {};
  82. const { action } = tran ?? {};
  83. return action ?? [];
  84. },
  85. },
  86. props: ["queryId"],
  87. data() {
  88. return {
  89. loading: true,
  90. dialogTableVisible: false,
  91. parmValue: {
  92. order_type: "",
  93. order_code: "", //销售订单编号
  94. thNo: "", //退货编号
  95. out_code: "", //销售出库编号
  96. return_code: "", //售后退货编号
  97. post_compay: "", //物流公司
  98. post_code: "", //物流单号
  99. start: "", //
  100. end: "", //
  101. status: "", //状态节点
  102. customer_code: "", //退货客户编号
  103. supplierName: "",
  104. page: 1, // 页码
  105. size: 15, // 每页显示条数
  106. },
  107. // 表格 - 数据
  108. tableData: [],
  109. // 表格 - 参数
  110. table: {
  111. stripe: true,
  112. border: true,
  113. // _defaultHeader_: ["setcol"],
  114. },
  115. // 表格 - 分页
  116. pageInfo: {
  117. size: 15,
  118. curr: 1,
  119. total: 0,
  120. },
  121. // 表格 - 列参数
  122. listColumens,
  123. statusList: [
  124. { value: "0", label: "待申请" },
  125. { value: "1", label: "待验收" },
  126. { value: "2", label: "待验收审核" },
  127. { value: "3", label: "待业务审核" },
  128. { value: "4", label: "完成退货" },
  129. ],
  130. // cg_order_type_options,
  131. orderCode: "",
  132. statusOptions,
  133. // cost_detailArr: [],
  134. //——————————————————————
  135. columns,
  136. newTime: "",
  137. status: "",
  138. sitem: null,
  139. loading: false,
  140. };
  141. },
  142. mounted() {
  143. this.searchList();
  144. },
  145. methods: {
  146. getNewTime() {
  147. this.newTime = new Date().valueOf();
  148. },
  149. async initData(code) {
  150. this.newTime = "";
  151. let model = {
  152. thNo: code,
  153. };
  154. const res = await asyncRequest.detail(model);
  155. if (res && res.code === 0 && res.data) {
  156. this.sitem = res.data;
  157. const { status, orderCode, can } = this.sitem;
  158. this.status = status;
  159. this.orderCode = orderCode;
  160. if (can && can.length > 0) {
  161. this.sitem.class_cat = "";
  162. can.forEach((x, i) => {
  163. this.sitem.class_cat += i === 0 ? x.name : "/" + x.name;
  164. });
  165. }
  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 searchList() {
  174. //通过订单编号去查询所有列表、当订单编号为空时,所有涉及字段不展示
  175. this.parmValue.order_code = this.queryId;
  176. this.loading = true;
  177. let model = JSON.parse(JSON.stringify(this.parmValue));
  178. model.post_compay = model.post_compay.toString();
  179. const res = await asyncRequest.list(model);
  180. if (res && res.code === 0 && res.data) {
  181. this.tableData = res.data.list;
  182. this.pageInfo.total = Number(res.data.count);
  183. } else if (res && res.code >= 100 && res.code <= 104) {
  184. await this.logout();
  185. } else {
  186. this.tableData = [];
  187. this.pageInfo.total = 0;
  188. }
  189. this.loading = false;
  190. },
  191. dilog(thNo) {
  192. this.dialogTableVisible = true;
  193. this.initData(thNo);
  194. },
  195. },
  196. };
  197. </script>
  198. <style></style>