index.vue 13.4 KB
Newer Older
我在何方's avatar
我在何方 committed
1 2 3 4 5 6
<template>
  <div class="app-container">
    <!-- 搜索工作栏 -->
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
      <el-row>
        <el-form-item >
我在何方's avatar
我在何方 committed
7
          <el-select v-model="queryParams.dateType" style="width: 172px;" clearable>
我在何方's avatar
我在何方 committed
8 9
             <el-option :label="$t('入仓时间')" value="1"/>
             <el-option :label="$t('处理时间')" value="2"/>
我在何方's avatar
我在何方 committed
10
          </el-select>
我在何方's avatar
我在何方 committed
11
          <el-date-picker clearable v-model="queryParams.beginCreateTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" type="datetime" :placeholder="$t('请选择开始日期')" />
我在何方's avatar
我在何方 committed
12
         <span style="margin: 0 8px;">{{$t('')}}</span>
我在何方's avatar
我在何方 committed
13
          <el-date-picker clearable v-model="queryParams.endCreateTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" type="datetime" :placeholder="$t('请选择结束日期')" />
我在何方's avatar
我在何方 committed
14
        </el-form-item>
我在何方's avatar
我在何方 committed
15 16
       <el-form-item :label="$t('始发仓')" prop="destinationId">
          <el-select v-model="queryParams.originId" :placeholder="$t('请选择始发仓')" clearable>
我在何方's avatar
我在何方 committed
17 18 19
            <el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
          </el-select>
        </el-form-item>
我在何方's avatar
我在何方 committed
20 21
        <el-form-item :label="$t('目的仓')" prop="destinationId">
          <el-select v-model="queryParams.destinationId" :placeholder="$t('请选择目的仓')" clearable>
我在何方's avatar
我在何方 committed
22 23 24
            <el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
          </el-select>
        </el-form-item>
我在何方's avatar
我在何方 committed
25
<!--       <el-form-item :label="$t('始发地')+':'">
我在何方's avatar
我在何方 committed
26
            <el-select v-model="queryParams.originId" :placeholder="$t('请选择始发地')" clearable>
我在何方's avatar
我在何方 committed
27
                <el-option v-for="item in expoerCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
我在何方's avatar
我在何方 committed
28 29
            </el-select>
        </el-form-item>
我在何方's avatar
我在何方 committed
30
        <el-form-item :label="$t('目的地')+':'" >
我在何方's avatar
我在何方 committed
31
            <el-select v-model="queryParams.destinationId" :placeholder="$t('请选择目的地')" clearable>
我在何方's avatar
我在何方 committed
32
             <el-option v-for="item in importCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id" ></el-option>
我在何方's avatar
我在何方 committed
33
            </el-select>
我在何方's avatar
我在何方 committed
34
        </el-form-item> -->
我在何方's avatar
我在何方 committed
35
        <el-form-item :label="$t('运输方式')+':'" >
我在何方's avatar
我在何方 committed
36
            <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :clearable="true" v-model="queryParams.transportId" />
我在何方's avatar
我在何方 committed
37 38 39
        </el-form-item>
      </el-row>
      <el-row>
我在何方's avatar
我在何方 committed
40
        <el-form-item :label="$t('控货')+':'">
我在何方's avatar
我在何方 committed
41
             <dict-selector :type="DICT_TYPE.ECW_YESNO" :clearable="true" v-model="queryParams.isCargoControl" @keyup.enter.native="handleQuery"/>
我在何方's avatar
我在何方 committed
42
        </el-form-item>
我在何方's avatar
我在何方 committed
43
        <el-form-item :label="$t('异常状态')+':'">
我在何方's avatar
我在何方 committed
44
             <dict-selector :type="DICT_TYPE.ORDER_EXCEPTION_STATUS" :clearable="true" v-model="queryParams.orderExceptionStatus" @keyup.enter.native="handleQuery"/>
我在何方's avatar
我在何方 committed
45
        </el-form-item>
我在何方's avatar
我在何方 committed
46
        <el-form-item :label="$t('异常类型')+':'">
我在何方's avatar
我在何方 committed
47
            <dict-selector :type="DICT_TYPE.ORDER_ERROR_TYPE" :clearable="true" v-model="queryParams.orderExceptionType" @keyup.enter.native="handleQuery"/>
我在何方's avatar
我在何方 committed
48
        </el-form-item>
我在何方's avatar
我在何方 committed
49
        <el-form-item :label="$t('订单号')+':'">
我在何方's avatar
我在何方 committed
50
          <el-input v-model="queryParams.orderNo" :placeholder="$t('请输入订单号')" clearable @keyup.enter.native="handleQuery"/>
我在何方's avatar
我在何方 committed
51 52 53
        </el-form-item>
      </el-row>
      <el-row>
我在何方's avatar
我在何方 committed
54
        <el-form-item :label="$t('发货人')+':'">
我在何方's avatar
我在何方 committed
55
            <customer-selector v-model="queryParams.consignor" :clearable="true" @change="consignor = $event" />
我在何方's avatar
我在何方 committed
56
        </el-form-item>
我在何方's avatar
我在何方 committed
57
        <el-form-item :label="$t('唛头')+':'">
我在何方's avatar
我在何方 committed
58
          <el-input v-model="queryParams.marks" :placeholder="$t('请输入唛头')" clearable @keyup.enter.native="handleQuery"/>
我在何方's avatar
我在何方 committed
59
        </el-form-item>
我在何方's avatar
我在何方 committed
60
        <el-form-item :label="$t('品名')+':'">
我在何方's avatar
我在何方 committed
61
          <product-selector v-model="queryParams.goodsName" :clearable="true" @keyup.enter.native="handleQuery" />
我在何方's avatar
我在何方 committed
62
        </el-form-item>
我在何方's avatar
我在何方 committed
63
        <el-form-item :label="$t('备案')+':'">
我在何方's avatar
我在何方 committed
64
             <dict-selector :type="DICT_TYPE.PRODUCT_RECORD_ATTRIBUTE" :clearable="true" v-model="queryParams.productRecord" @keyup.enter.native="handleQuery"/>
我在何方's avatar
我在何方 committed
65 66 67
        </el-form-item>
      </el-row>
      <el-row>
dragondean@qq.com's avatar
dragondean@qq.com committed
68
        <el-form-item :label="$t('客户经理')+':'">
我在何方's avatar
我在何方 committed
69
         <el-select v-model="queryParams.salesmanId" :placeholder="$t('请选择跟进业务')" clearable>
我在何方's avatar
我在何方 committed
70 71 72
          <el-option v-for="item in creatorData" :key="item.id" :label="item.nickname" :value="item.id"/>
          </el-select>
        </el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
73 74 75 76 77 78
        <el-form-item :label="$t('外部仓')" prop="number">
          <el-select v-model="queryParams.isExternalWarehouse" :placeholder="$t('请选择')" clearable @change="handleQuery">
            <el-option :label="$t('外部仓')" :value="1"></el-option>
            <el-option :label="$t('自有仓')" :value="0"></el-option>
          </el-select>
        </el-form-item>
我在何方's avatar
我在何方 committed
79
        <el-form-item>
我在何方's avatar
我在何方 committed
80
          <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
我在何方's avatar
我在何方 committed
81
          <!-- <el-button icon="el-icon-refresh" @click="reset">重置</el-button> -->
我在何方's avatar
我在何方 committed
82 83 84 85 86 87 88 89 90 91 92 93
        </el-form-item>
      </el-row>
    </el-form>


    <!-- 操作工具栏 -->
    <el-row :gutter="10" class="mb8">
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <!-- 列表 -->
    <el-table v-loading="loading" border :data="list">
我在何方's avatar
我在何方 committed
94
      <el-table-column :label="$t('序号')" align="center" prop="id" type="index">
我在何方's avatar
我在何方 committed
95 96 97 98
        <template slot-scope="scope">
            <span>{{scope.$index + 1}}</span>
        </template>
      </el-table-column>
我在何方's avatar
我在何方 committed
99
      <el-table-column :label="$t('订单号')" align="center">
我在何方's avatar
我在何方 committed
100
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
101 102 103
         <router-link :to="{path: '/order/detail',query: {orderId: scope.row.orderId}}" class="link-type">
           <span>{{ scope.row.orderNo }}</span>
         </router-link>
我在何方's avatar
我在何方 committed
104 105 106
             <span>{{specialNeedTag(scope.row.specialNeed)}}</span>
         </template>
       </el-table-column>
我在何方's avatar
我在何方 committed
107
      <el-table-column :label="$t('唛头')" align="center" >
我在何方's avatar
我在何方 committed
108
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
109
          <span>{{scope.row.marks||$t('')}}</span>
我在何方's avatar
我在何方 committed
110 111
        </template>
      </el-table-column>
我在何方's avatar
我在何方 committed
112
      <el-table-column :label="$t('总箱数/入仓箱数')" align="center" >
我在何方's avatar
我在何方 committed
113
      <template slot-scope="scope">
114 115 116
          <p v-if="scope.row.orderExceptionType!='order_doc_exception'||scope.row.customsType==1">{{scope.row.totalBox+$t('箱/')+scope.row.warehousingBox+$t('')}}</p>
          <p style="color:#ff4949" v-else>{{scope.row.totalBox+$t('箱/')+scope.row.warehousingBox+$t('')}}</p>
           <dict-tag  style="color:#ff4949" v-if="scope.row.orderExceptionType=='order_doc_exception'&&scope.row.customsType!=1" :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="scope.row.customsType"></dict-tag>
我在何方's avatar
我在何方 committed
117 118
        </template>
      </el-table-column>
我在何方's avatar
我在何方 committed
119
      <el-table-column :label="$t('体积/重量')" align="center">
我在何方's avatar
我在何方 committed
120
          <template slot-scope="scope">
121
                <div v-if="scope.row.orderExceptionType!='order_heavy_cargo_exception'&&scope.row.orderExceptionType!='order_bulky_cargo_exception'">
我在何方's avatar
我在何方 committed
122 123 124 125 126 127 128
                  <span v-if="scope.row.orderStatus >= 5 ">{{scope.row.volume+"m³/"+scope.row.weight+"kg"}}</span>
                  <span v-else>{{scope.row.totalVolume+"m³/"+scope.row.totalWeight+"kg"}}</span>
                </div>
                <el-tooltip v-if="scope.row.orderExceptionType=='order_heavy_cargo_exception'" class="item" effect="dark" :content="(scope.row.wvolume||0)+'m³'" placement="bottom">
                  <span style="color:#ff4949" v-if="scope.row.orderStatus >= 5 ">{{scope.row.volume+"m³/"+scope.row.weight+"kg"}}</span>
                  <span style="color:#ff4949" v-else>{{scope.row.totalVolume+"m³/"+scope.row.totalWeight+"kg"}}</span>
                </el-tooltip>
129 130 131 132
                <el-tooltip v-if="scope.row.orderExceptionType=='order_bulky_cargo_exception'" class="item" effect="dark" :content="(scope.row.vweight||0)+'kg'" placement="bottom">
                  <span style="color:#ff4949" v-if="scope.row.orderStatus >= 5 ">{{scope.row.volume+"m³/"+scope.row.weight+"kg"}}</span>
                  <span style="color:#ff4949" v-else>{{scope.row.totalVolume+"m³/"+scope.row.totalWeight+"kg"}}</span>
                </el-tooltip>
我在何方's avatar
我在何方 committed
133 134
          </template>
      </el-table-column>
我在何方's avatar
我在何方 committed
135
      <el-table-column :label="$t('运输方式/目的地')" align="center">
我在何方's avatar
我在何方 committed
136 137
          <template slot-scope="scope">
            <span><dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="scope.row.transportId"></dict-tag>
138
            / {{$l(scope.row, 'destination')}}</span>
我在何方's avatar
我在何方 committed
139 140
          </template>
      </el-table-column>
我在何方's avatar
我在何方 committed
141
      <el-table-column :label="$t('控货')" align="center">
我在何方's avatar
我在何方 committed
142
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
143
          <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.isCargoControl" />
我在何方's avatar
我在何方 committed
144 145
        </template>
      </el-table-column>
我在何方's avatar
我在何方 committed
146
      <el-table-column :label="$t('订单状态')" align="center" prop="orderExceptionAmount" >
我在何方's avatar
我在何方 committed
147
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
148
            <dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.orderStatus" />
我在何方's avatar
我在何方 committed
149 150
          </template>
        </el-table-column>
我在何方's avatar
我在何方 committed
151
      <el-table-column :label="$t('异常状态')" align="center">
我在何方's avatar
我在何方 committed
152 153 154 155
        <template slot-scope="scope">
            <dict-tag :type="DICT_TYPE.ORDER_EXCEPTION_STATUS" :value="scope.row.orderExceptionStatus" />
          </template>
        </el-table-column>
我在何方's avatar
我在何方 committed
156
      <el-table-column :label="$t('异常类型')" align="center">
我在何方's avatar
我在何方 committed
157
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
158
          <dict-tag :type="DICT_TYPE.ORDER_ERROR_TYPE" :value="scope.row.orderExceptionType" />
我在何方's avatar
我在何方 committed
159 160
        </template>
      </el-table-column>
我在何方's avatar
我在何方 committed
161
      <el-table-column :label="$t('操作')" align="center">
我在何方's avatar
我在何方 committed
162
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
163 164
          <el-button  v-if="scope.row.orderExceptionStatus<2" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row.orderId)">{{$t('处理')}}</el-button>
          <el-button size="mini" type="text" icon="el-icon-share" @click="handEdit(scope.row.orderId)">{{$t('查看')}}</el-button>
我在何方's avatar
我在何方 committed
165 166 167 168
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
我在何方's avatar
我在何方 committed
169
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows"
我在何方's avatar
我在何方 committed
170 171 172 173 174 175 176 177
                @pagination="getList"/>
  </div>
</template>

<script>
import {getOrderExceptionPage} from "@/api/ecw/orderException"
import {getTradeCityList} from '@/api/ecw/region'
import {DICT_TYPE} from  '@/utils/dict'
我在何方's avatar
我在何方 committed
178 179
// import { userList } from "@/api/system/user"
import {listServiceUser} from "@/api/system/user"
我在何方's avatar
我在何方 committed
180
import CustomerSelector from '@/components/CustomerSelector'
我在何方's avatar
我在何方 committed
181
import ProductSelector from '@/components/ProductSelector'
我在何方's avatar
我在何方 committed
182
import {getWarehouseList} from '@/api/ecw/warehouse'
我在何方's avatar
我在何方 committed
183 184

export default {
dragondean@qq.com's avatar
dragondean@qq.com committed
185
  name: "EcwOrderException",
我在何方's avatar
我在何方 committed
186
  components: {
我在何方's avatar
我在何方 committed
187
    CustomerSelector,ProductSelector
我在何方's avatar
我在何方 committed
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 订单异常列表
      list: [],
      dateRangeCreateTime: [],
      creatorData:[],
      // 查询参数
      queryParams: {
我在何方's avatar
我在何方 committed
203
        page: 1,
我在何方's avatar
我在何方 committed
204
        rows: 10
我在何方's avatar
我在何方 committed
205 206
      },
       tradeCityList:[],
我在何方's avatar
我在何方 committed
207
       warehouseList:[],
我在何方's avatar
我在何方 committed
208 209
    };
  },
dragondean@qq.com's avatar
dragondean@qq.com committed
210 211 212
  activated(){
    this.handleQuery()
  },
我在何方's avatar
我在何方 committed
213 214
  created() {
    this.getList();
我在何方's avatar
我在何方 committed
215 216

    getTradeCityList().then(res => this.tradeCityList = res.data)
我在何方's avatar
我在何方 committed
217 218 219
    listServiceUser().then(r => {
      this.creatorData = r.data
    })
我在何方's avatar
我在何方 committed
220
     getWarehouseList().then(res => this.warehouseList = res.data)
我在何方's avatar
我在何方 committed
221
    // userList('salesman').then(res =>this.creatorData = res.data)
我在何方's avatar
我在何方 committed
222 223 224 225 226 227 228
  },
  computed:{
    expoerCityList(){
        return this.tradeCityList.filter(item => item.type == 2)
    },
    importCityList(){
        return this.tradeCityList.filter(item => item.type == 1)
我在何方's avatar
我在何方 committed
229
    },
我在何方's avatar
我在何方 committed
230 231 232 233 234 235 236
    exportWarehouseList(){
      /* tradeType 1 进口,2出口,3进出口 */
      return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3)
    },
    importWarehouseList(){
      return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3)
    },
我在何方's avatar
我在何方 committed
237 238 239 240 241
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true;
我在何方's avatar
我在何方 committed
242
      this.list = []
我在何方's avatar
我在何方 committed
243 244 245 246 247 248 249
      // 处理查询参数
      let params = {...this.queryParams}
      // 执行查询
      getOrderExceptionPage(params).then(response => {
        this.list = response.data.list;
        this.total = response.data.total;
        this.loading = false;
我在何方's avatar
我在何方 committed
250
        // this.reset()
我在何方's avatar
我在何方 committed
251 252
      });
    },
我在何方's avatar
我在何方 committed
253 254 255 256 257 258 259
    /** 表单重置 */
    reset() {
      this.queryParams = {
        page: 1,
        rows: 10,
      };
    },
我在何方's avatar
我在何方 committed
260 261 262 263 264 265 266
    importCityName(id){
        return this.tradeCityList.filter(item => item.id == id)
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.getList();
    },
我在何方's avatar
我在何方 committed
267
    handEdit(id){
268 269 270
        this.$router.push({
          path:"./pending?id="+id,
        })
我在何方's avatar
我在何方 committed
271 272 273 274
    },
    specialNeedTag(value){
        var tag = ''
        if(!value){
275
          return
我在何方's avatar
我在何方 committed
276 277
        }
        if(value.indexOf("1")!=-1||value.indexOf("2")!=-1){
我在何方's avatar
我在何方 committed
278
          tag += this.$t('(木)')
我在何方's avatar
我在何方 committed
279 280
        }
        if(value.indexOf("3")!=-1){
我在何方's avatar
我在何方 committed
281
          tag += this.$t('(箱)')
我在何方's avatar
我在何方 committed
282 283
        }
        if(value.indexOf("4")!=-1){
我在何方's avatar
我在何方 committed
284
          tag += this.$t('(袋)')
我在何方's avatar
我在何方 committed
285 286
        }
        if(value.indexOf("5")!=-1){
我在何方's avatar
我在何方 committed
287
          tag += this.$t('(纸)')
我在何方's avatar
我在何方 committed
288 289
        }
        if(value.indexOf("6")!=-1){
我在何方's avatar
我在何方 committed
290
          tag += this.$t('(垫)')
我在何方's avatar
我在何方 committed
291 292
        }
        if(value.indexOf("7")!=-1){
我在何方's avatar
我在何方 committed
293
          tag += this.$t('(空)')
我在何方's avatar
我在何方 committed
294 295
        }
        return tag
我在何方's avatar
我在何方 committed
296
    }
我在何方's avatar
我在何方 committed
297 298 299
  }
}
</script>