groupDetail.vue 9.9 KB

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