CommodityPurchase.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view class="product">
  3. <view class="item-cmd_bx" @click="showAddModelFn">
  4. <text style="position: absolute;left:245upx;font-weight:bold;color:red;font-size:24upx;top:118upx;" v-if="info.needCgNum && Number(info.needCgNum)>0">待采 {{ info.needCgNum }}</text>
  5. <view class="img_bx" style="background:#eeeeee">
  6. <block v-if="info.status == 2">
  7. <view class="sold-out">
  8. <view class="sold-out-xj">已下架</view>
  9. </view>
  10. </block>
  11. <block v-else>
  12. <view class="sold-out" v-if="info.frontHide == 1">
  13. <view class="hide">隐</view>
  14. </view>
  15. </block>
  16. <image :src="info.cover" lazy-load="true" :lazy-load-margin="0"></image>
  17. <view style="width:30upx;height:30upx;top:0upx;left:0upx;position: absolute;" @click.stop="delProduct(info)"> </view>
  18. </view>
  19. <view class="cmd-info_bx">
  20. <view class="tit">
  21. <text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;"
  22. v-if="info.frontHide && info.frontHide == 1">隐</text>
  23. <text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;"
  24. v-if="info.presell == 1">预售</text>
  25. {{ info.name || "" }}
  26. </view>
  27. <view class="num-open_bx">
  28. <view class="price" style="position:absolute;top:105upx;">¥{{ parseFloat(info.price) }}</view>
  29. <view style="position: relative;top:-14upx;">
  30. <view class="kc">
  31. <block v-if="info.ratioType == 0">{{info.ratio}}{{ info.smallUnit }}</block>
  32. <block v-else>若干{{ info.smallUnit }}</block>
  33. </view>
  34. </view>
  35. <view>
  36. <view class="open-bx">
  37. <i class="iconfont iconjian" @click.stop="delItemFn" v-if="bigCount > 0 || smallCount > 0" ></i>
  38. <text class="num" @click.stop="showAddModelFn" >
  39. <text v-if="bigCount > 0" style="color:#3385FF;">{{ `${bigCount}` }}</text>
  40. <text v-if="smallCount > 0">{{ `${smallCount}` }}</text>
  41. </text>
  42. <i class="iconfont iconzeng" @click.stop="showAddModelFn" ></i>
  43. </view>
  44. <view class="price">
  45. <text class="unit">还剩 {{ parseFloat(info.stock) }}</text>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <text class="bottom-button" @click.stop="copyCreate(info)">复制新建</text>
  52. <text class="bottom-button" @click.stop="goToStockDetail(info)">库存明细</text>
  53. <text class="bottom-button" @click.stop="goDetail(info)">修改花材</text>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. name: "Commodity",
  59. components: {},
  60. mixins: [],
  61. props: {
  62. info: {
  63. required: true,
  64. type: Object,
  65. default () {
  66. return {bigCount:0,smallCount:0,userPrice:0,totalPrice:0,aboutPrice:0};
  67. }
  68. },
  69. type: {
  70. type: String,
  71. default: '01'
  72. }
  73. },
  74. data () {
  75. return {
  76. bigCount:0,
  77. smallCount:0,
  78. userPrice:0,
  79. totalPrice:0,
  80. aboutPrice:0
  81. };
  82. },
  83. watch:{
  84. info:{
  85. handler(){
  86. this.bigCount = this.info.bigCount
  87. this.smallCount = this.info.smallCount
  88. this.userPrice = this.info.userPrice
  89. this.totalPrice = this.info.totalPrice,
  90. this.aboutPrice = this.info.aboutPrice
  91. },
  92. deep:true
  93. }
  94. },
  95. created () { },
  96. mounted() {
  97. this.bigCount = this.info.bigCount
  98. this.smallCount = this.info.smallCount
  99. this.userPrice = this.info.userPrice
  100. this.totalPrice = this.info.totalPrice,
  101. this.aboutPrice = this.info.aboutPrice
  102. },
  103. methods: {
  104. delProduct(info){
  105. this.$emit("delProduct", info)
  106. },
  107. doPrintLabel(item,type){
  108. this.$msg('开发中')
  109. },
  110. copyCreate(item){
  111. this.pageTo({url: '/admin/item/copy?id='+item.id})
  112. },
  113. goDetail(item){
  114. this.$util.pageTo({url: "/admin/item/detail?id="+item.id})
  115. },
  116. goToStockDetail(item){
  117. this.$util.pageTo({url: "/pagesStorehouse/stockWarn/detailed?id="+item.id+'&name='+item.name})
  118. },
  119. delItemFn () {
  120. this.info.bigCount = 0
  121. this.info.smallCount = 0
  122. this.$emit("replaceItemFn", this.info,1)
  123. },
  124. showAddModelFn () {
  125. this.$emit("showAddModelFn", { ...this.info, bigCount: this.bigCount, smallCount: this.smallCount, userPrice: this.userPrice,totalPrice:this.totalPrice,aboutPrice:this.aboutPrice })
  126. }
  127. }
  128. };
  129. </script>
  130. <style lang="scss" scoped>
  131. .product{
  132. height:230upx;
  133. }
  134. .bottom-button{
  135. font-weight:normal;
  136. border:2upx solid #cccccc;
  137. font-size:24upx;
  138. border-radius: 20upx;
  139. padding:9upx 20upx 9upx 20upx;
  140. margin:0 25upx 0 0;
  141. float:right;
  142. color:#aaa9a9;
  143. }
  144. .item-cmd_bx {
  145. position: relative;
  146. margin-bottom: 20upx;
  147. .img_bx {
  148. height: 140upx;
  149. width: 140upx;
  150. position: absolute;
  151. left: 0upx;
  152. top: 0upx;
  153. image{
  154. width: 100%;
  155. height: 100%;
  156. }
  157. .sold-out{
  158. z-index:10;
  159. width:140upx;
  160. height:140upx;
  161. background-color:black;
  162. position:absolute;
  163. top:0;
  164. left:0;
  165. opacity: 0.6;
  166. color:white;
  167. text-align:center;
  168. .sold-out-xj{
  169. line-height:140upx;
  170. font-size:28upx;
  171. }
  172. .hide{
  173. line-height:140upx;
  174. font-size:30upx;
  175. }
  176. }
  177. }
  178. .cmd-info_bx {
  179. padding-left: 167upx;
  180. & .tit {
  181. font-size: 32upx;
  182. font-weight: 700;
  183. color: #333333;
  184. padding-top: 10upx;
  185. overflow: hidden;
  186. white-space: nowrap;
  187. text-overflow: ellipsis;
  188. width:380upx;
  189. }
  190. & .kc {
  191. color: #837f7f;
  192. font-size: 23upx;
  193. padding: 10upx 0 0;
  194. position: absolute;
  195. width:150upx;
  196. text-align: left;
  197. left: 0;
  198. top:15upx;
  199. font-size:25upx;
  200. }
  201. & .num-open_bx {
  202. text-align: right;
  203. display: flex;
  204. justify-content: space-between;
  205. & .price {
  206. font-size: 29upx;
  207. color: black;
  208. -webkit-box-flex: 1;
  209. -webkit-flex: 1;
  210. flex: 1;
  211. margin-right:90upx;
  212. .unit {
  213. font-size: 22upx;
  214. }
  215. }
  216. & .open-bx {
  217. align-items: center;
  218. display: inline-flex;
  219. & .iconfont {
  220. color: #4db0e4;
  221. font-size: 55upx;
  222. }
  223. .icondelete {
  224. margin: 0 10upx 0 30upx;
  225. color: #ccc;
  226. &.edit {
  227. color: #4db0e4;
  228. }
  229. }
  230. & > .num {
  231. display: inline-block;
  232. width: 120upx;
  233. height:50upx;
  234. line-height:50upx;
  235. text-align: center;
  236. margin: 0 8upx;
  237. color: #868686;
  238. border-radius: 22upx;
  239. background-color: #f5f5f5;
  240. font-size: 33upx;
  241. }
  242. .change-input {
  243. width: 164upx;
  244. height: 60upx;
  245. line-height: 60upx;
  246. text-align: center;
  247. background: #ffffff;
  248. border: 1upx solid #dddddd;
  249. border-radius: 4upx;
  250. font-size: 28upx;
  251. }
  252. }
  253. }
  254. }
  255. }
  256. </style>