detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <template>
  2. <div>
  3. <Anchor height="900px" :data="anchorArray">
  4. <div style="width: 100%" v-if="tableData">
  5. <el-collapse v-model="activeNames" style="margin: -8px 0 0 0">
  6. <div id="detail1" v-if="tableData.order_type">
  7. <el-collapse-item title="商品信息" name="1">
  8. <goodsDataTable
  9. :newTime="newTime"
  10. v-if="newTime !== ''"
  11. :type="tableData.order_type"
  12. :skucode="tableData.skuCode"
  13. :spucode="tableData.spuCode"
  14. :iscgd="true"
  15. />
  16. </el-collapse-item>
  17. </div>
  18. <div id="detail2" v-if="tableData.cgdNo">
  19. <el-collapse-item
  20. title="采购——采购单"
  21. name="2"
  22. v-if="newTime !== ''"
  23. >
  24. <detail2 :queryId="tableData.cgdNo"> </detail2>
  25. </el-collapse-item>
  26. </div>
  27. <div id="detail3" v-if="tableData.wsm_in_code">
  28. <el-collapse-item
  29. title="采购——入库单"
  30. name="3"
  31. v-if="newTime !== ''"
  32. >
  33. <detail3 :queryId="tableData.wsm_in_code"> </detail3>
  34. </el-collapse-item>
  35. </div>
  36. <div id="detail4" v-if="tableData.cgdReturnCode">
  37. <el-collapse-item
  38. title="采购——退货单"
  39. name="4"
  40. v-if="newTime !== ''"
  41. >
  42. <detail4 :queryId="tableData.cgdReturnCode"> </detail4>
  43. </el-collapse-item>
  44. </div>
  45. <!-- 编号id -->
  46. <div id="detail5" v-if="tableData.cgd_diff_id">
  47. <el-collapse-item
  48. title="采购——工差单"
  49. name="5"
  50. v-if="newTime !== ''"
  51. >
  52. <detail5 :queryId="tableData.cgd_diff_id"> </detail5>
  53. </el-collapse-item>
  54. </div>
  55. <div id="detail6" v-if="tableData.projectNo">
  56. <el-collapse-item title="销售——项目" name="6" v-if="newTime !== ''">
  57. <detail6 :queryId="tableData.projectNo"> </detail6>
  58. </el-collapse-item>
  59. </div>
  60. <div id="detail7" v-if="tableData.infoNo">
  61. <el-collapse-item
  62. title="销售——竞价单"
  63. name="7"
  64. v-if="newTime !== ''"
  65. >
  66. <detail7 :queryId="tableData.infoNo"> </detail7>
  67. </el-collapse-item>
  68. </div>
  69. <div id="detail8" v-if="tableData.bargainNo">
  70. <el-collapse-item
  71. title="销售——议价单"
  72. name="8"
  73. v-if="newTime !== ''"
  74. >
  75. <detail8 :queryId="tableData.bargainNo"> </detail8>
  76. </el-collapse-item>
  77. </div>
  78. <!-- 编号id -->
  79. <div id="detail9" v-if="tableData.bk_code">
  80. <el-collapse-item
  81. title="销售——备货申请单"
  82. name="9"
  83. v-if="newTime !== ''"
  84. >
  85. <detail9 :queryId="tableData.bk_code"> </detail9>
  86. </el-collapse-item>
  87. </div>
  88. <!-- 编号id -->
  89. <div id="detail10" v-if="tableData.orderCode">
  90. <el-collapse-item
  91. title="销售——销售订单"
  92. name="10"
  93. v-if="newTime !== ''"
  94. >
  95. <detail10 :queryId="tableData.orderCode"> </detail10>
  96. </el-collapse-item>
  97. </div>
  98. <div id="detail11" v-if="tableData.outCode">
  99. <el-collapse-item
  100. title="销售——发货申请单"
  101. name="11"
  102. v-if="newTime !== ''"
  103. >
  104. <detail11 :queryId="tableData.outCode"> </detail11>
  105. </el-collapse-item>
  106. </div>
  107. <div id="detail12" v-if="tableData.returnCode">
  108. <el-collapse-item
  109. title="销售——售后申请单"
  110. name="12"
  111. v-if="newTime !== ''"
  112. >
  113. <detail12 :queryId="tableData.returnCode"> </detail12>
  114. </el-collapse-item>
  115. </div>
  116. <div id="detail13" v-if="tableData.thNo">
  117. <el-collapse-item
  118. title="销售——售后退货单"
  119. name="13"
  120. v-if="newTime !== ''"
  121. >
  122. <detail13 :queryId="tableData.thNo"> </detail13>
  123. </el-collapse-item>
  124. </div>
  125. <div id="detail14" v-if="tableData.returnGoodCode">
  126. <el-collapse-item
  127. title="销售——退货单"
  128. name="14"
  129. v-if="newTime !== ''"
  130. >
  131. <detail14 :queryId="tableData.returnGoodCode"> </detail14>
  132. </el-collapse-item>
  133. </div>
  134. <!-- 编号id -->
  135. <div id="detail15" v-if="tableData.sale_diff_id">
  136. <el-collapse-item
  137. title="销售——工差单"
  138. name="15"
  139. v-if="newTime !== ''"
  140. >
  141. <detail15 :queryId="tableData.sale_diff_id"> </detail15>
  142. </el-collapse-item>
  143. </div>
  144. <div id="detail16" v-if="tableData.supplierNo">
  145. <el-collapse-item
  146. title="供应商详情"
  147. name="16"
  148. v-if="newTime !== ''"
  149. >
  150. <detail16 :queryId="tableData.supplierNo"> </detail16>
  151. </el-collapse-item>
  152. </div>
  153. <div id="detail17" v-if="tableData.companyNo">
  154. <el-collapse-item
  155. title="业务公司详情"
  156. name="17"
  157. v-if="newTime !== ''"
  158. >
  159. <detail17 :queryId="tableData.companyNo"> </detail17>
  160. </el-collapse-item>
  161. </div>
  162. <div id="detail18" v-if="tableData.customer_code">
  163. <el-collapse-item
  164. title="企业客户详情"
  165. name="18"
  166. v-if="newTime !== ''"
  167. >
  168. <detail18 :queryId="tableData.customer_code"> </detail18>
  169. </el-collapse-item>
  170. </div>
  171. </el-collapse>
  172. </div>
  173. </Anchor>
  174. </div>
  175. </template>
  176. <script>
  177. import mixinPage from "@/mixins/elPaginationHandle";
  178. import asyncRequest from "@/apis/service/reportQuery/standingBook";
  179. import resToken from "@/mixins/resToken";
  180. import { mapGetters } from "vuex";
  181. //锚点
  182. // import anchorItem from "./anch/anchorItem.vue"
  183. import Anchor from "./anchBook/anchor.vue";
  184. //商品
  185. import goodsDataTable from "./goodsDataTable";
  186. //详情组件
  187. import detail2 from "./components/detail2/main.vue";
  188. import detail3 from "./components/detail3/main.vue";
  189. import detail4 from "./components/detail4/main.vue";
  190. import detail5 from "./components/detail5/main.vue";
  191. import detail6 from "./components/detail6/main.vue";
  192. import detail7 from "./components/detail7/main.vue";
  193. import detail8 from "./components/detail8/main.vue";
  194. import detail9 from "./components/detail9/main.vue";
  195. import detail10 from "./components/detail10/main.vue";
  196. import detail11 from "./components/detail11/main.vue";
  197. import detail12 from "./components/detail12/main.vue";
  198. import detail13 from "./components/detail13/main.vue";
  199. import detail14 from "./components/detail14/main.vue";
  200. import detail15 from "./components/detail15/main.vue";
  201. import detail16 from "./components/detail16/main.vue";
  202. import detail17 from "./components/detail17/main.vue";
  203. import detail18 from "./components/detail18/main.vue";
  204. export default {
  205. name: "test",
  206. mixins: [mixinPage, resToken],
  207. components: {
  208. Anchor,
  209. goodsDataTable,
  210. detail2,
  211. detail3,
  212. detail4,
  213. detail5,
  214. detail6,
  215. detail7,
  216. detail8,
  217. detail9,
  218. detail10,
  219. detail11,
  220. detail12,
  221. detail13,
  222. detail14,
  223. detail15,
  224. detail16,
  225. detail17,
  226. detail18,
  227. },
  228. computed: {
  229. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  230. // powers() {
  231. // let tran =
  232. // this.$store.getters.btnList.find(
  233. // (item) => item.menu_route == "standingBookDetail"
  234. // ) || {};
  235. // if (tran && tran.action && tran.action.length > 0) {
  236. // return tran.action;
  237. // } else {
  238. // return [];
  239. // }
  240. // },
  241. },
  242. data() {
  243. return {
  244. newTime: "",
  245. activeNames: [],
  246. tableData: {},
  247. anchorArray: [
  248. // { tar: "#detail1", title: "商品信息" },
  249. // { tar: "#detail2", title: "采购——采购单" },
  250. // { tar: "#detail3", title: "采购——入库单" },
  251. // { tar: "#detail4", title: "采购——退货单" },
  252. // { tar: "#detail5", title: "采购——工差单" },
  253. // { tar: "#detail6", title: "销售——项目" },
  254. // { tar: "#detail7", title: "销售——竞价单" },
  255. // { tar: "#detail8", title: "销售——议价单" },
  256. // { tar: "#detail9", title: "销售——备货申请单" },
  257. // { tar: "#detail10", title: "销售——销售订单" },
  258. // { tar: "#detail11", title: "销售——发货申请单" },
  259. // { tar: "#detail12", title: "销售——售后申请单" },
  260. // { tar: "#detail13", title: "销售——售后退货单" },
  261. // { tar: "#detail14", title: "销售——退货单" },
  262. // { tar: "#detail15", title: "销售——工差单" },
  263. // { tar: "#detail16", title: "供应商详情" },
  264. // { tar: "#detail17", title: "业务公司详情" },
  265. // { tar: "#detail18", title: "企业客户详情" },
  266. ],
  267. };
  268. },
  269. mounted() {
  270. // console.log(11111,this.row)
  271. this.activeNames = [];
  272. for (let i = 1; i < 20; i++) {
  273. this.activeNames.push(i + "");
  274. }
  275. this.initData();
  276. },
  277. methods: {
  278. getNewTime() {
  279. this.newTime = new Date().valueOf();
  280. },
  281. async initData() {
  282. this.loading = true;
  283. const res = await asyncRequest.standbookdetail({
  284. id: this.$route.query.id,
  285. });
  286. if (res && res.code === 0 && res.data) {
  287. console.log(res);
  288. this.tableData = res.data;
  289. this.anchorArrayFn(this.tableData);
  290. this.getNewTime();
  291. } else if (res && res.code >= 100 && res.code <= 104) {
  292. await this.logout();
  293. } else {
  294. this.tableData = [];
  295. }
  296. this.loading = false;
  297. },
  298. anchorArrayFn(obj) {
  299. let arr = [];
  300. let flag = true;
  301. let {
  302. spuCode,
  303. skuCode,
  304. order_type,
  305. projectNo,
  306. infoNo,
  307. bargainNo,
  308. bk_code,
  309. orderCode,
  310. outCode,
  311. returnCode,
  312. thNo,
  313. returnGoodCode,
  314. sale_diff_id,
  315. cgdNo,
  316. wsm_in_code,
  317. cgdReturnCode,
  318. cgd_diff_id,
  319. supplierNo,
  320. companyNo,
  321. customer_code,
  322. } = obj;
  323. (order_type ?? "") != ""
  324. ? arr.push({ tar: "#detail1", title: "商品信息" })
  325. : (flag = false)(cgdNo ?? "") != ""
  326. ? arr.push({ tar: "#detail2", title: "采购——采购单" })
  327. : (flag = false);
  328. (wsm_in_code ?? "") != ""
  329. ? arr.push({ tar: "#detail3", title: "采购——入库单" })
  330. : (flag = false);
  331. (cgdReturnCode ?? "") != ""
  332. ? arr.push({ tar: "#detail4", title: "采购——退货单" })
  333. : (flag = false);
  334. (cgd_diff_id ?? "") != ""
  335. ? arr.push({ tar: "#detail5", title: "采购——工差单" })
  336. : (flag = false);
  337. (projectNo ?? "") != ""
  338. ? arr.push({ tar: "#detail6", title: "销售——项目" })
  339. : (flag = false);
  340. (infoNo ?? "") != ""
  341. ? arr.push({ tar: "#detail7", title: "销售——竞价单" })
  342. : (flag = false);
  343. (bargainNo ?? "") != ""
  344. ? arr.push({ tar: "#detail8", title: "销售——议价单" })
  345. : (flag = false);
  346. (bk_code ?? "") != ""
  347. ? arr.push({ tar: "#detail9", title: "销售——备货申请单" })
  348. : (flag = false);
  349. (orderCode ?? "") != ""
  350. ? arr.push({ tar: "#detail10", title: "销售——销售订单" })
  351. : (flag = false);
  352. (outCode ?? "") != ""
  353. ? arr.push({ tar: "#detail11", title: "销售——发货申请单" })
  354. : (flag = false);
  355. (returnCode ?? "") != ""
  356. ? arr.push({ tar: "#detail12", title: "销售——售后申请单" })
  357. : (flag = false);
  358. (thNo ?? "") != ""
  359. ? arr.push({ tar: "#detail13", title: "销售——售后退货单" })
  360. : (flag = false);
  361. (returnGoodCode ?? "") != ""
  362. ? arr.push({ tar: "#detail14", title: "销售——退货单" })
  363. : (flag = false);
  364. (sale_diff_id ?? "") != ""
  365. ? arr.push({ tar: "#detail15", title: "销售——工差单" })
  366. : (flag = false);
  367. (supplierNo ?? "") != ""
  368. ? arr.push({ tar: "#detail16", title: "供应商详情" })
  369. : (flag = false);
  370. (companyNo ?? "") != ""
  371. ? arr.push({ tar: "#detail17", title: "业务公司详情" })
  372. : (flag = false);
  373. (customer_code ?? "") != ""
  374. ? arr.push({ tar: "#detail18", title: "企业客户详情" })
  375. : (flag = false);
  376. this.anchorArray = arr
  377. },
  378. },
  379. };
  380. </script>
  381. <style lang="scss" scoped>
  382. .purchaseOrderDetail {
  383. }
  384. </style>