select.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <view class="billing_box_bg">
  3. <view class="input-wrap" >
  4. <view class="search-bar">
  5. <app-search-module v-model="py" placeholder="输入拼音首字母搜索" @input="searchFn" />
  6. </view>
  7. <view style="float:right">
  8. <button class="admin-button-com middle blue" @click="removeFromSave(0)">清除花材</button>
  9. </view>
  10. </view>
  11. <view class="scroll-middle_bx">
  12. <scroll-view scroll-y scroll-with-animation class="tab-view">
  13. <div v-for="(item, index) in globalClassItemList" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index)">
  14. <text>{{ item.className || "" }}</text>
  15. </div>
  16. <view style="height: 120upx"></view>
  17. </scroll-view>
  18. <scroll-view scroll-y class="right-box" v-if="tabIndex == 0" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
  19. @scroll="scroll_detail"
  20. lower-threshold="100"
  21. @scrolltolower="scroll_bottom">
  22. <block v-if="!$util.isEmpty(globalClassItemList)">
  23. <view class="item_list_bx selectAll" v-for="(classItem, classIndex) in globalClassItemList" :key="classIndex" :id="`class_${classIndex}`">
  24. <view class="item_list_title">
  25. {{ classItem.className }}
  26. </view>
  27. <template v-for="(productItem, productIndex) in classItem.child">
  28. <view style="height: 160upx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
  29. <Commondity v-if="classItem.isActive"
  30. :key="productIndex"
  31. :info="productItem"
  32. :selectJobType="selectJobType"
  33. @showAddModelFn="showAddModelFn"
  34. @replaceItemFn="replaceItemFn"
  35. ></Commondity>
  36. </view>
  37. </template>
  38. </view>
  39. </block>
  40. <block v-else>
  41. <app-wrapper-empty title="暂无花材" :is-empty="$util.isEmpty(globalClassItemList)" />
  42. </block>
  43. </scroll-view>
  44. <block v-else>
  45. <view style="width:100%">
  46. <AppWrapperEmpty title="敬请期待" :is-empty="true" />
  47. </view>
  48. </block>
  49. </view>
  50. <modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.name" color="#333" :size="32" padding="30rpx 30rpx" >
  51. <template slot="customContent">
  52. <view class="select-cmd_bx" v-if="customData">
  53. <view class="kc"> 库存{{ customData.stock?parseFloat(customData.stock):0 }} </view>
  54. <view class="num_bx">
  55. <!-- #ifdef APP-PLUS -->
  56. <input style="width: 430upx" v-model="customData.bigCount" v-if="globalUnitType == 0" type="number" />
  57. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 0">扎</text>
  58. <input style="width: 430upx" v-model="customData.smallCount" v-if="globalUnitType == 1" type="number" />
  59. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 1">支</text>
  60. <!-- #endif -->
  61. <!-- #ifdef MP-WEIXIN -->
  62. <input style="width: 430upx" v-model="customData.bigCount" v-if="globalUnitType == 0" :focus="isAddInputFocus" type="number" />
  63. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 0">扎</text>
  64. <input style="width: 430upx" v-model="customData.smallCount" v-if="globalUnitType == 1" :focus="isAddInputFocus" type="number" />
  65. <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 1">支</text>
  66. <!-- #endif -->
  67. <button v-if="selectJobType == 'inventory'" style="position:absolute;top:276upx;left:230upx;" @click="customData.bigCount=99999" class="admin-button-com middle blue">盘点为零</button>
  68. </view>
  69. </view>
  70. </template>
  71. </modal-module>
  72. <FooterCart :offPrice="true" :price="allPrice" :count="allCount" @confirm="confirmSelectEvent"></FooterCart>
  73. </view>
  74. </template>
  75. <script>
  76. import AppSearchModule from "@/components/module/app-search";
  77. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  78. import Commondity from "@/components/module/app-commodity";
  79. import FooterCart from "@/components/module/app-footer-cart";
  80. import ModalModule from "@/components/plugin/modal";
  81. import productMins from "@/mixins/product";
  82. export default {
  83. name: "select",
  84. components: {
  85. AppSearchModule,
  86. AppWrapperEmpty,
  87. Commondity,
  88. ModalModule,
  89. FooterCart
  90. },
  91. mixins: [productMins],
  92. data() {
  93. return {
  94. selectJobType: "inventory",
  95. isLimit: false,
  96. isSmallCount: false,
  97. tabIndex: 0,
  98. isModel: false,
  99. customData: {
  100. bigCount: 0,
  101. smallCount: 0
  102. },
  103. showSubmitModel: false,
  104. checkStock: false
  105. };
  106. },
  107. methods: {
  108. confirmSelectEvent() {
  109. this.$util.pageTo({url: "/pagesStorehouse/inventory/update",type:2})
  110. }
  111. }
  112. };
  113. </script>
  114. <style lang="scss" scoped>
  115. .billing_box_bg {
  116. height: 100%;
  117. display: flex;
  118. flex-direction: column;
  119. .input-wrap {
  120. padding: 22upx 20upx 22upx 30upx;
  121. .search-bar {
  122. display:inline-block;
  123. width:530upx;
  124. }
  125. }
  126. .scroll-middle_bx {
  127. flex: 1;
  128. display: flex;
  129. width: 100%;
  130. height: 100%;
  131. overflow: hidden;
  132. }
  133. .tab-view {
  134. height: 100%;
  135. width: 170upx;
  136. flex-shrink: 0;
  137. background-color: #f0f2f6;
  138. .tab-bar-item {
  139. position: relative;
  140. width: 170upx;
  141. height: 90upx;
  142. box-sizing: border-box;
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. font-size: 26upx;
  147. color: #444;
  148. font-weight: 400;
  149. .tag {
  150. display: flex;
  151. padding: 0 20upx;
  152. align-items: center;
  153. position: absolute;
  154. right: 0;
  155. top: 0;
  156. height: 32upx;
  157. background: #ff2842;
  158. border-radius: 16upx;
  159. color: #fff;
  160. font-size: 20upx;
  161. }
  162. &:last-child{
  163. margin-bottom: 110upx;
  164. }
  165. }
  166. .active {
  167. position: relative;
  168. color: $mainColor;
  169. font-size: 26upx;
  170. background: #fff;
  171. }
  172. .active::before {
  173. content: "";
  174. position: absolute;
  175. border-left: 8upx solid $mainColor;
  176. height: 100%;
  177. left: 0;
  178. }
  179. }
  180. .right-box {
  181. height: 100%;
  182. flex: 1;
  183. box-sizing: border-box;
  184. }
  185. .item_list_bx {
  186. padding: 40upx 16upx;
  187. &:last-child{
  188. margin-bottom: 70upx;
  189. }
  190. }
  191. .item_list_title {
  192. margin-bottom: 20upx;
  193. font-size: 24upx;
  194. font-weight: 600;
  195. color: #666666;
  196. }
  197. .select-cmd_bx {
  198. & .kc {
  199. color: #999999;
  200. font-size: 28upx;
  201. font-weight: 400;
  202. margin-bottom: 60upx;
  203. text-align: center;
  204. margin-top: 10upx;
  205. }
  206. & .num_bx {
  207. display: flex;
  208. align-items: center;
  209. margin-bottom:80upx;
  210. & > input {
  211. font-size:30upx;
  212. width: 212upx;
  213. height: 80upx;
  214. border: 1px solid #dddddd;
  215. border-radius: 4upx;
  216. text-align: center;
  217. margin-right: 24upx;
  218. margin-left:30upx;
  219. }
  220. }
  221. }
  222. }
  223. </style>