123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- <template>
- <view class="detail-view">
- <view class="top-view clearfix">
- <view class="float_left">
- <text v-if="order_detail.auditStatus === 2" class="status-text">已审核</text>
- <text v-else class="status-text">待审核</text>
- </view>
- </view>
- <view class="detail-cont">
- <view class="info-li clearfix">
- <view class="label">退货单号</view>
- <view class="value" @click="copy(order_detail.no)">
- <u-icon margin-right="20" label-pos="left" :label="order_detail.no" name="copy" custom-prefix="custom-icon" size="24"></u-icon>
- </view>
- </view>
- <view class="info-li clearfix">
- <view class="label">源采购单号</view>
- <view class="value" @click="copy(order_detail.originNo)">
- <u-icon margin-right="20" label-pos="left" :label="order_detail.no" name="copy" custom-prefix="custom-icon" size="24"></u-icon>
- </view>
- </view>
- <view class="info-li clearfix">
- <view class="label">退货仓库</view>
- <view class="value">{{ order_detail.warehouseName }}</view>
- </view>
- <view class="info-li clearfix">
- <view class="label">出库状态</view>
- <view class="value">
- <text v-if="order_detail.outStatus === 5" class="success-status">已出库</text>
- <text v-else class="warning-status">未出库</text>
- </view>
- </view>
- <view class="info-li clearfix">
- <view class="label">采购员</view>
- <view class="value">{{ order_detail.buyerName }}</view>
- </view>
- <view class="info-li clearfix">
- <view class="label">供应商</view>
- <view class="value">{{ order_detail.supplierName }}</view>
- </view>
- <view class="info-li clearfix">
- <view class="label">制单人</view>
- <view class="value">{{ order_detail.operatorName }}</view>
- </view>
- <view class="info-li clearfix">
- <view class="label">制单时间</view>
- <view class="value">{{ $u.timeFormat(order_detail.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
- </view>
- <block v-if="order_detail.auditStatus === 2">
- <view class="info-li clearfix">
- <view class="label">审核人</view>
- <view class="value">{{ order_detail.auditName }}</view>
- </view>
- <view class="info-li clearfix">
- <view class="label">审核时间</view>
- <view class="value">{{ $u.timeFormat(order_detail.auditTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
- </view>
- </block>
- <view class="goods-title">商品清单</view>
- <view class="goods-ul">
- <view class="goods-li clearfix" v-for="(item, index) in order_detail.details" :key="index">
- <view class="goods-img float_left"><image src="../../static/img/goods.png" mode="aspectFill"></image></view>
- <view class="float_left info">
- <view class="goods-name ellipsis">{{ item.goodsName }}</view>
- <view class="goods-code clearfix">
- <view class="float_left">{{ item.goodsCode }}</view>
- <view class="float_right">采购:{{ $utils.formatNub(item.purchaseNum) }}</view>
- </view>
- <view class="goods-num clearfix">
- <view class="float_left">{{ item.unitName }};{{ item.skuName }}</view>
- <text class="float_right">退货:{{ $utils.formatNub(item.buyerNum) }}</text>
- </view>
- <view class="goods-num clearfix">
- <view class="float_left ">
- <text class="price">{{ $utils.formattedNumber(item.buyerUnitPrice) }}</text>
- </view>
- <view class="float_right">
- 小计:
- <text class="price">{{ $utils.formattedNumber(item.subtotalPrice) }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="info-li clearfix">
- <view class="label">其他金额</view>
- <view class="value">{{ $utils.formattedNumber(order_detail.otherAmount) }}</view>
- </view>
- <view class="info-li clearfix">
- <view class="label money-label">退货金额</view>
- <view class="value money-value">{{ $utils.formattedNumber(order_detail.purchaseAmount) }}</view>
- </view>
- <view class="remark-li">
- <view class="label">退货说明</view>
- <view class="remark">
- <text>{{ order_detail.remark || '无' }}</text>
- </view>
- </view>
- </view>
- <view class="detail-bottom" v-if="order_detail.auditStatus === 1">
- <view v-if="$accessCheck($Access.PurchaseReturnOrderDelPurchaseOut)" class="handel-btn info-btn" @click="openModel('请确认是否要删除采购退货单?', '删除')">删除</view>
- <view v-if="$accessCheck($Access.PurchaseReturnOrderEditPurchase)" class="handel-btn" @click="goPage('/pagesT/Purchase/AddPurchaseReturn?id=' + order_id)">编辑</view>
- <view v-if="$accessCheck($Access.PurchaseReturnOrderUpdateAuditStatus)" class="handel-btn" @click="openModel('确定要审核通过该退货单吗?', '审核')">审核</view>
- </view>
- <u-modal v-model="model_show" :show-cancel-button="true" :content="model_content" @confirm="modelConfirm"></u-modal>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- model_tag: '',
- model_show: false,
- model_content: '',
- order_id: 0,
- order_detail: {}
- };
- },
- onPullDownRefresh() {
- this.getPurchaseOutInfoById();
- },
- computed: {
- userInfo() {
- return this.$store.state.userInfo;
- }
- },
- onLoad(options) {
- this.order_id = options.id;
- },
- onShow() {
- this.getPurchaseOutInfoById();
- },
- methods: {
- // 详情
- getPurchaseOutInfoById() {
- this.$u.api
- .getPurchaseOutInfoById(this.order_id)
- .then(res => {
- uni.stopPullDownRefresh();
- this.order_detail = res.data;
- })
- .catch(err => {
- uni.stopPullDownRefresh();
- });
- },
- // 打开提示框
- openModel(content, tag) {
- this.model_content = content;
- this.model_show = true;
- this.model_tag = tag;
- },
- // 审核
- modelConfirm() {
- switch (this.model_tag) {
- case '审核':
- this.updatePurchaseOut();
- break;
- case '删除':
- this.delPurchaseOut();
- break;
- }
- },
- // 审核订单
- updatePurchaseOut() {
- this.$u.api
- .updatePurchaseOut(this.order_id, {
- auditStatus: '2',
- auditName: this.userInfo.name
- })
- .then(res => {
- this.$u.toast('审核成功');
- this.getPurchaseOutInfoById();
- });
- },
- // 删除采购单
- delPurchaseOut() {
- this.$u.api.delPurchaseOut(this.order_id).then(res => {
- this.$u.toast('已删除');
- setTimeout(() => {
- uni.navigateBack();
- }, 2000);
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .detail-view {
- padding-bottom: 100rpx;
- }
- .top-view {
- background-color: $uni-color-primary;
- height: 200rpx;
- padding: 0 30rpx;
- color: #ffffff;
- font-size: 40rpx;
- line-height: 100rpx;
- .status-text {
- margin-right: 10rpx;
- }
- .float_right {
- font-size: 28rpx;
- }
- }
- .detail-cont {
- width: 710rpx;
- margin: 0 auto;
- background-color: #ffffff;
- border-radius: 20rpx;
- padding: 20rpx 0;
- overflow: hidden;
- transform: translateY(-80rpx);
- .info-li {
- padding: 0 30rpx;
- line-height: 80rpx;
- .label {
- float: left;
- color: #6c6c6c;
- }
- .value {
- float: right;
- }
- .money-label {
- font-weight: bold;
- }
- .money-value {
- font-weight: bold;
- font-size: 30rpx;
- }
- }
- .remark-li {
- padding: 0 30rpx;
- .label {
- color: #6c6c6c;
- line-height: 60rpx;
- }
- }
- .b-b {
- border-bottom: 1px solid #eeeeee;
- }
- .goods-title {
- background-color: #5e6a84;
- line-height: 72rpx;
- width: 644rpx;
- margin: 30rpx auto 0;
- color: #ffffff;
- border-top-left-radius: 20rpx;
- border-top-right-radius: 20rpx;
- padding: 0 24rpx;
- position: relative;
- z-index: 1;
- }
- .goods-ul {
- padding: 0 30rpx 30rpx;
- box-shadow: 0px -3px 12rpx 0px #e4eaf5;
- border-bottom: 1px solid #eeeeee;
- .goods-li {
- padding-top: 24rpx;
- .goods-img {
- margin-right: 20rpx;
- image {
- width: 150rpx;
- height: 150rpx;
- border-radius: 8rpx;
- display: block;
- }
- }
- .info {
- .goods-name {
- width: 470rpx;
- height: 34rpx;
- line-height: 34rpx;
- }
- .goods-code {
- font-size: 24rpx;
- padding-top: 10rpx;
- }
- .goods-num {
- padding-top: 10rpx;
- font-size: 24rpx;
- .price {
- font-size: 28rpx;
- font-weight: bold;
- color: $uni-color-error;
- }
- }
- }
- }
- }
- }
- </style>
|