detail.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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.viewQty}}</text></view>
  31. </view>
  32. <view v-if="salesOrderList.length">
  33. <view style="padding: 0 10upx 10upx;font-size: 26rpx;">此调回单已经存在对应的销售退货单?</view>
  34. <view style="padding: 0 10upx 20upx;font-size: 26rpx;">确认再次生成销售退货单吗?</view>
  35. <scroll-view scroll-y="true" style="height: 200rpx;">
  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. </scroll-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:false,
  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. let zeroFlag=this.partList.every(item=>{
  101. return item.confirmQty ==0
  102. })
  103. if(res.data.billState == 'CANCEL' ||zeroFlag ){
  104. webView.setTitleNViewButtonStyle(0,{
  105. "color": "transparent",
  106. "width": "0px"
  107. })
  108. }
  109. //#endif
  110. }else{
  111. this.basicInfoData = null
  112. }
  113. })
  114. },
  115. // 查询列表
  116. getPartList(){
  117. const _this = this
  118. shelfRecallDetail({ recallBillSn: this.recallBillSn }).then(res => {
  119. if(res.status == 200 && res.data){
  120. res.data.map(item =>{
  121. item.confirmQty = item.confirmQty ? Number(item.confirmQty) : 0
  122. item.putQty = item.confirmQty ? Number(item.confirmQty) : 0
  123. })
  124. this.partList = res.data || []
  125. }else{
  126. this.partList = []
  127. }
  128. })
  129. },
  130. // 生成销售退货单
  131. refundModalConfirm(){
  132. this.showLoading("正在生成销售退货单...")
  133. generateSaleReturnBill({ recallBillSn: this.recallBillSn }).then(res => {
  134. if (res.status == 200) {
  135. uni.showToast({
  136. title:res.message
  137. })
  138. this.getDetail();
  139. setTimeout(()=>{
  140. this.refundModal = false
  141. },800)
  142. }else{
  143. uni.showToast({
  144. title:res.message,
  145. icon:'none'
  146. })
  147. }
  148. uni.hideLoading()
  149. })
  150. }
  151. }
  152. }
  153. </script>
  154. <style lang="less">
  155. .shuntBack-detail-wrap{
  156. position: relative;
  157. width: 100%;
  158. height: 100%;
  159. overflow: hidden;
  160. .shuntBack-detail-body{
  161. padding: 0 30rpx;
  162. height: 100%;
  163. overflow: auto;
  164. > view{
  165. padding: 10rpx 25rpx;
  166. background-color: #fff;
  167. margin-bottom: 20rpx;
  168. border-radius: 25rpx;
  169. box-shadow: 2rpx 3rpx 5rpx #eee;
  170. }
  171. .head-info{
  172. .states{
  173. border: 0;
  174. padding: 20rpx 0;
  175. > view{
  176. color: #191919;
  177. text-align: center;
  178. font-size: 40rpx;
  179. text{
  180. margin-left: 20rpx;
  181. }
  182. }
  183. }
  184. .info-txt{
  185. word-break: break-word;
  186. }
  187. font-size: 30rpx;
  188. > view{
  189. display: flex;
  190. border-bottom: 2rpx solid #f5f5f5;
  191. padding: 20rpx 0;
  192. > view:last-child{
  193. flex-grow: 1;
  194. width: 80%;
  195. }
  196. &:last-child{
  197. border:0;
  198. }
  199. }
  200. .label{
  201. display: flex;
  202. align-items: center;
  203. width: 220rpx;
  204. height: 44rpx;
  205. color: #7C7D7E;
  206. text{
  207. margin-left: 10rpx;
  208. }
  209. }
  210. }
  211. }
  212. .shuntBack-detail-footer{
  213. padding: 26upx 32upx 30upx;
  214. background-color: #fff;
  215. position: fixed;
  216. left: 0;
  217. bottom: 0;
  218. width: 100%;
  219. box-shadow: 3px 1px 7px #eee;
  220. }
  221. }
  222. </style>