submitStockCheck.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="content flex flex_column">
  3. <view class="head-info" v-if="detail">
  4. <view>
  5. <text>货架名称</text>
  6. <view>{{detail.shelfName}}</view>
  7. </view>
  8. <view>
  9. <text>盘点日期</text>
  10. <view>{{detail.checkDate}}</view>
  11. </view>
  12. <view>
  13. <text>盘点人</text>
  14. <view>{{detail.checkPersonName}}</view>
  15. </view>
  16. <view>
  17. <text>备注</text>
  18. <view>
  19. <u-input v-if="type=='submit'" v-model="remarks" placeholder="请输入备注" input-align="right" type="textarea" :height="60" :auto-height="true" />
  20. <text v-else>{{detail.remarks}}</text>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="detail flex_1">
  25. <view class="detail-tongji" v-if="detail">
  26. <view>盘盈总数量:<text>{{detail.totalProfitQty}}</text>;盘盈总金额:<text>{{detail.totalProfitCost}}</text>;</view>
  27. <view>盘亏总数量:<text>{{detail.totalLossQty}}</text>;盘亏总金额:<text>{{detail.totalLossCost}}</text>;</view>
  28. <view>盈亏总数量:<text>{{detail.totalProfitLossQty}}</text>;盈亏总金额:<text>{{detail.totalProfitLossCost}}</text>;</view>
  29. </view>
  30. <view class="cpb_cart-list">
  31. <view class="nav-right-item flex" v-for="(item, index) in chooseList" :key="item.id" >
  32. <view class="uni-col-2">
  33. <u-image :src="item.product&&item.product.images?item.product.images:`../../static/${$config('themePath')}/def_img@2x.png`" width="100" height="100" border-radius="30"></u-image>
  34. </view>
  35. <view class="item-info uni-col-10">
  36. <view class="item-name">
  37. <text>{{item.shelfPlaceCode}}</text>
  38. {{item.productCode}}
  39. </view>
  40. <view class="item-detail">
  41. <view class="item-detail-info">
  42. <view class="flex justify_between">
  43. <view>
  44. <text class="item-detail-text">
  45. 可用:
  46. </text>
  47. {{item.stockQty||0}}
  48. </view>
  49. <view>
  50. <text class="item-detail-text">
  51. 冻结:
  52. </text>
  53. {{item.freezeQty||0}}
  54. </view>
  55. <view>
  56. <text class="item-detail-text">
  57. 实际可用:
  58. </text>
  59. <text class="red">
  60. {{item.checkQty||0}}
  61. </text>
  62. </view>
  63. </view>
  64. <view class="flex justify_between">
  65. <view>
  66. <text class="item-detail-text">
  67. 结算价:
  68. </text>
  69. ¥{{item.cost||0}}
  70. </view>
  71. <view>
  72. <text class="item-detail-text">
  73. 盈亏:
  74. </text>
  75. {{item.checkProfitLossQty||0}}
  76. (¥{{item.checkProfitLossCost||0}})
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 底部栏 -->
  86. <view class="footer-bar flex justify_between align_center" v-if="type=='submit'">
  87. <u-button size="medium" @click="goback" shape="circle" type="default" hover-class="none" >继续盘点</u-button>
  88. <u-button size="medium" @click="submitOrder" :custom-style="customBtnStyle" shape="circle" type="primary" hover-class="none" >盘点完成</u-button>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. import {
  94. stockCheckDetailQueryList,
  95. stockCheckBySn,
  96. stockCheckConfirm
  97. } from '@/api/stockCheck'
  98. import { clzConfirm } from '@/libs/tools'
  99. export default {
  100. data() {
  101. return {
  102. customBtnStyle: { // 自定义按钮样式
  103. borderColor: this.$config('primaryColor'),
  104. backgroundColor: this.$config('primaryColor'),
  105. color: '#fff'
  106. },
  107. stockCheckSn: null,
  108. remarks: '',
  109. detail: null,
  110. chooseList: [],
  111. type: ''
  112. }
  113. },
  114. onLoad(opts) {
  115. this.stockCheckSn = opts.stockCheckSn
  116. this.type = opts.type
  117. this.getDetail()
  118. this.getChooseList()
  119. if(this.type == 'view'){
  120. uni.setNavigationBarTitle({
  121. title: '盘点单详情'
  122. })
  123. }
  124. },
  125. methods: {
  126. // 详细
  127. getDetail(){
  128. stockCheckBySn({stockCheckSn: this.stockCheckSn}).then(res => {
  129. this.detail = res.data || null
  130. })
  131. },
  132. // 获取盘点明细列表
  133. getChooseList(){
  134. stockCheckDetailQueryList({
  135. stockCheckSn: this.stockCheckSn
  136. }).then(res => {
  137. this.chooseList = res.data || []
  138. })
  139. },
  140. // 盘点完成
  141. submitOrder(){
  142. const _this = this
  143. clzConfirm({
  144. title: '提示',
  145. content: '盘点完成后,无法再修改数据,确认盘点完成吗?',
  146. success (ret) {
  147. if (ret.confirm || ret.index == 0) {
  148. uni.showLoading({
  149. title:"正在提交.."
  150. })
  151. stockCheckConfirm({
  152. remarks: _this.remarks,
  153. stockCheckSn: _this.stockCheckSn
  154. }).then(res => {
  155. if(res.status == 200 && res.data){
  156. _this.goback()
  157. uni.$emit("resetStockCheck")
  158. }
  159. uni.hideLoading()
  160. })
  161. }
  162. }
  163. })
  164. },
  165. goback(){
  166. uni.navigateBack()
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="less">
  172. .content{
  173. width:100%;
  174. height: 100vh;
  175. background-color: #fff;
  176. .head-info{
  177. padding: 0 30upx;
  178. > view{
  179. display: flex;
  180. justify-content: space-between;
  181. padding: 15upx 10upx;
  182. color:#666;
  183. > text{
  184. color: #999;
  185. width: 150rpx;
  186. }
  187. border-bottom:2rpx solid #f8f8f8;
  188. > view{
  189. width: 80%;
  190. text-align: right;
  191. word-break: break-all;
  192. }
  193. }
  194. }
  195. .detail{
  196. flex-grow: 1;
  197. overflow: auto;
  198. .detail-tongji{
  199. padding: 15upx 30upx;
  200. > view{
  201. padding: 10upx;
  202. color:#999;
  203. text{
  204. color: #666;
  205. }
  206. }
  207. border-top:10rpx solid #f8f8f8;
  208. border-bottom:10rpx solid #f8f8f8;
  209. }
  210. }
  211. .cpb_cart-list{
  212. padding: 10upx 30upx;
  213. > view{
  214. border-bottom:2rpx solid #f8f8f8;
  215. padding: 15upx 0;
  216. }
  217. .item-name{
  218. font-size: 30rpx;
  219. text{
  220. background: #eef6ff;
  221. color: #174b76;
  222. border-radius: 1em;
  223. font-size: 0.8em;
  224. padding: 0 0.5em;
  225. margin-right: 10upx;
  226. }
  227. margin-bottom: 10upx;
  228. }
  229. .item-info{
  230. flex-grow: 1;
  231. padding-left: 0.2em;
  232. }
  233. .item-detail{
  234. .item-detail-info{
  235. padding: 10upx 0 4upx;
  236. font-size: 24upx;
  237. > view{
  238. padding-bottom: 10rpx;
  239. align-items: center;
  240. .item-detail-text{
  241. color: #999;
  242. }
  243. .red{
  244. color: red;
  245. }
  246. }
  247. }
  248. }
  249. }
  250. .footer-bar{
  251. background-color: #f8f8f8;
  252. padding: 20upx;
  253. button{
  254. width: 300upx;
  255. }
  256. }
  257. }
  258. </style>