groupDetail.vue 11 KB

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