groupDetail.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <div class="container normal-panel">
  3. <el-tag style="margin-left: 15px" size="small" >{{selectProduct.brandname}}</el-tag>
  4. <div class="product-detail container flex-align-stretch" style="width: 100%">
  5. <div>
  6. <el-image style="width:400px;height:400px;margin-right:30px" :src="actImage?actImage.url:''" fit="cover" />
  7. <div class="flex-align-stretch column">
  8. <el-image class="thumImage mt-10" :class="item.attachmentid === actImage.attachmentid?'act':''" v-for="item in selectProduct.attinfos" :key="item.index" :src="item.url" @click="actImage = item" fit="cover" />
  9. </div>
  10. </div>
  11. <div style="flex:1;">
  12. <p class="productName normal-margin">
  13. <el-tag class="inline-16" @click="actTradefield = item.tradefield" v-for="(item,index) in tradefield" :key="index" size="small" :effect="actTradefield === item.tradefield ? 'dark' : 'plain'">{{item.tradefield}}
  14. </el-tag>
  15. {{selectProduct.itemname}}
  16. </p>
  17. <p class="normal-margin" style="color:#888;">编码:&emsp;{{selectProduct.itemno}}</p>
  18. <p class="normal-margin">价格:&emsp;<span class="product-price">¥{{selectProduct.gradeprice}}</span>&nbsp;<span class="text-throughline">¥{{selectProduct.marketprice}}</span></p>
  19. <div class="line normal-margin"></div>
  20. <p class="normal-margin">型号:&emsp;{{selectProduct.model}}</p>
  21. <div>
  22. <p class="normal-margin">规格:&emsp;{{selectProduct.spec}}</p>
  23. </div>
  24. <div>
  25. <p class="normal-margin">标准:&emsp;{{selectProduct.standards}}</p>
  26. </div>
  27. <div v-if="selectProduct.itemextend">
  28. <p class="normal-margin">材质:&emsp;{{selectProduct.itemextend[0].material}}</p>
  29. </div>
  30. <div class="flex-align-center" style="margin-bottom:30px">
  31. <p>数量:&emsp;</p>
  32. <el-input-number v-model="count" :min="selectProduct.orderminqty" :step="selectProduct.orderaddqty" size="small" label="描述文字"></el-input-number>
  33. <span style="color:#888;font-size: 14px;margin-left: 10px">起订量:{{selectProduct.orderminqty}}</span>
  34. <span style="color:#888;font-size: 14px;margin-left: 10px">增量:{{selectProduct.orderaddqty}}</span>
  35. <span style="color:#888;font-size: 14px;margin-left: 10px">库存:
  36. <span v-if="selectProduct.stockstatus === '紧缺'" style="color: red">{{selectProduct.stockstatus}}</span>
  37. <span v-else-if="selectProduct.stockstatus === '充足'" style="color: green">{{selectProduct.stockstatus}}</span>
  38. <span v-else>{{selectProduct.stockstatus}}</span>
  39. </span>
  40. </div>
  41. <div class="type">
  42. <div class="content normal-margin">
  43. <p class="inline-16">更多:</p>
  44. <el-tag class="inline-16" style="margin-top: 5px;margin-bottom: 5px" @click="typeClick(item)" v-for="(item,index) in detail" :key="index" size="small" :effect="selectProduct.itemno == item.itemno ? 'dark' : 'plain'">
  45. {{item.model.length >20?item.model.substring(0,19)+'...':item.model}}
  46. </el-tag>
  47. <!-- <span style="color: #4f7bfd;width: 100px" @click="typeClick(item)" v-for="(item,index) in detail" :key="index">
  48. {{item.model}}
  49. </span>-->
  50. </div>
  51. </div>
  52. <!-- <div class="type">
  53. <div class="content normal-margin">
  54. <p class="inline-16">领域:</p>
  55. <el-tag class="inline-16" @click="actTradefield = item.tradefield" v-for="(item,index) in tradefield" :key="index" size="small" :effect="actTradefield === item.tradefield ? 'dark' : 'plain'">{{item.tradefield}}
  56. </el-tag>
  57. </div>
  58. </div>-->
  59. <div style="width: 700px;background: #f6f6f6;margin-bottom: 20px">
  60. <el-row :gutter="20" style="margin-left: 10px">
  61. <el-col :span="8" style="margin-top: 10px; " v-if="selectProduct.itemextend[0].device">
  62. <span class="search__label">装置:</span>
  63. <span class="tab-color">{{selectProduct.itemextend[0].device}}</span>
  64. </el-col>
  65. <el-col :span="8" style="margin-top: 10px" v-if="selectProduct.itemextend[0].prodline">
  66. <span class="search__label">产线:</span>
  67. <span class="tab-color">{{selectProduct.itemextend[0].prodline}}</span>
  68. </el-col>
  69. <el-col :span="8" style="margin-top: 10px" v-if="selectProduct.itemextend[0].specalnote">
  70. <span class="search__label">特殊说明:</span>
  71. <span class="tab-color">{{selectProduct.itemextend[0].specalnote}}</span>
  72. </el-col>
  73. <el-col :span="8" style="margin-top: 10px" v-if="selectProduct.itemextend[0].pressure">
  74. <span class="search__label">压力等级:</span>
  75. <span class="tab-color">{{selectProduct.itemextend[0].pressure}}</span>
  76. </el-col>
  77. <el-col :span="8" style="margin-top: 10px" v-if="selectProduct.itemextend[0].butterflyplatedrive">
  78. <span class="search__label">蝶板驱动:</span>
  79. <span class="tab-color">{{selectProduct.itemextend[0].butterflyplatedrive}}</span>
  80. </el-col>
  81. <el-col :span="8" style="margin-top: 10px" v-if="selectProduct.itemextend[0].connection">
  82. <span class="search__label">连接形式:</span>
  83. <span class="tab-color">{{selectProduct.itemextend[0].connection}}</span>
  84. </el-col>
  85. <el-col :span="8" style="margin-top: 10px;margin-bottom: 10px" v-if="selectProduct.itemextend[0].valveplatematerial">
  86. <span class="search__label">阀板材质:</span>
  87. <span class="tab-color">{{selectProduct.itemextend[0].valveplatematerial}}</span>
  88. </el-col>
  89. <el-col :span="8" style="margin-top: 10px;margin-bottom: 10px" v-if="selectProduct.itemextend[0].actuatortype">
  90. <span class="search__label">执行器类型:</span>
  91. <span class="tab-color">{{selectProduct.itemextend[0].actuatortype}}</span>
  92. </el-col>
  93. <el-col :span="8" style="margin-top: 10px;margin-bottom: 20px" v-if="selectProduct.itemextend[0].actuatorbrand">
  94. <span class="search__label">执行器品牌:</span>
  95. <span class="tab-color">{{selectProduct.itemextend[0].actuatorbrand}}</span>
  96. </el-col>
  97. </el-row>
  98. </div>
  99. <el-button class="normal-margin" type="primary" style="width:200px" icon="el-icon-shopping-cart-full" @click="addCart" :disabled="usertype === 0 || usertype === 1">加入购物车</el-button>
  100. <div style="display:flex">
  101. <p>相关链接:&emsp;</p>
  102. <div>
  103. <div v-for="item in selectProduct.technicalinfo" :key="item.index">
  104. <a class="file-link" :href="item.url">{{item.document}}</a>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </template>
  112. <script>
  113. export default {
  114. name: '',
  115. data () {
  116. return {
  117. detail: '',
  118. count: 1,
  119. selectProduct: '',
  120. actImage:{},
  121. tradefield:[],
  122. actTradefield:'',
  123. usertype:""
  124. };
  125. },
  126. computed: {
  127. },
  128. watch: {
  129. },
  130. created () {
  131. this.getDetail()
  132. },
  133. mounted() {
  134. this.usertype = JSON.parse(sessionStorage.getItem('active_account')).usertype
  135. },
  136. methods: {
  137. async getDetail () {
  138. let res = await this.$api.requested({
  139. "id": "20220926142403",
  140. "content": {
  141. "sa_itemgroupid": this.$route.query.id
  142. }
  143. })
  144. this.detail = res.data
  145. this.selectProduct = this.detail ? this.detail[0] : ''
  146. this.actImage = this.detail ? this.detail[0].attinfos[0] : {}
  147. this.tradefield = this.detail ? this.detail[0].tradefield : []
  148. this.actTradefield = this.detail[0].tradefield[0].tradefield
  149. },
  150. countChange (num) {
  151. this.count = num
  152. },
  153. typeClick (data) {
  154. console.log(data,"切换")
  155. this.selectProduct = data
  156. this.actImage = data.attinfos[0]
  157. this.actTradefield = data.tradefield[0].tradefield
  158. this.count = 1
  159. },
  160. async addCart () {
  161. let res = await this.$api.requested({
  162. "id": 20220924095102,
  163. "content": {
  164. "sa_brandid": this.$route.query.brandid, //品牌id
  165. "itemid": this.selectProduct.itemid, //货品id
  166. "qty": this.count, //数量
  167. "itemno": this.selectProduct.itemno, //货品编号
  168. "tradefield":this.actTradefield
  169. },
  170. })
  171. this.tool.showMessage(res)
  172. }
  173. },
  174. };
  175. </script>
  176. <style scoped>
  177. .product-detail{
  178. height: calc(100vh - 210px);
  179. overflow: scroll;
  180. width: 900px;
  181. }
  182. .productName{
  183. font-size: 1.75rem !important;
  184. color: #333 !important;
  185. }
  186. .line{
  187. border-bottom: 1px dashed #e3e5ea;
  188. }
  189. .border-left {
  190. border-left:1px solid #e3e5ea
  191. }
  192. .product-price {
  193. font-size: 1.25rem !important;
  194. color: red;
  195. }
  196. .product-itemno{
  197. font-size: 12px;
  198. color:#888;
  199. margin-bottom: 20px;
  200. }
  201. .text-throughline{
  202. font-size: 14px;
  203. text-decoration: line-through;
  204. color:#999
  205. }
  206. .product-detail p{
  207. font-size: 14px;
  208. color:#888 ;
  209. }
  210. .productName{
  211. font-size: 1.75rem !important;
  212. color: #333 !important;
  213. }
  214. .line{
  215. border-bottom: 1px dashed #e3e5ea;
  216. }
  217. .border-left {
  218. border-left:1px solid #e3e5ea
  219. }
  220. .product-price {
  221. font-size: 1.25rem !important;
  222. color: red;
  223. }
  224. .product-itemno{
  225. font-size: 12px;
  226. color:#888;
  227. margin-bottom: 20px;
  228. }
  229. .text-throughline{
  230. font-size: 14px;
  231. text-decoration: line-through;
  232. color:#999
  233. }
  234. .thumImage{
  235. width:100px;
  236. height:100px;
  237. margin-right:30px;
  238. border:1px solid #f1f2f3;
  239. cursor: pointer;
  240. }
  241. .column{
  242. flex-direction: row;
  243. }
  244. .act{
  245. border:1px solid #607d8b;
  246. }
  247. .file-link{
  248. font-size: 12px;
  249. margin-bottom:16px;
  250. color:#3848f6
  251. }
  252. .file-link a{
  253. text-decoration: none;
  254. margin-left:10px;
  255. color:#999
  256. }
  257. .file-link:hover{
  258. color:#4F7BFD;
  259. text-decoration: underline;
  260. }
  261. .tab-color{
  262. color: #5a73d3;
  263. font-size: 15px;
  264. /*font-weight: bold;*/
  265. }
  266. </style>