index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <div class="othOrderModifyAddressLog pagePadding">
  3. <div v-if="powers && powers.length > 0 && powers.some((item) => item == '001')">
  4. <ex-table
  5. v-loading="loading"
  6. :table="table"
  7. :data="tableData"
  8. :columns="columns"
  9. :page="pageInfo"
  10. :size="size"
  11. @page-curr-change="handlePageChange"
  12. @page-size-change="handleSizeChange"
  13. @screen-reset="
  14. pageInfo.curr = 1;
  15. parmValue.page = 1;
  16. searchList();
  17. "
  18. @screen-submit="
  19. pageInfo.curr = 1;
  20. parmValue.page = 1;
  21. searchList();
  22. "
  23. >
  24. <template #table-header="{}">
  25. <div style="width: 100%">
  26. <el-row style="padding: 0 0 0 80px">
  27. <el-col :span="6" style="width: 293px">
  28. <period-date-picker
  29. :type="1"
  30. :width="'135px'"
  31. :size="searchSize"
  32. :start="parmValue.start_date"
  33. :end="parmValue.end_date"
  34. @timeReturned="handleTime"
  35. />
  36. </el-col>
  37. <el-col :span="4" style="width: 380px; padding: 0 0 0 10px">
  38. <el-input
  39. :size="searchSize"
  40. v-model="parmValue.tid"
  41. :maxlength="40"
  42. @blur="
  43. pageInfo.curr = 1;
  44. parmValue.page = 1;
  45. searchList();
  46. "
  47. placeholder="平台订单号"
  48. />
  49. </el-col>
  50. <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
  51. <el-button type="primary" :size="searchSize" @click="searchList">
  52. 刷新
  53. </el-button>
  54. </el-col>
  55. <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
  56. <el-button type="warning" :size="searchSize" @click="restSearch">
  57. 重置
  58. </el-button>
  59. </el-col>
  60. </el-row>
  61. </div></template
  62. >
  63. <template #type="{ scope }">
  64. <el-tag
  65. :size="tablebtnSize"
  66. :type="''"
  67. v-text="
  68. (type_list.find((item) => item.value == scope.row.type + '') || {}).label ||
  69. '--'
  70. "
  71. ></el-tag>
  72. </template>
  73. <template #is_del="{ scope }">
  74. <el-tag
  75. :size="tablebtnSize"
  76. :type="
  77. (is_del_list.find((item) => item.value == scope.row.is_del + '') || {})
  78. .type || '--'
  79. "
  80. v-text="
  81. (is_del_list.find((item) => item.value == scope.row.is_del + '') || {})
  82. .label || '--'
  83. "
  84. ></el-tag>
  85. </template>
  86. </ex-table>
  87. </div>
  88. <no-auth v-else></no-auth>
  89. </div>
  90. </template>
  91. <script>
  92. import asyncRequest from "@/apis/service/youzan/othOrderModifyAddressLog";
  93. import mixinPage from "@/mixins/elPaginationHandle";
  94. import { mapGetters } from "vuex";
  95. import resToken from "@/mixins/resToken";
  96. import { columns, type_list, is_del_list } from "./columns";
  97. export default {
  98. name: "othOrderModifyAddressLog",
  99. mixins: [mixinPage, resToken],
  100. computed: {
  101. //组件SIZE设置
  102. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  103. powers() {
  104. let tran =
  105. this.$store.getters.btnList.find(
  106. (item) => item.menu_route == "othOrderModifyAddressLog"
  107. ) || {};
  108. if (tran && tran.action && tran.action.length > 0) {
  109. return tran.action;
  110. } else {
  111. return [];
  112. }
  113. },
  114. },
  115. data() {
  116. return {
  117. loading: false,
  118. sitem: {},
  119. showRateModel: false,
  120. modelRateId: "000",
  121. sitemRate: {},
  122. select: "1",
  123. sinput: "",
  124. parmValue: {
  125. page: 1, // 页码
  126. size: 15, // 每页显示条数
  127. tid: "",
  128. start_date: "",
  129. end_date: "",
  130. },
  131. // 表格 - 数据
  132. tableData: [],
  133. // 表格 - 参数
  134. table: {
  135. stripe: true,
  136. border: true,
  137. _defaultHeader_: ["setcol"],
  138. },
  139. // 表格 - 分页
  140. pageInfo: {
  141. size: 15,
  142. curr: 1,
  143. total: 0,
  144. },
  145. // 表格 - 列参数
  146. columns,
  147. type_list,
  148. is_del_list,
  149. };
  150. },
  151. mounted() {
  152. this.searchList();
  153. },
  154. methods: {
  155. restSearch() {
  156. // 表格 - 分页
  157. this.pageInfo = {
  158. size: 15,
  159. curr: 1,
  160. total: 0,
  161. };
  162. this.parmValue = {
  163. page: 1, // 页码
  164. size: 15, // 每页显示条数
  165. tid: "",
  166. start_date: "",
  167. end_date: "",
  168. };
  169. this.searchList();
  170. },
  171. async handleTime(e) {
  172. this.parmValue.start_date = e.startTime || "";
  173. this.parmValue.end_date = e.endTime || "";
  174. if (
  175. (this.parmValue.start_date !== "" && this.parmValue.end_date !== "") ||
  176. (this.parmValue.start_date === "" && this.parmValue.end_date === "")
  177. ) {
  178. this.pageInfo.curr = 1;
  179. this.parmValue.page = 1;
  180. await this.searchList();
  181. }
  182. },
  183. //点击详情
  184. getRouter(toRouter, queryId) {
  185. if (toRouter && queryId) {
  186. let model = {
  187. id: queryId,
  188. type: "view",
  189. };
  190. //有多选框的条件
  191. this.parmValue.select = this.select;
  192. // this.parmValue.sselect = this.sselect ;
  193. this.parmValue.sinput = this.sinput;
  194. //
  195. console.log(this.parmValue);
  196. let routerModel = {
  197. options: JSON.parse(JSON.stringify(this.parmValue)),
  198. router: this.$route.path,
  199. };
  200. model.preModel = JSON.stringify(routerModel);
  201. this.routeGoto(toRouter, model);
  202. } else {
  203. this.$message.warning("暂未找到相关流程!");
  204. }
  205. },
  206. // 刷新表格
  207. async searchList() {
  208. if (this.loading) return;
  209. if (
  210. (this.parmValue.start !== "" && this.parmValue.end === "") ||
  211. (this.parmValue.start === "" && this.parmValue.end !== "")
  212. ) {
  213. this.$message.warning("时间区间不完整!");
  214. return;
  215. }
  216. this.loading = true;
  217. const { code, data } = await asyncRequest.list(this.parmValue);
  218. if (code === 0) {
  219. const { list, count } = data ?? {};
  220. let arr = list ?? [];
  221. arr.map((e) => {
  222. for (let key in e.data) {
  223. e[`key_${key}`] = e.data[key];
  224. }
  225. return e;
  226. });
  227. this.tableData = arr;
  228. this.pageInfo.total = count ?? 0;
  229. } else if (code >= 100 && code <= 104) {
  230. await this.logout();
  231. } else {
  232. this.tableData = [];
  233. this.pageInfo.total = 0;
  234. }
  235. this.loading = false;
  236. },
  237. },
  238. };
  239. </script>
  240. <style lang="scss" scoped>
  241. .othOrderModifyAddressLog {
  242. .my-breadcrumb {
  243. .my-breadcrumb-item {
  244. float: left;
  245. span {
  246. height: 32px;
  247. line-height: 32px;
  248. }
  249. .label {
  250. padding: 0 5px 0 0;
  251. color: 010101;
  252. }
  253. .separator {
  254. color: #787878;
  255. font-size: 13px;
  256. padding: 0 5px 0 0;
  257. }
  258. &:last-child {
  259. .label {
  260. color: #787878;
  261. }
  262. }
  263. &:hover {
  264. cursor: pointer;
  265. }
  266. &:last-child {
  267. cursor: default;
  268. }
  269. &:only-child {
  270. cursor: pointer;
  271. }
  272. // &.chover {
  273. // cursor: pointer;
  274. // }
  275. }
  276. }
  277. }
  278. </style>