123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <template>
- <view class="replenishment-detail-wrap">
- <u-navbar back-text="补货单详情" :border-bottom="false" :background="{backgroundColor: $config('primaryColor')}" back-icon-color="#fff" :back-text-style="{ color: '#fff' }">
- <view slot='right' style="padding: 0 30upx;color: #ffffff;" @click="creatSalesOrder" v-if="pageType=='success'">
- <u-icon name="chuangjiandingdan" custom-prefix="iscm-icon"></u-icon>
- <text style="margin-left: 6rpx;">生成销售单</text>
- </view>
- </u-navbar>
- <view class="replenishment-detail-body" :style="`backgroundImage:linear-gradient(180deg, ${$config('primaryColor')}, #F5F6F7 12%)`">
- <view class="head-info" v-if="basicInfoData">
- <view class="states">
- <view>
- <u-icon :name="pageType=='success'?'icon_complete':'icon_cancel'" custom-prefix="iscm-icon" size="48"></u-icon>
- <text>{{pageType=='success'?'已完成':'已取消'}}</text>
- </view>
- </view>
- <view>
- <view class="label"><u-icon name="dingdanhao" custom-prefix="iscm-icon" size="32"></u-icon><text>补货单号</text></view>
- <view class="info-txt">{{basicInfoData.replenishBillNo || '--'}}</view>
- </view>
- <view>
- <view class="label"><u-icon name="ison_shelf" custom-prefix="iscm-icon" size="32"></u-icon><text>货架名称</text></view>
- <view class="info-txt">{{basicInfoData.shelfInfo&&basicInfoData.shelfInfo.shelfName || '--'}}</view>
- </view>
- <!-- <view v-if="pageType=='success'">
- <view class="label"><u-icon name="icon_delivery" custom-prefix="iscm-icon" size="32"></u-icon><text>配送方式</text></view>
- <view class="info-txt">{{basicInfoData.dispatchTypeDictValue || '--'}}</view>
- </view> -->
- <view v-if="pageType=='success'">
- <view class="label"><u-icon name="xinxi" custom-prefix="iscm-icon" size="32"></u-icon><text>出库备注</text></view>
- <view class="info-txt">{{basicInfoData.remarks || '--'}}</view>
- </view>
- </view>
- <view class="part-list">
- <!-- 补货产品 -->
- <partList :list="partList" title="配件列表" model="view" :fromPage="pageType=='success'?'replenishmentDetail':'replenishmentDetailc'" ref="partList" noDataText="暂无产品"></partList>
- </view>
- </view>
- <!-- 生成销售单 -->
- <common-modal v-if="confirmModal" :showTitle="false" :openModal="confirmModal" @confirm="modalConfirm" @close="confirmModal=false">
- <view style="font-size: 28upx;">
- <view style="padding: 10upx;" class="flex align_center justify_between">
- <view>产品总款数:<text style="color: red;">5</text></view>
- <view>产品总件数:<text style="color: red;">15</text></view>
- </view>
- <view v-if="salesOrderList.length">
- <view style="padding: 0 10upx 10upx;">此补货单已经存在对应的销售单?</view>
- <view style="padding: 0 10upx 20upx;">确认再次生成销售单吗?</view>
- <view>
- <view
- v-for="item in salesOrderList"
- :key="item.id"
- style="color: #00aaff;border-bottom: 1px solid #eee;padding: 10upx 0;"
- class="flex align_center justify_between">
- <text>{{item.orderNo}}</text>
- <view>
- <u-icon name="arrow-right"></u-icon>
- </view>
- </view>
- </view>
- </view>
- <view v-else>
- <view style="padding: 0 10upx 20upx;">确认生成销售单?</view>
- <view>
- <view
- v-for="item in salesOrderList" :key="item.id"
- style="color: #00aaff;border-bottom: 1px solid #eee;padding: 10upx 0;"
- class="flex align_center justify_between">
- <text>{{item.orderNo}}</text>
- <view>
- <u-icon name="arrow-right"></u-icon>
- </view>
- </view>
- </view>
- </view>
- </view>
- </common-modal>
- </view>
- </template>
- <script>
- import {
- shelfReplenishDetail,
- shelfReplenishDetailList,
- shelfReplenishPutStock,
- queryRelationSalesBill,
- createSalesBill} from '@/api/shelfReplenish'
- import partList from '@/pages/common/partList.vue'
- import commonModal from '@/pages/common/commonModal.vue'
- export default {
- components: { partList, commonModal },
- data() {
- return {
- confirmModal: false,
- replenishBillSn: '',
- basicInfoData:null,
- partList: [],
- salesOrderList:[],
- customStyle: {
- borderRadius:'100rpx',
- fontSize:'30rpx',
- background: this.$config('primaryColor')
- },
- pageType: ''
- }
- },
- onReady() {
- uni.setNavigationBarColor({
- frontColor: '#ffffff',
- backgroundColor: this.$config('primaryColor')
- })
- },
- onLoad(option) {
- this.replenishBillSn = option.sn
- this.pageType = option.type
- this.getDetail()
- this.getPartList()
- this.getSalesOrder()
- },
- methods: {
- // 查询详情
- getDetail(){
- shelfReplenishDetail({ sn: this.replenishBillSn }).then(res => {
- if(res.status == 200){
- this.basicInfoData = res.data || null
- }else{
- this.basicInfoData = null
- }
- })
- },
- // 查询列表
- getPartList(){
- const _this = this
- shelfReplenishDetailList({ replenishBillSn: this.replenishBillSn }).then(res => {
- console.log(res.data)
- if(res.status == 200 && res.data){
- this.partList = res.data || []
- }else{
- this.partList = []
- }
- })
- },
- // 查询关联销售单
- getSalesOrder () {
- queryRelationSalesBill({ replenishBillSn: this.replenishBillSn }).then(res => {
- if (res.status == 200) {
- this.salesOrderList = res.data
- } else {
- this.salesOrderList = []
- }
- })
- },
- // 生成销售单
- creatSalesOrder(){
- this.confirmModal = true
- },
- modalConfirm(){
- this.showLoading("正在生成销售单...")
- createSalesBill({ replenishBillSn: this.replenishBillSn }).then(res => {
- if (res.status == 200) {
- this.getSalesOrder()
- }
- this.toashMsg(res.message)
- uni.hideLoading()
- })
- }
- }
- }
- </script>
- <style lang="less">
- .replenishment-detail-wrap{
- position: relative;
- width: 100%;
- height: 100%;
- overflow: hidden;
- .replenishment-detail-body{
- padding: 0 30rpx;
- height: 100%;
- overflow: auto;
- > view{
- padding: 10rpx 25rpx;
- background-color: #fff;
- margin-bottom: 20rpx;
- border-radius: 25rpx;
- box-shadow: 2rpx 3rpx 5rpx #eee;
- }
- .head-info{
- .states{
- border: 0;
- padding: 20rpx 0;
- > view{
- color: #191919;
- text-align: center;
- font-size: 40rpx;
- text{
- margin-left: 20rpx;
- }
- }
- }
- .info-txt{
- word-break: break-word;
- }
- font-size: 30rpx;
- > view{
- display: flex;
- border-bottom: 2rpx solid #f5f5f5;
- padding: 20rpx 0;
- > view:last-child{
- flex-grow: 1;
- width: 80%;
- }
- &:last-child{
- border:0;
- }
- }
- .label{
- display: flex;
- align-items: center;
- width: 220rpx;
- height: 44rpx;
- color: #7C7D7E;
- text{
- margin-left: 10rpx;
- }
- }
- }
- }
- .replenishment-detail-footer{
- padding: 26upx 32upx 30upx;
- background-color: #fff;
- position: fixed;
- left: 0;
- bottom: 0;
- width: 100%;
- box-shadow: 3px 1px 7px #eee;
- }
- }
- </style>
|