receivable.vue 11.7 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 11
      <el-button
        style="float: right; margin-left: 10px"
        type="primary"
        size="mini"
        @click="handleAdd(0)"
吴滔's avatar
吴滔 committed
12
        >{{ $t('新增收款单') }}</el-button
吴滔's avatar
吴滔 committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
      >
      <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>
31
    <!-- 搜索工作栏 -->
吴滔's avatar
吴滔 committed
32 33 34 35 36 37 38 39 40 41
    <el-card v-show="showSearch">
      <el-form
        :model="queryParams"
        ref="queryForm"
        size="small"
        :inline="true"
        label-width="80px"
        class="card"
      >
        <el-row>
42
          <el-form-item :label="$t('始发地')">
吴滔's avatar
吴滔 committed
43 44
            <el-select
              v-model="queryParams.departureId"
45
              :placeholder="$t('请选择始发地')"
我在何方's avatar
我在何方 committed
46
              clearable
吴滔's avatar
吴滔 committed
47 48
            >
              <el-option
49 50
                v-for="item in exportWarehouseList"
                :label="$l(item, 'title')"
吴滔's avatar
吴滔 committed
51 52 53 54 55
                :value="item.id"
                :key="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
56
          <el-form-item :label="$t('目的地')">
吴滔's avatar
吴滔 committed
57 58
            <el-select
              v-model="queryParams.objectiveId"
59
              :placeholder="$t('请选择目的地')"
我在何方's avatar
我在何方 committed
60
              clearable
吴滔's avatar
吴滔 committed
61 62
            >
              <el-option
63 64
                v-for="item in importWarehouseList"
                :label="$l(item, 'title')"
吴滔's avatar
吴滔 committed
65 66 67 68 69
                :value="item.id"
                :key="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
吴滔's avatar
吴滔 committed
70
          <el-form-item :label="$t('运输方式')">
吴滔's avatar
吴滔 committed
71 72 73 74
            <dict-selector
              :type="DICT_TYPE.ECW_TRANSPORT_TYPE"
              v-model="queryParams.transportId"
              formatter="number"
我在何方's avatar
我在何方 committed
75
              clearable
吴滔's avatar
吴滔 committed
76 77
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
78
          <el-form-item :label="$t('控货')">
吴滔's avatar
吴滔 committed
79 80 81
            <dict-selector
              :type="DICT_TYPE.INFRA_BOOLEAN_STRING"
              v-model="queryParams.isCargoControl"
我在何方's avatar
我在何方 committed
82
              clearable
吴滔's avatar
吴滔 committed
83 84 85 86
            />
          </el-form-item>
        </el-row>
        <el-row>
吴滔's avatar
吴滔 committed
87
          <el-form-item :label="$t('订单状态')">
吴滔's avatar
吴滔 committed
88 89 90
            <dict-selector
              :type="DICT_TYPE.ORDER_STATUS"
              v-model="queryParams.status"
我在何方's avatar
我在何方 committed
91
              clearable
吴滔's avatar
吴滔 committed
92 93
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
94
          <el-form-item :label="$t('报关方式')">
吴滔's avatar
吴滔 committed
95 96 97
            <dict-selector
              :type="DICT_TYPE.ECW_CUSTOMS_TYPE"
              v-model="queryParams.customsType"
我在何方's avatar
我在何方 committed
98
              clearable
吴滔's avatar
吴滔 committed
99 100
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
101
          <el-form-item :label="$t('订单号')">
吴滔's avatar
吴滔 committed
102 103 104
            <el-input
              style="max-width: 188px"
              v-model="queryParams.orderNo"
吴滔's avatar
吴滔 committed
105
              :placeholder="$t('请输入订单编号')"
吴滔's avatar
吴滔 committed
106 107 108 109
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
110
          <el-form-item :label="$t('品名')">
吴滔's avatar
吴滔 committed
111 112 113
            <el-input
              style="max-width: 188px"
              v-model="queryParams.title"
吴滔's avatar
吴滔 committed
114
              :placeholder="$t('请输入品名')"
吴滔's avatar
吴滔 committed
115 116 117 118 119 120
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-row>
        <el-row>
吴滔's avatar
吴滔 committed
121
          <el-form-item :label="$t('提单号')">
吴滔's avatar
吴滔 committed
122 123 124
            <el-input
              style="max-width: 188px"
              v-model="queryParams.tidanNo"
吴滔's avatar
吴滔 committed
125
              :placeholder="$t('请输入提单号')"
吴滔's avatar
吴滔 committed
126 127 128 129
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
130
          <el-form-item :label="$t('唛头')">
吴滔's avatar
吴滔 committed
131 132 133
            <el-input
              style="max-width: 188px"
              v-model="queryParams.marks"
吴滔's avatar
吴滔 committed
134
              :placeholder="$t('请输入唛头')"
吴滔's avatar
吴滔 committed
135 136 137 138
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
139
          <el-form-item :label="$t('费用类型')">
吴滔's avatar
吴滔 committed
140 141 142
            <dict-selector
              :type="DICT_TYPE.FEE_TYPE"
              v-model="queryParams.feeType"
我在何方's avatar
我在何方 committed
143
              clearable
吴滔's avatar
吴滔 committed
144 145
            ></dict-selector>
          </el-form-item>
吴滔's avatar
吴滔 committed
146
          <el-form-item :label="$t('发货人')">
吴滔's avatar
吴滔 committed
147 148 149
            <customer-selector
              v-model="queryParams.consignorNameOrPhone"
              @change="consignor = $event"
我在何方's avatar
我在何方 committed
150
              clearable
吴滔's avatar
吴滔 committed
151 152 153
            />
          </el-form-item>
          <!--              <el-form-item label="发货人:" >
我在何方's avatar
我在何方 committed
154 155
                  <el-input style="max-width: 188px;" v-model="queryParams.orderNo" placeholder="请输入发货人" clearable @keyup.enter.native="handleQuery"/>
              </el-form-item> -->
吴滔's avatar
吴滔 committed
156 157
        </el-row>
        <el-row>
吴滔's avatar
吴滔 committed
158
          <el-form-item :label="$t('收货人')">
吴滔's avatar
吴滔 committed
159 160 161 162
            <!-- <el-input style="max-width: 188px;" v-model="queryParams.consigneeNameOrPhone" placeholder="请输入收货人" clearable @keyup.enter.native="handleQuery"/> -->
            <customer-selector
              v-model="queryParams.consigneeNameOrPhone"
              @change="consignor = $event"
我在何方's avatar
我在何方 committed
163
              clearable
吴滔's avatar
吴滔 committed
164 165
            />
          </el-form-item>
吴滔's avatar
吴滔 committed
166
          <el-form-item :label="$t('创建时间')">
吴滔's avatar
吴滔 committed
167 168 169 170 171 172
            <!-- <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
173 174
              :start-placeholder="$t('请选择日期')"
              :end-placeholder="$t('请选择日期')"
吴滔's avatar
吴滔 committed
175 176 177 178 179 180 181 182 183 184 185 186 187 188
            >
            </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
189 190 191
      <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
192
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
193
          {{ scope.row.titleZh? (scope.row.titleZh + "(" + scope.row.titleEn + ")"):'' }}
吴滔's avatar
吴滔 committed
194 195
        </template>
      </el-table-column>
吴滔's avatar
吴滔 committed
196
      <el-table-column :label="$t('箱数')" align="center" prop="num" />
我在何方's avatar
我在何方 committed
197 198 199 200 201
      <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
202 203 204
      <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
205 206 207 208
        <template slot-scope="scope">
          <dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" />
        </template>
      </el-table-column>
吴滔's avatar
吴滔 committed
209
      <el-table-column :label="$t('收入类型')" align="center" prop="feeType">
吴滔's avatar
吴滔 committed
210 211 212 213 214 215 216
        <template slot-scope="scope">
          <dict-tag
            :type="DICT_TYPE.FEE_TYPE"
            :value="scope.row.feeType"
          ></dict-tag>
        </template>
      </el-table-column>
吴滔's avatar
吴滔 committed
217
      <el-table-column :label="$t('单价')" align="center" prop="unitPrice">
218
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
219 220
          <span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
          <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
221 222
        </template>
      </el-table-column>
吴滔's avatar
吴滔 committed
223
      <el-table-column :label="$t('总金额')" align="center" prop="totalAmount">
224
        <template slot-scope="scope">
我在何方's avatar
我在何方 committed
225 226
          <span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
          <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
227 228
        </template>
      </el-table-column>
吴滔's avatar
吴滔 committed
229
      <el-table-column
吴滔's avatar
吴滔 committed
230
        :label="$t('操作')"
吴滔's avatar
吴滔 committed
231 232 233 234
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
235
          <el-button size="mini" type="text" @click="handleAdd(scope.row.id)"
吴滔's avatar
吴滔 committed
236
            >{{ $t('收款') }}</el-button
吴滔's avatar
吴滔 committed
237 238 239 240 241 242 243 244 245 246 247 248
          >
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.page"
      :limit.sync="queryParams.rows"
      @pagination="getList"
    />
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 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
  components: {
    CustomerSelector,
  },
  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 295 296
  activated(){
    console.log(11)
    this.handleQuery()
  },
吴滔'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 324 325 326
	  getCurrencyLabel(id){
	    var label = this.currencyList.filter(item=>item.id == id)
	    if(label.length>0) return label[0].titleZh
	    return ''
	  },
吴滔's avatar
吴滔 committed
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
    /** 查询列表 */
    getList() {
      this.loading = true;
      // 处理查询参数
      let params = { ...this.queryParams };
      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();
    },
    /** 新增按钮操作 */
346 347
    handleAdd(id) {
      return this.$router.push("creatCollection?receiptId=" + id);
吴滔's avatar
吴滔 committed
348 349 350 351 352
    },
    submitForm() {},
  },
};
</script>
353

我在何方's avatar
我在何方 committed
354
 <style scoped>
吴滔's avatar
吴滔 committed
355 356 357 358 359 360 361 362 363
.card {
  margin-top: 20px;
}
.dialog-footer {
  padding: 40px;
}
.card-title {
  font-size: 18px;
  font-weight: bold;
我在何方's avatar
我在何方 committed
364
  display: inline-block;
吴滔's avatar
吴滔 committed
365 366
}
</style>