detail.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. <template>
  2. <div class="goodsOnlineDetail">
  3. <div class="goodsOnlineDetail-main" v-if="powers.some((i) => i == '007')">
  4. <el-tabs v-model="activeTabs">
  5. <el-tab-pane label="商品上线详情" name="1" v-if="queryType !== 'add'">
  6. <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
  7. <el-collapse-item title="商品上线详情" name="0">
  8. <show-data-table
  9. :newTime="newTime"
  10. v-if="newTime !== ''"
  11. :sitem="sitem"
  12. :columns="public_listCol"
  13. >
  14. <template slot="proof_id">
  15. <el-popover
  16. placement="top"
  17. width="300"
  18. trigger="hover"
  19. v-if="sitem.proof.proof_type === '1'"
  20. >
  21. <video width="275" controls class="fl">
  22. <source :src="sitem.proof.proof_url" type="video/mp4" />
  23. <source :src="sitem.proof.proof_url" type="video/avi" />您的浏览器不支持Video标签。
  24. </video>
  25. <i
  26. class="el-icon-video-camera-solid hover"
  27. style="font-size: 18px"
  28. slot="reference"
  29. ></i>
  30. </el-popover>
  31. <img
  32. v-else-if="sitem.proof.proof_type + '' === '2'"
  33. style="width: 23px; height: 23px"
  34. :src="sitem.proof.proof_url"
  35. class="avatar fl hover"
  36. v-viewer
  37. />
  38. <a
  39. v-else-if="sitem.proof.proof_type + '' === '3'"
  40. :href="sitem.proof.proof_url"
  41. download="凭证文件"
  42. >点击下载</a>
  43. <span v-else>暂无凭证</span>
  44. </template>
  45. <template slot="is_combind">{{String(sitem.is_combind) === '1' ? '组合商品' : '非组合商品'}}</template>
  46. <tempalte slot="is_fixed">{{String(sitem.is_fixed) === "0" ? '实时金价' : '一口价'}}</tempalte>
  47. <template slot="good_name">
  48. <img
  49. v-viewer
  50. style="width: 23px; height: 23px; margin: 0 5px 0 0"
  51. class="fl"
  52. v-if="sitem.good_thumb_img"
  53. :src="sitem.good_thumb_img"
  54. alt
  55. />
  56. <span>{{ sitem.good_name }}</span>
  57. <span v-for="(si, i) in sitem.speclist" :key="si.spec_id + i">
  58. <span v-if="i !== 0">-</span>
  59. <span v-else>_</span>
  60. <span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
  61. </span>
  62. <el-popover placement="top" width="300" trigger="hover">
  63. <ul>
  64. <li>
  65. <span>上线商品编号:</span>
  66. <span>{{ sitem.skuCode }}</span>
  67. </li>
  68. <li
  69. v-if="
  70. newTime !== '' &&
  71. private_field &&
  72. private_field.length > 0 &&
  73. private_field.some((item) => item == '1')
  74. "
  75. >
  76. <span>成本商品编号:</span>
  77. <span>{{ sitem.spuCode }}</span>
  78. </li>
  79. <li>
  80. <span>平台商品编码:</span>
  81. <span>{{ sitem.plat_code }}</span>
  82. </li>
  83. </ul>
  84. <i class="el-icon-warning-outline fr" slot="reference"></i>
  85. </el-popover>
  86. </template>
  87. <template slot="company">
  88. <span>{{ sitem.company }}</span>
  89. <el-popover placement="top" width="300" trigger="hover">
  90. <ul>
  91. <li>
  92. <span>业务企业编号:</span>
  93. <span>{{ sitem.companyNo }}</span>
  94. </li>
  95. </ul>
  96. <i class="el-icon-warning-outline fr" slot="reference"></i>
  97. </el-popover>
  98. </template>
  99. <template slot="good_img">
  100. <img
  101. class="fl"
  102. style="width: 23px; height: 23px; margin: 0 5px 0 0"
  103. v-viewer
  104. v-for="(si, i) in sitem.good_img"
  105. :src="si"
  106. :key="si + i"
  107. />
  108. </template>
  109. <template slot="market_url">
  110. <el-button type="text" size="mini" @click="openMarkletUrl"> {{sitem.market_url}}</el-button>
  111. </template>
  112. <template slot="good_info_img">
  113. <img
  114. class="fl"
  115. style="width: 23px; height: 23px; margin: 0 5px 0 0"
  116. v-viewer
  117. v-for="(si, i) in sitem.good_info_img"
  118. :src="si"
  119. :key="si + i"
  120. />
  121. </template>
  122. <template slot="exclusive">
  123. <span v-for="(si, sii) in sitem.exclusive" :key="si.id">
  124. <span v-if="sii !== 0">/</span>
  125. <span>{{ si.name }}</span>
  126. </span>
  127. </template>
  128. <template slot="supply_area">
  129. <el-tag
  130. :size="'mini'"
  131. v-text="
  132. (options6.find((item) => item.id == sitem.supply_area) || {})
  133. .name || '--'
  134. "
  135. />
  136. </template>
  137. <template slot="create_source">
  138. <el-tag size="mini" :type="sitem.create_source === '1' ? 'warning' : ''">
  139. {{ sitem.create_source === "1" ? "咨询成交商品" : "手动创建商品" }}
  140. </el-tag> <span v-if="Number(sitem.create_source) === 1">,咨询销售价 {{ sitem.sale_price }}</span>
  141. </template>
  142. <template slot="is_stock">
  143. <el-tag
  144. :size="'mini'"
  145. v-text="
  146. (options4.find((item) => item.id == sitem.is_stock) || {}).name ||
  147. '--'
  148. "
  149. />
  150. </template>
  151. <template slot="exam_status">
  152. <el-tag
  153. :size="'mini'"
  154. :type="
  155. (options8.find((item) => item.id == sitem.exam_status) || {})
  156. .type || ''
  157. "
  158. v-text="
  159. (options8.find((item) => item.id == sitem.exam_status) || {})
  160. .name || '--'
  161. "
  162. />
  163. </template>
  164. <template slot="good_type">
  165. <el-tag
  166. :size="'mini'"
  167. v-text="
  168. (options1.find((item) => item.id == sitem.good_type) || {}).name ||
  169. '--'
  170. "
  171. />
  172. <span
  173. v-if="sitem.good_type + '' === '1'"
  174. style="padding: 0 0 0 5px"
  175. >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span>
  176. </template>
  177. <template slot="noble">
  178. <span v-if="sitem.noble_metal">
  179. {{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
  180. sitem.noble_name
  181. }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
  182. sitem.is_gold_price === "0" ? "不" : ""
  183. }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
  184. sitem.config
  185. }}-{{ sitem.other_config }}
  186. </span>
  187. </template>
  188. </show-data-table>
  189. <show-data-table
  190. :newTime="newTime"
  191. v-if="
  192. // newTime !== '' &&
  193. // private_field &&
  194. // private_field.length > 0 &&
  195. // private_field.some((item) => item == '1')
  196. isDisplayPrivateField('1')
  197. "
  198. :sitem="sitem"
  199. :columns="purchase_listCol"
  200. >
  201. <template slot="supplierName">
  202. <span>{{ sitem.supplierName }}</span>
  203. <el-popover placement="top" width="300" trigger="hover">
  204. <ul>
  205. <li>
  206. <span>供应商编号:</span>
  207. <span>{{ sitem.supplierNo }}</span>
  208. </li>
  209. </ul>
  210. <i class="el-icon-warning-outline fr" slot="reference"></i>
  211. </el-popover>
  212. </template>
  213. <template slot="is_auth">
  214. <el-tag
  215. :size="'mini'"
  216. v-text="
  217. (options3.find((item) => item.id == sitem.is_auth) || {}).name ||
  218. '--'
  219. "
  220. />
  221. </template>
  222. <template slot="is_step">
  223. <el-tag
  224. :size="'mini'"
  225. v-text="
  226. (options7.find((item) => item.id == sitem.is_step) || {}).name ||
  227. '--'
  228. "
  229. />
  230. </template>
  231. <template slot="nakelist">
  232. <div v-if="nakelist">
  233. <el-table
  234. :data="nakelist"
  235. :size="'mini'"
  236. border
  237. stripe
  238. style="width: 99%; margin: 10px 10px 10px 0"
  239. >
  240. <el-table-column prop="min_num" label="起订量(>=)" />
  241. <el-table-column prop="nake_fee" label="成本单价" />
  242. <el-table-column prop="cost_fee" label="工艺费" />
  243. <el-table-column prop="delivery_fee" label="物流费" />
  244. <el-table-column prop="cert_fee" label="证书费" />
  245. <el-table-column prop="mark_fee" label="加标费" />
  246. <el-table-column prop="package_fee" label="包装费" />
  247. <el-table-column prop="other_fee" label="其他费用" />
  248. <el-table-column prop="nake_total" label="成本合计" />
  249. </el-table>
  250. </div>
  251. <div v-else>--</div>
  252. </template>
  253. </show-data-table>
  254. <show-data-table
  255. :newTime="newTime"
  256. v-if="
  257. newTime !== '' &&
  258. private_field &&
  259. private_field.length > 0 &&
  260. private_field.some((item) => item == '2') &&
  261. ladderlist &&
  262. ladderlist.length > 0
  263. "
  264. :sitem="sitem"
  265. :columns="sale_listCol"
  266. >
  267. <template slot="ladderlist">
  268. <el-table
  269. :data="ladderlist"
  270. :size="'mini'"
  271. border
  272. stripe
  273. style="width: 99%; margin: 10px 10px 10px 0"
  274. >
  275. <el-table-column prop="min_num" label="起订量(>=)" />
  276. <el-table-column prop="sale_price" label="售价" />
  277. <el-table-column prop="cost_fee" label="工艺费" />
  278. <el-table-column prop="market_price" label="市场价" />
  279. <el-table-column prop="market_platform" label="对比平台" />
  280. <el-table-column prop="status" label="状态">
  281. <template slot-scope="scope">
  282. {{
  283. scope.row.status + "" === "1" ? "启用" : "禁用"
  284. }}
  285. </template>
  286. </el-table-column>
  287. </el-table>
  288. </template>
  289. </show-data-table>
  290. </el-collapse-item>
  291. <!-- -->
  292. <el-collapse-item
  293. title="待产品审核"
  294. name="1"
  295. v-if="status == '2' && ppowers.some((i) => i == '2') && !isSupertube"
  296. >
  297. <FixedPriceForm
  298. :newTime="newTime"
  299. :id="queryId"
  300. :spuCode="spuCode"
  301. v-if="newTime !== ''"
  302. :sitem="sitem"
  303. :isFixed="sitem.is_fixed"
  304. :disabled="false"
  305. :isMust="false"
  306. @resSuccess="initForm"
  307. @searchChange="examForm1"
  308. @rejectRes="examForm2"
  309. />
  310. </el-collapse-item>
  311. </el-collapse>
  312. </el-tab-pane>
  313. <el-tab-pane label="审批记录" name="2">
  314. <process-time-line
  315. v-if="newTime !== ''"
  316. :newTime="newTime"
  317. :type="'SPSX'"
  318. :orderCode="queryId"
  319. />
  320. </el-tab-pane>
  321. <el-tab-pane label="审批备注" name="3">
  322. <process-remark-time-line v-if="newTime !== ''" :newTime="newTime" :skuCode="queryId" />
  323. </el-tab-pane>
  324. <el-tab-pane label="流程图" name="4">
  325. <flow-chart process_id="16" type="SPSX" :orderCode="queryId" />
  326. </el-tab-pane>
  327. </el-tabs>
  328. </div>
  329. <div v-else>
  330. <no-auth></no-auth>
  331. </div>
  332. </div>
  333. </template>
  334. <script>
  335. import asyncRequest from "@/apis/service/goodStore/goodsOnline";
  336. import resToken from "@/mixins/resToken";
  337. import { mapGetters } from "vuex";
  338. import processRemarkTimeLine from "./components/process-remark-time-line";
  339. import { isArray } from "@/utils/validate";
  340. import onlineForm from "./components/online-form";
  341. import FixedPriceForm from "./components/fixed-price-form.vue";
  342. import privateField from "@/mixins/privateField";
  343. import {
  344. purchase_listCol,
  345. public_listCol,
  346. sale_listCol
  347. } from "./ShowDataTableColumns";
  348. import {
  349. options1,
  350. options2,
  351. options3,
  352. options4,
  353. options5,
  354. options6,
  355. options7,
  356. options8
  357. } from "./columns";
  358. export default {
  359. name: "goodsOnlineDetail",
  360. mixins: [resToken, privateField],
  361. components: {
  362. onlineForm,
  363. processRemarkTimeLine,
  364. FixedPriceForm
  365. },
  366. computed: {
  367. ...mapGetters([
  368. "tablebtnSize",
  369. "searchSize",
  370. "size",
  371. "private_field",
  372. "isSupertube"
  373. ]),
  374. powers() {
  375. const tran =
  376. this.$store.getters.btnList.find(
  377. item => item.menu_route == "goodsOnlineDetail"
  378. ) || {};
  379. const { action } = tran ?? {};
  380. return action ?? [];
  381. },
  382. ppowers() {
  383. const tran =
  384. this.$store.getters.roleProcess.find(i => i.process_type === "SPSX") ||
  385. {};
  386. const { action } = tran ?? {};
  387. return action ?? [];
  388. }
  389. },
  390. data() {
  391. return {
  392. public_listCol: public_listCol,
  393. purchase_listCol: purchase_listCol,
  394. sale_listCol: sale_listCol,
  395. options1: options1,
  396. options2: options2,
  397. options3: options3,
  398. options4: options4,
  399. options5: options5,
  400. options6: options6,
  401. options7: options7,
  402. options8: options8,
  403. ladderlist: [],
  404. nakelist: [],
  405. spuCode: "",
  406. size: "small",
  407. activeTabs: "1",
  408. activeNames: ["0", "1", "2", "3", "4", "5", "6", "7"],
  409. newTime: "",
  410. loading: false,
  411. queryType: "",
  412. queryId: "",
  413. status: "",
  414. sitem: null
  415. };
  416. },
  417. mounted() {
  418. this.initForm();
  419. },
  420. methods: {
  421. openMarkletUrl(){
  422. window.open(this.sitem.market_url)
  423. },
  424. async initForm() {
  425. const { id, type } = this.$route.query;
  426. this.queryId = id;
  427. this.queryType = type;
  428. this.activeTabs = type === "add" ? "0" : "1";
  429. this.loading = true;
  430. if (this.queryType === "add") {
  431. this.sitem = {};
  432. this.getNewTime();
  433. } else {
  434. await this.initData();
  435. }
  436. this.loading = false;
  437. },
  438. refresh(e) {
  439. const { spuCode } = e;
  440. let model = {
  441. id: this.queryType === "add" ? spuCode : this.queryId,
  442. type: "view"
  443. };
  444. this.routeReGoto("goodsOnlineDetail", model);
  445. },
  446. async initData() {
  447. this.loading = true;
  448. const { code, message, data } = await asyncRequest.detail({
  449. skuCode: this.queryId
  450. });
  451. this.loading = false;
  452. if (code === 0) {
  453. this.sitem = JSON.parse(JSON.stringify(data));
  454. const {
  455. exam_status,
  456. cat_info,
  457. ladderlist,
  458. nakelist,
  459. spuCode
  460. } = this.sitem;
  461. this.spuCode = spuCode;
  462. this.ladderlist = JSON.parse(JSON.stringify(ladderlist));
  463. console.log(ladderlist);
  464. this.nakelist = JSON.parse(JSON.stringify(nakelist));
  465. let cat = "";
  466. if (cat_info && cat_info.length > 0) {
  467. cat_info.forEach((e, i) => {
  468. cat += i === 0 ? e.name : "/" + e.name;
  469. });
  470. }
  471. this.sitem.cat = cat;
  472. if (!isArray(this.sitem.good_info_img)) {
  473. this.sitem.good_info_img = this.sitem.good_info_img.split(",");
  474. }
  475. if (!isArray(this.sitem.good_img)) {
  476. this.sitem.good_img = this.sitem.good_img.split(",");
  477. }
  478. this.status = exam_status;
  479. console.log(this.status);
  480. this.getNewTime();
  481. } else if (code >= 100 && code <= 104) {
  482. await this.logout();
  483. } else {
  484. this.$message.warning(message);
  485. }
  486. },
  487. getNewTime() {
  488. this.newTime = new Date().valueOf();
  489. }
  490. }
  491. };
  492. </script>
  493. <style lang="scss" scoped>
  494. .goodsOnlineDetail {
  495. width: 100%;
  496. box-sizing: border-box;
  497. .goodsOnlineDetail-main {
  498. padding: 10px;
  499. width: 100%;
  500. }
  501. .goodsOnlineDetail-title {
  502. border-top: 1px solid #ebeef5;
  503. span {
  504. height: 50px;
  505. line-height: 50px;
  506. font-family: "微软雅黑", sans-serif;
  507. font-weight: 400;
  508. font-style: normal;
  509. font-size: 16fpx;
  510. text-align: left;
  511. }
  512. }
  513. /deep/ .ddiv {
  514. border-top: 1px solid #dcdfe6;
  515. }
  516. /deep/ .dtitle {
  517. width: 40px;
  518. text-align: center;
  519. height: 100%;
  520. min-height: 100%;
  521. ul {
  522. padding: 12px 0 0 0;
  523. }
  524. }
  525. /deep/ .dmain {
  526. padding: 20px 0 0 0;
  527. width: calc(100% - 40px);
  528. border-left: 1px solid #dcdfe6;
  529. }
  530. }
  531. </style>