select-goods.wxml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <wxs module="m1">
  2. var displayPrice = function (item) {
  3. var numberFormat = require("/utils/numberFormat.wxs");
  4. // 如果有促销显示标准售价,如果正常品显示标价
  5. // if (item.promotionType == 0) {
  6. //优先显示促销价
  7. if (item.pricePromotion) {
  8. return '¥' + numberFormat.toThousandCents(item.pricePromotion)
  9. } else {
  10. return '¥' + numberFormat.toThousandCents(item.priceStandard)
  11. }
  12. // } else {
  13. // return '¥' + numberFormat.toThousandCents(item.pricePromotion)
  14. // }
  15. // return ''
  16. }
  17. module.exports.displayPrice = displayPrice
  18. </wxs>
  19. <wxs src='/utils/numberFormat.wxs' module="numberFormat"></wxs>
  20. <wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
  21. <loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
  22. <van-dialog id="van-dialog" />
  23. <van-sticky offset-top="{{ 0 }}">
  24. <van-nav-bar title="选择商品" left-text="" left-arrow="{{true}}" bind:click-left="onClickLeft" />
  25. <view style="display: flex;">
  26. <view style="width: 85%;">
  27. <van-search border="{{false}}" bind:search="doSearch" custom-class="search-class" bind:change="onSearchText" model:value="{{ searchText }}" placeholder="输入商品名/商品编码/唯一编码" use-right-icon-slot="{{true}}" placeholder-style="color:#95A8CB">
  28. </van-search>
  29. </view>
  30. <view class="scan-class" style="width: 15%;display: flex;align-items: center;">
  31. <image class="scan-image" fit="fill" src="{{imageUrl+'scan_image.png'}}"></image>
  32. </view>
  33. </view>
  34. <view style="display: flex;margin-left: 24rpx;margin-right: 24rpx;margin-top: 10rpx;">
  35. <view bind:tap="selectedProduct" data-active="{{0}}" class="{{ active == 0 ?'selected-product selected-product-color-01' : 'selected-product selected-product-color-02'}}">
  36. 商品列表
  37. </view>
  38. <view bind:tap="selectedProduct" data-active="{{1}}" class="{{ active == 0 ? 'selected-product selected-product-color-02' : 'selected-product selected-product-color-01'}}">
  39. 已选商品
  40. </view>
  41. </view>
  42. </van-sticky>
  43. <!-- <van-tabs type="card" custom-class="tags-class" tab-active-class="{{active==0?'van-tab-active-left':'van-tab-active-right'}}" animated="{{true}}" swipeable="{{true}}" active="{{ active }}" dot bind:change="changeTag">
  44. <van-tab title="商品列表"></van-tab>
  45. <van-tab title="已选商品" info="{{choosedGoodsList.length==0?'':choosedGoodsList.length}}"></van-tab>
  46. </van-tabs> -->
  47. <view style="height:100%;background: #F8F9FD ;" class="{{ controlFlags.choosewhFlag?'addtop':''}}">
  48. <!-- 商品编码的列表 走sku-->
  49. <scroll-view scroll-y='{{true}}' bindscrolltolower='scrollToLower' lower-threshold='100' wx:if="{{active == 0 &&( billType == 'pur' || billType == 'sale' || billType == 'saleOut' )}}" class="goods-class" style="height:calc({{windowHeight+'px'}} - 295rpx);overflow: scroll;">
  50. <van-cell-group style="display: flex;justify-content: flex-end;width: calc({{windowWidth+'px'}} - 20rpx);" custom-class="cell-width">
  51. <view wx:for="{{tableData}}" wx:key="index" border="{{ false }}" class="goods-cell-class" data-item="{{item}}" bind:tap="openAddItemInfo">
  52. <view class="goods-item-class">
  53. <view>
  54. <van-image radius="15rpx" custom-class="goods-item-image" fit="fill" src="{{item.skuImages? item.skuImages.path : '' }}" />
  55. </view>
  56. <view style="margin-left: 26rpx;width: 100%; ">
  57. <!-- 标题 -->
  58. <view>
  59. <dk-text fontSize="24rpx" value="{{item.skuCode}}"></dk-text>
  60. <!-- <dk-title fontSize="28rpx" titleTag="{{item.brandName}}" title="{{item.skuCode}}"></dk-title> -->
  61. </view>
  62. <!-- 描述 -->
  63. <view style="display: flex; ">
  64. <dk-text fontSize="24rpx" value="{{item.skuName}}"></dk-text>
  65. </view>
  66. <view style="display: flex;align-items: flex-end;">
  67. <!-- 标准价/标价-->
  68. <view style="width: 85%;">
  69. <view wx:if="{{billType == 'pur'}}">
  70. <!-- <view style="color: #002340A6;font-size:22rpx;font-weight: 500;">采购价</view> -->
  71. <dk-cell height="46rpx" spaceWidth="1rpx" left="0" fontSize="14" contentColor="#FF7B1A" fontWeight="700" title="" content="{{item.pricePurchase?item.pricePurchase:0}}"></dk-cell>
  72. </view>
  73. <view wx:else style="margin-top: 30rpx;">
  74. <!-- <view style="color: #002340A6;font-size:22rpx;font-weight: 500;margin-top: 18rpx;">标价</view> -->
  75. <dk-cell height="46rpx" spaceWidth="1rpx" left="0" fontSize="14" contentColor="#FF7B1A" fontWeight="700" title="" content="{{item.priceStandard?item.priceStandard:0}}"></dk-cell>
  76. </view>
  77. </view>
  78. <!-- 加号 -->
  79. <view class="van-icon-class">
  80. <van-icon data-item="{{item}}" bind:tap="openAddItemInfo" size="25px" name="add-square" style="color:#3E69F6;border-radius: 8px !important;" />
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <view wx:if="{{tableData.length!=0}}" style="height:180rpx;"></view>
  87. <van-cell wx:if="{{tableData.length==0}}" border="{{ false }}">
  88. <view style="width:100%;">
  89. <van-empty description="暂无商品" />
  90. </view>
  91. </van-cell>
  92. </van-cell-group>
  93. </scroll-view>
  94. <!--出库商品 列表 走库存-->
  95. <view wx:if="{{active == 0 && (billType == 'out' || billType =='purReturn')}}" style="height:calc({{windowHeight+'px'}} - 295rpx);overflow: scroll;" >
  96. <scroll-view scroll-y='{{true}}' bindscrolltolower='scrollToLower' lower-threshold='100' >
  97. <view wx:for="{{tableData}}" wx:key="index" catch:tap="openAddItemInfo" data-item="{{item}}" class="main-class" style="width: 75%;margin-left: 166rpx;">
  98. <view class="main-foot" style="border-radius:15rpx;">
  99. <view>
  100. <view class="table-content-row">
  101. <view style="display:flex;width:100%;">
  102. <view data-item="{{item}}" style="display:flex;font-size: 15px;">
  103. <dk-text style="font-size:30rpx;" fontWeight="nomal" value="{{item.skuCode}}"></dk-text>
  104. </view>
  105. </view>
  106. </view>
  107. <!-- 商品名称 -->
  108. <view class="table-row">
  109. <view class="table-content-row">
  110. <view style="display: flex;">
  111. <view class="table-content-row-font">
  112. <dk-text fontSize="14px" color="#95A8CB" fontWeight="nomal" value="商品名称" copyValue="{{item.skuName}}"></dk-text>
  113. </view>
  114. <view class="table-content-class">
  115. {{item.skuName?item.skuName:''}}
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. <!-- 库区 -->
  121. <view class="table-content-row">
  122. <view style="display: flex;">
  123. <view class="table-content-row-font">
  124. <dk-text layoutFlag="{{true}}" fontSize="14px" color="#95A8CB" fontWeight="nomal" value="库区" copyValue="{{item.whName}}"></dk-text>
  125. </view>
  126. <view class="table-content-class">
  127. {{item.whName?item.whName:''}}
  128. </view>
  129. </view>
  130. </view>
  131. <!-- 库区色号 -->
  132. <view class="table-content-row">
  133. <view style="display: flex; justify-content:space-between;">
  134. <view style="display: flex;">
  135. <view class="table-content-row-font">
  136. <dk-text layoutFlag="{{true}}" fontSize="14px" color="#95A8CB" fontWeight="nomal" value="色号" copyValue="{{item.nonStdCode}}"></dk-text>
  137. </view>
  138. <view class="table-content-class">
  139. {{item.nonStdCode?item.nonStdCode:''}}
  140. </view>
  141. </view>
  142. <!-- 加号 -->
  143. <view class="van-icon-class">
  144. <van-icon size="25px" name="add" style="color:#1B365D" />
  145. </view>
  146. </view>
  147. </view>
  148. <!-- 分割线 -->
  149. <dk-divider marginTop="20rpx" marginBottom="0rpx"></dk-divider>
  150. <!-- 下半部分 -->
  151. <view class="table-content-row">
  152. <view style="display: flex;justify-content:space-between">
  153. <view style="display: flex;">
  154. <view class="table-content-row-font">
  155. <dk-text layoutFlag="{{true}}" fontSize="14px" color="#95A8CB" fontWeight="nomal" value="库存量"></dk-text>
  156. </view>
  157. <view style="font-size: 13px;color: #CAA977;">
  158. {{item.invQty}}
  159. </view>
  160. </view>
  161. <view style="display: flex;">
  162. <view class="table-content-row-font">
  163. <dk-text layoutFlag="{{true}}" fontSize="14px" color="#95A8CB" fontWeight="nomal" value="可售量"></dk-text>
  164. </view>
  165. <view style="font-size: 13px;color: #CAA977;">
  166. {{item.usableQty }}
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. </scroll-view>
  175. </view>
  176. <!--已选列表-->
  177. <view wx:if="{{active == 1}}" class="goods-selected-class">
  178. <view class="goods-class" style="height:calc({{windowHeight+'px'}} - 295rpx);overflow: scroll;"></view>
  179. <van-cell-group style="display: flex;justify-content: flex-end;width: calc({{windowWidth+'px'}} - 20rpx);" custom-class="width-80">
  180. <van-cell wx:if="{{choosedGoodsList.length==0}}" border="{{ false }}">
  181. <van-empty description="暂无商品" />
  182. </van-cell>
  183. <van-cell custom-class="goods-cell-class" wx:for="{{choosedGoodsList}}" wx:key="index" data-index="{{index}}" border="{{ false }}">
  184. <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" async-close bind:close="delChoosedGoodsItem">
  185. <view class="goods-item-class">
  186. <view>
  187. <van-image radius="15rpx" custom-class="goods-item-image" fit="fill" src="{{item.skuImages? item.skuImages.path : '' }}" />
  188. </view>
  189. <view style="margin-left: 26rpx;width: 100%;">
  190. <view data-item="{{item}}" data-index="{{index}}" bind:tap="openChoosedItemInfo">
  191. <!-- 标题 -->
  192. <view style="display: flex;">
  193. <dk-title titleTag="{{item.brandName}}" title="{{item.skuCode}}"></dk-title>
  194. </view>
  195. <!-- 描述 -->
  196. <view style="display: flex; ">
  197. <dk-text value="{{item.skuName}}"></dk-text>
  198. </view>
  199. <view style="display: flex;" wx:if="{{billType == 'pur'}}">
  200. <!-- 标准价/标价-->
  201. <view style="width: 85%;">
  202. <dk-cell height="46rpx" spaceWidth="1rpx" left="0" fontSize="13" contentColor="#CAA977" fontWeight="bold" title=" " content="{{item.pricePurchase?item.pricePurchase:0}}"></dk-cell>
  203. </view>
  204. <view style="text-align: right;width: 5%;">
  205. <van-icon name="arrow" style="font-size:3.5vw;" />
  206. </view>
  207. </view>
  208. <view style="display: flex;" wx:if="{{billType == 'sale'}}">
  209. <view class="table-content-row-font">
  210. <dk-text fontSize="14px" color="#95A8CB" fontWeight="nomal" value="库区" copyValue="{{item.whName}}"></dk-text>
  211. </view>
  212. <view class="table-content-class">
  213. {{item.whName?item.whName:''}}
  214. </view>
  215. </view>
  216. <view style="display: flex;" wx:if="{{billType == 'sale'}}">
  217. <view class="table-content-row-font">
  218. <dk-text fontSize="14px" color="#95A8CB" fontWeight="nomal" value="商品批次号" copyValue="{{item.nonStdCode}}"></dk-text>
  219. </view>
  220. <view class="table-content-class">
  221. {{item.nonStdCode?item.nonStdCode:''}}
  222. </view>
  223. </view>
  224. </view>
  225. <view style="display:flex">
  226. <!-- <view style="padding-top: 5rpx;">
  227. <dk-text value="数量:"></dk-text>
  228. </view> -->
  229. <van-stepper value="{{item.itemQty}}" data-index="{{index}}" min="0" integer="{{true}}" max="999999999" bind:change="changeAllreadyChooseQuantity" />
  230. </view>
  231. </view>
  232. </view>
  233. <view slot="right">删除</view>
  234. </van-swipe-cell>
  235. </van-cell>
  236. </van-cell-group>
  237. <view style="height:220rpx;"></view>
  238. </view>
  239. </view>
  240. <view wx:if="{{active == 0 && controlFlags.choosewhFlag}}" class="screen-class">
  241. <van-dropdown-menu active-color="#1B365D" style=" width: calc(100% ) !important; ">
  242. <!-- 库区 -->
  243. <van-dropdown-item id="statusItemWareHouse" disabled="{{controlFlags.choosewhReadonly}}" title="{{ form.whName ? form.whName:'仓库' }}" bind:open="dropdowncommit">
  244. </van-dropdown-item>
  245. <!-- 可售量排序 -->
  246. <van-dropdown-item title="{{ orderBy.text?orderBy.text:'可售量升序' }}" value="{{value}}" options="{{ orderBy }}" bind:change="onSwitchChange">
  247. </van-dropdown-item>
  248. </van-dropdown-menu>
  249. </view>
  250. <van-sidebar activeKey="{{sideKey}}" bindchange="changeSidebar" custom-class="{{active == 0 ? 'left-class' : 'right-class'}}">
  251. <view wx:if="{{active != 1}}" class="{{controlFlags.choosewhFlag?'addsidebar':''}}" style=" height:calc({{windowHeight+'px'}} - {{active == 1 ? '270rpx' :'400rpx' }});overflow: scroll;">
  252. <van-sidebar-item class="sidebar" wx:key="index" custom-class="{{sideKey - 1 == index? 'sidebar-item-before': (sideKey + 1 == index?'sidebar-item-next':'sidebar-item')}}" title="{{item.catName}}" data-id="{{item.catId}}" wx:for="{{typeList}}" />
  253. </view>
  254. </van-sidebar>
  255. <dk-popup wx:if="{{ billType != 'sale' && billType != 'saleOut' }}" type="sale" descCol="skuModel"titleTagCol="shortName" titleCol="skuModel" priceCol="pricePromotion" value="{{dataItem}}" show="{{showPop}}" routeObjName="{{routeObjName}}" priceTitle="参考价:" priceCol="pricePurchase" contentObj="{{popContent}}" bind:commit="editItems">
  256. </dk-popup>
  257. <dk-popup wx:if="{{ billType == 'sale' }}" type="sale" titleTagCol="brandName" subCol="skuCode" descCol="skuModel" titleCol="skuName" priceTitle="标价:" priceCol="priceStandard" value="{{dataItem}}" show="{{showPop}}" routeObjName="{{routeObjName}}" contentObj="{{popContent}}" bind:commit="editItems">
  258. </dk-popup>
  259. <dk-popup wx:if="{{ billType == 'saleOut' }}" type="sale" titleTagCol="brandName" subCol="skuCode" descCol="skuModel" titleCol="skuName" priceTitle="标价:" priceCol="priceStandard" value="{{dataItem}}" show="{{showPop}}" routeObjName="{{routeObjName}}" contentObj="{{popContent}}" bind:commit="editItems" popupTopObj="{{popupTopObj}}">
  260. </dk-popup>
  261. <!-- <dk-save-button cssType="{{ (billType == 'sale' || billType == 'saleOut' )? 'shopping':''}}" model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="submit"></dk-save-button> -->
  262. <dk-save-button cssType="sale" model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="submit"></dk-save-button>
  263. <!-- 仓库 -->
  264. <dk-single-dropdown-item show="{{whFlag}}" content="{{form.whName}}" id='warehouse' typeName='warehouse' bind:commit='mutiSearch' bind:close='muticlose'>
  265. </dk-single-dropdown-item>