detail.vue 6.6 KB

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