detail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. if(res.data.billState == 'CANCEL' ||res.data.billState == 'FINISH'){
  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. this.showLoading("正在生成销售退货单...")
  130. generateSaleReturnBill({ recallBillSn: this.recallBillSn }).then(res => {
  131. if (res.status == 200) {
  132. uni.showToast({
  133. title:res.message
  134. })
  135. setTimeout(()=>{
  136. this.refundModal = false
  137. this.getDetail();
  138. },800)
  139. }else{
  140. uni.showToast({
  141. title:res.message,
  142. icon:'none'
  143. })
  144. }
  145. uni.hideLoading()
  146. })
  147. }
  148. }
  149. }
  150. </script>
  151. <style lang="less">
  152. .shuntBack-detail-wrap{
  153. position: relative;
  154. width: 100%;
  155. height: 100%;
  156. overflow: hidden;
  157. .shuntBack-detail-body{
  158. padding: 0 30rpx;
  159. height: 100%;
  160. overflow: auto;
  161. > view{
  162. padding: 10rpx 25rpx;
  163. background-color: #fff;
  164. margin-bottom: 20rpx;
  165. border-radius: 25rpx;
  166. box-shadow: 2rpx 3rpx 5rpx #eee;
  167. }
  168. .head-info{
  169. .states{
  170. border: 0;
  171. padding: 20rpx 0;
  172. > view{
  173. color: #191919;
  174. text-align: center;
  175. font-size: 40rpx;
  176. text{
  177. margin-left: 20rpx;
  178. }
  179. }
  180. }
  181. .info-txt{
  182. word-break: break-word;
  183. }
  184. font-size: 30rpx;
  185. > view{
  186. display: flex;
  187. border-bottom: 2rpx solid #f5f5f5;
  188. padding: 20rpx 0;
  189. > view:last-child{
  190. flex-grow: 1;
  191. width: 80%;
  192. }
  193. &:last-child{
  194. border:0;
  195. }
  196. }
  197. .label{
  198. display: flex;
  199. align-items: center;
  200. width: 220rpx;
  201. height: 44rpx;
  202. color: #7C7D7E;
  203. text{
  204. margin-left: 10rpx;
  205. }
  206. }
  207. }
  208. }
  209. .shuntBack-detail-footer{
  210. padding: 26upx 32upx 30upx;
  211. background-color: #fff;
  212. position: fixed;
  213. left: 0;
  214. bottom: 0;
  215. width: 100%;
  216. box-shadow: 3px 1px 7px #eee;
  217. }
  218. }
  219. </style>