SplitDetail.vue 8.47 KB
Newer Older
dragondean@qq.com's avatar
dragondean@qq.com committed
1 2
<!--拆单审核中的申请信息部分-->
<template>
3 4
    <div v-if="detail">
        <el-descriptions :column="4" v-if="order">
5 6
            <el-descriptions-item :label="$t('订单号')">{{order.orderNo}}</el-descriptions-item>
            <el-descriptions-item :label="$t('运输方式')">
7 8
                <dict-tag class="mr-10" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="order.transportId" />
            </el-descriptions-item>
9
            <el-descriptions-item :label="$t('出货方式')">
10 11
                {{channel ? channel.nameZh : ''}}
            </el-descriptions-item>
12
            <el-descriptions-item :label="$t('订单状态')">
13
                <el-tag size="small">
14
                    {{order.statusMsg}}
15 16
                </el-tag>
            </el-descriptions-item>
17 18
            <el-descriptions-item :label="$t('唛头')">{{order.marks}}</el-descriptions-item>
            <el-descriptions-item :label="$t('始发仓')">
19 20
                {{order.logisticsInfoDto.startTitleZh}}
            </el-descriptions-item>
21
            <el-descriptions-item :label="$t('目的仓')">
22
                {{order.logisticsInfoDto.destAddressZh}}
dragondean@qq.com's avatar
dragondean@qq.com committed
23 24 25
            </el-descriptions-item>
        </el-descriptions>

26
        <template v-for="item in orderSplitBackVOList">
27 28 29 30
            <div class="title mt-20" :key="item.orderNo">
                <span class="mr-10">{{item.orderNo}}</span>
                <dict-tag class="mr-10" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="item.transportId" />
                <span class="mr-10" v-if="item.channelName">{{item.channelName}}</span>
31
                <span>{{$t('发往')}}{{item.dstWarehouseName}}</span>
32 33
            </div>
            <el-table :data="item.orderSplitItemBackVOList" :key="'items-' + item.orderNo">
34 35 36 37 38 39 40 41 42 43 44
                <el-table-column :label="$t('序号')">
                    <template slot-scope="scope">{{scope.$index+1}}</template>
                </el-table-column>
                <el-table-column :label="$t('中文品名')">
                    <template slot-scope="{row}">{{row.prodTitleZh}}</template>
                </el-table-column>
                <el-table-column :label="$t('英文品名')">
                    <template slot-scope="{row}">{{row.prodTitleEn}}</template>
                </el-table-column>
                <el-table-column :label="$t('品牌')">
                    <template slot-scope="{row}">
45
                        <template v-if="row.brandName">{{row.brandName}}</template>
46
                        <dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="row.feeType" />
47 48
                    </template>
                </el-table-column>
dragondean@qq.com's avatar
dragondean@qq.com committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
              <el-table-column :label="$t('入仓体积')">
                <template slot-scope="{row}">{{row.volume}}</template>
              </el-table-column>
              <el-table-column :label="$t('收费体积')">
                <template slot-scope="{row}">{{row.chargeVolume}}</template>
              </el-table-column>
              <el-table-column :label="$t('入仓重量')">
                <template slot-scope="{row}">{{row.weight}}kg</template>
              </el-table-column>
              <el-table-column :label="$t('收费重量')">
                <template slot-scope="{row}">{{row.chargeWeight}}kg</template>
              </el-table-column>
              <el-table-column :label="$t('箱数')">
                <template slot-scope="{row}">
                  <el-button type="text" @click="showWarehouseRecord(row)">{{row.num}}</el-button>
                </template>
              </el-table-column>
66 67 68 69 70 71 72 73 74
              <el-table-column :label="$t('数量')">
                  <template slot-scope="{row}">{{row.quantity}}</template>
              </el-table-column>
              <el-table-column :label="$t('货值')">
                <template slot-scope="{row}">{{row.worth}}{{$t('')}}</template>
              </el-table-column>
              <el-table-column :label="$t('备注')">
                  <template slot-scope="{row}">{{row.remark}}</template>
              </el-table-column>
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
              <el-table-column :label="$t('成交单价')" align="center" min-width="220px" v-if="[3,4].indexOf(order.transportId) > -1">
                <template slot-scope="scope">
                  <template v-if="scope.row.charging != 1">
                    <div class="flex">
                      {{$t('运费')}}
                      <el-input v-model="scope.row.oneSeaFreight" disabled size="mini" style="width: 80px"></el-input>
                      {{currencyMap[scope.row.seaFreightCurrency]}} / {{unitMap[scope.row.seaFreightVolume]}}
                    </div>
                    <div class="flex">
                      {{$t('清关费')}}
                      <el-input v-model="scope.row.oneClearanceFreight" disabled size="mini" style="width: 80px"></el-input>
                      {{currencyMap[scope.row.clearanceFreightCurrency]}} / {{unitMap[scope.row.clearanceFreightVolume]}}
                    </div>
                  </template>
                  <template v-else>
                    {{$t('全包价')}}<el-input v-model="scope.row.oneSeaFreight" @change="updateField(scope.row, 'oneSeaFreight')" size="mini" style="width: 80px"></el-input>
                    {{currencyMap[scope.row.currencyId]}}
                    {{unitMap[scope.row.clearanceFreightVolume]}}
                  </template>
                </template>
              </el-table-column>
96
            </el-table>
dragondean@qq.com's avatar
dragondean@qq.com committed
97
        </template>
98
      <warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body @close="currentWarehouseRecord=null"></warehouse-record>
dragondean@qq.com's avatar
dragondean@qq.com committed
99
    </div>
dragondean@qq.com's avatar
dragondean@qq.com committed
100 101
</template>
<script>
102 103
import {getApproval, getOrder} from '@/api/ecw/order'
import {getChannel} from '@/api/ecw/channel'
104
import {getSplitList} from '@/api/ecw/orderHandle'
dragondean@qq.com's avatar
dragondean@qq.com committed
105
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord";
106 107 108
import Template from "@/views/cms/template/index.vue";
import {getCurrencyList} from "@/api/ecw/currency";
import {getUnitList} from "@/api/ecw/unit";
dragondean@qq.com's avatar
dragondean@qq.com committed
109
export default {
110
  components: {Template, WarehouseRecord},
dragondean@qq.com's avatar
dragondean@qq.com committed
111
  props:{
dragondean@qq.com's avatar
dragondean@qq.com committed
112 113 114 115
        id: [String, Number]
    },
    data(){
        return {
116 117
            detail: null,
            order: null,
118
            channel: null,
119
            // orderSplitBackVOList: [],
dragondean@qq.com's avatar
dragondean@qq.com committed
120
          // 查看入仓记录的条目
121 122 123
          currentWarehouseRecord: null,
          currencyList:[],
          unitList: []
dragondean@qq.com's avatar
dragondean@qq.com committed
124 125 126 127 128
        }
    },
    watch:{
        id(){
            this.getData()
129 130
        },
        detail(){
131
            // this.getSplit()
132 133 134 135 136 137
            this.getOrder()
        },
        order(){
            if(this.order.channelId){
                this.getChannel()
            }
dragondean@qq.com's avatar
dragondean@qq.com committed
138 139
        }
    },
140 141 142
    computed:{
      orderSplitBackVOList(){
        return this.detail ? this.detail.orderSplitBackVOList : []
143 144 145 146 147 148 149 150 151 152 153 154 155 156
      },
      currencyMap(){
        let map = {}
        this.currencyList.forEach(item => {
          map[item.id] = this.$l(item, 'title')
        })
        return map
      },
      unitMap(){
        let map = {}
        this.unitList.forEach(item => {
          map[item.id] = this.$l(item, 'title')
        })
        return map
157 158
      }
    },
159
    async created(){
dragondean@qq.com's avatar
dragondean@qq.com committed
160
        if(this.id){
161
            this.getData()
dragondean@qq.com's avatar
dragondean@qq.com committed
162 163 164 165 166 167 168
        }
    },
    methods:{
        getData(){
            getApproval(this.id).then(res => {
                this.detail = JSON.parse(res.data.details)
            })
169
        },
170
        /*getSplit(){
171 172 173 174
            getSplitList({orderId: this.detail.orderId, lang: this.$i18n.locale.toLowerCase().indexOf('zh') > -1 ? 0 : 1 }).then(res => {
                console.log('getSplitList', res)
                this.orderSplitBackVOList = res.data.orderSplitBackVOList
            })
175
        },*/
176 177 178
        getOrder(){
            getOrder(this.detail.orderId).then(res => {
                this.order = res.data
179 180 181 182
                if([3, 4].indexOf(this.order.transportId) > -1){
                  getCurrencyList().then(res => this.currencyList = res.data)
                  getUnitList().then(res => this.unitList = res.data)
                }
183 184 185 186 187 188
            })
        },
        getChannel(){
            getChannel(this.order.channelId).then(res => {
                this.channel = res.data
            })
dragondean@qq.com's avatar
dragondean@qq.com committed
189 190 191 192
        },
      showWarehouseRecord(row){
        if(!row.specsRecordVOList){
          return this.$message.info(this.$t('暂无入仓记录'))
dragondean@qq.com's avatar
dragondean@qq.com committed
193
        }
dragondean@qq.com's avatar
dragondean@qq.com committed
194 195
        this.currentWarehouseRecord = row.specsRecordVOList
      }
dragondean@qq.com's avatar
dragondean@qq.com committed
196 197
    }
}
198 199 200 201 202 203 204 205 206
</script>
<style scoped lang="scss">
.title{
    padding: 10px 0;
    span{
        font-size: 14px;
        font-weight: bold;
    }
}
dragondean@qq.com's avatar
dragondean@qq.com committed
207
</style>