main.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. import mixinPage from "@/mixins/elPaginationHandle";
  65. import resToken from "@/mixins/resToken";
  66. import asyncRequest from "@/apis/service/sellOut/deliveryWorkOrder";
  67. import { mapGetters } from "vuex";
  68. import detailDatatable from "../detail-data-table";
  69. export default {
  70. components: {
  71. detailDatatable,
  72. },
  73. mixins: [mixinPage, resToken],
  74. computed: {
  75. ...mapGetters(["tablebtnSize", "searchSize", "size", "private_field"]),
  76. powers() {
  77. const tran =
  78. this.$store.getters.btnList.find(
  79. (item) => item.menu_route == "standingBookDetail"
  80. ) || {};
  81. const { action } = tran ?? {};
  82. return action ?? [];
  83. },
  84. },
  85. props: ["queryId"],
  86. data() {
  87. return {
  88. loading: true,
  89. dialogTableVisible: false,
  90. parmValue: {
  91. order_type: "",
  92. order_code: "", //销售订单编号
  93. thNo: "", //退货编号
  94. out_code: "", //销售出库编号
  95. return_code: "", //售后退货编号
  96. post_compay: "", //物流公司
  97. post_code: "", //物流单号
  98. start: "", //
  99. end: "", //
  100. status: "", //状态节点
  101. customer_code: "", //退货客户编号
  102. supplierName: "",
  103. page: 1, // 页码
  104. size: 15, // 每页显示条数
  105. },
  106. // 表格 - 数据
  107. tableData: [],
  108. // 表格 - 参数
  109. table: {
  110. stripe: true,
  111. border: true,
  112. // _defaultHeader_: ["setcol"],
  113. },
  114. // 表格 - 分页
  115. pageInfo: {
  116. size: 15,
  117. curr: 1,
  118. total: 0,
  119. },
  120. // 表格 - 列参数
  121. listColumens,
  122. statusList: [
  123. { value: "0", label: "待申请" },
  124. { value: "1", label: "待验收" },
  125. { value: "2", label: "待验收审核" },
  126. { value: "3", label: "待业务审核" },
  127. { value: "4", label: "完成退货" },
  128. ],
  129. // cg_order_type_options,
  130. orderCode: "",
  131. statusOptions,
  132. // cost_detailArr: [],
  133. //——————————————————————
  134. columns,
  135. newTime: "",
  136. status: "",
  137. sitem: null,
  138. loading: false,
  139. };
  140. },
  141. mounted() {
  142. this.searchList();
  143. },
  144. methods: {
  145. getNewTime() {
  146. this.newTime = new Date().valueOf();
  147. },
  148. async initData(code) {
  149. this.newTime = "";
  150. let model = {
  151. thNo: code,
  152. };
  153. const res = await asyncRequest.detail(model);
  154. if (res && res.code === 0 && res.data) {
  155. this.sitem = res.data;
  156. const { status, orderCode, can } = this.sitem;
  157. this.status = status;
  158. this.orderCode = orderCode;
  159. if (can && can.length > 0) {
  160. this.sitem.class_cat = "";
  161. can.forEach((x, i) => {
  162. this.sitem.class_cat += i === 0 ? x.name : "/" + x.name;
  163. });
  164. }
  165. this.getNewTime();
  166. } else if (res && res.code >= 100 && res.code <= 104) {
  167. await this.logout();
  168. } else {
  169. this.$message.warning(res.message);
  170. }
  171. },
  172. async searchList() {
  173. //通过订单编号去查询所有列表、当订单编号为空时,所有涉及字段不展示
  174. this.parmValue.order_code = this.queryId;
  175. this.loading = true;
  176. let model = JSON.parse(JSON.stringify(this.parmValue));
  177. model.post_compay = model.post_compay.toString();
  178. const res = await asyncRequest.list(model);
  179. if (res && res.code === 0 && res.data) {
  180. this.tableData = res.data.list;
  181. this.pageInfo.total = Number(res.data.count);
  182. } else if (res && res.code >= 100 && res.code <= 104) {
  183. await this.logout();
  184. } else {
  185. this.tableData = [];
  186. this.pageInfo.total = 0;
  187. }
  188. this.loading = false;
  189. },
  190. dilog(thNo) {
  191. this.dialogTableVisible = true;
  192. this.initData(thNo);
  193. },
  194. },
  195. };
  196. </script>
  197. <style></style>