receivable.vue 12 KB
Newer Older
1 2
<template>
  <div class="app-container">
我在何方's avatar
我在何方 committed
3

吴滔's avatar
吴滔 committed
4 5
    <!-- 操作工具栏 -->
    <el-row :gutter="10" class="mb8" style="margin-right: 60px">
我在何方's avatar
我在何方 committed
6
      <div class="card-title">{{ $t('待收款') }}</div>
吴滔's avatar
吴滔 committed
7 8 9 10
      <el-button
        style="float: right; margin-left: 10px"
        type="primary"
        size="mini"
11
        v-hasPermi="['ecw:receivable:add']"
吴滔's avatar
吴滔 committed
12
        @click="handleAdd(0)"
吴滔's avatar
吴滔 committed
13
        >{{ $t('新增收款单') }}</el-button
吴滔's avatar
吴滔 committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
      >
      <el-button
        v-if="showSearch"
        style="float: right"
        type="primary"
        size="mini"
        icon="el-icon-s-unfold"
        @click="showSearch = !showSearch"
      ></el-button>
      <el-button
        v-else
        style="float: right"
        type="primary"
        size="mini"
        icon="el-icon-s-fold"
        @click="showSearch = !showSearch"
      ></el-button>
    </el-row>
32
    <!-- 搜索工作栏 -->
吴滔's avatar
吴滔 committed
33 34 35 36 37 38 39 40 41 42
    <el-card v-show="showSearch">
      <el-form
        :model="queryParams"
        ref="queryForm"
        size="small"
        :inline="true"
        label-width="80px"
        class="card"
      >
        <el-row>
43
          <el-form-item :label="$t('始发地')">
吴滔's avatar
吴滔 committed
44 45
            <el-select
              v-model="queryParams.departureId"
46
              :placeholder="$t('请选择始发地')"
我在何方's avatar
我在何方 committed
47
              clearable
吴滔's avatar
吴滔 committed
48 49
            >
              <el-option
50 51
                v-for="item in exportWarehouseList"
                :label="$l(item, 'title')"
吴滔's avatar
吴滔 committed
52 53 54 55 56
                :value="item.id"
                :key="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
57
          <el-form-item :label="$t('目的地')">
吴滔's avatar
吴滔 committed
58 59
            <el-select
              v-model="queryParams.objectiveId"
60
              :placeholder="$t('请选择目的地')"
我在何方's avatar
我在何方 committed
61
              clearable
吴滔's avatar
吴滔 committed
62 63
            >
              <el-option
64 65
                v-for="item in importWarehouseList"
                :label="$l(item, 'title')"
吴滔's avatar
吴滔 committed
66 67 68 69 70
                :value="item.id"
                :key="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
吴滔's avatar
吴滔 committed
71
          <el-form-item :label="$t('运输方式')">
吴滔's avatar
吴滔 committed
72 73 74 75
            <dict-selector
              :type="DICT_TYPE.ECW_TRANSPORT_TYPE"
              v-model="queryParams.transportId"
              formatter="number"
我在何方's avatar
我在何方 committed
76
              clearable
吴滔's avatar
吴滔 committed
77 78
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
79
          <el-form-item :label="$t('控货')">
吴滔's avatar
吴滔 committed
80 81 82
            <dict-selector
              :type="DICT_TYPE.INFRA_BOOLEAN_STRING"
              v-model="queryParams.isCargoControl"
我在何方's avatar
我在何方 committed
83
              clearable
吴滔's avatar
吴滔 committed
84 85 86 87
            />
          </el-form-item>
        </el-row>
        <el-row>
吴滔's avatar
吴滔 committed
88
          <el-form-item :label="$t('订单状态')">
吴滔's avatar
吴滔 committed
89 90 91
            <dict-selector
              :type="DICT_TYPE.ORDER_STATUS"
              v-model="queryParams.status"
我在何方's avatar
我在何方 committed
92
              clearable
吴滔's avatar
吴滔 committed
93 94
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
95
          <el-form-item :label="$t('报关方式')">
吴滔's avatar
吴滔 committed
96 97 98
            <dict-selector
              :type="DICT_TYPE.ECW_CUSTOMS_TYPE"
              v-model="queryParams.customsType"
我在何方's avatar
我在何方 committed
99
              clearable
吴滔's avatar
吴滔 committed
100 101
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
102
          <el-form-item :label="$t('订单号')">
吴滔's avatar
吴滔 committed
103 104 105
            <el-input
              style="max-width: 188px"
              v-model="queryParams.orderNo"
吴滔's avatar
吴滔 committed
106
              :placeholder="$t('请输入订单编号')"
吴滔's avatar
吴滔 committed
107 108 109 110
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
111
          <el-form-item :label="$t('品名')">
吴滔's avatar
吴滔 committed
112 113 114
            <el-input
              style="max-width: 188px"
              v-model="queryParams.title"
吴滔's avatar
吴滔 committed
115
              :placeholder="$t('请输入品名')"
吴滔's avatar
吴滔 committed
116 117 118 119 120 121
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-row>
        <el-row>
吴滔's avatar
吴滔 committed
122
          <el-form-item :label="$t('提单号')">
吴滔's avatar
吴滔 committed
123 124 125
            <el-input
              style="max-width: 188px"
              v-model="queryParams.tidanNo"
吴滔's avatar
吴滔 committed
126
              :placeholder="$t('请输入提单号')"
吴滔's avatar
吴滔 committed
127 128 129 130
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
131
          <el-form-item :label="$t('唛头')">
吴滔's avatar
吴滔 committed
132 133 134
            <el-input
              style="max-width: 188px"
              v-model="queryParams.marks"
吴滔's avatar
吴滔 committed
135
              :placeholder="$t('请输入唛头')"
吴滔's avatar
吴滔 committed
136 137 138 139
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
140
          <el-form-item :label="$t('费用类型')">
吴滔's avatar
吴滔 committed
141 142 143
            <dict-selector
              :type="DICT_TYPE.FEE_TYPE"
              v-model="queryParams.feeType"
我在何方's avatar
我在何方 committed
144
              clearable
吴滔's avatar
吴滔 committed
145 146
            ></dict-selector>
          </el-form-item>
147
<!--          <el-form-item :label="$t('发货人')">
吴滔's avatar
吴滔 committed
148 149 150
            <customer-selector
              v-model="queryParams.consignorNameOrPhone"
              @change="consignor = $event"
我在何方's avatar
我在何方 committed
151
              clearable
吴滔's avatar
吴滔 committed
152
            />
153 154 155 156
          </el-form-item> -->
            <el-form-item label="发货人:" >
              <el-input style="max-width: 188px;" v-model="queryParams.consignorNameOrPhone" :placeholder="$t('请输入发货人')" clearable @keyup.enter.native="handleQuery"/>
            </el-form-item>
吴滔's avatar
吴滔 committed
157 158
        </el-row>
        <el-row>
吴滔's avatar
吴滔 committed
159
          <el-form-item :label="$t('收货人')">
160 161
            <el-input style="max-width: 188px;" v-model="queryParams.consigneeNameOrPhone" :placeholder="$t('请输入收货人')" clearable @keyup.enter.native="handleQuery"/>
<!--           <customer-selector
吴滔's avatar
吴滔 committed
162 163
              v-model="queryParams.consigneeNameOrPhone"
              @change="consignor = $event"
我在何方's avatar
我在何方 committed
164
              clearable
165
            /> -->
吴滔's avatar
吴滔 committed
166
          </el-form-item>
吴滔's avatar
吴滔 committed
167
          <el-form-item :label="$t('创建时间')">
吴滔's avatar
吴滔 committed
168 169 170 171 172 173
            <!-- <dict-selector :type="DICT_TYPE.BEGINTIME_TYPE_ENDTIME" v-model="queryParams.date"></dict-selector> -->
            <el-date-picker
              v-model="dateType"
              type="datetimerange"
              range-separator="-"
              value-format="yyyy-MM-dd"
吴滔's avatar
吴滔 committed
174 175
              :start-placeholder="$t('请选择日期')"
              :end-placeholder="$t('请选择日期')"
吴滔's avatar
吴滔 committed
176 177 178 179 180 181 182 183 184 185 186 187 188 189
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="handleQuery"
            ></el-button>
          </el-form-item>
        </el-row>
      </el-form>
    </el-card>
    <el-table v-loading="loadings" :data="list" border class="card">
吴滔's avatar
吴滔 committed
190 191 192
      <el-table-column :label="$t('订单号')" align="center" prop="orderNo" />
      <el-table-column :label="$t('唛头')" align="center" prop="marks" />
      <el-table-column :label="$t('品名')" align="center" prop="title">
吴滔's avatar
吴滔 committed
193
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
194
          {{ scope.row.titleZh? (scope.row.titleZh + "(" + scope.row.titleEn + ")"):'' }}
吴滔's avatar
吴滔 committed
195 196
        </template>
      </el-table-column>
吴滔's avatar
吴滔 committed
197
      <el-table-column :label="$t('箱数')" align="center" prop="num" />
我在何方's avatar
我在何方 committed
198 199 200 201 202
      <el-table-column :label="$t('体积/重量')" align="center" prop="weight" >
        <template slot-scope="scope">
            {{ scope.row.volume}}/ {{ scope.row.weight}}
          </template>
        </el-table-column>
吴滔's avatar
吴滔 committed
203 204 205
      <el-table-column :label="$t('发货人')" align="center" prop="consignorName" />
      <el-table-column :label="$t('收货人')" align="center" prop="consigneeName" />
      <el-table-column :label="$t('订单状态')" align="center" prop="status">
吴滔's avatar
吴滔 committed
206 207 208 209
        <template slot-scope="scope">
          <dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" />
        </template>
      </el-table-column>
吴滔's avatar
吴滔 committed
210
      <el-table-column :label="$t('收入类型')" align="center" prop="feeType">
吴滔's avatar
吴滔 committed
211 212 213 214 215 216 217
        <template slot-scope="scope">
          <dict-tag
            :type="DICT_TYPE.FEE_TYPE"
            :value="scope.row.feeType"
          ></dict-tag>
        </template>
      </el-table-column>
吴滔's avatar
吴滔 committed
218
      <el-table-column :label="$t('单价')" align="center" prop="unitPrice">
219
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
220 221
          <span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
          <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
222 223
        </template>
      </el-table-column>
吴滔's avatar
吴滔 committed
224
      <el-table-column :label="$t('总金额')" align="center" prop="totalAmount">
225
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
226 227
          <span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
          <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
228 229
        </template>
      </el-table-column>
吴滔's avatar
吴滔 committed
230
      <el-table-column
吴滔's avatar
吴滔 committed
231
        :label="$t('操作')"
吴滔's avatar
吴滔 committed
232 233 234 235
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
236
          <el-button size="mini" type="text" v-hasPermi="['ecw:receivable:collection']" @click="handleAdd(scope.row.id)" >{{ $t('收款') }}</el-button>
吴滔's avatar
吴滔 committed
237 238 239 240 241 242 243 244 245 246 247
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.page"
      :limit.sync="queryParams.rows"
      @pagination="getList"
    />
248

249 250 251 252
  </div>
</template>

<script>
吴滔's avatar
吴滔 committed
253 254 255 256 257
import { userList } from "@/api/system/user";
import { DICT_TYPE } from "@/utils/dict";
import CustomerSelector from "@/components/CustomerSelector";
import { getTradeCityList } from "@/api/ecw/region";
import { getReceivableList } from "@/api/ecw/financial";
我在何方's avatar
我在何方 committed
258
import { getCurrencyPage } from "@/api/ecw/currency";
259
import {getWarehouseList} from '@/api/ecw/warehouse'
我在何方's avatar
我在何方 committed
260

吴滔's avatar
吴滔 committed
261
export default {
262
  name: "EcwFinancialReceivable",
吴滔's avatar
吴滔 committed
263
  components: {
264
    CustomerSelector
吴滔's avatar
吴滔 committed
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
  },
  data() {
    return {
      showSearch: true,
      loadings: false,
      form: {},
      creatorData: [],
      list: [],
      total: 0,
      dateType: [],
      loading: "",
      params: {
        page: 1,
        rows: 20,
      },
      queryParams: {
        page: 1,
        rows: 20,
      },
      tradeCityList: [],
我在何方's avatar
我在何方 committed
285 286 287 288
	  params: {
	    page: 1,
	    rows: 20,
	  },
289 290
	  currencyList:[],
    warehouseList:[],
吴滔's avatar
吴滔 committed
291 292
    };
  },
293 294
  activated(){
    console.log(11)
295
    this.getList();
296
  },
吴滔's avatar
吴滔 committed
297 298
  created() {
    let that = this;
我在何方's avatar
我在何方 committed
299
	getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
吴滔's avatar
吴滔 committed
300 301 302
    userList("salesman").then((res) => (that.creatorData = res.data));
    getTradeCityList().then((res) => (that.tradeCityList = res.data));
    this.getList();
303
     getWarehouseList().then(res => this.warehouseList = res.data)
吴滔's avatar
吴滔 committed
304
  },
305

吴滔's avatar
吴滔 committed
306 307 308 309 310 311 312
  computed: {
    expoerCityList() {
      return this.tradeCityList.filter((item) => item.type == 2);
    },
    importCityList() {
      return this.tradeCityList.filter((item) => item.type == 1);
    },
313 314 315 316 317 318 319
    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
320 321
  },
  methods: {
我在何方's avatar
我在何方 committed
322 323
	  getCurrencyLabel(id){
	    var label = this.currencyList.filter(item=>item.id == id)
我在何方's avatar
我在何方 committed
324
	    if(label.length>0) return this.$i18n.locale=='zh_CN'?label[0].titleZh:label[0].titleEn
我在何方's avatar
我在何方 committed
325 326
	    return ''
	  },
吴滔's avatar
吴滔 committed
327 328 329 330
    /** 查询列表 */
    getList() {
      this.loading = true;
      // 处理查询参数
331 332 333 334 335 336 337 338
      console.log(this.queryParams)
      let params = {};
      for(let key in this.queryParams){
        if(this.queryParams[key]&&this.queryParams[key]!= undefined){
          params[key] = this.queryParams[key]
        }
      }

吴滔's avatar
吴滔 committed
339 340 341 342 343 344 345 346 347 348 349 350 351 352
      this.addBeginAndEndTime(params, this.dateType, "createTime");
      // 执行查询
      getReceivableList(params).then((response) => {
        this.list = response.data.list;
        this.total = response.data.total;
        this.loading = false;
      });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.page = 1;
      this.getList();
    },
    /** 新增按钮操作 */
353 354
    handleAdd(id) {
      return this.$router.push("creatCollection?receiptId=" + id);
吴滔's avatar
吴滔 committed
355 356 357 358 359
    },
    submitForm() {},
  },
};
</script>
360

我在何方's avatar
我在何方 committed
361
 <style scoped>
吴滔's avatar
吴滔 committed
362 363 364 365 366 367 368 369 370
.card {
  margin-top: 20px;
}
.dialog-footer {
  padding: 40px;
}
.card-title {
  font-size: 18px;
  font-weight: bold;
我在何方's avatar
我在何方 committed
371
  display: inline-block;
吴滔's avatar
吴滔 committed
372 373
}
</style>