main.vue 6.0 KB

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