goodPreview.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <el-row v-if="sitem && sitem.id" class="goodPreview-main clear">
  3. <el-col :span="24">
  4. <div class="good-img">
  5. <showGoodImg :pList="sitem && sitem.good_img ? sitem.good_img : ''" />
  6. </div>
  7. <div class="parameter">
  8. <el-row>
  9. <el-col :span="24" class="good_name">{{ sitem.good_name }}</el-col>
  10. <el-col :span="24" class="t2"
  11. >业务公司:
  12. <el-tooltip
  13. class="item"
  14. effect="dark"
  15. :content="sitem.companyNo"
  16. placement="top"
  17. >
  18. <el-icon class="el-icon-warning-outline" />
  19. </el-tooltip>
  20. {{ sitem.companyName }}</el-col
  21. >
  22. <el-col :span="12" class="t2"
  23. >供应商名称:
  24. <el-tooltip
  25. class="item"
  26. effect="dark"
  27. :content="sitem.supplierNo"
  28. placement="top"
  29. >
  30. <el-icon class="el-icon-warning-outline" />
  31. </el-tooltip>
  32. {{ sitem.supplierName }}</el-col
  33. >
  34. <el-col :span="12" class="t2">成本编号:{{ sitem.spuCode }}</el-col>
  35. </el-row>
  36. <el-row>
  37. <el-col :span="24" style="padding: 5px 0">
  38. <showGoodPrice :price_list="slit" />
  39. </el-col>
  40. <el-col :span="24" class="t2">税率: {{ sitem.tax }}%</el-col>
  41. <el-col :span="24" class="t2">品牌: {{ sitem.brand_name }}</el-col>
  42. <el-col :span="24" class="t2"
  43. >供货区域:
  44. {{ sitem.supply_area + "" === "1" ? "全国" : "除偏远地区" }}
  45. </el-col>
  46. <el-col :span="24" class="t2">供货周期: {{ sitem.lead_time }}天</el-col>
  47. <el-col :span="24" class="t2">产地: {{ origin_place }}</el-col>
  48. <el-col :span="24" class="t2"
  49. >售后说明:
  50. {{ sitem.after_sales }}</el-col
  51. >
  52. <el-col :span="24" class="t2"
  53. >创建时间:
  54. {{ sitem.addtime }}</el-col
  55. >
  56. </el-row>
  57. </div>
  58. </el-col>
  59. <el-col :span="24" class="info-parameter">
  60. <el-row>
  61. <el-col :span="24" class="t2"
  62. >规格:
  63. <span v-for="(si, ii) in sitem.speclist" :key="si + ii">{{
  64. ii === 0 ? si.spec_value : "-" + si.spec_value
  65. }}</span>
  66. </el-col>
  67. <el-col :span="6" class="t2">包装方式:{{ sitem.packing_way }}</el-col>
  68. <el-col :span="6" class="t2">装箱规格:{{ sitem.packing_spec }}</el-col>
  69. <el-col :span="6" class="t2">装箱重量:{{ sitem.packing_weight }}g</el-col>
  70. <el-col :span="6" class="t2">装箱尺寸:{{ sitem.packing_size }}</el-col>
  71. <el-col :span="6" class="t2">商品尺寸:{{ sitem.good_size }}</el-col>
  72. <el-col :span="6" class="t2">商品清单:{{ sitem.packing_list }}</el-col>
  73. </el-row>
  74. </el-col>
  75. <el-col :span="24" class="info-img clear" style="margin: 5px 0 0 0">
  76. <img
  77. :src="si"
  78. alt=""
  79. class="fl"
  80. style="width: 100%"
  81. v-for="(si, i) in img_list"
  82. :key="si + i"
  83. />
  84. </el-col>
  85. </el-row>
  86. </template>
  87. <script>
  88. export default {
  89. name: "goodPreview",
  90. props: ["sitem", "newTime", "origin_place"],
  91. data() {
  92. return {
  93. img_list: [],
  94. slit: [],
  95. };
  96. },
  97. watch: {
  98. // newTime: function (val) {
  99. // if (val) {
  100. // this.initForm();
  101. // }
  102. // },
  103. },
  104. created() {
  105. this.slit = [];
  106. this.img_list = [];
  107. if (typeof this.sitem.good_info_img === "string") {
  108. this.img_list = (this.sitem.good_info_img || "").split(",");
  109. }
  110. this.img_list = this.img_list.map(
  111. (item) => item + "?t=" + this.generateRandomString(20)
  112. );
  113. if (this.sitem && this.sitem.nakelist) {
  114. let arr = this.bubbleSort(this.sitem.nakelist);
  115. arr.forEach((si, i) => {
  116. let sModel = {
  117. min: si.min_num,
  118. max: arr.length - 1 === i ? 0 : arr[i + 1].min_num,
  119. price: si.nake_total,
  120. };
  121. this.slit.push(sModel);
  122. });
  123. }
  124. // nakelist
  125. },
  126. methods: {
  127. bubbleSort(arr) {
  128. for (var i = 0; i < arr.length - 1; i++) {
  129. for (var j = 0; j < arr.length - i - 1; j++) {
  130. if (Number(arr[j].min_num) > Number(arr[j + 1].min_num)) {
  131. var temp = arr[j];
  132. arr[j] = arr[j + 1];
  133. arr[j + 1] = temp;
  134. }
  135. }
  136. }
  137. return arr;
  138. },
  139. generateRandomString(length) {
  140. let str = Math.random()
  141. .toString(36)
  142. .substring(2, length + 2);
  143. return str;
  144. },
  145. },
  146. };
  147. </script>
  148. <style scoped>
  149. .goodPreview-main {
  150. width: 1200px;
  151. max-width: 1200px;
  152. margin: 10px 0;
  153. text-align: left;
  154. .t2 {
  155. font-size: 14px;
  156. line-height: 32px;
  157. }
  158. .good-img {
  159. float: left;
  160. width: 420px;
  161. height: 510px;
  162. }
  163. .parameter {
  164. float: left;
  165. width: calc(100% - 420px);
  166. height: 510px;
  167. .good_name {
  168. line-height: 38px;
  169. height: 38px;
  170. font-size: 19px;
  171. font-weight: bold;
  172. }
  173. }
  174. .info-img {
  175. width: 100%;
  176. overflow: hidden;
  177. float: left;
  178. }
  179. }
  180. </style>