detail.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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;margin: 20upx 0;" class="flex align_center justify_between">
  43. <view>产品总款数:<text style="color: red;">{{partList.length}}</text></view>
  44. <view>产品总件数:<text style="color: red;">{{totalNums}}</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. @click="viewSales(item)"
  56. >
  57. <text>{{item.salesBillNo}}</text>
  58. <view>
  59. <u-icon name="arrow-right"></u-icon>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view v-else>
  65. <view style="padding: 0 10upx 20upx;">确认生成销售单?</view>
  66. <view>
  67. <view
  68. v-for="item in salesOrderList" :key="item.id"
  69. style="color: #00aaff;border-bottom: 1px solid #eee;padding: 10upx 0;"
  70. class="flex align_center justify_between">
  71. <text>{{item.orderNo}}</text>
  72. <view>
  73. <u-icon name="arrow-right"></u-icon>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </common-modal>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. shelfReplenishDetail,
  85. shelfReplenishDetailList,
  86. shelfReplenishPutStock,
  87. queryRelationSalesBill,
  88. createSalesBill} from '@/api/shelfReplenish'
  89. import partList from '@/pages/common/partList.vue'
  90. import commonModal from '@/pages/common/commonModal.vue'
  91. export default {
  92. components: { partList, commonModal },
  93. data() {
  94. return {
  95. confirmModal: false,
  96. replenishBillSn: '',
  97. basicInfoData:null,
  98. partList: [],
  99. salesOrderList:[],
  100. customStyle: {
  101. borderRadius:'100rpx',
  102. fontSize:'30rpx',
  103. background: this.$config('primaryColor')
  104. },
  105. pageType: ''
  106. }
  107. },
  108. onReady() {
  109. uni.setNavigationBarColor({
  110. frontColor: '#ffffff',
  111. backgroundColor: this.$config('primaryColor')
  112. })
  113. },
  114. onLoad(option) {
  115. this.replenishBillSn = option.sn
  116. this.pageType = option.type
  117. this.getDetail()
  118. this.getPartList()
  119. this.getSalesOrder()
  120. },
  121. computed: {
  122. totalNums() {
  123. let ret = 0
  124. this.partList.map(item => {
  125. ret = ret + item.putQty
  126. })
  127. return ret
  128. }
  129. },
  130. methods: {
  131. // 查询详情
  132. getDetail(){
  133. shelfReplenishDetail({ sn: this.replenishBillSn }).then(res => {
  134. if(res.status == 200){
  135. this.basicInfoData = res.data || null
  136. }else{
  137. this.basicInfoData = null
  138. }
  139. })
  140. },
  141. // 查询列表
  142. getPartList(){
  143. const _this = this
  144. shelfReplenishDetailList({ replenishBillSn: this.replenishBillSn }).then(res => {
  145. console.log(res.data)
  146. if(res.status == 200 && res.data){
  147. this.partList = res.data || []
  148. }else{
  149. this.partList = []
  150. }
  151. })
  152. },
  153. // 查询关联销售单
  154. getSalesOrder () {
  155. queryRelationSalesBill({ replenishBillSn: this.replenishBillSn }).then(res => {
  156. if (res.status == 200) {
  157. this.salesOrderList = res.data
  158. } else {
  159. this.salesOrderList = []
  160. }
  161. })
  162. },
  163. // 生成销售单
  164. creatSalesOrder(){
  165. this.confirmModal = true
  166. },
  167. modalConfirm(){
  168. this.showLoading("正在生成销售单...")
  169. createSalesBill({ replenishBillSn: this.replenishBillSn }).then(res => {
  170. if (res.status == 200) {
  171. this.getSalesOrder()
  172. }
  173. this.confirmModal = false
  174. this.toashMsg(res.message)
  175. uni.hideLoading()
  176. })
  177. },
  178. // 查看销售单
  179. viewSales(data){
  180. uni.navigateTo({ url: '/pages/sales/edit?pageType=detail&data='+JSON.stringify(data) })
  181. }
  182. }
  183. }
  184. </script>
  185. <style lang="less">
  186. .replenishment-detail-wrap{
  187. position: relative;
  188. width: 100%;
  189. height: 100%;
  190. overflow: hidden;
  191. .replenishment-detail-body{
  192. padding: 0 30rpx;
  193. height: 100%;
  194. overflow: auto;
  195. > view{
  196. padding: 10rpx 25rpx;
  197. background-color: #fff;
  198. margin-bottom: 20rpx;
  199. border-radius: 25rpx;
  200. box-shadow: 2rpx 3rpx 5rpx #eee;
  201. }
  202. .head-info{
  203. .states{
  204. border: 0;
  205. padding: 20rpx 0;
  206. > view{
  207. color: #191919;
  208. text-align: center;
  209. font-size: 40rpx;
  210. text{
  211. margin-left: 20rpx;
  212. }
  213. }
  214. }
  215. .info-txt{
  216. word-break: break-word;
  217. }
  218. font-size: 30rpx;
  219. > view{
  220. display: flex;
  221. border-bottom: 2rpx solid #f5f5f5;
  222. padding: 20rpx 0;
  223. > view:last-child{
  224. flex-grow: 1;
  225. width: 80%;
  226. }
  227. &:last-child{
  228. border:0;
  229. }
  230. }
  231. .label{
  232. display: flex;
  233. align-items: center;
  234. width: 220rpx;
  235. height: 44rpx;
  236. color: #7C7D7E;
  237. text{
  238. margin-left: 10rpx;
  239. }
  240. }
  241. }
  242. }
  243. .replenishment-detail-footer{
  244. padding: 26upx 32upx 30upx;
  245. background-color: #fff;
  246. position: fixed;
  247. left: 0;
  248. bottom: 0;
  249. width: 100%;
  250. box-shadow: 3px 1px 7px #eee;
  251. }
  252. }
  253. </style>