detail.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view class="shuntBack-detail-wrap" :style="`backgroundImage:linear-gradient(180deg, ${$config('primaryColor')}, #F5F6F7 12%)`">
  3. <view class="shuntBack-detail-body">
  4. <view class="head-info" v-if="basicInfoData">
  5. <view class="states">
  6. <view>
  7. <u-icon :name="pageType=='success'?'icon_complete':'icon_cancel'" custom-prefix="iscm-icon" size="48"></u-icon>
  8. <text>{{pageType=='success'?'已完成':'已取消'}}</text>
  9. </view>
  10. </view>
  11. <view>
  12. <view class="label"><u-icon name="icon_order" custom-prefix="iscm-icon" size="32"></u-icon><text>调回单号</text></view>
  13. <view class="info-txt">{{basicInfoData.recallBillNo || '--'}}</view>
  14. </view>
  15. <view>
  16. <view class="label"><u-icon name="ison_shelf" custom-prefix="iscm-icon" size="32"></u-icon><text>货架名称</text></view>
  17. <view class="info-txt">{{basicInfoData.shelfInfo&&basicInfoData.shelfInfo.shelfName || '--'}}</view>
  18. </view>
  19. </view>
  20. <view class="part-list">
  21. <!-- 调回产品 -->
  22. <partList :list="partList" title="调回产品" model="view" :fromPage="pageType=='success'?'shuntBackDetail':'shuntBackDetailc'" ref="partList" noDataText="暂无产品"></partList>
  23. </view>
  24. </view>
  25. <!-- 生成销售退货单弹窗 -->
  26. <common-modal :showTitle="false" :openModal="refundModal" @confirm="refundModalConfirm" @close="refundModal=false">
  27. <view style="font-size: 28upx;">
  28. <view style="padding: 10upx;" class="flex align_center justify_between" v-if="basicInfoData">
  29. <view>产品总款数:<text style="color: red;">{{basicInfoData.totalCategory}}</text></view>
  30. <view>产品总件数:<text style="color: red;">{{basicInfoData.totalQty}}</text></view>
  31. </view>
  32. <view v-if="salesOrderList.length">
  33. <view style="padding: 0 10upx 10upx;">此补货单已经存在对应的销售单?</view>
  34. <view style="padding: 0 10upx 20upx;">确认再次生成销售单吗?</view>
  35. <view>
  36. <view
  37. v-for="item in salesOrderList"
  38. :key="item.id"
  39. style="color: #00aaff;border-bottom: 1px solid #eee;padding: 10upx 0;"
  40. class="flex align_center justify_between">
  41. <text>{{item.salesReturnNo}}</text>
  42. <view>
  43. <u-icon name="arrow-right"></u-icon>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view v-else>
  49. <view style="padding: 0 10upx 20upx;">确认生成销售单?</view>
  50. </view>
  51. </view>
  52. </common-modal>
  53. </view>
  54. </template>
  55. <script>
  56. import { shelfRecallFindBySn, shelfRecallDetail,generateSaleReturnBill } from '@/api/shelfRecall'
  57. import partList from '@/pages/common/partList.vue'
  58. import commonModal from '@/pages/common/commonModal.vue'
  59. export default {
  60. components: { partList,commonModal },
  61. data() {
  62. return {
  63. recallBillSn: '',
  64. basicInfoData:null,
  65. partList: [],
  66. customStyle: {
  67. borderRadius:'100rpx',
  68. fontSize:'30rpx',
  69. background: this.$config('primaryColor')
  70. },
  71. pageType: '',
  72. refundModal:true,
  73. salesOrderList:[]
  74. }
  75. },
  76. onReady() {
  77. uni.setNavigationBarColor({
  78. frontColor: '#ffffff',
  79. backgroundColor: this.$config('primaryColor')
  80. })
  81. },
  82. onLoad(option) {
  83. this.recallBillSn = option.sn
  84. this.pageType = option.type
  85. this.getDetail()
  86. this.getPartList()
  87. },
  88. onNavigationBarButtonTap(){
  89. this.refundModal = true;
  90. },
  91. methods: {
  92. // 查询详情
  93. getDetail(){
  94. shelfRecallFindBySn({ sn: this.recallBillSn }).then(res => {
  95. if(res.status == 200){
  96. this.basicInfoData = res.data || null;
  97. this.salesOrderList = res.data.salesReturnBillList ? res.data.salesReturnBillList:[];
  98. //#ifdef APP-PLUS
  99. let webView = this.$mp.page.$getAppWebview();
  100. if(res.data.billState == 'CANCEL'){
  101. webView.setTitleNViewButtonStyle(0,{
  102. "color": "transparent",
  103. "width": "0px"
  104. })
  105. }
  106. //#endif
  107. }else{
  108. this.basicInfoData = null
  109. }
  110. })
  111. },
  112. // 查询列表
  113. getPartList(){
  114. const _this = this
  115. shelfRecallDetail({ recallBillSn: this.recallBillSn }).then(res => {
  116. if(res.status == 200 && res.data){
  117. res.data.map(item =>{
  118. item.confirmQty = item.confirmQty ? Number(item.confirmQty) : 0
  119. item.putQty = item.confirmQty ? Number(item.confirmQty) : 0
  120. })
  121. this.partList = res.data || []
  122. }else{
  123. this.partList = []
  124. }
  125. })
  126. },
  127. // 生成销售退货单
  128. refundModalConfirm(){
  129. generateSaleReturnBill({ recallBillSn: this.recallBillSn }).then(res => {
  130. if (res.status == 200) {
  131. uni.showToast({
  132. title:res.message
  133. })
  134. this.refundModal = false
  135. }else{
  136. uni.showToast({
  137. title:res.message,
  138. icon:'none'
  139. })
  140. }
  141. })
  142. }
  143. }
  144. }
  145. </script>
  146. <style lang="less">
  147. .shuntBack-detail-wrap{
  148. position: relative;
  149. width: 100%;
  150. height: 100%;
  151. overflow: hidden;
  152. .shuntBack-detail-body{
  153. padding: 0 30rpx;
  154. height: 100%;
  155. overflow: auto;
  156. > view{
  157. padding: 10rpx 25rpx;
  158. background-color: #fff;
  159. margin-bottom: 20rpx;
  160. border-radius: 25rpx;
  161. box-shadow: 2rpx 3rpx 5rpx #eee;
  162. }
  163. .head-info{
  164. .states{
  165. border: 0;
  166. padding: 20rpx 0;
  167. > view{
  168. color: #191919;
  169. text-align: center;
  170. font-size: 40rpx;
  171. text{
  172. margin-left: 20rpx;
  173. }
  174. }
  175. }
  176. .info-txt{
  177. word-break: break-word;
  178. }
  179. font-size: 30rpx;
  180. > view{
  181. display: flex;
  182. border-bottom: 2rpx solid #f5f5f5;
  183. padding: 20rpx 0;
  184. > view:last-child{
  185. flex-grow: 1;
  186. width: 80%;
  187. }
  188. &:last-child{
  189. border:0;
  190. }
  191. }
  192. .label{
  193. display: flex;
  194. align-items: center;
  195. width: 220rpx;
  196. height: 44rpx;
  197. color: #7C7D7E;
  198. text{
  199. margin-left: 10rpx;
  200. }
  201. }
  202. }
  203. }
  204. .shuntBack-detail-footer{
  205. padding: 26upx 32upx 30upx;
  206. background-color: #fff;
  207. position: fixed;
  208. left: 0;
  209. bottom: 0;
  210. width: 100%;
  211. box-shadow: 3px 1px 7px #eee;
  212. }
  213. }
  214. </style>