main.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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. (statusOptions.find((item) => item.value == sitem.status) || {})
  16. .label || '--'
  17. "
  18. ></el-tag>
  19. </template>
  20. <template slot="order_type">
  21. <el-tag :size="'mini'" :type="''">{{
  22. sitem.status === "1" ? "发货申请单" : "竞价发货申请单"
  23. }}</el-tag>
  24. </template>
  25. <template slot="sale_price">
  26. <span>{{
  27. private_field &&
  28. private_field.length > 0 &&
  29. private_field.some((item) => item == "2")
  30. ? sitem.sale_price
  31. : "******"
  32. }}</span>
  33. </template>
  34. <template slot="total_price">
  35. <span>{{
  36. private_field &&
  37. private_field.length > 0 &&
  38. private_field.some((item) => item == "2")
  39. ? sitem.total_price
  40. : "******"
  41. }}</span>
  42. </template>
  43. </detailDatatable>
  44. </el-dialog>
  45. <ex-table
  46. v-loading="loading"
  47. :table="table"
  48. :data="tableData"
  49. :columns="listColumns"
  50. :page="pageInfo"
  51. :size="size"
  52. @page-curr-change="handlePageChange"
  53. @page-size-change="handleSizeChange"
  54. @screen-reset="
  55. pageInfo.curr = 1;
  56. parmValue.page = 1;
  57. searchList();
  58. "
  59. @screen-submit="
  60. pageInfo.curr = 1;
  61. parmValue.page = 1;
  62. searchList();
  63. "
  64. @selection="selection_change"
  65. >
  66. <template #status="{ scope }">
  67. <el-tag
  68. :size="tablebtnSize"
  69. :type="scope.row.status == '0' ? 'warning' : ''"
  70. v-text="
  71. (listStatusOptions.find((item) => item.id == scope.row.status) || {})
  72. .label || '--'
  73. "
  74. ></el-tag>
  75. </template>
  76. <template #operation="{ scope }">
  77. <el-tooltip
  78. effect="dark"
  79. content="详情"
  80. placement="top"
  81. >
  82. <i
  83. class="el-icon-view tb-icon"
  84. @click="dilog(scope.row.outCode)"
  85. ></i>
  86. </el-tooltip>
  87. </template>
  88. </ex-table>
  89. </div>
  90. </template>
  91. <script>
  92. import { columns,listColumns } from "./columns";
  93. // import { cg_order_type_options } from "@/assets/js/statusList";
  94. //————————————————
  95. import mixinPage from "@/mixins/elPaginationHandle";
  96. import resToken from "@/mixins/resToken";
  97. import asyncRequest from "@/apis/service/sellOut/sellOutOrder";
  98. import { mapGetters } from "vuex";
  99. import detailDatatable from "../detail-data-table";
  100. export default {
  101. components:{
  102. detailDatatable
  103. },
  104. computed: {
  105. ...mapGetters(["tablebtnSize", "searchSize", "size", "private_field"]),
  106. powers() {
  107. let tran =
  108. this.$store.getters.btnList.find(
  109. (item) => item.menu_route == "standingBookDetail"
  110. ) || {};
  111. if (tran && tran.action && tran.action.length > 0) {
  112. return tran.action;
  113. } else {
  114. return [];
  115. }
  116. },
  117. },
  118. mixins: [mixinPage, resToken],
  119. props: ["queryId"],
  120. data() {
  121. return {
  122. listColumns,
  123. loading: true,
  124. dialogTableVisible:false,
  125. parmValue: {
  126. order_type: "",
  127. orderCode: "",
  128. apply_name: "", //申请人名称
  129. cgdNo: "",
  130. start: "",
  131. end: "",
  132. // supplierNo: "",
  133. companyNo: "",
  134. good_code: "",
  135. good_name: "",
  136. outCode: "",
  137. status: "",
  138. company_name: "", //申请人部门
  139. page: 1, // 页码
  140. size: 15, // 每页显示条数
  141. },
  142. listStatusOptions: [
  143. { id: "0", label: "待发货" },
  144. { id: "1", label: "待库管发货" },
  145. { id: "2", label: "已发货待收货" },
  146. { id: "3", label: "已收货" },
  147. { id: "4", label: "已全部退货" },
  148. ],
  149. // 表格 - 数据
  150. tableData: [],
  151. // 表格 - 参数
  152. table: {
  153. stripe: true,
  154. border: true,
  155. },
  156. // 表格 - 分页
  157. pageInfo: {
  158. size: 15,
  159. curr: 1,
  160. total: 0,
  161. },
  162. // cg_order_type_options,
  163. // statusOptions,
  164. // cost_detailArr: [],
  165. returnCode: "",
  166. returnCode_type: "",
  167. activeTabs: "1",
  168. activeNames: ["0", "1", "2", "3", "4"],
  169. orderOptions: [
  170. { id: "1", label: "线上商品销售" },
  171. { id: "2", label: "项目线上商品销售" },
  172. { id: "3", label: "竞价单销售" },
  173. { id: "4", label: "项目竞价单销售" },
  174. { id: "5", label: "平台部订单销售" },
  175. ],
  176. statusOptions: [
  177. { value: "0", label: "待采购备货" },
  178. { value: "1", label: "待库管发货" },
  179. { value: "2", label: "已发货待收货" },
  180. { value: "3", label: "已收货" },
  181. { value: "4", label: "已全部退货" },
  182. ],
  183. // 收到货状态
  184. status1Options: [
  185. { id: "1", label: "待业务审核" },
  186. { id: "2", label: "待采购审核" },
  187. { id: "3", label: "待设置仓库" },
  188. { id: "4", label: "待客户退货" },
  189. { id: "5", label: "售后已完成" },
  190. { id: "6", label: "业务已驳回" },
  191. { id: "7", label: "采购已驳回" },
  192. { id: "8", label: "申请已取消" },
  193. ],
  194. // 未收到货状态
  195. status2Options: [
  196. { id: "1", label: "待业务审核" },
  197. { id: "2", label: "待采购审核" },
  198. { id: "3", label: "待同意退货" },
  199. { id: "5", label: "售后已完成" },
  200. { id: "6", label: "业务已驳回" },
  201. { id: "7", label: "采购已驳回" },
  202. { id: "8", label: "申请已取消" },
  203. ],
  204. returnShowColumns: [
  205. {
  206. prop: "is_th",
  207. label: "物流承担方",
  208. _slot_: "is_th",
  209. span: 6,
  210. },
  211. {
  212. prop: "addr",
  213. label: "收货地址",
  214. _slot_: "addr",
  215. span: 18,
  216. },
  217. ],
  218. returnShowResColumns: [
  219. {
  220. prop: "post_fee",
  221. label: "退货物流费用",
  222. span: 6,
  223. },
  224. {
  225. prop: "post_company",
  226. label: "退货物流公司",
  227. span: 6,
  228. },
  229. {
  230. prop: "post_code",
  231. label: "退货物流单号",
  232. span: 12,
  233. },
  234. ],
  235. expect_options: [],
  236. expect_options1: [
  237. {
  238. value: "1",
  239. label: "退货",
  240. },
  241. {
  242. value: "2",
  243. label: "换货",
  244. },
  245. ],
  246. expect_options0: [
  247. {
  248. value: "1",
  249. label: "退货",
  250. },
  251. {
  252. value: "2",
  253. label: "补发",
  254. },
  255. ],
  256. is_th_options: [
  257. {
  258. value: "1",
  259. label: "收货人承担",
  260. },
  261. {
  262. value: "2",
  263. label: "业务公司承担",
  264. },
  265. {
  266. value: "3",
  267. label: "供应商承担",
  268. },
  269. ],
  270. //——————————————————————
  271. columns,
  272. newTime: "",
  273. status: "",
  274. sitem: null,
  275. loading: false,
  276. did: "", //详情页上的id
  277. };
  278. },
  279. mounted() {
  280. this.searchList()
  281. },
  282. methods: {
  283. getNewTime() {
  284. this.newTime = new Date().valueOf();
  285. },
  286. async initData(outCode) {
  287. this.returnCode = "";
  288. this.returnCode_type = "";
  289. let model = {
  290. // outCode: this.queryId,
  291. outCode: outCode,
  292. };
  293. const res = await asyncRequest.detail(model);
  294. if (res && res.code === 0 && res.data) {
  295. this.sitem = res.data;
  296. const { status, can, id, order_return } = this.sitem;
  297. this.status = status;
  298. this.did = id;
  299. if (order_return) {
  300. this.returnCode = order_return.returnCode;
  301. this.returnCode_type = order_return.status;
  302. await this.receive_initData(this.returnCode);
  303. }
  304. this.getNewTime();
  305. } else if (res && res.code >= 100 && res.code <= 104) {
  306. await this.logout();
  307. } else {
  308. this.$message.warning(res.message);
  309. }
  310. },
  311. async receive_initData(code) {
  312. let model = {
  313. returnCode: code,
  314. };
  315. const res = await asyncRequest.afterinfo(model);
  316. if (res && res.code === 0 && res.data) {
  317. this.resitem = res.data;
  318. this.resitem.error_img = this.resitem.error_img.split(",");
  319. this.expect_options = JSON.parse(
  320. JSON.stringify(
  321. this.resitem.is_receive === "1"
  322. ? this.expect_options1
  323. : this.expect_options0
  324. )
  325. );
  326. } else if (res && res.code >= 100 && res.code <= 104) {
  327. await this.logout();
  328. } else {
  329. this.$message.warning(res.message);
  330. }
  331. },
  332. async searchList() {
  333. //通过订单编号去查询所有列表、当订单编号为空时,所有涉及字段不展示
  334. this.parmValue.orderCode = this.queryId;
  335. this.loading = true;
  336. let model = JSON.parse(JSON.stringify(this.parmValue));
  337. const res = await asyncRequest.list(model);
  338. if (res && res.code === 0 && res.data) {
  339. this.tableData = res.data.list;
  340. this.pageInfo.total = Number(res.data.count);
  341. this.tableData.forEach((v) => {
  342. v.good_class = "";
  343. if (v.can && v.can.length > 0) {
  344. v.can.forEach((x, i) => {
  345. v.good_class += i === 0 ? x.name : "/" + x.name;
  346. });
  347. }
  348. });
  349. } else if (res && res.code >= 100 && res.code <= 104) {
  350. await this.logout();
  351. } else {
  352. this.tableData = [];
  353. this.pageInfo.total = 0;
  354. }
  355. this.loading = false;
  356. },
  357. dilog(outCode){
  358. this.dialogTableVisible = true;
  359. this.initData(outCode);
  360. }
  361. },
  362. };
  363. </script>
  364. <style>
  365. </style>