detail.vue 6.5 KB

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