detail.vue 6.9 KB

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