Commit 80da72cf authored by liuzeheng's avatar liuzeheng
parents f34ae302 31d93922
......@@ -59,6 +59,15 @@ export function getCustomerContactsSelect(query) {
params: query
})
}
export function getCustomerContactsSelect2(query) {
return request({
url: '/ecw/customer-contacts/select2',
method: 'get',
params: query
})
}
// 导出客户联系人 Excel
export function exportCustomerContactsExcel(query) {
return request({
......
<template>
<el-dialog :title="$t('选择联系人')" visible :before-close="closeDialog" :close-on-click-modal="false">
<el-dialog
:title="$t('选择联系人')"
visible
:before-close="closeDialog"
:close-on-click-modal="false"
>
<div class="header mb-10 flex-center">
<div class="flex-center">{{$t('关键字')}}</div>
<div class="flex-center">{{ $t("关键字") }}</div>
<el-input v-model="form.searchKey" clearable class="w-200"></el-input>
<el-button type="primary" class="ml-10" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button type="primary" class="ml-10" @click="handleQuery">{{
$t("搜索")
}}</el-button>
</div>
<div class="list">
<div class="list-item" v-for="item in list" :key="item.customerContactsId" @click="choose(item)">
<div
class="list-item"
v-for="item in list"
:key="item.customerContactsId"
@click="choose(item)"
>
<div class="item-box">
<div class="line">
<div class="label">{{$t('姓名')}}</div>
<div class="value">{{item.contactsName}}</div>
<el-tag v-if="item.isInOpenSea" type="danger" effect="dark">{{$t('')}}</el-tag>
<div class="label">{{ $t("姓名") }}</div>
<div class="value">{{ item.contactsName }}</div>
<el-tag v-if="item.isInOpenSea" type="danger" effect="dark">{{
$t("")
}}</el-tag>
</div>
<!-- v1.7新增 -->
<div class="line">
<div class="label">{{$t('姓名(英文)')}}</div>
<div class="value">{{item.contactsNameEn}}</div>
<div class="label">{{ $t("姓名(英文)") }}</div>
<div class="value">{{ item.contactsNameEn }}</div>
</div>
<div class="line">
<div class="label">{{$t('电话')}}</div>
<div class="value">+{{item.areaCode}} {{item.phoneNew}}</div>
<div class="label">{{ $t("电话") }}</div>
<div class="value">+{{ item.areaCode }} {{ item.phoneNew }}</div>
</div>
<div class="line">
<div class="label">{{$t('邮箱')}}</div>
<div class="value">{{item.email}}</div>
<div class="label">{{ $t("邮箱") }}</div>
<div class="value">{{ item.email }}</div>
</div>
<div class="line">
<div class="label">{{$t('公司')}}</div>
<div class="value">{{item.company}}</div>
<div class="label">{{ $t("公司") }}</div>
<div class="value">{{ item.company }}</div>
</div>
<!-- v1.7新增 -->
<div class="line">
<div class="label">{{$t('公司(英文)')}}</div>
<div class="value">{{item.companyEn}}</div>
<div class="label">{{ $t("公司(英文)") }}</div>
<div class="value">{{ item.companyEn }}</div>
</div>
</div>
</div>
</div>
<pagination v-show="total > 0" :total="total" :page.sync="form.pageNo" :limit.sync="form.pageSize"
@pagination="loadList" />
<pagination
v-show="total > 0"
:total="total"
:page.sync="form.pageNo"
:limit.sync="form.pageSize"
@pagination="loadList"
/>
</el-dialog>
</template>
<script>
import {getCustomerContactsSelect} from '@/api/ecw/customerContacts'
import {
getCustomerContactsSelect,
getCustomerContactsSelect2,
} from "@/api/ecw/customerContacts";
export default {
props:{
type: Number
props: {
type: Number,
},
data(){
data() {
return {
show: true,
form:{
form: {
pageNo: 1,
pageSize: 10,
searchKey: ''
searchKey: "",
},
list:[],
total: 0
}
list: [],
total: 0,
};
},
created(){
this.show = true
this.loadList()
created() {
this.show = true;
this.loadList();
},
methods:{
handleQuery(){
this.form.pageNo = 1
this.loadList()
methods: {
handleQuery() {
this.form.pageNo = 1;
this.loadList();
},
loadList(){
getCustomerContactsSelect(this.form).then(res => {
this.list = res.data.list
this.total = res.data.total
})
loadList() {
//加载联系人数据,怎样使用属性
if (this.type == "1") {
getCustomerContactsSelect2(this.form).then((res) => {
this.list = res.data.list;
this.total = res.data.total;
});
} else {
getCustomerContactsSelect(this.form).then((res) => {
this.list = res.data.list;
this.total = res.data.total;
});
}
},
closeDialog(){
this.show = false
this.$emit('close');
closeDialog() {
this.show = false;
this.$emit("close");
},
choose(contact){
this.$emit('choose', contact)
}
}
}
choose(contact) {
this.$emit("choose", contact);
},
},
};
</script>
<style lang="scss" scoped>
.header{
.header {
display: flex;
}
.list{
.list {
display: flex;
flex-wrap: wrap;
justify-content: center;
&-item{
&-item {
background: #eee;
width: 300px;
margin: 10px;
padding: 5px;
border-radius: 10px;
border: 5px solid transparent;
background: linear-gradient(white,white) padding-box,repeating-linear-gradient(-45deg, red 0, red 12.5%, transparent 0, transparent 25%, #58a 0, #58a 37.5%, transparent 0, transparent 50%) 0/5em 5em;
.item-box{
background: linear-gradient(white, white) padding-box,
repeating-linear-gradient(
-45deg,
red 0,
red 12.5%,
transparent 0,
transparent 25%,
#58a 0,
#58a 37.5%,
transparent 0,
transparent 50%
)
0/5em 5em;
.item-box {
/* background: #fbfaf5; */
padding: 20px;
}
.line{
.line {
display: flex;
/* .label{
width: 100px;
} */
.value{
.value {
flex: 1;
margin-left: 10px;
}
......
......@@ -224,6 +224,7 @@ import { getCabinetPage } from "@/api/ecw/cabinet";
import { getWarehouseList } from "@/api/ecw/warehouse";
import { getListTree } from "@/api/ecw/region";
import costForm from "./costForm.vue";
//异常登记对话框
import regError from "./regError.vue";
import editForm from "./editForm.vue";
import ladingBill from "./ladingBill/index.vue";
......
......@@ -228,6 +228,24 @@
:label="$t('报关费用')"
align="center"
></el-table-column>
<!--
<el-table-column
prop=""
:label="$t('异常操作')"
align="center"
width="120px"
>
lanbm 2024-05-23 添加异常登记功能
<template slot-scope="scope">
<el-button
type="primary"
size="small"
@click="() => updateStatus_2('single', scope.row)"
>{{ $t("异常登记") }}</el-button
>
</template>
</el-table-column>-->
<el-table-column
prop=""
:label="$t('操作')"
......@@ -476,7 +494,6 @@
</el-tabs>
</el-col>
</el-row>
<!-- 对话框(添加 / 修改) -->
<el-dialog
:title="dialogConfig.title"
......@@ -522,6 +539,23 @@
/>
</template>
</el-dialog>
<!-- 对话框 lanbm 2024-05-23 add异常登记对话框 -->
<el-dialog
custom-class="shipping-dialog"
:title="$t('异常')"
:visible.sync="dialogVisible"
width="600px"
:modal-append-to-body="false"
append-to-body
>
<unloadingError
v-if="dialogVisible"
@closeDialog="closeDialog_2"
v-bind="$attrs"
:currRow="currRow"
/>
</el-dialog>
</div>
</template>
......@@ -554,6 +588,7 @@ import updateError from "./updateError.vue";
import { listUser } from "@/api/system/user";
//lanbm 2024-05-16 add
import { getCurrencyList } from "@/api/ecw/currency";
import unloadingError from "@/views/ecw/box/shippingSea/nodePage/unloading/unloadingError.vue";
export default {
name: "EcwBoxQuery",
......@@ -565,6 +600,8 @@ export default {
regError,
editForm,
updateError,
//lanbm 2024-05-23 异常登记对话框
unloadingError,
},
created() {
this.transportTypes = this.getDictDatas(
......@@ -677,6 +714,9 @@ export default {
},
//币种信息 lanbm 2024-05-16 add
currencyList: [],
// 当前行
currRow: {},
dialogVisible: false,
};
},
methods: {
......@@ -696,6 +736,15 @@ export default {
handleSelectionChange(selected) {
this.selectedRows = selected;
},
closeDialog_2() {
//关闭异常对话框
this.dialogVisible = false;
},
updateStatus_2(type, row) {
//lanbm 2024-05-23 添加的异常登记功能
this.currRow = row;
this.dialogVisible = true;
},
/* 更新状态 */
updateStatus(type, row) {
let orders = [];
......
<template>
<div class="app-container shipping-detail">
<el-row type="flex" style="margin-top: 15px; margin-bottom: 15px" justify="center">
<el-row
type="flex"
style="margin-top: 15px; margin-bottom: 15px"
justify="center"
>
<el-col :xs="24" :sm="24" :md="24" :lg="20" :xl="22">
<div style="display: flex; justify-content: space-between;align-items: flex-end;">
<h2>{{$t('出货详情')}}</h2>
<div
style="
display: flex;
justify-content: space-between;
align-items: flex-end;
"
>
<h2>{{ $t("出货详情") }}</h2>
<div>
<!-- <el-button size="small" @click="handleCommand('edit')">{{$t('编辑')}}</el-button> -->
<el-button size="small" v-hasPermi="['shipment:box:action:sea']" @click="handleCommand('router')">{{$t('操作')}}</el-button>
<el-button type="primary" v-hasPermi="['shipment:box:action:error']" size="small" @click="handleCommand('error')">{{$t('异常登记')}}</el-button>
<el-button type="primary" v-hasPermi="['shipment:box:action:cost']" size="small" @click="handleCommand('cost')">{{$t('费用登记')}}</el-button>
<el-button
size="small"
v-hasPermi="['shipment:box:action:sea']"
@click="handleCommand('router')"
>{{ $t("操作") }}</el-button
>
<el-button
type="primary"
v-hasPermi="['shipment:box:action:error']"
size="small"
@click="handleCommand('error')"
>{{ $t("异常登记") }}</el-button
>
<el-button
type="primary"
v-hasPermi="['shipment:box:action:cost']"
size="small"
@click="handleCommand('cost')"
>{{ $t("费用登记") }}</el-button
>
<!-- <el-button type="danger" size="small" @click="handleCommand('delete')">{{$t('删除')}}</el-button> -->
</div>
</div>
<el-card style="margin-top: 15px">
<el-descriptions :column="4" border>
<el-descriptions-item :label="$t('自编号')">
{{shipmentObj.selfNo}}
{{ shipmentObj.selfNo }}
</el-descriptions-item>
<el-descriptions-item :label="$t('运输方式')">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="shipmentObj.transportType" />
<dict-tag
:type="DICT_TYPE.ECW_TRANSPORT_TYPE"
:value="shipmentObj.transportType"
/>
</el-descriptions-item>
<el-descriptions-item :label="$t('出货渠道')">
{{getShipChannelName(shipmentObj.shippingChannelId)}}
{{ getShipChannelName(shipmentObj.shippingChannelId) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('状态')">
{{shipmentObj.shipmentStatusText}}
{{ shipmentObj.shipmentStatusText }}
</el-descriptions-item>
<el-descriptions-item :label="$t('总计')">
{{getBoxSum(shipmentObj.boxStatistics)}}
{{ getBoxSum(shipmentObj.boxStatistics) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('始发地')">
{{getCityName(shipmentObj.startWarehouseId)}}
{{ getCityName(shipmentObj.startWarehouseId) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('目的地')">
{{getCityName(shipmentObj.destWarehouseId)}}
{{ getCityName(shipmentObj.destWarehouseId) }}
</el-descriptions-item>
<el-descriptions-item label="SO NO">
{{shipmentObj.bookSeaInfo ? shipmentObj.bookSeaInfo.sono : '' }}
{{ shipmentObj.bookSeaInfo ? shipmentObj.bookSeaInfo.sono : "" }}
</el-descriptions-item>
<el-descriptions-item :label="$t('目的港清关')">
{{getClearance(shipmentObj.destinationClearance)}}
{{ getClearance(shipmentObj.destinationClearance) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('发货方式')">
{{getdeliveryType(shipmentObj.deliveryType)}}
{{ getdeliveryType(shipmentObj.deliveryType) }}
</el-descriptions-item>
</el-descriptions>
</el-card>
......@@ -50,65 +80,248 @@
<el-tabs style="margin-top: 15px" type="border-card" value="detail">
<el-tab-pane :label="$t('明细')" name="detail">
<div class="detail-pane">
<div>{{$t('当前部分')}}</div>
<el-select :placeholder="$t('请选择')" v-model="sectionId" @change="sectionChange">
<div>{{ $t("当前部分") }}</div>
<el-select
:placeholder="$t('请选择')"
v-model="sectionId"
@change="sectionChange"
>
<el-option key="0" :label="$t('全部')" value="0"></el-option>
<el-option v-for="item in sectionList" :key="item.id" :label="item.title" :value="item.id"></el-option>
<el-option
v-for="item in sectionList"
:key="item.id"
:label="item.title"
:value="item.id"
></el-option>
</el-select>
<p class="box-weight">
{{getSectionInfo}}
{{ getSectionInfo }}
</p>
<div class="document-status">
<p>{{$t('单证状态')}}</p>
<template v-for="(item, index) in getDocStatus(sectionObj.sectionOrderList)">
<dict-tag :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="item" :key="index" />
<p>{{ $t("单证状态") }}</p>
<template
v-for="(item, index) in getDocStatus(
sectionObj.sectionOrderList
)"
>
<dict-tag
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
:value="item"
:key="index"
/>
</template>
</div>
</div>
<div style="margin:20px 0 20px 0;">
<el-button type="primary" v-hasPermi="['shipment:box:order:select']" size="small" @click="()=>updateStatus('selected')">{{$t('更新所选订单状态')}}</el-button>
<el-button type="primary" v-hasPermi="['shipment:box:order:all']" size="small" @click="()=>updateStatus('all')">{{$t('更新全部订单状态')}}</el-button>
<el-button type="primary" v-if="shipmentObj.sapStatus==152&&(shipmentObj.airArrivalInfo&&shipmentObj.airArrivalInfo.arriveType==1)" v-hasPermi="['shipment:box:order:select']" size="small" @click="()=>updateArrivalStatus('selected')">{{$t('更新所选订单到港状态')}}</el-button>
<el-button type="primary" v-if="shipmentObj.sapStatus==152&&(shipmentObj.airArrivalInfo&&shipmentObj.airArrivalInfo.arriveType==1)" v-hasPermi="['shipment:box:order:all']" size="small" @click="()=>updateArrivalStatus('all')">{{$t('更新全部订单到港状态')}}</el-button>
<el-button type="primary" v-if="shipmentObj.clStatus==132&&(shipmentObj.clearanceInfo&&shipmentObj.clearanceInfo.clearanceType==1)" v-hasPermi="['shipment:box:order:select']" size="small" @click="()=>updateClearStatus('selected')">{{$t('更新所选订单清关状态')}}</el-button>
<el-button type="primary" v-if="shipmentObj.clStatus==132&&(shipmentObj.clearanceInfo&&shipmentObj.clearanceInfo.clearanceType==1)" v-hasPermi="['shipment:box:order:all']" size="small" @click="()=>updateClearStatus('all')">{{$t('更新全部订单清关状态')}}</el-button>
<div style="margin: 20px 0 20px 0">
<el-button
type="primary"
v-hasPermi="['shipment:box:order:select']"
size="small"
@click="() => updateStatus('selected')"
>{{ $t("更新所选订单状态") }}</el-button
>
<el-button
type="primary"
v-hasPermi="['shipment:box:order:all']"
size="small"
@click="() => updateStatus('all')"
>{{ $t("更新全部订单状态") }}</el-button
>
<el-button
type="primary"
v-if="
shipmentObj.sapStatus == 152 &&
shipmentObj.airArrivalInfo &&
shipmentObj.airArrivalInfo.arriveType == 1
"
v-hasPermi="['shipment:box:order:select']"
size="small"
@click="() => updateArrivalStatus('selected')"
>{{ $t("更新所选订单到港状态") }}</el-button
>
<el-button
type="primary"
v-if="
shipmentObj.sapStatus == 152 &&
shipmentObj.airArrivalInfo &&
shipmentObj.airArrivalInfo.arriveType == 1
"
v-hasPermi="['shipment:box:order:all']"
size="small"
@click="() => updateArrivalStatus('all')"
>{{ $t("更新全部订单到港状态") }}</el-button
>
<el-button
type="primary"
v-if="
shipmentObj.clStatus == 132 &&
shipmentObj.clearanceInfo &&
shipmentObj.clearanceInfo.clearanceType == 1
"
v-hasPermi="['shipment:box:order:select']"
size="small"
@click="() => updateClearStatus('selected')"
>{{ $t("更新所选订单清关状态") }}</el-button
>
<el-button
type="primary"
v-if="
shipmentObj.clStatus == 132 &&
shipmentObj.clearanceInfo &&
shipmentObj.clearanceInfo.clearanceType == 1
"
v-hasPermi="['shipment:box:order:all']"
size="small"
@click="() => updateClearStatus('all')"
>{{ $t("更新全部订单清关状态") }}</el-button
>
</div>
<el-table :data="sectionObj.sectionOrderList" style="width: 100%" border @selection-change="handleSelectionChange">
<el-table
:data="sectionObj.sectionOrderList"
style="width: 100%"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50"></el-table-column>>
<el-table-column align="center" :label="$t('序号')" width="50" prop="tidanNum" />
<el-table-column prop="orderNo" :label="$t('订单号')" align="center">
<el-table-column
align="center"
:label="$t('序号')"
width="50"
prop="tidanNum"
/>
<el-table-column
prop="orderNo"
:label="$t('订单号')"
align="center"
>
<template v-slot="scope">
<a href="javascript:void(0)" @click="jumpOrderDetail(scope.row)">{{ scope.row.orderNo }}</a>
<a
href="javascript:void(0)"
@click="jumpOrderDetail(scope.row)"
>{{ scope.row.orderNo }}</a
>
</template>
</el-table-column>
<el-table-column prop="goodsList" :label="$t('货物信息')" width="230px" align="center">
<template v-slot="{row}">
<el-table-column
prop="goodsList"
:label="$t('货物信息')"
width="230px"
align="center"
>
<template v-slot="{ row }">
<section>
<div v-for="(item, index) in row.goodsList" :key="index">
{{index+1}}{{item.prodTitleZh}}
{{ index + 1 }}{{ item.prodTitleZh }}
</div>
</section>
</template>
</el-table-column>
<el-table-column prop="num" :label="$t('计划箱数')" align="center"></el-table-column>
<el-table-column prop="installNum" :label="$t('实装箱数')" align="center"></el-table-column>
<el-table-column prop="unloadNum" :label="$t('卸柜箱数')" align="center"></el-table-column>
<el-table-column prop="destWarehouseName" :label="$t('提货点')" align="center"></el-table-column>
<el-table-column prop="volume" :label="$t('体积')" align="center"></el-table-column>
<el-table-column prop="weight" :label="$t('重量')" align="center"></el-table-column>
<el-table-column prop="totalWorth" :label="$t('货值')" align="center"></el-table-column>
<el-table-column prop="customsType" :label="$t('报关方式')" align="center">
<el-table-column
prop="num"
:label="$t('计划箱数')"
align="center"
></el-table-column>
<el-table-column
prop="installNum"
:label="$t('实装箱数')"
align="center"
></el-table-column>
<el-table-column
prop="unloadNum"
:label="$t('卸柜箱数')"
align="center"
></el-table-column>
<el-table-column
prop="destWarehouseName"
:label="$t('提货点')"
align="center"
></el-table-column>
<el-table-column
prop="volume"
:label="$t('体积')"
align="center"
></el-table-column>
<el-table-column
prop="weight"
:label="$t('重量')"
align="center"
></el-table-column>
<el-table-column
prop="totalWorth"
:label="$t('货值')"
align="center"
></el-table-column>
<el-table-column
prop="customsType"
:label="$t('报关方式')"
align="center"
>
<template slot-scope="scope">
<div :class="scope.row.customsType !== 1 ? 'customsType-red' : ''">
<dict-tag :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="scope.row.customsType" />
<div
:class="
scope.row.customsType !== 1 ? 'customsType-red' : ''
"
>
<dict-tag
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
:value="scope.row.customsType"
/>
</div>
</template>
</el-table-column>
<el-table-column prop="customsFee" :label="$t('报关费用')" align="center"></el-table-column>
<el-table-column prop="" :label="$t('操作')" align="center" width="120px">
<el-table-column
prop="customsFee"
:label="$t('报关费用')"
align="center"
></el-table-column>
<!--
<el-table-column
prop=""
:label="$t('异常操作')"
align="center"
width="120px"
>
<template slot-scope="scope">
<el-button
type="primary"
size="small"
@click="() => updateStatus_2('single', scope.row)"
style="margin-top: 5px"
>{{ $t("异常登记") }}</el-button
>
</template>
</el-table-column>-->
<el-table-column
prop=""
:label="$t('操作')"
align="center"
width="120px"
>
<template slot-scope="scope">
<el-button type="primary" size="small" :disabled="scope.row.abnormalDealStatus === 1" @click="()=>updateStatus('single', scope.row)" style="margin-top: 5px;">{{$t('更新状态')}}</el-button>
<el-button type="primary" size="small" style="margin-top: 5px;" :disabled="shipmentObj.clStatus==132|| (shipmentObj.clearanceInfo == null) || (shipmentObj.clearanceInfo&&shipmentObj.clearanceInfo.clearanceOrderList.findIndex(ff=>ff.orderId == scope.row.orderId) == -1)" @click="()=>cancleClear(scope.row)">{{$t('撤销清关申请')}}</el-button>
<el-button
type="primary"
size="small"
:disabled="scope.row.abnormalDealStatus === 1"
@click="() => updateStatus('single', scope.row)"
style="margin-top: 5px"
>{{ $t("更新状态") }}</el-button
>
<el-button
type="primary"
size="small"
style="margin-top: 5px"
:disabled="
shipmentObj.clStatus == 132 ||
shipmentObj.clearanceInfo == null ||
(shipmentObj.clearanceInfo &&
shipmentObj.clearanceInfo.clearanceOrderList.findIndex(
(ff) => ff.orderId == scope.row.orderId
) == -1)
"
@click="() => cancleClear(scope.row)"
>{{ $t("撤销清关申请") }}</el-button
>
<!-- <el-button type="danger" style="margin-top: 5px;" size="small" @click="openError(scope.row)">{{$t('异常')}}</el-button> -->
</template>
......@@ -116,42 +329,96 @@
</el-table>
</el-tab-pane>
<el-tab-pane :label="$t('状态')" name="status">
<div v-for="(item, index) in logList" :key="item.id" :class="`shipping-status ${index === 0 ? 'curr-status' : '' }`">
<div
v-for="(item, index) in logList"
:key="item.id"
:class="`shipping-status ${index === 0 ? 'curr-status' : ''}`"
>
<div class="status-line"></div>
<div class="status-number">{{logList.length - index}}</div>
<div class="status-number">{{ logList.length - index }}</div>
<div class="status-info">
<div>{{$l(item, 'title')}} <el-button v-if="item.approvalId>0" type="text" @click="handleApproval(item.bpmProcessId)">{{$t('查看审批')}}</el-button></div>
<div>
<p>{{formatDate(item.createTime)}}</p>
<p>{{item.operator}}</p>
{{ $l(item, "title") }}
<el-button
v-if="item.approvalId > 0"
type="text"
@click="handleApproval(item.bpmProcessId)"
>{{ $t("查看审批") }}</el-button
>
</div>
<div>
<p>{{ formatDate(item.createTime) }}</p>
<p>{{ item.operator }}</p>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane :label="$t('费用')" name="fee">
<el-table :data="costList" style="width: 100%" border>
<el-table-column type="index" align="center" :label="$t('序号')" width="50" />
<el-table-column prop="costType" :label="$t('费用类型')" align="center">
<el-table-column
type="index"
align="center"
:label="$t('序号')"
width="50"
/>
<el-table-column
prop="costType"
:label="$t('费用类型')"
align="center"
>
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="scope.row.costType" />
<dict-tag
:type="DICT_TYPE.FEE_TYPE"
:value="scope.row.costType"
/>
</template>
</el-table-column>
<el-table-column prop="supplierId" :label="$t('供应商')" align="center">
<el-table-column
prop="supplierId"
:label="$t('供应商')"
align="center"
>
<template slot-scope="scope">
{{getSupplier(scope.row.supplierId)}}
{{ getSupplier(scope.row.supplierId) }}
</template>
</el-table-column>
<el-table-column prop="price" :label="$t('金额')" align="center"></el-table-column>
<el-table-column
prop="price"
:label="$t('金额')"
align="center"
></el-table-column>
<!--lanbm 2024-05-16 修改-->
<el-table-column prop="priceUnitName" :label="$t('币种')" align="center"></el-table-column>
<el-table-column prop="payPrice" :label="$t('实付金额')" align="center"></el-table-column>
<el-table-column prop="payPriceBz" :label="$t('实付币种')" align="center"></el-table-column>
<el-table-column prop="payTime" :label="$t('实付日期')" align="center">
<el-table-column
prop="priceUnitName"
:label="$t('币种')"
align="center"
></el-table-column>
<el-table-column
prop="payPrice"
:label="$t('实付金额')"
align="center"
></el-table-column>
<el-table-column
prop="payPriceBz"
:label="$t('实付币种')"
align="center"
></el-table-column>
<el-table-column
prop="payTime"
:label="$t('实付日期')"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.payTime">{{formatDate(scope.row.payTime)}}</span>
<span v-if="scope.row.payTime">{{
formatDate(scope.row.payTime)
}}</span>
</template>
</el-table-column>
<el-table-column prop="payableNo" :label="$t('付款单号')" align="center">
<el-table-column
prop="payableNo"
:label="$t('付款单号')"
align="center"
>
<template slot-scope="scope">
<span
style="color: #1890ff"
......@@ -160,17 +427,53 @@
>
</template>
</el-table-column>
<el-table-column prop="creator" :label="$t('创建人')" align="center"></el-table-column>
<el-table-column prop="createTime" :label="$t('创建日期')" align="center"></el-table-column>
<el-table-column prop="updater" :label="$t('修改人')" align="center"></el-table-column>
<el-table-column prop="updateTime" :label="$t('修改日期')" align="center"></el-table-column>
<el-table-column
prop="creator"
:label="$t('创建人')"
align="center"
></el-table-column>
<el-table-column
prop="createTime"
:label="$t('创建日期')"
align="center"
></el-table-column>
<el-table-column
prop="updater"
:label="$t('修改人')"
align="center"
></el-table-column>
<el-table-column
prop="updateTime"
:label="$t('修改日期')"
align="center"
></el-table-column>
<!--添加备注信息列 lanbm 2024-05-16 add-->
<el-table-column prop="remarks" :label="$t('备注')" align="center"></el-table-column>
<el-table-column
prop="remarks"
:label="$t('备注')"
align="center"
></el-table-column>
<el-table-column :label="$t('操作')" align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editCostClick(scope.row)" style="marginRight:10px;" v-hasPermi="['ecw:box-cost:update']">{{$t('编辑')}}</el-button>
<el-popconfirm :title="$t('确定是否删除')" @confirm="deleteCostClick(scope.row)">
<el-button type="danger" size="small" slot="reference" v-hasPermi="['ecw:box-cost:delete']">{{$t('删除')}}</el-button>
<el-button
type="primary"
size="small"
@click="editCostClick(scope.row)"
style="marginright: 10px"
v-hasPermi="['ecw:box-cost:update']"
>{{ $t("编辑") }}</el-button
>
<el-popconfirm
:title="$t('确定是否删除')"
@confirm="deleteCostClick(scope.row)"
>
<el-button
type="danger"
size="small"
slot="reference"
v-hasPermi="['ecw:box-cost:delete']"
>{{ $t("删除") }}</el-button
>
</el-popconfirm>
</template>
</el-table-column>
......@@ -178,34 +481,76 @@
</el-tab-pane>
<el-tab-pane :label="$t('异常')" name="error">
<el-table :data="errorList" style="width: 100%" border>
<el-table-column type="index" align="center" :label="$t('序号')" width="50" />
<el-table-column
type="index"
align="center"
:label="$t('序号')"
width="50"
/>
<el-table-column prop="opStep" :label="$t('操作')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.BOX_AIR_SHIPMENT_PROCESS" :value="scope.row.opStep" />
<dict-tag
:type="DICT_TYPE.BOX_AIR_SHIPMENT_PROCESS"
:value="scope.row.opStep"
/>
</template>
</el-table-column>
<el-table-column prop="billAbnId" :label="$t('异常')" align="center">
<el-table-column
prop="billAbnId"
:label="$t('异常')"
align="center"
>
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE[getregprocess(scope.row.opStep)]" :value="scope.row.billAbnId" />
<dict-tag
:type="DICT_TYPE[getregprocess(scope.row.opStep)]"
:value="scope.row.billAbnId"
/>
</template>
</el-table-column>
<el-table-column prop="abnDetail" :label="$t('异常描述')" align="center" width="300"></el-table-column>
<el-table-column prop="delayDays" :label="$t('异常延迟天数')" align="center"></el-table-column>
<el-table-column prop="" :label="$t('异常时间')" align="center" width="200">
<el-table-column
prop="abnDetail"
:label="$t('异常描述')"
align="center"
width="300"
></el-table-column>
<el-table-column
prop="delayDays"
:label="$t('异常延迟天数')"
align="center"
></el-table-column>
<el-table-column
prop=""
:label="$t('异常时间')"
align="center"
width="200"
>
<template slot-scope="scope">
<span v-if="scope.row.abnStartTime">{{formatDate(scope.row.abnStartTime)}} - </span>
<span v-if="scope.row.abnEndTime">{{formatDate(scope.row.abnEndTime)}}</span>
<span v-if="scope.row.abnStartTime"
>{{ formatDate(scope.row.abnStartTime) }} -
</span>
<span v-if="scope.row.abnEndTime">{{
formatDate(scope.row.abnEndTime)
}}</span>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane :label="$t('表单')" name="download">
<el-table :data="downloadList" style="width: 50%">
<el-table-column prop="title" :label="$t('文件类型')"></el-table-column>
<el-table-column
prop="title"
:label="$t('文件类型')"
></el-table-column>
<el-table-column prop="" :label="$t('下载链接')">
<template slot-scope="scope">
<a v-if="scope.row.serviceName" href="javascript:void(0)" @click="downloadDetailFile(scope.row)" v-hasPermi="[`${scope.row.hasPermi}`]">{{$t('下载')}}</a>
<div v-else>{{$t('未完成')}}</div>
<a
v-if="scope.row.serviceName"
href="javascript:void(0)"
@click="downloadDetailFile(scope.row)"
v-hasPermi="[`${scope.row.hasPermi}`]"
>{{ $t("下载") }}</a
>
<div v-else>{{ $t("未完成") }}</div>
</template>
</el-table-column>
</el-table>
......@@ -215,40 +560,100 @@
</el-row>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogConfig.title" :visible.sync="dialogConfig.visible" :width="dialogConfig.width" append-to-body class="shippingSea-dialog">
<el-dialog
:title="dialogConfig.title"
:visible.sync="dialogConfig.visible"
:width="dialogConfig.width"
append-to-body
class="shippingSea-dialog"
>
<template v-if="dialogConfig.type === 'edit'">
<editForm v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :warehouseList="warehouseList" :transportTypes="transportTypes" :cabinetList="cabinetList" />
<editForm
v-if="dialogConfig.visible"
@closeDialog="closeDialog"
:shipmentObj="shipmentObj"
:warehouseList="warehouseList"
:transportTypes="transportTypes"
:cabinetList="cabinetList"
/>
</template>
<template v-if="dialogConfig.type === 'cost'">
<costForm v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :costDetail="costDetail" flag="air" />
<costForm
v-if="dialogConfig.visible"
@closeDialog="closeDialog"
:shipmentObj="shipmentObj"
:costDetail="costDetail"
flag="air"
/>
</template>
<template v-if="dialogConfig.type === 'error'">
<regError v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :allUsers="allUsers" flag="air" />
<regError
v-if="dialogConfig.visible"
@closeDialog="closeDialog"
:shipmentObj="shipmentObj"
:allUsers="allUsers"
flag="air"
/>
</template>
<template v-if="dialogConfig.type === 'updateError'">
<updateError v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :errorInfo="errorInfo" />
<updateError
v-if="dialogConfig.visible"
@closeDialog="closeDialog"
:shipmentObj="shipmentObj"
:errorInfo="errorInfo"
/>
</template>
<template v-if="dialogConfig.type === 'updateArrival'">
<updateArrival v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :arrivalInfo="arrivalInfo" />
<updateArrival
v-if="dialogConfig.visible"
@closeDialog="closeDialog"
:shipmentObj="shipmentObj"
:arrivalInfo="arrivalInfo"
/>
</template>
<template v-if="dialogConfig.type === 'updateClear'">
<updateClear v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :clearInfo="clearInfo" />
<updateClear
v-if="dialogConfig.visible"
@closeDialog="closeDialog"
:shipmentObj="shipmentObj"
:clearInfo="clearInfo"
/>
</template>
<template v-if="dialogConfig.type === 'cancelClear'">
<cancelClear v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :cancelClearInfo="cancelClearInfo" />
<cancelClear
v-if="dialogConfig.visible"
@closeDialog="closeDialog"
:shipmentObj="shipmentObj"
:cancelClearInfo="cancelClearInfo"
/>
</template>
<template v-if="dialogConfig.type === 'unloadingError'">
<unloadingError v-if="dialogConfig.visible" @closeDialog="closeDialog" :shipmentObj="shipmentObj" :unloadingError="unloadingError" />
<unloadingError
v-if="dialogConfig.visible"
@closeDialog="closeDialog"
:shipmentObj="shipmentObj"
:unloadingError="unloadingError"
/>
</template>
</el-dialog>
<!-- 对话框 -->
<el-dialog custom-class="shipping-dialog" :title="$t('异常')" :visible.sync="dialogVisible" width="600px" :modal-append-to-body=false append-to-body>
<unloadingError v-if="dialogVisible" @closeDialog="closeDialog1" v-bind="$attrs" :currRow="currRow" />
<el-dialog
custom-class="shipping-dialog"
:title="$t('异常')"
:visible.sync="dialogVisible"
width="600px"
:modal-append-to-body="false"
append-to-body
>
<unloadingError
v-if="dialogVisible"
@closeDialog="closeDialog1"
v-bind="$attrs"
:currRow="currRow"
/>
</el-dialog>
</div>
</template>
......@@ -259,7 +664,8 @@ import {
getCostList,
getAbnormalList,
deleteCost,
deletebox,getPaymentId
deletebox,
getPaymentId,
} from "@/api/ecw/box";
import { getChannelList } from "@/api/ecw/channel";
import { getCabinetPage } from "@/api/ecw/cabinet";
......@@ -296,7 +702,7 @@ export default {
updateArrival,
updateClear,
cancelClear,
unloadingError
unloadingError,
},
created() {
this.transportTypes = this.getDictDatas(
......@@ -361,47 +767,59 @@ export default {
// },
dialogVisible: false,
// 运输方式
transportTypes: [],
// 费用详情
costDetail: {},
// 下载
downloadList: [
{ title: this.$t("预装单"), serviceName: "downloadPreloadGoodsList", hasPermi: "shipment:air:download:downloadPreloadGoodsList" },
{
title: this.$t("预装单"),
serviceName: "downloadPreloadGoodsList",
hasPermi: "shipment:air:download:downloadPreloadGoodsList",
},
// { title: this.$t("已装单"), serviceName: "downloadLoadGoodsList", hasPermi: "shipment:box:download:downloadLoadGoodsList" },
{ title: this.$t("应收汇总表"), serviceName: "downloadReceivableList", hasPermi: "shipment:air:download:downloadReceivableList" },
{
title: this.$t("应收汇总表"),
serviceName: "downloadReceivableList",
hasPermi: "shipment:air:download:downloadReceivableList",
},
{
title: this.$t("提货单"),
serviceName: "zipDownload",
fileFormat: "zip",
hasPermi: "shipment:air:download:zipDownload"
hasPermi: "shipment:air:download:zipDownload",
},
{
title: "agent list",
serviceName: "downloadAgentListFiles",
type: "url",
hasPermi: "shipment:air:download:downloadAgentListFiles"
hasPermi: "shipment:air:download:downloadAgentListFiles",
},
{
title: "soncap",
serviceName: "downloadSoncapFiles",
type: "url",
hasPermi: "shipment:air:download:downloadSoncapFiles",
},
{ title: "soncap", serviceName: "downloadSoncapFiles", type: "url", hasPermi: "shipment:air:download:downloadSoncapFiles" },
{
title: this.$t("AWB文件"),
serviceName: "cdAwbFile",
type: "url",
hasPermi: "shipment:air:download:cdAwbFile"
hasPermi: "shipment:air:download:cdAwbFile",
},
{
title: this.$t("提单Copy"),
serviceName: "downloadLadingCopy",
type: "url",
hasPermi: "shipment:air:download:downloadLadingCopy"
hasPermi: "shipment:air:download:downloadLadingCopy",
},
{
title: this.$t("已装单"),
serviceName: "downloadLoadGoods",
type: "url",
hasPermi: "shipment:air:download:downloadLoadGoods"
hasPermi: "shipment:air:download:downloadLoadGoods",
},
],
// 选中行
......@@ -413,12 +831,12 @@ export default {
operate: "",
},
arrivalInfo: {
orderList: []
orderList: [],
},
clearInfo: {
orderList: []
orderList: [],
},
cancelClearInfo: {}
cancelClearInfo: {},
};
},
methods: {
......@@ -431,22 +849,22 @@ export default {
});
},
getregprocess(val) {
var data = ''
switch(val){
var data = "";
switch (val) {
case 10:
data = 'FLYING_TICKET_EXCEPTION'
data = "FLYING_TICKET_EXCEPTION";
break;
case 12:
data = 'ARRIVAL_TICKET_EXCEPTION'
break
data = "ARRIVAL_TICKET_EXCEPTION";
break;
case 13:
data = 'CLEARANCE_TICKET_EXCEPTION'
break
data = "CLEARANCE_TICKET_EXCEPTION";
break;
default:
data = 'BOX_SHIPPING_TICKET_EXCEPTION'
break
data = "BOX_SHIPPING_TICKET_EXCEPTION";
break;
}
return data
return data;
},
selectable(row, index) {
if (row.abnormalDealStatus === 1) return false;
......@@ -461,7 +879,7 @@ export default {
/* 打开异常 */
openError(row) {
console.log(row)
console.log(row);
this.currRow = row;
this.dialogVisible = true;
},
......@@ -470,6 +888,12 @@ export default {
handleSelectionChange(selected) {
this.selectedRows = selected;
},
updateStatus_2(type, row) {
//异常登记 lanbm 2024-05-23 add
this.$set(this.dialogConfig, "visible", true);
this.$set(this.dialogConfig, "title", this.$t("异常登记"));
this.$set(this.dialogConfig, "type", "error");
},
/* 更新状态 */
updateStatus(type, row) {
let orders = [];
......@@ -491,7 +915,7 @@ export default {
} else if (type === "single") {
orders = [row];
}
console.log('getErrorType', type)
console.log("getErrorType", type);
this.getErrorType();
this.$set(this.errorInfo, "orderList", orders);
this.$set(this.errorInfo, "operate", type);
......@@ -499,8 +923,6 @@ export default {
this.handleCommand("updateError");
},
/* 更新到港状态 */
updateArrivalStatus(type) {
let orders = [];
......@@ -509,7 +931,9 @@ export default {
this.$message.error("请选择需要更新的订单");
return;
}
orders = this.selectedRows.map(item=>{return item.orderId});
orders = this.selectedRows.map((item) => {
return item.orderId;
});
}
this.$set(this.arrivalInfo, "orderList", orders);
this.$set(this.arrivalInfo, "type", type);
......@@ -523,7 +947,9 @@ export default {
this.$message.error("请选择需要更新的订单");
return;
}
orders = this.selectedRows.map(item=>{return item.orderId});
orders = this.selectedRows.map((item) => {
return item.orderId;
});
}
this.$set(this.clearInfo, "orderList", orders);
this.$set(this.clearInfo, "type", type);
......@@ -531,7 +957,7 @@ export default {
},
/* 更新清关状态 */
cancleClear(val) {
this.cancelClearInfo = val
this.cancelClearInfo = val;
this.handleCommand("cancelClear");
},
getErrorType() {
......@@ -556,7 +982,7 @@ export default {
this.$set(this.errorInfo, "errorType", "flight");
this.$set(this.dialogConfig, "title", this.$t("更新起飞异常状态"));
}
console.log(key, value)
console.log(key, value);
}
},
// 初始化字典数据
......@@ -745,10 +1171,10 @@ export default {
},
formatDate,
downloadDetailFile(row) {
if(row.serviceName == 'downloadLoadGoods'){
if(this.shipmentObj.tyStatus < 2112){
this.$message.error('请先完成理货后,再下载已装单')
return
if (row.serviceName == "downloadLoadGoods") {
if (this.shipmentObj.tyStatus < 2112) {
this.$message.error("请先完成理货后,再下载已装单");
return;
}
}
const { fileFormat, type } = row;
......@@ -765,11 +1191,14 @@ export default {
fileFormat ?? "xlsx"
);
}
this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
this.$message.success(this.$t("已加入导出队列,请稍后在下载日志中下载"));
},
handleApproval(id) {
this.$router.push({path: '/bpm/process-instance/detail', query: {id: id}})
}
this.$router.push({
path: "/bpm/process-instance/detail",
query: { id: id },
});
},
},
computed: {
visitedViews() {
......@@ -835,16 +1264,16 @@ export default {
},
getClearance() {
return (id) => {
let data = ['','我司清关','合作方清关','客户']
return data[id]
}
let data = ["", "我司清关", "合作方清关", "客户"];
return data[id];
};
},
getdeliveryType() {
return (id) => {
let data = ['','多票','单票']
return data[id]
}
}
let data = ["", "多票", "单票"];
return data[id];
};
},
},
};
</script>
......
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item :label="$t('客户编号')" prop="number">
<el-input v-model="queryParams.number" :placeholder="$t('请输入客户编号')" clearable @keyup.enter.native="handleQuery"/>
<el-input
v-model="queryParams.number"
:placeholder="$t('请输入客户编号')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('客户名称')" prop="name">
<el-input v-model="queryParams.name" :placeholder="$t('请输入客户名称')" clearable @keyup.enter.native="handleQuery"/>
<el-input
v-model="queryParams.name"
:placeholder="$t('请输入客户名称')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('客户等级')" prop="level">
<el-select clearable v-model="queryParams.level" :placeholder="$t('请选择客户等级')" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value"/>
<el-select
clearable
v-model="queryParams.level"
:placeholder="$t('请选择客户等级')"
clearable
size="small"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('联系方式')">
<el-input :placeholder="$t('请输入联系方式')" v-model="queryParams.defaultContactPhone"></el-input>
<el-input
:placeholder="$t('请输入联系方式')"
v-model="queryParams.defaultContactPhone"
></el-input>
</el-form-item>
<el-form-item :label="$t('客户类别')" prop="level">
<dict-selector clearable :type="DICT_TYPE.CUSTOMER_TYPE" v-model="queryParams.type" ></dict-selector>
<dict-selector
clearable
:type="DICT_TYPE.CUSTOMER_TYPE"
v-model="queryParams.type"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" clearable size="small">
<el-option v-for="dict in customerServiceList"
:key="dict.id" :label="dict.nickname" :value="dict.id"/>
<el-select
clearable
v-model="queryParams.customerService"
:placeholder="$t('请选择客户经理')"
clearable
size="small"
>
<el-option
v-for="dict in customerServiceList"
:key="dict.id"
:label="dict.nickname"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('客户来源')" prop="source">
<el-select clearable v-model="queryParams.source" :placeholder="$t('请选择客户来源')" size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value"/>
<el-select
clearable
v-model="queryParams.source"
:placeholder="$t('请选择客户来源')"
size="small"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('国家')" prop="source">
<el-select clearable v-model="queryParams.country" :placeholder="$t('请选择国家')">
<el-option v-for="dict in countryList"
:key="dict.id" :label=" isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
<el-select
clearable
v-model="queryParams.country"
:placeholder="$t('请选择国家')"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('客户状态')" prop="status">
<el-select clearable v-model="queryParams.status" :placeholder="$t('请选择客户状态')" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value"/>
<el-select
clearable
v-model="queryParams.status"
:placeholder="$t('请选择客户状态')"
clearable
size="small"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')">
<el-date-picker
type="datetimerange"
clearable v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
clearable
v-model="dateRangeCreateTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('信用等级')" prop="department">
<el-select clearable v-model="queryParams.creditLevel" >
<el-option v-for="(item,index) in creditList" :label="isChinese ? item.nameZh : item.nameEn" :key="index" :value="item.id" ></el-option>
<el-select clearable v-model="queryParams.creditLevel">
<el-option
v-for="(item, index) in creditList"
:label="isChinese ? item.nameZh : item.nameEn"
:key="index"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('市场获客')" prop="department">
<dict-selector clearable :type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE" v-model="queryParams.resourceType" formatter="number"></dict-selector>
<dict-selector
clearable
:type="DICT_TYPE.ECW_CUSTOMER_RESOURCE_TYPE"
v-model="queryParams.resourceType"
formatter="number"
></dict-selector>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
$t("搜索")
}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置")
}}</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<div v-if="path === '/customer/customer'" style="color: red;margin-bottom: 5px;">
<div
v-if="path === '/customer/customer'"
style="color: red; margin-bottom: 5px"
>
注意:创建的客户需接收
</div>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button v-if="path === '/customer/potential'" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddPotential">{{$t('新增潜在客户')}}</el-button>
<el-button v-else type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="[ selectAuthorityFn('ecw:customer:create')]">{{$t('新增')}}
<el-button
v-if="path === '/customer/potential'"
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAddPotential"
>{{ $t("新增潜在客户") }}</el-button
>
<el-button
v-else
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="[selectAuthorityFn('ecw:customer:create')]"
>{{ $t("新增") }}
</el-button>
</el-col>
<el-col :span="1.5" >
<el-button :disabled="selectCustomerList.length === 0" type="primary" size="mini" @click="transferShow = true;"
v-hasPermi="[selectAuthorityFn('ecw:customer:batch-transfer')]">{{$t('批量移交')}}</el-button>
<el-col :span="1.5">
<el-button
:disabled="selectCustomerList.length === 0"
type="primary"
size="mini"
@click="transferShow = true"
v-hasPermi="[selectAuthorityFn('ecw:customer:batch-transfer')]"
>{{ $t("批量移交") }}</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="[selectAuthorityFn('ecw:customer:export')]">{{$t('导出')}}</el-button>
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="[selectAuthorityFn('ecw:customer:export')]"
>{{ $t("导出") }}</el-button
>
</el-col>
<el-col :span="1.5">
<!-- <el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(true)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"-->
<!-- v-hasPermi="['ecw:customer:transport']" >{{$t('设为空运客户')}}</el-button>-->
<!-- <el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(true)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"-->
<!-- v-hasPermi="['ecw:customer:transport']" >{{$t('设为空运客户')}}</el-button>-->
</el-col>
<el-col :span="1.5">
<!-- <el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(false)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"-->
<!-- v-hasPermi="['ecw:customer:transport']">{{$t('设为非空运客户')}}</el-button>-->
<!-- <el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(false)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"-->
<!-- v-hasPermi="['ecw:customer:transport']">{{$t('设为非空运客户')}}</el-button>-->
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['ecw:customer:fcl']" :disabled="!selectCustomerList.length" @click="setFullContainerLoad(true)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading">{{$t('设置海运整柜客户')}}</el-button>
<el-button
v-hasPermi="['ecw:customer:fcl']"
:disabled="!selectCustomerList.length"
@click="setFullContainerLoad(true)"
v-if="$route.path === '/customer/customer'"
type="primary"
plain
size="mini"
:loading="exportLoading"
>{{ $t("设置海运整柜客户") }}</el-button
>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['ecw:customer:fcl-mistake']" :disabled="!selectCustomerList.length" @click="setFullContainerLoad(false)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"
>{{$t('设置海运非整柜客户')}}</el-button>
<el-button
v-hasPermi="['ecw:customer:fcl-mistake']"
:disabled="!selectCustomerList.length"
@click="setFullContainerLoad(false)"
v-if="$route.path === '/customer/customer'"
type="primary"
plain
size="mini"
:loading="exportLoading"
>{{ $t("设置海运非整柜客户") }}</el-button
>
</el-col>
<el-col :span="1.5">
<el-button v-has-permi="[selectAuthorityFn('ecw:customer:create-potential')]" v-if="path === '/customer/customer'" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddPotential">{{$t('新增潜在客户')}}</el-button>
<el-button
v-has-permi="[selectAuthorityFn('ecw:customer:create-potential')]"
v-if="path === '/customer/customer'"
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAddPotential"
>{{ $t("新增潜在客户") }}</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table ref="multipleTable" v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column :label="$t('客户编号')" align="center" prop="number" >
<template v-slot="{row}">
{{row.number}}
<el-table
ref="multipleTable"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column :label="$t('客户编号')" align="center" prop="number">
<template v-slot="{ row }">
{{ row.number }}
</template>
</el-table-column>
<el-table-column :label="$t('客户名称')" align="center" prop="name">
<template slot-scope="{row}">
<p style="display:inline-block;white-space:pre-wrap;">{{$l(row, 'name')}}</p>
<el-tag v-if="row.isInOpenSea" size="mini">{{ $t('') }}</el-tag>
<template slot-scope="{ row }">
<p style="display: inline-block; white-space: pre-wrap">
{{ $l(row, "name") }}
</p>
<el-tag v-if="row.isInOpenSea" size="mini">{{ $t("") }}</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('客户等级')" align="center" prop="vipLevelNameZh">
<el-table-column
:label="$t('客户等级')"
align="center"
prop="vipLevelNameZh"
>
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" />
</template>
</el-table-column>
<el-table-column :label="$t('信用等级')" :prop="isChinese ? 'creditLevelNameZh' : 'creditLevelNameEn'"></el-table-column>
<el-table-column
:label="$t('信用等级')"
:prop="isChinese ? 'creditLevelNameZh' : 'creditLevelNameEn'"
></el-table-column>
<el-table-column :label="$t('客户状态')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
<dict-tag
:type="DICT_TYPE.CUSTOMER_STATUS"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column :label="$t('主联系人')" prop="defaultContactName"></el-table-column>
<el-table-column
:label="$t('主联系人')"
prop="defaultContactName"
></el-table-column>
<el-table-column :label="$t('主联系方式')" prop="defaultContactPhone">
<template v-slot="{row}">
+{{row.defaultContactPhone}} <br/>
<contacts :id="row.id" >
<template v-slot="{ row }">
+{{ row.defaultContactPhone }} <br />
<contacts :id="row.id">
<el-button type="text">更多</el-button>
</contacts>
</template>
</el-table-column>
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
<el-table-column
:label="$t('创建时间')"
align="center"
prop="createTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('入公海时间')" align="center" prop="createTime" width="180">
<template v-slot = {row}>
<span>{{ parseTime(row.enterOpenSeaTime ? row.enterOpenSeaTime : row.estimateEnterOpenSeaTime ) }}</span>
<el-table-column
:label="$t('入公海时间')"
align="center"
prop="createTime"
width="180"
>
<template v-slot="{ row }">
<span>{{
parseTime(
row.enterOpenSeaTime
? row.enterOpenSeaTime
: row.estimateEnterOpenSeaTime
)
}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerServiceName">
<el-table-column
:label="$t('客户经理')"
align="center"
prop="customerServiceName"
></el-table-column>
<!--
<el-table-column
:label="$t('客户经理ID')"
align="center" v-show="false"
prop="customerService"
>-->
</el-table-column>
<el-table-column :label="$t('出货渠道')">
<template slot-scope="{row}">
{{channel(row.transportType)}}
<template slot-scope="{ row }">
{{ channel(row.transportType) }}
</template>
</el-table-column>
<el-table-column :label="$t('国家')" align="center" prop="country" :formatter="countryFormatter"></el-table-column>
<el-table-column width="200px" :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<el-table-column
:label="$t('国家')"
align="center"
prop="country"
:formatter="countryFormatter"
></el-table-column>
<el-table-column
width="200px"
:label="$t('操作')"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<!-- <el-button size="mini" type="text" v-show="'development' === env && scope.row.isInOpenSea" @click="seasPond(scope.row)"-->
<!-- v-hasPermi="['ecw:customer:query']">{{$t('掉入公海池')}}</el-button>-->
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
v-hasPermi="[selectAuthorityFn('ecw:customer:index-query')]">{{$t('查看')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="[selectAuthorityFn('ecw:customer:update')]">{{$t('修改')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="[selectAuthorityFn('ecw:customer:delete')]">{{$t('删除')}}</el-button>
<el-button size="mini" v-has-permi="[selectAuthorityFn('ecw:customer:follow-up')]" type="text" icon="el-icon-collection" @click="followUp(scope.row)">{{$t('跟进')}}</el-button>
<el-button size="mini" v-has-permi="[selectAuthorityFn('ecw:customer:customer-complaint')]" type="text" icon="el-icon-user" @click="complaint(scope.row)">{{$t('客诉')}}</el-button>
<el-button :disabled="scope.row.isInOpenSea" v-has-permi="[selectAuthorityFn('ecw:customer:postpone')]" size="mini" type="text" icon="el-icon-user" @click="delay(scope.row)">{{$t('延期')}}</el-button>
<el-button v-has-permi="['ecw:customer:treat-recovery']" v-if="scope.row.customerService !== null && scope.row.customerServiceAssignedTime !== null && !scope.row.isCustomerServiceConfirmed && !scope.row.isInOpenSea && path === '/customer/customer'" size="mini" type="text" @click="recovery(scope.row)" > {{$t('回收客户')}} </el-button>
<el-button v-has-permi="['ecw:customer:performanceType']" v-if="path === '/customer/customer'" size="mini" type="text" @click="dialogVisible = true; customData = scope.row;currentisNew = scope.row.isNew" > {{$t('业绩类型')}} </el-button>
<el-button v-has-permi="[selectAuthorityFn('ecw:customer:treat-quoted-price')]" size="mini" type="text" icon="el-icon-user" @click="quote(scope.row)">{{$t('报价')}}</el-button>
<!-- <el-button size="mini" type="text" v-show="'development' === env && scope.row.isInOpenSea" @click="seasPond(scope.row)"-->
<!-- v-hasPermi="['ecw:customer:query']">{{$t('掉入公海池')}}</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
v-hasPermi="[selectAuthorityFn('ecw:customer:index-query')]"
>{{ $t("查看") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="[selectAuthorityFn('ecw:customer:update')]"
>{{ $t("修改") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="[selectAuthorityFn('ecw:customer:delete')]"
>{{ $t("删除") }}</el-button
>
<el-button
size="mini"
v-has-permi="[selectAuthorityFn('ecw:customer:follow-up')]"
type="text"
icon="el-icon-collection"
@click="followUp(scope.row)"
>{{ $t("跟进") }}</el-button
>
<el-button
size="mini"
v-has-permi="[selectAuthorityFn('ecw:customer:customer-complaint')]"
type="text"
icon="el-icon-user"
@click="complaint(scope.row)"
>{{ $t("客诉") }}</el-button
>
<el-button
:disabled="scope.row.isInOpenSea"
v-has-permi="[selectAuthorityFn('ecw:customer:postpone')]"
size="mini"
type="text"
icon="el-icon-user"
@click="delay(scope.row)"
>{{ $t("延期") }}</el-button
>
<el-button
v-has-permi="['ecw:customer:treat-recovery']"
v-if="
scope.row.customerService !== null &&
scope.row.customerServiceAssignedTime !== null &&
!scope.row.isCustomerServiceConfirmed &&
!scope.row.isInOpenSea &&
path === '/customer/customer'
"
size="mini"
type="text"
@click="recovery(scope.row)"
>
{{ $t("回收客户") }}
</el-button>
<el-button
v-has-permi="['ecw:customer:performanceType']"
v-if="path === '/customer/customer'"
size="mini"
type="text"
@click="
dialogVisible = true;
customData = scope.row;
currentisNew = scope.row.isNew;
"
>
{{ $t("业绩类型") }}
</el-button>
<!--lanbm 2024-05-23 添加报价按钮逻辑控制-->
<el-button
v-has-permi="[selectAuthorityFn('ecw:customer:treat-quoted-price')]"
size="mini"
type="text"
icon="el-icon-user"
@click="quote(scope.row)"
>{{ $t("报价") }}</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="90%" append-to-body :close-on-click-modal="false">
<el-dialog
:title="title"
:visible.sync="open"
width="90%"
append-to-body
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('客户名称')" prop="name">
<el-input v-model="form.name" :placeholder="$t('请输入客户名称')" />
<el-input
v-model="form.name"
:placeholder="$t('请输入客户名称')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('国家')" prop="country">
<el-select v-model="form.country" :placeholder="$t('请选择国家')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.COUNTRY)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
<el-option
v-for="dict in getDictDatas(DICT_TYPE.COUNTRY)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户等级')" prop="level">
<el-select v-model="form.level" :placeholder="$t('请选择客户等级')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
<el-select
v-model="form.level"
:placeholder="$t('请选择客户等级')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('联系地址')" prop="address">
<el-input v-model="form.address" :placeholder="$t('请输入联系地址')" />
<el-input
v-model="form.address"
:placeholder="$t('请输入联系地址')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户类别')" prop="type">
<el-select v-model="form.type" :placeholder="$t('请选择客户类别')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_TYPE)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />
<el-select
v-model="form.type"
:placeholder="$t('请选择客户类别')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_TYPE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item :label="$t('所属代理')" prop="agentId">-->
<!-- <el-select v-model="form.agentId" :placeholder="$t('请选择所属代理')">-->
<!-- <el-option v-for="dict in getDictDatas(DICT_TYPE.COMMON_STATUS)"-->
<!-- :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item :label="$t('所属代理')" prop="agentId">-->
<!-- <el-select v-model="form.agentId" :placeholder="$t('请选择所属代理')">-->
<!-- <el-option v-for="dict in getDictDatas(DICT_TYPE.COMMON_STATUS)"-->
<!-- :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<el-form-item :label="$t('常用提货网点')" prop="pickupPoint">
<el-select v-model="form.pickupPoint" :placeholder="$t('请输入常用提货网点')">
<el-option v-for="node in nodeList"
:key="node.value" :label="node.label" :value="node.value" />
<el-select
v-model="form.pickupPoint"
:placeholder="$t('请输入常用提货网点')"
>
<el-option
v-for="node in nodeList"
:key="node.value"
:label="node.label"
:value="node.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('公司名称')" prop="company">
<el-input v-model="form.company" :placeholder="$t('请输入公司名称')" />
<el-input
v-model="form.company"
:placeholder="$t('请输入公司名称')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户生日')" prop="birthday">
<el-date-picker
v-model="form.birthday"
type="date"
value-format="timestamp"
:placeholder="$t('请输入客户生日')">
:placeholder="$t('请输入客户生日')"
>
</el-date-picker>
</el-form-item>
</el-col>
......@@ -260,13 +583,19 @@
<el-form-item :label="$t('主营类别')" prop="productType">
<el-row :gutter="10">
<el-col :span="11">
<el-select v-model="form.productType" :placeholder="$t('请选择产品类别')">
<!-- <el-option :label="$t('请选择字典生成')" value="" />-->
<el-select
v-model="form.productType"
:placeholder="$t('请选择产品类别')"
>
<!-- <el-option :label="$t('请选择字典生成')" value="" />-->
</el-select>
</el-col>
<el-col :span="11">
<el-select v-model="form.productType" :placeholder="$t('请选择主营类别')">
<!-- <el-option :label="$t('请选择字典生成')" value="" />-->
<el-select
v-model="form.productType"
:placeholder="$t('请选择主营类别')"
>
<!-- <el-option :label="$t('请选择字典生成')" value="" />-->
</el-select>
</el-col>
</el-row>
......@@ -274,25 +603,46 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户来源')" prop="source">
<el-select v-model="form.source" :placeholder="$t('请选择客户来源')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
<el-select
v-model="form.source"
:placeholder="$t('请选择客户来源')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('结算方式')" prop="balance">
<el-select v-model="form.balance" :placeholder="$t('请选择结算方式')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
<el-select
v-model="form.balance"
:placeholder="$t('请选择结算方式')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')">
<el-option v-for="dict in customerServiceList"
:key="dict.id" :label="dict.nickname" :value="dict.id" />
<el-select
v-model="form.customerService"
:placeholder="$t('请选择客户经理')"
>
<el-option
v-for="dict in customerServiceList"
:key="dict.id"
:label="dict.nickname"
:value="dict.id"
/>
</el-select>
</el-form-item>
</el-col>
......@@ -300,25 +650,36 @@
<el-form-item :label="$t('图片')" prop="picture">
<upload v-model="form.picture" :limit="1"></upload>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('客户状态')" prop="status">
<el-select v-model="form.status" :placeholder="$t('请选择客户状态')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
<el-select
v-model="form.status"
:placeholder="$t('请选择客户状态')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('推介人')" prop="promoter">
<el-input v-model="form.promoter" :placeholder="$t('请输入推介人')" />
<el-input
v-model="form.promoter"
:placeholder="$t('请输入推介人')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('创建人')" prop="founder">
<el-input v-model="form.founder" :placeholder="$t('请输入创建人')" />
<el-input
v-model="form.founder"
:placeholder="$t('请输入创建人')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -327,23 +688,34 @@
v-model="form.createTime"
type="datetime"
value-format="timestamp"
:placeholder="$t('选择创建时间')">
:placeholder="$t('选择创建时间')"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('备注')" prop="remarks">
<el-input v-model="form.remarks" :placeholder="$t('请输入备注')" />
<el-input
v-model="form.remarks"
:placeholder="$t('请输入备注')"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('到仓确认')" prop="arrivalConfirm">
<el-switch v-model="form.arrivalConfirm" :active-value="0" :inactive-value="1" />
<el-switch
v-model="form.arrivalConfirm"
:active-value="0"
:inactive-value="1"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('重货标准(CBM)')" prop="weightUnit">
<el-input v-model="form.weightUnit" :placeholder="$t('请输入重货标准(CBM)')" />
<el-input
v-model="form.weightUnit"
:placeholder="$t('请输入重货标准(CBM)')"
/>
</el-form-item>
</el-col>
<el-col :span="24">
......@@ -353,14 +725,11 @@
v-show="showLine"
border
:data="form.customerLines"
style="width: 500px">
<el-table-column
prop="departureId"
:label="$t('始发地')">
style="width: 500px"
>
<el-table-column prop="departureId" :label="$t('始发地')">
</el-table-column>
<el-table-column
prop="objectiveId"
:label="$t('目的地')">
<el-table-column prop="objectiveId" :label="$t('目的地')">
</el-table-column>
</el-table>
</el-form-item>
......@@ -369,113 +738,132 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{ $t('联系人') }}</span>
<el-button style="float: right;" size="small" type="primary" @click="form.customerContacts.push({department: undefined})">+</el-button>
</div>
<el-table
:data="form.customerContacts"
style="width: 100%"
>
<el-table-column
prop="department"
:label="$t('部门')"
width=""
<span>{{ $t("联系人") }}</span>
<el-button
style="float: right"
size="small"
type="primary"
@click="form.customerContacts.push({ department: undefined })"
>+</el-button
>
</div>
<el-table :data="form.customerContacts" style="width: 100%">
<el-table-column prop="department" :label="$t('部门')" width="">
<template v-slot="{ row, column, $index }">
<el-input v-model="row.department" :placeholder="$t('请输入部门')" size="mini"/>
<el-input
v-model="row.department"
:placeholder="$t('请输入部门')"
size="mini"
/>
</template>
</el-table-column>
<el-table-column
prop="position"
:label="$t('职位')"
width=""
>
<template v-slot="{row}">
<el-input v-model="row.position" :placeholder="$t('请输入职位')" size="mini"/>
<el-table-column prop="position" :label="$t('职位')" width="">
<template v-slot="{ row }">
<el-input
v-model="row.position"
:placeholder="$t('请输入职位')"
size="mini"
/>
</template>
</el-table-column>
<el-table-column
prop="name"
:label="$t('联系人')"
>
<template v-slot:header>{{ $t('联系人') }}<span style="color: #ff0000">*</span>
<el-table-column prop="name" :label="$t('联系人')">
<template v-slot:header
>{{ $t("联系人") }}<span style="color: #ff0000">*</span>
</template>
<template v-slot="{row}">
<el-input v-model="row.name" :placeholder="$t('请输入联系人')" size="mini"/>
<template v-slot="{ row }">
<el-input
v-model="row.name"
:placeholder="$t('请输入联系人')"
size="mini"
/>
</template>
</el-table-column>
<el-table-column
prop="areaCode"
:label="$t('区号')"
>
<template v-slot:header>{{ $t('区号') }}<span style="color: #ff0000">*</span>
<el-table-column prop="areaCode" :label="$t('区号')">
<template v-slot:header
>{{ $t("区号") }}<span style="color: #ff0000">*</span>
</template>
<template v-slot="{row}">
<el-select v-model="row.areaCode" :placeholder="$t('请选择区号')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.AREA_CODE)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
<template v-slot="{ row }">
<el-select
v-model="row.areaCode"
:placeholder="$t('请选择区号')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.AREA_CODE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="phoneNew"
:label="$t('联系方式')"
>
<template v-slot:header>{{ $t('联系方式') }}<span style="color: #ff0000">*</span>
<el-table-column prop="phoneNew" :label="$t('联系方式')">
<template v-slot:header
>{{ $t("联系方式") }}<span style="color: #ff0000">*</span>
</template>
<template v-slot="{row}">
<el-input v-model="row.phoneNew" :placeholder="$t('请输入联系方式')" size="mini"/>
<template v-slot="{ row }">
<el-input
v-model="row.phoneNew"
:placeholder="$t('请输入联系方式')"
size="mini"
/>
</template>
</el-table-column>
<el-table-column
prop=""
:label="$t('关联账号')"
<el-table-column prop="" :label="$t('关联账号')"> </el-table-column>
<el-table-column prop="social" :label="$t('社交软件')">
<template v-slot="{ row }">
<el-select
v-model="row.social"
:placeholder="$t('请选择社交软件')"
>
</el-table-column>
<el-table-column
prop="social"
:label="$t('社交软件')"
>
<template v-slot="{row}">
<el-select v-model="row.social" :placeholder="$t('请选择社交软件')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.SOCIAL)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)" />
<el-option
v-for="dict in getDictDatas(DICT_TYPE.SOCIAL)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="socialNumber"
:label="$t('社交软件号码')"
>
<template v-slot="{row}">
<el-input v-model="row.socialNumber" :placeholder="$t('请输入社交软件号码')" size="mini"/>
<el-table-column prop="socialNumber" :label="$t('社交软件号码')">
<template v-slot="{ row }">
<el-input
v-model="row.socialNumber"
:placeholder="$t('请输入社交软件号码')"
size="mini"
/>
</template>
</el-table-column>
<el-table-column
prop="email"
:label="$t('邮箱')"
>
<template v-slot="{row}">
<el-input v-model="row.email" :placeholder="$t('请输入邮箱')" size="mini"/>
<el-table-column prop="email" :label="$t('邮箱')">
<template v-slot="{ row }">
<el-input
v-model="row.email"
:placeholder="$t('请输入邮箱')"
size="mini"
/>
</template>
</el-table-column>
<el-table-column
prop="isDefault"
:label="$t('设为默认')"
<el-table-column prop="isDefault" :label="$t('设为默认')">
<template v-slot="{ row }">
<el-select
v-model="row.isDefault"
:placeholder="$t('设为默认')"
>
<template v-slot="{row}">
<el-select v-model="row.isDefault" :placeholder="$t('设为默认')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.isDefault)" />
<el-option
v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.isDefault)"
/>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="name"
:label="$t('操作')"
>
<el-table-column prop="name" :label="$t('操作')">
<template v-slot="{ row, column, $index }">
<el-button type="danger" @click="form.customerContacts.splice($index, 1)">{{ $t('删除') }}</el-button>
<el-button
type="danger"
@click="form.customerContacts.splice($index, 1)"
>{{ $t("删除") }}</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -484,12 +872,18 @@
<el-row :gutter="10" style="margin-top: 15px">
<el-col :span="12">
<el-form-item :label="$t('发票抬头')" prop="invoiceTitle">
<el-input v-model="form.invoiceTitle" :placeholder="$t('请输入发票抬头')" />
<el-input
v-model="form.invoiceTitle"
:placeholder="$t('请输入发票抬头')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('纳税人识别号')" prop="licenseNumber">
<el-input v-model="form.licenseNumber" :placeholder="$t('请输入纳税人识别号')" />
<el-input
v-model="form.licenseNumber"
:placeholder="$t('请输入纳税人识别号')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -499,60 +893,92 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('账户')" prop="bankNumber">
<el-input v-model="form.bankNumber" :placeholder="$t('请输入账户')" />
<el-input
v-model="form.bankNumber"
:placeholder="$t('请输入账户')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('项目')" prop="project">
<el-input v-model="form.project" :placeholder="$t('请输入项目')" />
<el-input
v-model="form.project"
:placeholder="$t('请输入项目')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('开票地址')" prop="billingAddress">
<el-input v-model="form.billingAddress" :placeholder="$t('请输入开票地址')" />
<el-input
v-model="form.billingAddress"
:placeholder="$t('请输入开票地址')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('开票电话')" prop="billingTell">
<el-input v-model="form.billingTell" :placeholder="$t('请输入开票电话')" />
<el-input
v-model="form.billingTell"
:placeholder="$t('请输入开票电话')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('税率')" prop="taxRate">
<el-input v-model="form.taxRate" :placeholder="$t('请输入税率')" />
<el-input
v-model="form.taxRate"
:placeholder="$t('请输入税率')"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{$t('确 定')}}</el-button>
<el-button @click="cancel">{{$t('取 消')}}</el-button>
<el-button type="primary" @click="submitForm">{{
$t("确 定")
}}</el-button>
<el-button @click="cancel">{{ $t("取 消") }}</el-button>
</div>
</el-dialog>
<customer-follow-list :customer-id="customerId" :id="customerId" ref="CustomerFollowList"></customer-follow-list>
<customer-complaints :customer-id="customerId" ref="customerComplaints"></customer-complaints>
<transfer-customer :show.sync="transferShow" :customer-ids.sync="selectCustomerList"></transfer-customer>
<add-potential-custom ref="potentialCustom" @change="getList" ></add-potential-custom>
<customer-follow-list
:customer-id="customerId"
:id="customerId"
ref="CustomerFollowList"
></customer-follow-list>
<customer-complaints
:customer-id="customerId"
ref="customerComplaints"
></customer-complaints>
<transfer-customer
:show.sync="transferShow"
:customer-ids.sync="selectCustomerList"
></transfer-customer>
<add-potential-custom
ref="potentialCustom"
@change="getList"
></add-potential-custom>
<!--业绩类型 -->
<el-dialog
title="业绩类型"
:visible.sync="dialogVisible"
width="30%">
<el-dialog title="业绩类型" :visible.sync="dialogVisible" width="30%">
<div>
<el-form>
<el-form-item label="客户编号">{{customData.number}}</el-form-item>
<el-form-item label="客户名称">{{customData.name}}</el-form-item>
<el-form-item label="客户编号">{{ customData.number }}</el-form-item>
<el-form-item label="客户名称">{{ customData.name }}</el-form-item>
<el-form-item label="业绩类型">
<el-radio-group v-model="currentisNew">
<el-radio :label="true" >{{$t('新客户')}}</el-radio>
<el-radio :label="false" >{{$t('老客户')}}</el-radio>
<el-radio :label="true">{{ $t("新客户") }}</el-radio>
<el-radio :label="false">{{ $t("老客户") }}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button :disabled="customData.isNew === currentisNew" type="primary" @click="modifyCustomer">修改</el-button>
<el-button
:disabled="customData.isNew === currentisNew"
type="primary"
@click="modifyCustomer"
>修改</el-button
>
</span>
</el-dialog>
</div>
......@@ -570,24 +996,28 @@ import {
getCustomerDeptPage,
changeCustomerAir,
getPotential,
setChangeCustomerFcl, potentialExportExcel, deptExportExcel, recycleUnconfirmedCustomer, updatecustomerToOld
setChangeCustomerFcl,
potentialExportExcel,
deptExportExcel,
recycleUnconfirmedCustomer,
updatecustomerToOld,
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants'
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { CommonStatusEnum } from "@/utils/constants";
import { uploadFile } from "@/api/infra/file";
import upload from '@/components/ImageUpload'
import {getNodeList} from "@/api/ecw/node"
import CustomerFollowList from "@/components/CustomerFollowList"
import customerComplaints from "@/components/customerComplaints"
import {listServiceUser} from "@/api/system/user";
import { getCountryListAll } from '@/api/ecw/country'
import {getCreditPage} from "@/api/customer/credit";
import {customerExportExcel} from "@/api/ecw/customer";
import upload from "@/components/ImageUpload";
import { getNodeList } from "@/api/ecw/node";
import CustomerFollowList from "@/components/CustomerFollowList";
import customerComplaints from "@/components/customerComplaints";
import { listServiceUser } from "@/api/system/user";
import { getCountryListAll } from "@/api/ecw/country";
import { getCreditPage } from "@/api/customer/credit";
import { customerExportExcel } from "@/api/ecw/customer";
import transferCustomer from "@/views/ecw/customer/transferCustomer";
import Template from "@/views/cms/template/index.vue";
import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
import { getUserProfile } from "@/api/system/user";
export default {
name: "EcwCustomerIndex",
......@@ -598,11 +1028,11 @@ export default {
upload,
CustomerFollowList,
customerComplaints,
transferCustomer
transferCustomer,
},
data() {
return {
env:process.env.NODE_ENV,
env: process.env.NODE_ENV,
getDictDatas,
DICT_TYPE,
// 遮罩层
......@@ -631,202 +1061,267 @@ export default {
customerService: null,
status: null,
department: null,
creditLevel:null,
country:null,
resourceType:null,
creditLevel: null,
country: null,
resourceType: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
name: [{ required: true, message: this.$t('客户名称不能为空'), trigger: "blur" }],
country: [{ required: true, message: this.$t('国家不能为空'), trigger: "blur" }],
level: [{ required: true, message: this.$t('客户等级不能为空'), trigger: "blur" }],
type: [{ required: true, message: this.$t('客户类别不能为空'), trigger: "blur" }],
name: [
{
required: true,
message: this.$t("客户名称不能为空"),
trigger: "blur",
},
],
country: [
{ required: true, message: this.$t("国家不能为空"), trigger: "blur" },
],
level: [
{
required: true,
message: this.$t("客户等级不能为空"),
trigger: "blur",
},
],
type: [
{
required: true,
message: this.$t("客户类别不能为空"),
trigger: "blur",
},
],
// createTime: [{ required: true, message: this.$t("创建时间不能为空"), trigger: "blur" }],
source: [{ required: true, message: this.$t('客户来源不能为空'), trigger: "blur" }],
customerService: [{ required: true, message: this.$t('客户经理不能为空'), trigger: "blur" }],
status: [{ required: true, message: this.$t('客户状态不能为空'), trigger: "blur" }],
founder: [{ required: true, message: this.$t('创建人不能为空'), trigger: "blur" }],
source: [
{
required: true,
message: this.$t("客户来源不能为空"),
trigger: "blur",
},
],
customerService: [
{
required: true,
message: this.$t("客户经理不能为空"),
trigger: "blur",
},
],
status: [
{
required: true,
message: this.$t("客户状态不能为空"),
trigger: "blur",
},
],
founder: [
{
required: true,
message: this.$t("创建人不能为空"),
trigger: "blur",
},
],
},
// 网点
nodeList: [],
showLine: false,
customerId:undefined,
customerServiceList:[],
customerId: undefined,
customerServiceList: [],
countryList: [],
creditList:[],
selectCustomerList:[],
transferShow:false,
dialogVisible:false,
customData:{
},
currentisNew:false
creditList: [],
selectCustomerList: [],
transferShow: false,
dialogVisible: false,
customData: {},
currentisNew: false,
userId: undefined, //lanbm 2024-05-23 add
};
},
computed:{
path(){
return this.$route.path
computed: {
path() {
return this.$route.path;
},
channel(){
return (val)=>{
return !!val ? this.getDictDatas(this.DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE).filter(i => (val.split(',') || []).includes(i.value)).map(i => this.isChinese ? i.label : i.labelEn ).join('') :''
}
channel() {
return (val) => {
return !!val
? this.getDictDatas(this.DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE)
.filter((i) => (val.split(",") || []).includes(i.value))
.map((i) => (this.isChinese ? i.label : i.labelEn))
.join("")
: "";
};
},
isChinese(){
return this.$i18n.locale === 'zh_CN'
isChinese() {
return this.$i18n.locale === "zh_CN";
},
authorityFn(){
let i = ''
switch (this.$route.path){
case '/customer/department-customers':
i = 'dep-'
authorityFn() {
let i = "";
switch (this.$route.path) {
case "/customer/department-customers":
i = "dep-";
break;
case '/customer/potential':
i = 'pot-'
case "/customer/potential":
i = "pot-";
break;
}
return i
},
selectAuthorityFn(){
return (val)=>{
let t = val.split(":")
t[t.length - 1] = this.authorityFn + t[t.length - 1]
console.log( t.join(":"))
return t.join(":")
}
}
return i;
},
selectAuthorityFn() {
return (val) => {
let t = val.split(":");
t[t.length - 1] = this.authorityFn + t[t.length - 1];
console.log(t.join(":"));
return t.join(":");
};
},
},
watch:{
selectCustomerList(val){
if(val.length === 0){
this.getList()
watch: {
selectCustomerList(val) {
if (val.length === 0) {
this.getList();
this.$refs.multipleTable.clearSelection();
}
},
},
created() {
getCreditPage({page:1,rows:999}).then(r => {
this.creditList = r.data.list
})
getCreditPage({ page: 1, rows: 999 }).then((r) => {
this.creditList = r.data.list;
});
this.getList();
listServiceUser().then(r=>{
listServiceUser().then((r) => {
this.customerServiceList = r.data;
})
getCountryListAll().then(r => {
this.countryList = r.data
})
});
getCountryListAll().then((r) => {
this.countryList = r.data;
});
//获取用户id信息 lanbm 2024-05-23 add
getUserProfile().then((res) => {
this.userId = res.data.id;
});
},
activated(){
activated() {
this.getList();
},
methods: {
recovery(row){
this.$confirm(this.$t('是否要回收当前{name}',row), '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
recycleUnconfirmedCustomer({customerId:row.id}).then(r =>{
this.$message.success(this.$t('回收成功。'))
this.getList()
recovery(row) {
this.$confirm(this.$t("是否要回收当前{name}", row), "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
}).catch(() => {
this.$message.info(this.$t('已取消'))
.then(() => {
recycleUnconfirmedCustomer({ customerId: row.id }).then((r) => {
this.$message.success(this.$t("回收成功。"));
this.getList();
});
})
.catch(() => {
this.$message.info(this.$t("已取消"));
});
},
// 设置整柜
setFullContainerLoad(isFcl){
setFullContainerLoad(isFcl) {
setChangeCustomerFcl({
"customerIdList": this.selectCustomerList,
isFcl
}).then(r =>{
if(r.code === 0){
this.$message.success(isFcl ? '设置客户为海运整柜成功!' : '设置客户为非海运整柜成功!')
this.selectCustomerList = []
this.getList()
customerIdList: this.selectCustomerList,
isFcl,
}).then((r) => {
if (r.code === 0) {
this.$message.success(
isFcl ? "设置客户为海运整柜成功!" : "设置客户为非海运整柜成功!"
);
this.selectCustomerList = [];
this.getList();
}
})
});
},
// 设置空运客户
setChangeCustomerAir(isAir){
setChangeCustomerAir(isAir) {
changeCustomerAir({
customerIdList:this.selectCustomerList,
isAir
}).then(r =>{
console.log(r)
if(r.code === 0){
this.$message.success(isAir ? '设为空运客户成功!' : '设为非空运客户成功!')
this.selectCustomerList = []
this.getList()
customerIdList: this.selectCustomerList,
isAir,
}).then((r) => {
console.log(r);
if (r.code === 0) {
this.$message.success(
isAir ? "设为空运客户成功!" : "设为非空运客户成功!"
);
this.selectCustomerList = [];
this.getList();
}
})
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
complaint(row){
complaint(row) {
this.customerId = row.id;
this.$nextTick(()=>{
this.$nextTick(() => {
this.$refs.customerComplaints.handleAdd();
})
});
},
countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue)
return this.isChinese ? country?.nameZh : country?.nameEn
const country = this.countryList.find((e) => e.id === cellValue);
return this.isChinese ? country?.nameZh : country?.nameEn;
},
delay(row){
this.$router.push({path:'/customer/delay',query:{id:row.id}})
delay(row) {
this.$router.push({ path: "/customer/delay", query: { id: row.id } });
},
followUp(row){
followUp(row) {
this.customerId = row.id;
this.$nextTick(()=>{
this.$nextTick(() => {
this.$refs.CustomerFollowList.customerFollow.dialogVisible = true;
})
});
},
//报价
quote(row){
quote(row) {
//lanbm 2024-05-23 添加报价是判断客户所属客户经理,不是就不能报价
if (row.customerService != this.userId) {
this.$message.error(this.$t("此客户属于其他客户经理名下的客户。"));
return;
}
//this.$router.push({path:'/offer/create',query:{id:row.id}})
this.$router.push({path:'/offer/create' , query:{customer:row,type:1}}).then({
this.$router
.push({ path: "/offer/create", query: { customer: row, type: 1 } })
.then({
//this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}})
})
});
},
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime', false);
let params = { ...this.queryParams };
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);
// 执行查询
switch (this.$route.path){
case '/customer/customer' :
switch (this.$route.path) {
case "/customer/customer":
getCustomerPage(params).then(this.setData);
break;
case '/customer/department-customers':
case "/customer/department-customers":
getCustomerDeptPage(params).then(this.setData);
break;
case '/customer/potential':
getPotential(params).then(this.setData)
case "/customer/potential":
getPotential(params).then(this.setData);
break;
}
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push('/customer/add-edit/0')
this.$router.push("/customer/add-edit/0");
// this.reset();
// this.open = true;
// this.title = this.$t("添加客户");
},
// 新增潜在客户
handleAddPotential(){
handleAddPotential() {
this.$refs.potentialCustom.dialogTableVisible = true;
},
/** 删除按钮操作 */
......@@ -834,51 +1329,62 @@ export default {
const id = row.id;
const name = row.name;
const number = row.number;
this.$modal.confirm(this.$t('是否确认删除客户编号为"') + number + this.$t('"的数据项?')).then(function() {
this.$modal
.confirm(
this.$t('是否确认删除客户编号为"') + number + this.$t('"的数据项?')
)
.then(function () {
return deleteCustomer(id);
}).then(() => {
})
.then(() => {
this.getList();
this.$modal.msgSuccess(this.$t('删除成功'));
}).catch(() => {});
this.$modal.msgSuccess(this.$t("删除成功"));
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
let func = null;
let title = ''
switch (this.$route.path){
case '/customer/customer' :
func = customerExportExcel
title = '是否确认导出所有客户数据项?'
let title = "";
switch (this.$route.path) {
case "/customer/customer":
func = customerExportExcel;
title = "是否确认导出所有客户数据项?";
break;
case '/customer/department-customers':
func = deptExportExcel
title = '是否确认导出部门客户数据项?'
case "/customer/department-customers":
func = deptExportExcel;
title = "是否确认导出部门客户数据项?";
break;
case '/customer/potential':
func = potentialExportExcel
title = '是否确认导出潜在客户数据项?'
case "/customer/potential":
func = potentialExportExcel;
title = "是否确认导出潜在客户数据项?";
break;
}
// // 执行导出
this.$modal.confirm(this.$t(title)).then(() => {
func().then(r =>{
this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
this.$modal
.confirm(this.$t(title))
.then(() => {
func().then((r) => {
this.$message.success(
this.$t("已加入导出队列,请稍后在下载日志中下载")
);
});
})
}).catch(() => {});
.catch(() => {});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
handleSelectionChange(val){
this.selectCustomerList = val.map(i => i.id);
handleSelectionChange(val) {
this.selectCustomerList = val.map((i) => i.id);
},
/** 修改按钮操作 */
handleUpdate(row) {
console.log(row.id)
this.$router.push('/customer/add-edit/' + row.id)
console.log(row.id);
this.$router.push("/customer/add-edit/" + row.id);
// this.reset();
// const id = row.id;
// getCustomer(id).then(response => {
......@@ -889,7 +1395,7 @@ export default {
},
/** 查看按钮操作 */
handleView(row) {
this.$router.push('/customer/query/' + row.id)
this.$router.push("/customer/query/" + row.id);
},
/** 表单重置 */
reset() {
......@@ -946,66 +1452,72 @@ export default {
customerService: null,
status: null,
department: null,
creditLevel:null,
country:null,
}
creditLevel: null,
country: null,
};
this.handleQuery();
},
/** 调入公海池测试用 */
seasPond(row) {
testEnterToOpenSea(row.id).then(r => {
if(r.code === 0){
this.$t('调入公海池成功!')
testEnterToOpenSea(row.id).then((r) => {
if (r.code === 0) {
this.$t("调入公海池成功!");
this.getList();
}
})
});
},
setData(response){
console.log(response,'response')
setData(response) {
console.log(response, "response");
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (!valid) {
// return;
}
// 修改的提交
if (this.form.id != null) {
updateCustomer(this.form).then(response => {
this.$modal.msgSuccess(this.$t('修改成功'));
updateCustomer(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.open = false;
this.getList();
});
return;
}
// 添加的提交
createCustomer(this.form).then(response => {
this.$modal.msgSuccess(this.$t('新增成功'));
createCustomer(this.form).then((response) => {
this.$modal.msgSuccess(this.$t("新增成功"));
this.open = false;
this.getList();
});
});
},
// 修改客户类型
modifyCustomer(){
this.$confirm(this.$t('修改业绩类型后,将会影响客户新订单业绩计算,请问确定吗?'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
}).then(() => {
updatecustomerToOld({customerId:this.customData.id,isNew:this.currentisNew}).then((r) =>{
this.$message.success(this.$t('修改成功'));
this.dialogVisible = false
this.getList()
})
}).catch(() => {
});
}
modifyCustomer() {
this.$confirm(
this.$t("修改业绩类型后,将会影响客户新订单业绩计算,请问确定吗?"),
this.$t("提示"),
{
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
}
)
.then(() => {
updatecustomerToOld({
customerId: this.customData.id,
isNew: this.currentisNew,
}).then((r) => {
this.$message.success(this.$t("修改成功"));
this.dialogVisible = false;
this.getList();
});
})
.catch(() => {});
},
},
};
</script>
......@@ -90,7 +90,7 @@
v-model="queryParams.dateRangeCreateTime"
style="width: 300px"
value-format="yyyy-MM-dd"
type="datetimerange"
type="daterange"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
......@@ -366,13 +366,15 @@ export default {
page: 1,
rows: 20,
dateRangeCreateTime: undefined,
beginCreateTime: undefined,
endCreateTime: undefined,
},
allSupplier: [],
currencyList: [],
warehouseList: [],
//lanbm 2024-05-17 add
dateTypes: [
{ value: "0", label: this.$t("费用产生时间") },
{ value: "7", label: this.$t("费用产生时间") },
{ value: "1", label: this.$t("预装时间") },
{ value: "2", label: this.$t("装柜时间") },
{ value: "3", label: this.$t("起运时间") },
......@@ -426,6 +428,13 @@ export default {
let params = { ...this.queryParams };
this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime");
// 执行查询
if (
params.dateRangeCreateTime != null &&
params.dateRangeCreateTime.length == 2
) {
params.beginCreateTime = params.dateRangeCreateTime[0];
params.endCreateTime = params.dateRangeCreateTime[1];
}
getPayableList(params).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
......
......@@ -77,6 +77,7 @@
<el-button type="primary" @click="handleQuery">{{
$t("查找")
}}</el-button>
<!--
<el-button type="primary" @click="handleQuery2">{{
$t("批量反审核")
}}</el-button>
......@@ -85,7 +86,8 @@
}}</el-button>
<el-button type="primary" @click="handleQuery3">{{
$t("批量核销")
}}</el-button>
}}</el-button>-->
</el-form-item>
</el-row>
</el-form>
......
<template>
<div class="app-container">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" inline :validate-on-rule-change="false">
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="120px"
inline
:validate-on-rule-change="false"
>
<el-card>
<div slot="header" class="card-title">{{$route.path.indexOf('create') > -1 ? $t('新建报价单') : $t('编辑报价单')}}</div>
<div slot="header" class="card-title">
{{
$route.path.indexOf("create") > -1
? $t("新建报价单")
: $t("编辑报价单")
}}
</div>
<el-form-item :label="$t('所属人')" prop="relation">
<!-- <el-radio-group v-model="form.relation" > -->
<el-radio-group v-model="form.relation" id="relation">
<el-radio :label="1" >{{$t('发件人')}}</el-radio>
<el-radio :label="2" >{{$t('收件人')}}</el-radio>
<el-radio :label="1">{{ $t("发件人") }}</el-radio>
<el-radio :label="2">{{ $t("收件人") }}</el-radio>
</el-radio-group>
</el-form-item>
<br/>
<el-form-item :label="$t('订单类型')" v-if="routeOtherServices.indexOf('1') > -1 || routeOtherServices.indexOf('4') > -1">
<br />
<el-form-item
:label="$t('订单类型')"
v-if="
routeOtherServices.indexOf('1') > -1 ||
routeOtherServices.indexOf('4') > -1
"
>
<el-checkbox-group v-model="form.type">
<el-checkbox label="1" v-if="routeOtherServices.indexOf('1') > -1">{{$t('集运服务')}}</el-checkbox>
<el-checkbox label="2" v-if="routeOtherServices.indexOf('4') > -1">{{$t('海外仓')}}</el-checkbox>
<el-checkbox
label="1"
v-if="routeOtherServices.indexOf('1') > -1"
>{{ $t("集运服务") }}</el-checkbox
>
<el-checkbox
label="2"
v-if="routeOtherServices.indexOf('4') > -1"
>{{ $t("海外仓") }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<div class="form-section">
<el-form-item :label="$t('发货人')" prop="consignorId">
<div class="contact">
<el-input v-model="form.consignorName" id="defaultContactName" :placeholder="$t('选择或新建')" disabled style="width:120px"/>
<img src="@/assets/svg/contacts.svg" class="phonebook" @click="contactChooseType='consignor'" />
<img src="@/assets/svg/contact_create.svg" class="phonebook" @click="quickCreateType='0'" />
<el-input
v-model="form.consignorName"
id="defaultContactName"
:placeholder="$t('选择或新建')"
disabled
style="width: 120px"
/>
<img
src="@/assets/svg/contacts.svg"
class="phonebook"
@click="contactChooseType = 'consignor'"
/>
<img
src="@/assets/svg/contact_create.svg"
class="phonebook"
@click="quickCreateType = '0'"
/>
</div>
</el-form-item>
<el-form-item :label="$t('发货人电话')" prop="consignorPhone">
<!-- <area-code-selector v-model="form.consignorCountryCode" class="w-200 mr-10" disabled /> -->
<el-input id="defaultContactPhone" :value="`${form.consignorCountryCode ? '+' + form.consignorCountryCode : ''} ${form.consignorPhone || ''}`" class="w-200" disabled/>
<el-input
id="defaultContactPhone"
:value="`${
form.consignorCountryCode ? '+' + form.consignorCountryCode : ''
} ${form.consignorPhone || ''}`"
class="w-200"
disabled
/>
<!-- <el-input v-if="$route.query.type==1 && form.relation==1" v-model="$route.query.customer.defaultContactPhone" class="w-200" disabled/>
<el-input v-else :value="`${form.consignorCountryCode ? '+' + form.consignorCountryCode : ''} ${form.consignorPhone || ''}`" class="w-200" disabled/> -->
</el-form-item>
<el-form-item :label="$t('发货人公司')" prop="consignorCompany">
<!-- 修改从客户列表按钮进来的 -->
<el-input v-model="form.consignorCompany" id="company" disabled class="w-200"/>
<el-input
v-model="form.consignorCompany"
id="company"
disabled
class="w-200"
/>
<!-- <el-input v-if="$route.query.type==1 && form.relation==1" v-model="$route.query.customer.company" disabled class="w-200"/>
<el-input v-else v-model="form.consignorCompany" disabled class="w-200"/> -->
</el-form-item>
<el-form-item label="Email" prop="consignorEmail">
<el-input v-model="form.consignorEmail" id="defaultEmail" disabled class="w-200"/>
<el-input
v-model="form.consignorEmail"
id="defaultEmail"
disabled
class="w-200"
/>
<!-- <el-input v-if="$route.query.type==1 && form.relation==1" v-model="$route.query.customer.defaultEmail" disabled class="w-200"/>
<el-input v-else v-model="form.consigneeEmail" disabled class="w-200"/> -->
</el-form-item>
......@@ -56,24 +109,54 @@
<el-form-item :label="$t('收货人')" prop="consigneeId">
<div class="contact">
<!-- <el-input v-model="form.consigneeName" :placeholder="$t('请选择或新建')" :disabled="true" style="width:120px"/> -->
<el-input v-model="form.consigneeName" id="defaultContactName2" :placeholder="$t('请选择或新建')" :disabled="true" style="width:120px"/>
<img src="@/assets/svg/contacts.svg" class="phonebook" @click="contactChooseType='consignee'" />
<img src="@/assets/svg/contact_create.svg" class="phonebook" @click="quickCreateType='1'" />
<el-input
v-model="form.consigneeName"
id="defaultContactName2"
:placeholder="$t('请选择或新建')"
:disabled="true"
style="width: 120px"
/>
<img
src="@/assets/svg/contacts.svg"
class="phonebook"
@click="contactChooseType = 'consignee'"
/>
<img
src="@/assets/svg/contact_create.svg"
class="phonebook"
@click="quickCreateType = '1'"
/>
</div>
</el-form-item>
<el-form-item :label="$t('收货人电话')" prop="consigneePhone">
<!-- <area-code-selector v-model="form.consigneeCountryCode" class="w-200 mr-10" disabled/> -->
<el-input id="defaultContactPhone2" :value="`${form.consigneeCountryCode ? '+' + form.consigneeCountryCode : ''} ${form.consigneePhone || ''}`" disabled class="w-200"/>
<el-input
id="defaultContactPhone2"
:value="`${
form.consigneeCountryCode ? '+' + form.consigneeCountryCode : ''
} ${form.consigneePhone || ''}`"
disabled
class="w-200"
/>
</el-form-item>
<el-form-item :label="$t('收货人公司')" prop="consigneeCompany">
<el-input id="company2" v-model="form.consigneeCompany" :disabled="true" class="w-200"/>
<el-input
id="company2"
v-model="form.consigneeCompany"
:disabled="true"
class="w-200"
/>
<!-- <el-input v-if="$route.query.type==1 && form.relation==2" v-model="$route.query.customer.company" disabled class="w-200"/>
<el-input v-else v-model="form.consignorCompany" disabled class="w-200"/> -->
</el-form-item>
<el-form-item label="Email" prop="consigneeEmail">
<el-input id="defaultEmail2" v-model="form.consigneeEmail" :disabled="true" class="w-200"/>
<el-input
id="defaultEmail2"
v-model="form.consigneeEmail"
:disabled="true"
class="w-200"
/>
<!-- <el-input v-if="$route.query.type==1 && form.relation==2" v-model="$route.query.customer.defaultEmail" disabled class="w-200"/>
<el-input v-else v-model="form.consigneeEmail" disabled class="w-200"/> -->
</el-form-item>
......@@ -115,11 +198,25 @@
<div class="form-section">
<el-form-item :label="$t('运输方式')" prop="transportId">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="form.transportId" class="w-200"/>
<dict-selector
:type="DICT_TYPE.ECW_TRANSPORT_TYPE"
v-model="form.transportId"
class="w-200"
/>
</el-form-item>
<el-form-item :label="$t('出货渠道')" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'" prop="channelId">
<el-form-item
:label="$t('出货渠道')"
v-if="
getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId)
.cssClass == 'channel'
"
prop="channelId"
>
<selector
:disabled="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass != 'channel'"
:disabled="
getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId)
.cssClass != 'channel'
"
v-model="form.channelId"
:options="channelList"
value-field="channelId"
......@@ -131,273 +228,448 @@
<div class="form-section">
<el-form-item :label="$t('始发城市')" prop="departureId">
<el-select v-model="form.departureId" :placeholder="$t('请选择始发地')" class="w-200">
<el-option v-for="item in exportCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
<el-select
v-model="form.departureId"
:placeholder="$t('请选择始发地')"
class="w-200"
>
<el-option
v-for="item in exportCityList"
:label="$l(item, 'title')"
:value="item.id"
:key="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select v-model="form.objectiveId" :placeholder="$t('请选择目的地')" class="w-200">
<el-option v-for="item in importCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
<el-select
v-model="form.objectiveId"
:placeholder="$t('请选择目的地')"
class="w-200"
>
<el-option
v-for="item in importCityList"
:label="$l(item, 'title')"
:value="item.id"
:key="item.id"
></el-option>
</el-select>
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('选择线路')" prop="lineId">
<!-- <el-input :value="getRouterNameById(form.lineId)" readonly :placeholder="$t('请在右侧选择线路')"></el-input> -->
<el-input :value="selectedRouter ? $l(selectedRouter, 'startTitle') + ' > ' + $l(selectedRouter, 'destTitle') : ''" disabled :placeholder="$t('请在右侧选择线路')" class="w-200"></el-input>
<el-input
:value="
selectedRouter
? $l(selectedRouter, 'startTitle') +
' > ' +
$l(selectedRouter, 'destTitle')
: ''
"
disabled
:placeholder="$t('请在右侧选择线路')"
class="w-200"
></el-input>
</el-form-item>
<select size="5" v-model="form.lineId" style="min-width: 300px; border:1px solid #DCDFE6; border-radius:4px">
<select
size="5"
v-model="form.lineId"
style="
min-width: 300px;
border: 1px solid #dcdfe6;
border-radius: 4px;
"
>
<template v-for="item in routerList">
<option :value="item.id" :key="item.id">{{$l(item, 'startTitle')}} >> {{$l(item, 'destTitle')}}</option>
<option :value="item.id" :key="item.id">
{{ $l(item, "startTitle") }} >> {{ $l(item, "destTitle") }}
</option>
</template>
</select>
</div>
</el-card>
<el-card class="mt-10">
<div slot="header" class="card-title">
<div class="card-name">{{$t('商品信息')}}</div>
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addProduct()" :disabled="!canAddProduct"></el-button>
<div class="card-name">{{ $t("商品信息") }}</div>
<el-button
type="primary"
size="mini"
icon="el-icon-plus"
@click="addProduct()"
:disabled="!canAddProduct"
></el-button>
</div>
<el-table :data="form.prodCreateReqVOList" border class="product-list">
<el-table-column :label="$t('序号')" width="60px" fixed>
<template slot-scope="scope">
{{scope.$index + 1}}
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column :label="$t('中文品名')" width="160px">
<template slot="header" slot-scope="scope">
{{$t('中文品名')}} <span class="red">*</span>
{{ $t("中文品名") }} <span class="red">*</span>
</template>
<template slot-scope="scope">
<el-form-item label=""
<el-form-item
label=""
:prop="`prodCreateReqVOList.${scope.$index}.prodId`"
:rules="{
required: true, message: $t('请选择产品'), trigger: 'blur'
required: true,
message: $t('请选择产品'),
trigger: 'blur',
}"
class="mb-0 mr-0"
>
<product-selector v-model="scope.row.prodId" @change="onProductChange(scope.row, $event)" :disabled="!canAddProduct" />
<product-selector
v-model="scope.row.prodId"
@change="onProductChange(scope.row, $event)"
:disabled="!canAddProduct"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('英文品名')" width="160px">
<template slot="header" slot-scope="scope">
{{$t('英文品名')}} <span class="red">*</span>
{{ $t("英文品名") }} <span class="red">*</span>
</template>
<template slot-scope="{row}">
<product-selector lang="En" v-model="row.prodId" @change="onProductChange(row, $event)" :disabled="!canAddProduct" />
<template slot-scope="{ row }">
<product-selector
lang="En"
v-model="row.prodId"
@change="onProductChange(row, $event)"
:disabled="!canAddProduct"
/>
</template>
</el-table-column>
<el-table-column width="100px">
<template slot="header" slot-scope="scope">
{{$t('品牌')}} <span class="red">*</span>
{{ $t("品牌") }} <span class="red">*</span>
</template>
<template slot-scope="scope">
<el-form-item label=""
<el-form-item
label=""
:prop="`prodCreateReqVOList.${scope.$index}.brand`"
:rules="{
required: true, message: $t('请选择品牌'), trigger: 'blur'
required: true,
message: $t('请选择品牌'),
trigger: 'blur',
}"
class="mb-0 mr-0"
>
<dict-selector v-model="scope.row.brand" :type="DICT_TYPE.ECW_IS_BRAND" defaultable @input="calculationPrice" :disabled="!canAddProduct" />
<dict-selector
v-model="scope.row.brand"
:type="DICT_TYPE.ECW_IS_BRAND"
defaultable
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('件数')" width="90px">
<template slot="header" slot-scope="scope">
{{$t('件数')}} <span class="red">*</span>
{{ $t("件数") }} <span class="red">*</span>
</template>
<template slot-scope="{row}">
<el-input v-model.number="row.num" @input="calculationPrice" :disabled="!canAddProduct" />
<template slot-scope="{ row }">
<el-input
v-model.number="row.num"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</template>
</el-table-column>
<el-table-column :label="$t('包装单位')" width="100px">
<template slot="header" slot-scope="scope">
{{$t('包装单位')}} <span class="red">*</span>
{{ $t("包装单位") }} <span class="red">*</span>
</template>
<template slot-scope="{row}">
<dict-selector v-model="row.unit" :type="DICT_TYPE.ECW_PACKAGING_TYPE" defaultable @input="calculationPrice" :disabled="!canAddProduct" />
<template slot-scope="{ row }">
<dict-selector
v-model="row.unit"
:type="DICT_TYPE.ECW_PACKAGING_TYPE"
defaultable
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</template>
</el-table-column>
<el-table-column :label="$t('数量') + '(个)'">
<template slot-scope="{row}">
<el-input v-model="row.quantity" @input="calculationPrice" :disabled="!canAddProduct" />
<template slot-scope="{ row }">
<el-input
v-model="row.quantity"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</template>
</el-table-column>
<el-table-column :label="$t('总体积') + '(m³)'" width="100px">
<template slot-scope="{row}">
<el-input v-model="row.volume" @input="calculationPrice" :disabled="!canAddProduct"/>
<template slot-scope="{ row }">
<el-input
v-model="row.volume"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</template>
</el-table-column>
<el-table-column :label="$t('总重量') + '(kg)'" width="100px">
<template slot-scope="{row}">
<el-input v-model="row.weight" @input="calculationPrice" :disabled="!canAddProduct" />
<template slot-scope="{ row }">
<el-input
v-model="row.weight"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</template>
</el-table-column>
<el-table-column :label="$t('总货值') + '(RMB)'" width="120px">
<template slot="header" slot-scope="scope">
{{$t('总货值')}}(RMB) <span class="red">*</span>
{{ $t("总货值") }}(RMB) <span class="red">*</span>
</template>
<template slot-scope="scope">
<el-form-item label=""
<el-form-item
label=""
:prop2="`prodCreateReqVOList.${scope.$index}.worth`"
:rules2="{
// required: true, message: $t('货值不能为空'), trigger: 'blur'
}"
class="mb-0 mr-0"
>
<el-input v-model="scope.row.worth" @input="calculationPrice" :disabled="!canAddProduct" />
<el-input
v-model="scope.row.worth"
@input="calculationPrice"
:disabled="!canAddProduct"
/>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('商品特性')" width="250px">
<template slot-scope="{row}">
<el-checkbox-group v-model="row.prodAttrArr" @change="onProductAttrChange(row, $event)" :disabled="!canAddProduct">
<el-checkbox v-for="item in productAttrList" :label="item.id" :key="item.id">{{$l(item, 'attrName')}}</el-checkbox>
<template slot-scope="{ row }">
<el-checkbox-group
v-model="row.prodAttrArr"
@change="onProductAttrChange(row, $event)"
:disabled="!canAddProduct"
>
<el-checkbox
v-for="item in productAttrList"
:label="item.id"
:key="item.id"
>{{ $l(item, "attrName") }}</el-checkbox
>
</el-checkbox-group>
</template>
</el-table-column>
<el-table-column :label="$t('运费')" width="200px">
<template slot-scope="{row}">
<template slot-scope="{ row }">
<template v-if="row.fee && row.fee.charging == 1">
<template v-if="!row.fee.oneFreight">{{$t('未报价')}}</template>
<template v-if="!row.fee.oneFreight">{{
$t("未报价")
}}</template>
<template v-else>
{{$t('全包价')}}{{row.fee.oneFreight}} {{currencyMap[row.fee.freightCurrency]}} / {{unitMap[row.fee.freightVolume]}}
{{ $t("全包价") }}{{ row.fee.oneFreight }}
{{ currencyMap[row.fee.freightCurrency] }} /
{{ unitMap[row.fee.freightVolume] }}
</template>
</template>
<template v-else-if="!row.fee || !row.fee.oneFreight && !row.fee.oneClearanceFee">{{$t('未报价')}}</template>
<template
v-else-if="
!row.fee || (!row.fee.oneFreight && !row.fee.oneClearanceFee)
"
>{{ $t("未报价") }}</template
>
<template v-else-if="row.fee">
<div>
{{$t('运费')}}{{row.fee.oneFreight}} {{currencyMap[row.fee.freightCurrency]}} / {{unitMap[row.fee.freightVolume]}}
{{ $t("运费") }}{{ row.fee.oneFreight }}
{{ currencyMap[row.fee.freightCurrency] }} /
{{ unitMap[row.fee.freightVolume] }}
</div>
<div>
{{$t('清关费')}}{{row.fee.oneClearanceFee}} {{currencyMap[row.fee.clearanceFeeCurrency]}} / {{unitMap[row.fee.clearanceFeeVolume]}}
{{ $t("清关费") }}{{ row.fee.oneClearanceFee }}
{{ currencyMap[row.fee.clearanceFeeCurrency] }} /
{{ unitMap[row.fee.clearanceFeeVolume] }}
</div>
</template>
</template>
</el-table-column>
<el-table-column :label="$t('是否预付')">
<template slot-scope="{row}">
<dict-tag v-if="row.fee" :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="row.fee.isPayAdvance" />
<template slot-scope="{ row }">
<dict-tag
v-if="row.fee"
:type="DICT_TYPE.ECW_PAY_ADVANCE"
:value="row.fee.isPayAdvance"
/>
</template>
</el-table-column>
<el-table-column :label="$t('商品链接')" width="200px" align="center">
<template slot-scope="{row}">
<el-link type="primary" :href="row.link" target="_blank" style="display:block">{{row.link}}</el-link>
<el-button type="primary" size="mini" @click="setLink(row)" :disabled="!canAddProduct">
{{row.link ? $t('编辑商品链接') : $t('添加商品链接')}}
<template slot-scope="{ row }">
<el-link
type="primary"
:href="row.link"
target="_blank"
style="display: block"
>{{ row.link }}</el-link
>
<el-button
type="primary"
size="mini"
@click="setLink(row)"
:disabled="!canAddProduct"
>
{{ row.link ? $t("编辑商品链接") : $t("添加商品链接") }}
</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('快递单号')" width="100px">
<template slot-scope="{row}">
<el-input v-model="row.expressNo" placeholder="" :disabled="!canAddProduct" />
<template slot-scope="{ row }">
<el-input
v-model="row.expressNo"
placeholder=""
:disabled="!canAddProduct"
/>
</template>
</el-table-column>
<el-table-column :label="$t('操作')" width="180px" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="danger" @click="delProduct(scope.$index)">{{$t('删除')}}</el-button>
<el-button
size="mini"
type="danger"
@click="delProduct(scope.$index)"
>{{ $t("删除") }}</el-button
>
</template>
</el-table-column>
</el-table>
<!--
</el-card>
<el-card class="mt-10"> -->
<div class="card-title" style="padding:20px 0;">{{$t('合计')}}</div>
<div class="card-title" style="padding: 20px 0">{{ $t("合计") }}</div>
<el-descriptions :column="4" border>
<el-descriptions-item :label="$t('总件数')">
{{sum.totalNum.toFixed() || 0}}
{{ sum.totalNum.toFixed() || 0 }}
</el-descriptions-item>
<el-descriptions-item :label="$t('总体积')">
{{sum.totalVolume.toFixed() || 0}}m³
{{ sum.totalVolume.toFixed() || 0 }}m³
</el-descriptions-item>
<el-descriptions-item :label="$t('总重量')">
{{sum.totalWeight.toFixed() || 0}}kg
{{ sum.totalWeight.toFixed() || 0 }}kg
</el-descriptions-item>
<el-descriptions-item :label="$t('总数量')">
{{sum.totalQuatity.toFixed() || 0}}
{{ sum.totalQuatity.toFixed() || 0 }}
</el-descriptions-item>
<el-descriptions-item :label="$t('总货值') + '(RMB)'">
{{sum.totalWorth.toFixed() || 0}}{{$t('元')}}
{{ sum.totalWorth.toFixed() || 0 }}{{ $t("元") }}
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="mt-10">
<div class="card-title" slot="header">{{$t('预计费用')}}</div>
<div class="card-title" slot="header">{{ $t("预计费用") }}</div>
<el-descriptions :column="5" border>
<el-descriptions-item :label="$t('保价费')">
{{fee.insuranceFee || 0}} {{ selectedRouter ? currencyMap[selectedRouter.currencyUnit || 1] : '' }}
{{ fee.insuranceFee || 0 }}
{{
selectedRouter
? currencyMap[selectedRouter.currencyUnit || 1]
: ""
}}
</el-descriptions-item>
<el-descriptions-item :label="$t('总运费')">
<template v-for="item in freightFeeList">
<div :key="item.currencyId">{{item.amount || 0}}{{currencyMap[item.currencyId]}}</div>
<div :key="item.currencyId">
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
</template>
</el-descriptions-item>
<!--代收货款,只有非控货订单、并且线路开通了代收货款后,才显示是否代收货款选项-->
<el-descriptions-item :label="$t('总清关费')">
<template v-for="item in clearanceFeeList">
<div :key="item.currencyId">{{item.amount || 0}}{{currencyMap[item.currencyId]}}</div>
<div :key="item.currencyId">
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
</template>
</el-descriptions-item>
<el-descriptions-item :label="$t('其他费用')">
<el-input v-model="form.otherFee" placeholder="" class="w-100 mr-10"></el-input>
<selector v-model="form.otherFeeCurrencyId" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable class="w-100" />
<el-input
v-model="form.otherFee"
placeholder=""
class="w-100 mr-10"
></el-input>
<selector
v-model="form.otherFeeCurrencyId"
:options="currencyList"
:label-field="$l('title')"
value-field="id"
defaultable
class="w-100"
/>
</el-descriptions-item>
<el-descriptions-item :label="$t('原价')" :span="2">
<template v-for="item in originalFeeList">
<div :key="item.currencyId">{{item.amount || 0}}{{currencyMap[item.currencyId]}}</div>
<div :key="item.currencyId">
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
</template>
</el-descriptions-item>
</el-descriptions>
<div class="card-title" style="padding:20px 0;">{{$t('优惠信息')}}</div>
<el-table :data="couponList" :show-header="false" :empty-text="$t('暂无优惠')">
<div class="card-title" style="padding: 20px 0">
{{ $t("优惠信息") }}
</div>
<el-table
:data="couponList"
:show-header="false"
:empty-text="$t('暂无优惠')"
>
<el-table-column label="">
<template slot-scope="scope">
{{scope.$index+1}}.
{{$l(productNames[scope.row.prodId], 'title') || $t('未知')}}
{{ scope.$index + 1 }}.
{{ $l(productNames[scope.row.prodId], "title") || $t("未知") }}
</template>
</el-table-column>
<el-table-column label="">
<template slot-scope="{row}">
<template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.ECW_COUPON_TYPE" :value="row.type" />
</template>
</el-table-column>
<el-table-column label="">
<template slot-scope="{row}">
{{$l(row, 'title')}}
<template slot-scope="{ row }">
{{ $l(row, "title") }}
</template>
</el-table-column>
<el-table-column label="">
<template slot-scope="{row}">
-{{row.reduceAmount}}
{{currencyMap[row.reduceCurrencyId]}}
<template slot-scope="{ row }">
-{{ row.reduceAmount }}
{{ currencyMap[row.reduceCurrencyId] }}
</template>
</el-table-column>
<el-table-column label="">
<template slot-scope="{row}">
{{$t('有效期至')}}{{row.endTime ? row.endTime : $t('永久有效')}}
<template slot-scope="{ row }">
{{ $t("有效期至") }}{{
row.endTime ? row.endTime : $t("永久有效")
}}
</template>
</el-table-column>
</el-table>
<el-descriptions :column="1" class="mt-20">
<el-descriptions-item :label="$t('优惠费用')" v-if="couponTotalAmountList && couponTotalAmountList.length">
<div v-for="(item, discountIndex) in couponTotalAmountList" :key="discountIndex">
{{item.totalAmount}} {{currencyMap[item.currencyId]}}
<el-descriptions-item
:label="$t('优惠费用')"
v-if="couponTotalAmountList && couponTotalAmountList.length"
>
<div
v-for="(item, discountIndex) in couponTotalAmountList"
:key="discountIndex"
>
{{ item.totalAmount }} {{ currencyMap[item.currencyId] }}
</div>
</el-descriptions-item>
<el-descriptions-item :label="$t('预计费用')" :span="1">
<div>
<template v-for="item in estimatedCosts">
<div :key="item.currencyId">{{item.amount || 0}}{{currencyMap[item.currencyId]}}</div>
<div :key="item.currencyId">
{{ item.amount || 0 }}{{ currencyMap[item.currencyId] }}
</div>
</template>
</div>
</el-descriptions-item>
......@@ -405,29 +677,52 @@
</el-card>
<el-card class="mt-10">
<div class="card-title" slot="header">{{$t('通用')}}</div>
<div class="card-title" slot="header">{{ $t("通用") }}</div>
<div class="form-section">
<el-form-item :label="$t('唛头')" prop="marks">
<el-input v-model="form.marks" placeholder="" class="w-200"></el-input>
<el-input
v-model="form.marks"
placeholder=""
class="w-200"
></el-input>
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('报关方式')" prop="customsType">
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="form.customsType" form-type="radio" defaultable />
<dict-selector
:type="DICT_TYPE.ECW_CUSTOMS_TYPE"
v-model="form.customsType"
form-type="radio"
defaultable
/>
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('预计结束时间')" prop="stopTime">
<!-- <el-date-picker v-model="form.stopTime" value-format="yyyy-MM-dd HH:mm:ss" class="w-200"></el-date-picker> -->
<el-date-picker v-model="form.stopTime" value-format="yyyy-MM-dd" class="w-200" :picker-options="stopDate" ></el-date-picker>
<el-date-picker
v-model="form.stopTime"
value-format="yyyy-MM-dd"
class="w-200"
:picker-options="stopDate"
></el-date-picker>
</el-form-item>
<el-form-item :label="$t('是否控货')" prop="control">
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" formatter="bool" v-model="form.control" form-type="radio" />
<dict-selector
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
formatter="bool"
v-model="form.control"
form-type="radio"
/>
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('竞争对手')" prop="competitor">
<el-input v-model="form.competitor" placeholder="" class="w-200"></el-input>
<el-input
v-model="form.competitor"
placeholder=""
class="w-200"
></el-input>
</el-form-item>
<el-form-item :label="$t('重要程度')" prop="importance">
<el-rate v-model="form.importance"></el-rate>
......@@ -436,11 +731,23 @@
<div class="form-section">
<el-form-item :label="$t('价格有效时间')" prop="startTime">
<!-- <el-date-picker v-model="form.startTime" placeholder="" value-format="yyyy-MM-dd HH:mm:ss" class="w-200"></el-date-picker> -->
<el-date-picker v-model="form.startTime" placeholder="" value-format="yyyy-MM-dd" class="w-200" :picker-options="startDate"></el-date-picker>
<el-date-picker
v-model="form.startTime"
placeholder=""
value-format="yyyy-MM-dd"
class="w-200"
:picker-options="startDate"
></el-date-picker>
</el-form-item>
<el-form-item label="" prop="endTime">
<!-- <el-date-picker v-model="form.endTime" placeholder="" value-format="yyyy-MM-dd HH:mm:ss" class="w-200"></el-date-picker> -->
<el-date-picker v-model="form.endTime" placeholder="" value-format="yyyy-MM-dd" class="w-200" :picker-options="endDate"></el-date-picker>
<el-date-picker
v-model="form.endTime"
placeholder=""
value-format="yyyy-MM-dd"
class="w-200"
:picker-options="endDate"
></el-date-picker>
</el-form-item>
</div>
......@@ -450,145 +757,236 @@
接口要求数据为整数,所以增加trade_type类型的字典,用1234代码以下不同类型
FOB(离岸价),CIF(到岸价),CNF(成本加运费),EXW(出厂价)
-->
<dict-selector :type="DICT_TYPE.ECW_TRADE_TYPE" fomtter="number" v-model="form.tradeType" class="w-200"/>
<dict-selector
:type="DICT_TYPE.ECW_TRADE_TYPE"
fomtter="number"
v-model="form.tradeType"
class="w-200"
/>
</el-form-item>
<el-form-item :label="$t('交货地址')">
<el-input v-model="form.tradeAdress" :placeholder="$t('港口或地点')"></el-input>
<el-input
v-model="form.tradeAdress"
:placeholder="$t('港口或地点')"
></el-input>
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('备注')" :span="2">
<el-input v-model="form.remarks" type="textarea" placeholder="" style="width:500px; height: 100px"></el-input>
<el-input
v-model="form.remarks"
type="textarea"
placeholder=""
style="width: 500px; height: 100px"
></el-input>
</el-form-item>
</div>
</el-card>
<el-card class="mt-10" v-if="transport">
<div class="card-title" slot="header">{{$l(transport, 'label')}}</div>
<div class="card-title" slot="header">{{ $l(transport, "label") }}</div>
<!-- <el-form-item :label="$t('快递单号')">
<el-input v-model="form.number" :placeholder="$t('请输入购买商品的快递单号')"></el-input>
</el-form-item> -->
<el-form-item :label="$t('是否双清')" v-if="[2,3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.transportVO.doubleClear" form-type="radio" :type="DICT_TYPE.ECW_DOUBLE_CLEAR" />
<el-form-item
:label="$t('是否双清')"
v-if="[2, 3, 4].indexOf(+form.transportId) > -1"
>
<dict-selector
v-model="form.transportVO.doubleClear"
form-type="radio"
:type="DICT_TYPE.ECW_DOUBLE_CLEAR"
/>
</el-form-item>
<el-form-item :label="$t('航空公司')" v-if="[3,4].indexOf(+form.transportId) > -1">
<el-form-item
:label="$t('航空公司')"
v-if="[3, 4].indexOf(+form.transportId) > -1"
>
<!--待查询备选数据-->
<!-- <el-select placeholder="" v-model="form.airlineCompany">
</el-select> -->
<supplier-selector v-model="form.transportVO.airlineCompany" companyType="10" />
<supplier-selector
v-model="form.transportVO.airlineCompany"
companyType="10"
/>
</el-form-item>
<el-form-item :label="$t('船公司')" v-if="[2].indexOf(+form.transportId) > -1">
<el-form-item
:label="$t('船公司')"
v-if="[2].indexOf(+form.transportId) > -1"
>
<!-- <el-select placeholder="" v-model="form.shippingCompany">
</el-select> -->
<supplier-selector v-model="form.transportVO.shippingCompany" companyType="9" />
<supplier-selector
v-model="form.transportVO.shippingCompany"
companyType="9"
/>
</el-form-item>
<el-form-item :label="$t('清关证书')" v-if="[2,3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.transportVO.customsClearCert" form-type="radio" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" formatter="bool" />
<el-form-item
:label="$t('清关证书')"
v-if="[2, 3, 4].indexOf(+form.transportId) > -1"
>
<dict-selector
v-model="form.transportVO.customsClearCert"
form-type="radio"
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
formatter="bool"
/>
</el-form-item>
<el-form-item :label="$t('清关证书备注')" v-if="[2,3,4].indexOf(+form.transportId) > -1">
<el-input v-model="form.transportVO.remarks" ></el-input>
<el-form-item
:label="$t('清关证书备注')"
v-if="[2, 3, 4].indexOf(+form.transportId) > -1"
>
<el-input v-model="form.transportVO.remarks"></el-input>
</el-form-item>
<el-form-item :label="$t('是否拆包')" v-if="[3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.transportVO.isUnpack" form-type="radio" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" formatter="bool" />
<el-form-item
:label="$t('是否拆包')"
v-if="[3, 4].indexOf(+form.transportId) > -1"
>
<dict-selector
v-model="form.transportVO.isUnpack"
form-type="radio"
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
formatter="bool"
/>
</el-form-item>
<el-form-item :label="$t('单票立刻转运')" v-if="[3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.transportVO.isSingleTicketTransport" form-type="radio" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" formatter="bool" />
<span style="margin-left:10px">{{$t('注:若只有一件,货到仓库立即发,选“是”,多件需仓库集运待发,选“否”')}}</span>
<el-form-item
:label="$t('单票立刻转运')"
v-if="[3, 4].indexOf(+form.transportId) > -1"
>
<dict-selector
v-model="form.transportVO.isSingleTicketTransport"
form-type="radio"
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
formatter="bool"
/>
<span style="margin-left: 10px">{{
$t(
"注:若只有一件,货到仓库立即发,选“是”,多件需仓库集运待发,选“否”"
)
}}</span>
</el-form-item>
<br/>
<el-form-item :label="$t('特殊要求')" >
<dict-selector v-model="form.transportVO.packageTypeArr" form-type="checkbox" :type="DICT_TYPE.ORDER_SPECIAL_NEEDS" multiple />
<br />
<el-form-item :label="$t('特殊要求')">
<dict-selector
v-model="form.transportVO.packageTypeArr"
form-type="checkbox"
:type="DICT_TYPE.ORDER_SPECIAL_NEEDS"
multiple
/>
</el-form-item>
<br/>
<br />
<el-form-item :label="$t('特殊要求备注')">
<el-input v-model="form.transportVO.packageRemarks" ></el-input>
<el-input v-model="form.transportVO.packageRemarks"></el-input>
</el-form-item>
</el-card>
<el-form-item label="" class="mt-20">
<!-- 非草稿状态显示为编辑按钮 -->
<el-button v-if="form.offerId && form.status != 2" type="primary" @click="submitForm(2)">{{$t('编辑')}}</el-button>
<el-button
v-if="form.offerId && form.status != 2"
type="primary"
@click="submitForm(2)"
>{{ $t("编辑") }}</el-button
>
<template v-else>
<el-button type="primary" @click="submitForm(2)">{{$t('保存草稿')}}</el-button> <!-- 草稿 -->
<el-button type="primary" @click="submitForm(3)">{{$t('确认报价')}}</el-button> <!-- 需求确认 -->
<el-button type="primary" @click="submitForm(2)">{{
$t("保存草稿")
}}</el-button>
<!-- 草稿 -->
<el-button type="primary" @click="submitForm(3)">{{
$t("确认报价")
}}</el-button>
<!-- 需求确认 -->
</template>
<el-button @click="$store.dispatch('tagsView/delCurrentView')">{{$t('取消')}}</el-button>
<el-button @click="$store.dispatch('tagsView/delCurrentView')">{{
$t("取消")
}}</el-button>
</el-form-item>
</el-form>
<choose-contact-dialog v-if="!!contactChooseType" @choose="onContactChoose" @close="contactChooseType=null" />
<quick-create-customer v-if="quickCreateType" :type="quickCreateType" @success="onContactChoose" @close="quickCreateType=null" />
<choose-contact-dialog
v-if="!!contactChooseType"
:type="1"
@choose="onContactChoose"
@close="contactChooseType = null"
/>
<quick-create-customer
v-if="quickCreateType"
:type="quickCreateType"
@success="onContactChoose"
@close="quickCreateType = null"
/>
</div>
</template>
<script>
import { createOffer, updateOffer, getOffer} from "@/api/ecw/offer";
import ProductSelector from '@/components/ProductSelector'
import {getProductAttrList} from '@/api/ecw/productAttr'
import {getChannelList} from '@/api/ecw/channel'
import Selector from '@/components/Selector'
import {openedRouterList as getOpenedRouterList} from '@/api/ecw/warehouse'
import {getTradeCityList} from '@/api/ecw/region'
import {getDictData} from '@/utils/dict'
import {getCurrencyList} from '@/api/ecw/currency'
import {getUnitList} from '@/api/ecw/unit'
import {calculationPrice} from '@/api/ecw/product'
import SupplierSelector from '@/components/SupplierSelector'
import ChooseContactDialog from '@/components/ChooseContactDialog'
import QuickCreateCustomer from '@/components/QuickCreateCustomer'
import {getCustomerContactsSelect} from '@/api/ecw/customerContacts'
import Decimal from 'decimal.js'
import getQuote from '@/views/ecw/customer/index.vue'
window.Decimal= Decimal
import { createOffer, updateOffer, getOffer } from "@/api/ecw/offer";
import ProductSelector from "@/components/ProductSelector";
import { getProductAttrList } from "@/api/ecw/productAttr";
import { getChannelList } from "@/api/ecw/channel";
import Selector from "@/components/Selector";
import { openedRouterList as getOpenedRouterList } from "@/api/ecw/warehouse";
import { getTradeCityList } from "@/api/ecw/region";
import { getDictData } from "@/utils/dict";
import { getCurrencyList } from "@/api/ecw/currency";
import { getUnitList } from "@/api/ecw/unit";
import { calculationPrice } from "@/api/ecw/product";
import SupplierSelector from "@/components/SupplierSelector";
import ChooseContactDialog from "@/components/ChooseContactDialog";
import QuickCreateCustomer from "@/components/QuickCreateCustomer";
import { getCustomerContactsSelect } from "@/api/ecw/customerContacts";
import Decimal from "decimal.js";
import getQuote from "@/views/ecw/customer/index.vue";
window.Decimal = Decimal;
const createDefaultForm = () => {
return {
sendstatus:0,
sendstatus: 0,
type: [],
control: false,
isCargoControl: false,
prodCreateReqVOList:[],
transportVO: {}
}
}
prodCreateReqVOList: [],
transportVO: {},
};
};
export default {
name: "EcwOfferEdit",
components: {
ProductSelector, Selector, SupplierSelector,ChooseContactDialog, QuickCreateCustomer
ProductSelector,
Selector,
SupplierSelector,
ChooseContactDialog,
QuickCreateCustomer,
},
data() {
return {
// 遮罩层
form: {
relation: 1, // CustomerLevel 的初始值
},
type: this.$route.query.type,
contacts:null,
contactsList:[],
contacts: null,
contactsList: [],
loading: true,
// productList:[], // 商品信息
productAttrList:[], // 商品属性
productAttrList: [], // 商品属性
channelList: [], // 出货取到
routerList: [],
tradeCityList: [],
consignor: {}, // 发货人
consignee:{}, // 收货人
consignee: {}, // 收货人
transportList: [],
currencyList:[],
unitList:[],
currencyList: [],
unitList: [],
// couponList: [],
fee: {}, // 费用
// 表单参数
form: {...createDefaultForm()},
form: { ...createDefaultForm() },
// 表单校验
labelStyle: 'width:120px',
labelStyle: "width:120px",
productNames: {}, // 品名id和名称对应关系
couponAvailableGroupDtoList: [], // 可用优惠
couponTotalAmountList: [], // 优惠总额
......@@ -596,94 +994,92 @@ export default {
quickCreateType: null, // 快速新建客户类型,1发货人,2收货人
getOpenedRouterListHandler: undefined,
//预计结束时间,用于日历框校验
stopDate:{
disabledDate: time => {
return Date.now() - 8.64e7 >= time.getTime() // 加- 8.64e7则表示包当天
}
stopDate: {
disabledDate: (time) => {
return Date.now() - 8.64e7 >= time.getTime(); // 加- 8.64e7则表示包当天
},
},
//有效起始时间
startDate: {
disabledDate: time => {
return Date.now() - 8.64e7 >= time.getTime() // 加- 8.64e7则表示包当天
}
disabledDate: (time) => {
return Date.now() - 8.64e7 >= time.getTime(); // 加- 8.64e7则表示包当天
},
},
//有效结束时间
endDate: {
disabledDate: time => {
disabledDate: (time) => {
if (this.form.startTime) {
return (
//限制日期范围
new Date( this.form.startTime).getTime() - 8.64e7 >=time.getTime() || time.getTime() >= new Date().setDate(new Date().getDate() + 30)
)
new Date(this.form.startTime).getTime() - 8.64e7 >=
time.getTime() ||
time.getTime() >= new Date().setDate(new Date().getDate() + 30)
);
} else {
// 加- 8.64e7则表示包当天
return Date.now() - 8.64e7>= time.getTime() || time.getTime() >= new Date().setDate(new Date().getDate() + 30)
}
}
return (
Date.now() - 8.64e7 >= time.getTime() ||
time.getTime() >= new Date().setDate(new Date().getDate() + 30)
);
}
},
},
};
},
computed:{
computed: {
computedStandard() {
if(this.$route.query.type==1){
if (this.$route.query.type == 1) {
// 使用计算属性动态设置 'Standard' 的值
switch (this.form.relation) {
case 1:
if(this.$route.query.customer.defaultContactName !=null){
this.form.consignorName = this.$route.query.customer.defaultContactName
this.form.consigneeName = ""
this.form.consignorId = this.$route.query.customer.defaultContactId
}
if(this.$route.query.customer.company !=null){
this.form.consignorCompany = this.$route.query.customer.company
this.form.consigneeCompany = ""
}
if(this.$route.query.customer.defaultContactPhone!=null){
this.form.consignorPhone = this.$route.query.customer.defaultContactPhone
this.form.consigneePhone = ""
this.form.consigeeCountryCode =""
}
if(this.$route.query.customer.defaultEmail!=null){
this.form.consignorEmail = this.$route.query.customer.defaultEmail;
this.form.consigneeEmail = ""
if (this.$route.query.customer.defaultContactName != null) {
this.form.consignorName =
this.$route.query.customer.defaultContactName;
this.form.consigneeName = "";
this.form.consignorId =
this.$route.query.customer.defaultContactId;
}
if (this.$route.query.customer.company != null) {
this.form.consignorCompany = this.$route.query.customer.company;
this.form.consigneeCompany = "";
}
if (this.$route.query.customer.defaultContactPhone != null) {
this.form.consignorPhone =
this.$route.query.customer.defaultContactPhone;
this.form.consigneePhone = "";
this.form.consigeeCountryCode = "";
}
if (this.$route.query.customer.defaultEmail != null) {
this.form.consignorEmail =
this.$route.query.customer.defaultEmail;
this.form.consigneeEmail = "";
}
return;
case 2:
if(this.$route.query.customer.defaultContactName !=null){
this.form.consignorName = ""
this.form.consigneeName = this.$route.query.customer.defaultContactName
this.form.consigneeId = this.$route.query.customer.defaultContactId
}
if(this.$route.query.customer.company !=null){
this.form.consignorCompany = ""
this.form.consigneeCompany = this.$route.query.customer.company
}
if(this.$route.query.customer.defaultContactPhone!=null){
this.form.consignorPhone = ""
this.form.consignorCountryCode =""
this.form.consigneePhone = this.$route.query.customer.defaultContactPhone
if (this.$route.query.customer.defaultContactName != null) {
this.form.consignorName = "";
this.form.consigneeName =
this.$route.query.customer.defaultContactName;
this.form.consigneeId =
this.$route.query.customer.defaultContactId;
}
if (this.$route.query.customer.company != null) {
this.form.consignorCompany = "";
this.form.consigneeCompany = this.$route.query.customer.company;
}
if (this.$route.query.customer.defaultContactPhone != null) {
this.form.consignorPhone = "";
this.form.consignorCountryCode = "";
this.form.consigneePhone =
this.$route.query.customer.defaultContactPhone;
}
if (this.$route.query.customer.defaultEmail != null) {
this.form.consignorEmail = "";
this.form.consigneeEmail =
this.$route.query.customer.defaultEmail;
}
if(this.$route.query.customer.defaultEmail!=null){
this.form.consignorEmail = ""
this.form.consigneeEmail = this.$route.query.customer.defaultEmail;
}
return ;
return;
default:
return "";
......@@ -691,36 +1087,42 @@ export default {
}
},
rules(){
rules() {
let rules = {
marks: [
{
validator: (rule, value, callback) => {
if(value && !/[a-zA-Z]/.test(value.charAt(0))){
return callback(new Error(this.$t('唛头必须以字母开头')))
if (value && !/[a-zA-Z]/.test(value.charAt(0))) {
return callback(new Error(this.$t("唛头必须以字母开头")));
}
callback()
callback();
},
trigger: "blur",
},
trigger: 'blur'
}
],
lineId: [{ required: true, message: this.$t("请选择线路")}],
lineId: [{ required: true, message: this.$t("请选择线路") }],
/* consignorId: [{ required: true, message: this.$t("发货人不能为空"),}],
consigneeId: [{ required: true, message: this.$t("收货人不能为空")}], */
startTime: [{ required: true, message: this.$t("有效期开始时间不能为空")}],
endTime: [{ required: true, message: this.$t("有效期结束时间不能为空")}],
transportId: [{ required: true, message: this.$t("选择运输方式")}],
channelId: [{ required: true, message: this.$t("选择出货渠道")}],
stopTime: [{ required: true, message: this.$t("不能为空")}],
relation: [{ required: true, message: this.$t("请选择所属人")}],
control: [{ required: true, message: this.$t("请选择是否控货")}],
startTime: [
{ required: true, message: this.$t("有效期开始时间不能为空") },
],
endTime: [
{ required: true, message: this.$t("有效期结束时间不能为空") },
],
transportId: [{ required: true, message: this.$t("选择运输方式") }],
channelId: [{ required: true, message: this.$t("选择出货渠道") }],
stopTime: [{ required: true, message: this.$t("不能为空") }],
relation: [{ required: true, message: this.$t("请选择所属人") }],
control: [{ required: true, message: this.$t("请选择是否控货") }],
importance: [
{ required: true, message: this.$t("请选择重要程度")},
{ type: 'number', min: 1, message: this.$t("请选择重要程度")}
]
}
if(this.form.relation == 1 ){
rules.consignorId = [{ required: true, message: this.$t("发货人不能为空")}]
{ required: true, message: this.$t("请选择重要程度") },
{ type: "number", min: 1, message: this.$t("请选择重要程度") },
],
};
if (this.form.relation == 1) {
rules.consignorId = [
{ required: true, message: this.$t("发货人不能为空") },
];
// if(this.$route.query.type ==1){
// if(this.$route.query.customer.defaultContactName==null){
// rules.consignorId = [{ required: true, message: this.$t("发货人不能为空")}]
......@@ -735,86 +1137,90 @@ export default {
// rules.consignorId = [{ required: true, message: this.$t("发货人不能为空")}]
// }
}
if(this.form.relation == 2){
rules.consigneeId = [{ required: true, message: this.$t("收货人不能为空")}]
if (this.form.relation == 2) {
rules.consigneeId = [
{ required: true, message: this.$t("收货人不能为空") },
];
}
return rules
return rules;
},
exportCityList(){
return this.tradeCityList.filter(item => item.type == 2)
exportCityList() {
return this.tradeCityList.filter((item) => item.type == 2);
},
importCityList(){
return this.tradeCityList.filter(item => item.type == 1)
importCityList() {
return this.tradeCityList.filter((item) => item.type == 1);
},
getDictData(){
return (type, value) => getDictData(type, value) || {}
getDictData() {
return (type, value) => getDictData(type, value) || {};
},
// 根据线路id显示线路名称
getRouterNameById(){
return routerId => {
let router = this.routerList.find(item => item.id == routerId)
getRouterNameById() {
return (routerId) => {
let router = this.routerList.find((item) => item.id == routerId);
if(router){
return router.startTitleZh + ' > ' + router.destTitleZh
}
return '-'
if (router) {
return router.startTitleZh + " > " + router.destTitleZh;
}
return "-";
};
},
// 根据渠道id显示渠道名
getChannelNameById(){
return channelId => {
return this.channelList.find(item => item.channelId == channelId) ?. nameZh
}
getChannelNameById() {
return (channelId) => {
return this.channelList.find((item) => item.channelId == channelId)
?.nameZh;
};
},
// 当前运输方式
transport(){
return this.transportList.find(item => item.value == this.form.transportId)
transport() {
return this.transportList.find(
(item) => item.value == this.form.transportId
);
},
selectedRouter(){
selectedRouter() {
// otherService 1 送货上门,2非控货订单代收货款
if(!this.form.lineId)return null
return this.routerList.find(item => item.id == this.form.lineId)
if (!this.form.lineId) return null;
return this.routerList.find((item) => item.id == this.form.lineId);
},
currencyMap(){
let map = {}
this.currencyList.forEach(item => {
map[item.id] = this.$l(item, 'title')
})
return map
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
unitMap() {
let map = {};
this.unitList.forEach((item) => {
map[item.id] = this.$l(item, "title");
});
return map;
},
sum(){
sum() {
let sum = {
totalNum: new Decimal(0),
totalVolume: new Decimal(0),
totalWeight: new Decimal(0),
totalWorth: new Decimal(0),
totalQuatity: new Decimal(0)
}
this.form.prodCreateReqVOList.forEach(item => {
sum.totalNum = sum.totalNum.plus(item.num || 0)
sum.totalVolume = sum.totalVolume.plus(item.volume || 0)
sum.totalWeight = sum.totalWeight.plus(item.weight || 0)
sum.totalWorth = sum.totalWorth.plus(item.worth || 0)
sum.totalQuatity = sum.totalQuatity.plus(item.quantity || 0)
})
return sum
totalQuatity: new Decimal(0),
};
this.form.prodCreateReqVOList.forEach((item) => {
sum.totalNum = sum.totalNum.plus(item.num || 0);
sum.totalVolume = sum.totalVolume.plus(item.volume || 0);
sum.totalWeight = sum.totalWeight.plus(item.weight || 0);
sum.totalWorth = sum.totalWorth.plus(item.worth || 0);
sum.totalQuatity = sum.totalQuatity.plus(item.quantity || 0);
});
return sum;
},
// 总有优惠金额
couponList(){
let arr = []
this.couponAvailableGroupDtoList.forEach(item => {
if(item.couponAvailableDtoList && item.couponAvailableDtoList.length){
couponList() {
let arr = [];
this.couponAvailableGroupDtoList.forEach((item) => {
if (item.couponAvailableDtoList && item.couponAvailableDtoList.length) {
// 只取第一个
let it = item.couponAvailableDtoList[0]
let it = item.couponAvailableDtoList[0];
arr.push({
prodId: item.prodId,
type: it.type,
......@@ -823,307 +1229,370 @@ export default {
endTime: it.endTime,
reduceTotalAmount: it.reduceTotalAmount,
reduceAmount: it.reduceAmount,
reduceCurrencyId: it.reduceCurrencyId
})
reduceCurrencyId: it.reduceCurrencyId,
});
}
})
return arr
});
return arr;
},
// 计算返回的费用清单
feeDtoList(){
return this.fee.feeDtoList || []
feeDtoList() {
return this.fee.feeDtoList || [];
},
// 清关费
clearanceFeeList(){
return this.feeDtoList.filter(item => item.feeType == 2)
clearanceFeeList() {
return this.feeDtoList.filter((item) => item.feeType == 2);
},
// 运费
freightFeeList(){
return this.feeDtoList.filter(item => item.feeType == 1)
freightFeeList() {
return this.feeDtoList.filter((item) => item.feeType == 1);
},
// 原价(清关费 + 运费)
originalFeeList(){
let arr = []
this.clearanceFeeList.forEach(item => {
originalFeeList() {
let arr = [];
this.clearanceFeeList.forEach((item) => {
let it = {
src: this.$t('清关费'),
src: this.$t("清关费"),
currencyId: item.currencyId,
amount: Decimal(item.amount)
}
let freight = this.freightFeeList.find(fee => fee.currencyId == item.currencyId)
if(freight){
it.amount = it.amount.plus(freight.amount)
amount: Decimal(item.amount),
};
let freight = this.freightFeeList.find(
(fee) => fee.currencyId == item.currencyId
);
if (freight) {
it.amount = it.amount.plus(freight.amount);
}
arr.push(it)
})
arr.push(it);
});
// 判断是否有运费单位不在清关费里的
this.freightFeeList.forEach(item => {
if(!arr.find(arrItem => arrItem.currencyId == item.currencyId)){
this.freightFeeList.forEach((item) => {
if (!arr.find((arrItem) => arrItem.currencyId == item.currencyId)) {
arr.push({
src: this.$t('未计算的运费'),
src: this.$t("未计算的运费"),
currencyId: item.currencyId,
amount: Decimal(item.amount)
})
amount: Decimal(item.amount),
});
}
})
return arr
});
return arr;
},
// 预计费用(原价 - 优惠金额 + 其他费用 + 保价费)
estimatedCosts(){
let arr = []
this.originalFeeList.forEach(item => {
estimatedCosts() {
let arr = [];
this.originalFeeList.forEach((item) => {
let it = {
currencyId: item.currencyId,
amount: Decimal(item.amount)
}
let coupon = this.couponList.find(coupon => coupon.reduceCurrencyId == item.currencyId)
if(coupon){
it.amount = it.amount.minus(coupon.reduceTotalAmount)
amount: Decimal(item.amount),
};
let coupon = this.couponList.find(
(coupon) => coupon.reduceCurrencyId == item.currencyId
);
if (coupon) {
it.amount = it.amount.minus(coupon.reduceTotalAmount);
}
arr.push(it)
})
arr.push(it);
});
// 累加保价费
const insuranceFeeIndex = arr.findIndex(item => item.currencyId == this.insuranceFeeCurrency)
if(insuranceFeeIndex > -1){
arr[insuranceFeeIndex].amount = arr[insuranceFeeIndex].amount.plus(this.fee.insuranceFee || 0)
}else{
const insuranceFeeIndex = arr.findIndex(
(item) => item.currencyId == this.insuranceFeeCurrency
);
if (insuranceFeeIndex > -1) {
arr[insuranceFeeIndex].amount = arr[insuranceFeeIndex].amount.plus(
this.fee.insuranceFee || 0
);
} else {
arr.push({
currencyId: this.insuranceFeeCurrency,
amount: Decimal(this.fee.insuranceFee || 0)
})
amount: Decimal(this.fee.insuranceFee || 0),
});
}
// 累加其他费用
const otherFeeIndex = arr.findIndex(item => item.currencyId == this.form.otherFeeCurrencyId)
if(otherFeeIndex > -1){
arr[otherFeeIndex].amount = arr[otherFeeIndex].amount.plus(this.form.otherFee || 0)
}else{
if(this.form.otherFee>0){
const otherFeeIndex = arr.findIndex(
(item) => item.currencyId == this.form.otherFeeCurrencyId
);
if (otherFeeIndex > -1) {
arr[otherFeeIndex].amount = arr[otherFeeIndex].amount.plus(
this.form.otherFee || 0
);
} else {
if (this.form.otherFee > 0) {
arr.push({
currencyId: this.form.otherFeeCurrencyId,
amount: Decimal(this.form.otherFee || 0)
})
amount: Decimal(this.form.otherFee || 0),
});
}
}
return arr
return arr;
},
// 路线开通的服务
routeOtherServices(){
if(!this.selectedRouter || !this.selectedRouter.otherService) return []
return this.selectedRouter.otherService.split(',')
routeOtherServices() {
if (!this.selectedRouter || !this.selectedRouter.otherService) return [];
return this.selectedRouter.otherService.split(",");
},
// 保价费单位(路线里设置,默认美元)
insuranceFeeCurrency() {
return this.selectedRouter?.currencyUnit || 1;
},
// 是否可以添加商品
canAddProduct(){
if(!this.form.lineId){
return false
canAddProduct() {
if (!this.form.lineId) {
return false;
}
// 如果是海空联运或者空运专线则必须选择渠道
if(this.transport && this.transport.cssClass == 'channel' && !this.form.channelId ){
return false
}
return true
}
if (
this.transport &&
this.transport.cssClass == "channel" &&
!this.form.channelId
) {
return false;
}
return true;
},
},
watch:{
"form.relation": function(newVal) {
watch: {
"form.relation": function (newVal) {
this.form.standard = this.computedStandard;
},
// 始发地
'form.departureId'(){
this.getOpenedRouterList()
"form.departureId"() {
this.getOpenedRouterList();
},
// 目的地
async 'form.objectiveId'(){
await this.$nextTick()
await this.getChannelList()
this.getOpenedRouterList()
async "form.objectiveId"() {
await this.$nextTick();
await this.getChannelList();
this.getOpenedRouterList();
},
'form.transportId'(transportId, oldTransportId){
"form.transportId"(transportId, oldTransportId) {
// 海空联运默认数据
if(transportId == 4){
this.$set(this.form.transportVO, Object.assign(this.form.transportVO, {
"doubleClear":"1",
"customsClearCert":false,
"isUnpack":false,
"isSingleTicketTransport":false,
"packageTypeArr":[],
"packageType":""
}))
if (transportId == 4) {
this.$set(
this.form.transportVO,
Object.assign(this.form.transportVO, {
doubleClear: "1",
customsClearCert: false,
isUnpack: false,
isSingleTicketTransport: false,
packageTypeArr: [],
packageType: "",
})
);
}
this.getOpenedRouterList()
this.getOpenedRouterList();
// 更换运输方式之后,之前选择的路线会失效,需要重新选择
if(oldTransportId && oldTransportId != transportId && transportId != this.selectedRouter?.transportType){
console.log('重置路线',oldTransportId, transportId, this.selectedRouter?.transportType)
this.$set(this.form, 'lineId', undefined)
if (
oldTransportId &&
oldTransportId != transportId &&
transportId != this.selectedRouter?.transportType
) {
console.log(
"重置路线",
oldTransportId,
transportId,
this.selectedRouter?.transportType
);
this.$set(this.form, "lineId", undefined);
}
},
async 'form.channelId'(){
await this.getTradeCity()
this.getOpenedRouterList()
this.calculationPrice('form.channelId')
async "form.channelId"() {
await this.getTradeCity();
this.getOpenedRouterList();
this.calculationPrice("form.channelId");
},
async 'form.lineId'(lineId){
let router = this.routerList.find(item => item.id == lineId)
if(router){
this.$set(this.form, 'departureId', router.startCityId)
this.$set(this.form, 'objectiveId', router.destCityId)
async "form.lineId"(lineId) {
let router = this.routerList.find((item) => item.id == lineId);
if (router) {
this.$set(this.form, "departureId", router.startCityId);
this.$set(this.form, "objectiveId", router.destCityId);
}
await this.$nextTick()
await this.getChannelList()
await this.getTradeCity()
await this.calculationPrice('form.lineId')
await this.$nextTick();
await this.getChannelList();
await this.getTradeCity();
await this.calculationPrice("form.lineId");
},
'form.transportVO.packageTypeArr'(val){
this.$set(this.form.transportVO, 'packageType', (val || []).join(','))
"form.transportVO.packageTypeArr"(val) {
this.$set(this.form.transportVO, "packageType", (val || []).join(","));
},
// 选择的路线变化后,需要判断是否开通了对应的服务,如果没开通需要取消对应的服务选择
selectedRouter(val){
if(!val) return
['1', '4'].forEach(service => {
if(this.routeOtherServices.indexOf(service) < 0 && this.form.type.indexOf(service) > -1){
this.form.type.splice(this.form.type.findIndex(item => item == service), 1)
}
})
selectedRouter(val) {
if (!val) return;
["1", "4"].forEach((service) => {
if (
this.routeOtherServices.indexOf(service) < 0 &&
this.form.type.indexOf(service) > -1
) {
this.form.type.splice(
this.form.type.findIndex((item) => item == service),
1
);
}
});
},
activated(){
if(this.form.offerId != this.$route.query.id){
this.getOffer()
},
activated() {
if (this.form.offerId != this.$route.query.id) {
this.getOffer();
}
},
async created() {
await this.getChannelList()
await this.getTradeCity()
getProductAttrList().then(res => this.productAttrList = res.data)
getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data)
this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE)
if(this.$route.query.id){
this.getOffer()
}else {
await this.getChannelList();
await this.getTradeCity();
getProductAttrList().then((res) => (this.productAttrList = res.data));
getCurrencyList().then((res) => (this.currencyList = res.data));
getUnitList().then((res) => (this.unitList = res.data));
this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE);
if (this.$route.query.id) {
this.getOffer();
} else {
// alert(this.$route.query.customer.defaultContactPhone)
this.addProduct()
this.addProduct();
}
},
methods: {
async getChannelList(){
async getChannelList() {
let query = {
cityId: this.form.objectiveId,
lineId: this.form.lineId
}
this.channelList = (await getChannelList(query)).data || []
lineId: this.form.lineId,
};
this.channelList = (await getChannelList(query)).data || [];
},
async getTradeCity(){
let query = {}
if(this.form.channelId){
query.channelId = this.form.channelId
async getTradeCity() {
let query = {};
if (this.form.channelId) {
query.channelId = this.form.channelId;
}
this.tradeCityList = (await getTradeCityList(query)).data || []
this.tradeCityList = (await getTradeCityList(query)).data || [];
},
getOffer(){
getOffer() {
//加了是否从全部客户列表中报价按钮进来的判断
if(this.$route.query !==1){
getOffer(this.$route.query.id).then(res => {
let formData = res.data
formData.type = formData.type ? formData.type.split(',').filter(item => item != '') : []
formData.prodCreateReqVOList = []
if(formData.transportVO && formData.transportVO.packageType){
formData.transportVO.packageTypeArr = formData.transportVO.packageType.split(",").filter(item => item && item != '')
}
if(res.data.offerProdRespVOList){
res.data.offerProdRespVOList.forEach(item => {
if (this.$route.query !== 1) {
getOffer(this.$route.query.id).then((res) => {
let formData = res.data;
formData.type = formData.type
? formData.type.split(",").filter((item) => item != "")
: [];
formData.prodCreateReqVOList = [];
if (formData.transportVO && formData.transportVO.packageType) {
formData.transportVO.packageTypeArr =
formData.transportVO.packageType
.split(",")
.filter((item) => item && item != "");
}
if (res.data.offerProdRespVOList) {
res.data.offerProdRespVOList.forEach((item) => {
formData.prodCreateReqVOList.push({
"goodsType": item.goodsType,
"brand": item.brand,
"unit": item.unit,
"channelId": item.channelId,
"lineId": item.lineId,
"prodId": item.prodId,
"num": item.num,
"quantity": item.quantity,
"boxGauge": item.boxGauge,
"volume": item.volume,
"transportId": item.transportId,
"weight": item.weight,
"worth": item.worth,
"prodAttrArr": item.prodAttrIds && item.prodAttrIds != '' ? item.prodAttrIds.split(',').filter(item => item != '').map(item => +item) : []
})
})
goodsType: item.goodsType,
brand: item.brand,
unit: item.unit,
channelId: item.channelId,
lineId: item.lineId,
prodId: item.prodId,
num: item.num,
quantity: item.quantity,
boxGauge: item.boxGauge,
volume: item.volume,
transportId: item.transportId,
weight: item.weight,
worth: item.worth,
prodAttrArr:
item.prodAttrIds && item.prodAttrIds != ""
? item.prodAttrIds
.split(",")
.filter((item) => item != "")
.map((item) => +item)
: [],
});
});
}
this.$set(this, 'form', formData)
this.$set(this, "form", formData);
// 接口只返回了发货人和收货人ID,还需要调用接口获取详细信息回显
getCustomerContactsSelect({ids: [res.data.consigneeId, res.data.consignorId].join(',')}).then(({data}) => {
this.contactChooseType = 'consignee'
this.onContactChoose(data.list.find(item => item.customerContactsId == res.data.consigneeId))
this.contactChooseType = 'consignor'
this.onContactChoose(data.list.find(item => item.customerContactsId == res.data.consignorId))
})
})
getCustomerContactsSelect({
ids: [res.data.consigneeId, res.data.consignorId].join(","),
}).then(({ data }) => {
this.contactChooseType = "consignee";
this.onContactChoose(
data.list.find(
(item) => item.customerContactsId == res.data.consigneeId
)
);
this.contactChooseType = "consignor";
this.onContactChoose(
data.list.find(
(item) => item.customerContactsId == res.data.consignorId
)
);
});
});
}
},
onContactChoose(contact){
if(!contact) return
if(!this.contactChooseType && !this.quickCreateType) return
if(!this.contactChooseType && this.quickCreateType){
this.contactChooseType = this.quickCreateType == 0 ? 'consignor' : 'consignee'
}
this.$set(this.form, this.contactChooseType + 'Company', contact.company)
this.$set(this.form, this.contactChooseType + 'Id', contact.customerContactsId)
this.$set(this.form, this.contactChooseType + 'CountryCode', contact.areaCode)
this.$set(this.form, this.contactChooseType + 'Email', contact.email)
onContactChoose(contact) {
if (!contact) return;
if (!this.contactChooseType && !this.quickCreateType) return;
if (!this.contactChooseType && this.quickCreateType) {
this.contactChooseType =
this.quickCreateType == 0 ? "consignor" : "consignee";
}
this.$set(this.form, this.contactChooseType + "Company", contact.company);
this.$set(
this.form,
this.contactChooseType + "Id",
contact.customerContactsId
);
this.$set(
this.form,
this.contactChooseType + "CountryCode",
contact.areaCode
);
this.$set(this.form, this.contactChooseType + "Email", contact.email);
// this.$set(this.form, this.contactChooseType + 'Id', contact.customerId)
this.$set(this.form, this.contactChooseType + 'Name', contact.contactsName)
this.$set(this.form, this.contactChooseType + 'Phone', contact.phoneNew)
this.contactChooseType = null
this.quickCreateType = null
this.$set(
this.form,
this.contactChooseType + "Name",
contact.contactsName
);
this.$set(this.form, this.contactChooseType + "Phone", contact.phoneNew);
this.contactChooseType = null;
this.quickCreateType = null;
},
onProductChange(row, product){
onProductChange(row, product) {
// row.goodsType = product ? product.typeId : null
row.prodAttrArr = !product ? [] : product.attrId.split(',').filter(item => item !== '').map(item => +item)
if(product){
row.prodAttrArr = !product
? []
: product.attrId
.split(",")
.filter((item) => item !== "")
.map((item) => +item);
if (product) {
this.$set(this.productNames, product.id, {
titleZh: product.titleZh,
titleEn: product.titleEn
})
titleEn: product.titleEn,
});
}
this.calculationPrice('onProductChange')
this.calculationPrice("onProductChange");
},
/* onLineChange(row){
this.calculationPrice()
// this.updateEnabledTransports()
}, */
onChannelChange(row){
this.calculationPrice('onChannelChange')
onChannelChange(row) {
this.calculationPrice("onChannelChange");
},
onProductAttrChange(row, attr){
this.calculationPrice('onProductAttrChange')
onProductAttrChange(row, attr) {
this.calculationPrice("onProductAttrChange");
},
addProduct(data){
this.form.prodCreateReqVOList.push(data || {prodAttrArr:[]})
addProduct(data) {
this.form.prodCreateReqVOList.push(data || { prodAttrArr: [] });
},
// 计算商品运费
/* getProductFee(row){
......@@ -1136,223 +1605,240 @@ export default {
})
}, */
// 获取路线
getOpenedRouterList(){
let params = {}
if(this.form.departureId){
params.startCityId = this.form.departureId
getOpenedRouterList() {
let params = {};
if (this.form.departureId) {
params.startCityId = this.form.departureId;
}
if(this.form.objectiveId){
params.destCityId = this.form.objectiveId
if (this.form.objectiveId) {
params.destCityId = this.form.objectiveId;
}
if(this.form.transportId){
params.transportType = this.form.transportId
if (this.form.transportId) {
params.transportType = this.form.transportId;
}
if(this.form.channelId){
params.channelId = this.form.channelId
if (this.form.channelId) {
params.channelId = this.form.channelId;
}
// 如果没有任何条件,不请求接口
if(!params.startCityId && !params.destCityId && !params.transportType && !params.channelId) return false
getOpenedRouterList(params).then(res => this.routerList = res.data)
if (
!params.startCityId &&
!params.destCityId &&
!params.transportType &&
!params.channelId
)
return false;
getOpenedRouterList(params).then((res) => (this.routerList = res.data));
},
// 计算体积
calcVolume(row){
if(!row.boxGauge || !row.num) return false
try{
row.volume = (eval(row.boxGauge) * row.num).toFixed(2)
}catch(e){
row.volume = ''
calcVolume(row) {
if (!row.boxGauge || !row.num) return false;
try {
row.volume = (eval(row.boxGauge) * row.num).toFixed(2);
} catch (e) {
row.volume = "";
}
},
// 删除一条产品
delProduct(index){
this.$confirm(this.$t('确定删除此条内容么?'))
.then(res => {
this.form.prodCreateReqVOList.splice(index, 1)
})
delProduct(index) {
this.$confirm(this.$t("确定删除此条内容么?")).then((res) => {
this.form.prodCreateReqVOList.splice(index, 1);
});
},
/** 提交按钮 */
submitForm(status) {
this.$refs["form"].validate((valid, errors) => {
if (!valid) {
return this.$showFormValidateErrors(errors)
return this.$showFormValidateErrors(errors);
}
this.form.prodCreateReqVOList.map(item => {
item.prodAttrIds = item.prodAttrArr.join(',')
item.lineId = this.form.lineId
item.channelId = this.form.channelId
item.transportId = this.form.transportId
})
this.form.prodCreateReqVOList.map((item) => {
item.prodAttrIds = item.prodAttrArr.join(",");
item.lineId = this.form.lineId;
item.channelId = this.form.channelId;
item.transportId = this.form.transportId;
});
if(this.form.transportVO?.packageTypeArr){
this.form.transportVO.packageType = this.form.transportVO.packageTypeArr.join(',')
if (this.form.transportVO?.packageTypeArr) {
this.form.transportVO.packageType =
this.form.transportVO.packageTypeArr.join(",");
}
let endTime = new Date(this.form.endTime)
let startTime = new Date(this.form.startTime)
let endTime = new Date(this.form.endTime);
let startTime = new Date(this.form.startTime);
if(endTime.getTime()<startTime.getTime()){
return this.$message.error(this.$t('价格有效结束时间不能小于开始时间'));
if (endTime.getTime() < startTime.getTime()) {
return this.$message.error(
this.$t("价格有效结束时间不能小于开始时间")
);
}
let time2 = new Date().setDate(new Date().getDate() + 30) ;
let time2 = new Date().setDate(new Date().getDate() + 30);
if(endTime> time2){
return this.$message.error(this.$t('价格有效结束时间不能超过当前时间30天'));
if (endTime > time2) {
return this.$message.error(
this.$t("价格有效结束时间不能超过当前时间30天")
);
}
// 修改的提交
if (this.form.offerId != null) {
let data = Object.assign({}, this.form, {
// transportUpdateReqVOList: this.transportList.filter(item => item._enabled),
prodUpdateReqVOList: this.getProductListWithDefaultValue()
})
if(data.status < 3){
data.status = status
prodUpdateReqVOList: this.getProductListWithDefaultValue(),
});
if (data.status < 3) {
data.status = status;
}
updateOffer(data).then(response => {
updateOffer(data).then((response) => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.$redirect('index')
this.$redirect("index");
});
return;
}
let data =null ;
if(this.$route.query.type ==1){
console.log(JSON.stringify(this.contactsList))
let data = null;
if (this.$route.query.type == 1) {
console.log(JSON.stringify(this.contactsList));
data = Object.assign({}, this.form, {
prodCreateReqVOList: this.getProductListWithDefaultValue(),
consignorId: this.$route.query.customer.defaultContactId,
status
})
status,
});
// data.consignorId = contacts.customerContactsId
}else{
} else {
data = Object.assign({}, this.form, {
prodCreateReqVOList: this.getProductListWithDefaultValue(),
status
})
status,
});
}
// 添加的提交
createOffer(data).then(response => {
createOffer(data).then((response) => {
// 重置表单内容
this.$set(this, 'form', {...createDefaultForm()})
this.routerList = []
this.$set(this, "form", { ...createDefaultForm() });
this.routerList = [];
this.$nextTick(() => {
console.log('清理表单校验和路线')
this.addProduct()
this.$refs.form.clearValidate()
})
console.log("清理表单校验和路线");
this.addProduct();
this.$refs.form.clearValidate();
});
this.$modal.msgSuccess(this.$t("新增成功"));
this.$redirect('index')
this.$redirect("index");
});
});
},
setLink(row){
this.$prompt(this.$t('请输入商品链接'), {inputValue: row.link}).then(({value}) => {
this.$set(row, 'link', value)
})
setLink(row) {
this.$prompt(this.$t("请输入商品链接"), { inputValue: row.link }).then(
({ value }) => {
this.$set(row, "link", value);
}
);
},
// 计算商品运费
calculationPrice(tag){
let calcable = true
if(!this.form.prodCreateReqVOList.length) return
this.form.prodCreateReqVOList.forEach(item => {
if(!item.prodId){
console.log('产品未选择', item)
calcable = false
}
item.brandType = item.brand
})
if(this.calculating || !calcable){
console.log('不满足费用计算条件,清空已获取的费用信息')
this.form.prodCreateReqVOList.forEach(item => {
delete item.fee
})
this.fee = {}
return false
calculationPrice(tag) {
let calcable = true;
if (!this.form.prodCreateReqVOList.length) return;
this.form.prodCreateReqVOList.forEach((item) => {
if (!item.prodId) {
console.log("产品未选择", item);
calcable = false;
}
item.brandType = item.brand;
});
if (this.calculating || !calcable) {
console.log("不满足费用计算条件,清空已获取的费用信息");
this.form.prodCreateReqVOList.forEach((item) => {
delete item.fee;
});
this.fee = {};
return false;
}
this.calculating = true
this.calculating = true;
console.log('calculationPrice')
console.log("calculationPrice");
calculationPrice({
lineId: this.form.lineId,
transportId: this.form.transportId,
channelId: [3,4].indexOf(this.form.transportId) > -1 ? this.form.channelId : undefined,
channelId:
[3, 4].indexOf(this.form.transportId) > -1
? this.form.channelId
: undefined,
prodConditionParamList: this.getProductListWithDefaultValue(),
consigneeCustomerContactsId: this.form.consigneeCustomerContactsId,
consignorCustomerContactsId: this.form.consignorCustomerContactsId,
customsType: this.form.customsType,
isCargoControl: this.form.control,
orderType: this.form.orderType,
}).then(res => {
this.$set(this, 'fee', res.data.costDto)
if(res.data.availableDto){
this.$set(this, 'couponTotalAmountList', res.data.availableDto.couponTotalAmountList)
this.$set(this, 'couponAvailableGroupDtoList', res.data.availableDto.couponAvailableGroupDtoList)
})
.then((res) => {
this.$set(this, "fee", res.data.costDto);
if (res.data.availableDto) {
this.$set(
this,
"couponTotalAmountList",
res.data.availableDto.couponTotalAmountList
);
this.$set(
this,
"couponAvailableGroupDtoList",
res.data.availableDto.couponAvailableGroupDtoList
);
}
this.form.prodCreateReqVOList.map((item, index) => {
this.$set(item, 'fee', res.data.prodCostDtoList[index] || null)
})
}).finally(() => {
this.calculating = false
this.$set(item, "fee", res.data.prodCostDtoList[index] || null);
});
})
.finally(() => {
this.calculating = false;
});
},
// 体积。件数,数量,重量为选填,但是接口确实必填,所以生成一个副本并赋予默认值
getProductListWithDefaultValue(){
let arr = []
this.form.prodCreateReqVOList.forEach(item => {
let tmp = {...item}
tmp.prodAttrIds = tmp.prodAttrArr.join(',')
if(!tmp.volume)tmp.volume = 0
if(!tmp.weight)tmp.weight = 0
if(!tmp.quantity)tmp.quantity = 0
if(!tmp.num)tmp.num = 0
if(!tmp.worth)tmp.worth = 0
arr.push(tmp)
})
return arr
}
}
getProductListWithDefaultValue() {
let arr = [];
this.form.prodCreateReqVOList.forEach((item) => {
let tmp = { ...item };
tmp.prodAttrIds = tmp.prodAttrArr.join(",");
if (!tmp.volume) tmp.volume = 0;
if (!tmp.weight) tmp.weight = 0;
if (!tmp.quantity) tmp.quantity = 0;
if (!tmp.num) tmp.num = 0;
if (!tmp.worth) tmp.worth = 0;
arr.push(tmp);
});
return arr;
},
},
};
</script>
<style lang="scss" scoped>
.card-title{
.card-title {
font-size: 18px;
display: flex;
.card-name{
.card-name {
flex: 1;
}
}
.form-section{
.contact{
.form-section {
.contact {
display: flex;
align-items: center;
img.phonebook{
img.phonebook {
width: 30px;
height: 30px;
margin-left: 10px;
cursor: pointer;
}
}
}
::v-deep .product-list .el-form-item__error{
::v-deep .product-list .el-form-item__error {
position: static;
}
::v-deep th.el-table__cell .cell{
::v-deep th.el-table__cell .cell {
white-space: nowrap;
.red{
.red {
color: red;
}
}
......
......@@ -694,7 +694,8 @@ export default {
components: {
ImageDisplay,
OperateLogDetail,
PrintWarehouseReceipt, PrintLadingBill, WarehouseDetail, WarehouseAreaSelect,DeclarationDocuments,
PrintWarehouseReceipt, PrintLadingBill,
WarehouseDetail, WarehouseAreaSelect,DeclarationDocuments,
FeeDetail,PackHistory,PackHistoryDetail
},
filters: {
......
......@@ -626,7 +626,7 @@
</div>
</el-dialog>
<choose-contact-dialog v-if="!!contactChooseType" @choose="onContactChoose" @close="contactChooseType=null" />
<choose-contact-dialog v-if="!!contactChooseType" :type="2" @choose="onContactChoose" @close="contactChooseType=null" />
<quick-create-customer v-if="quickCreateType" :type="quickCreateType" @success="onContactChoose" @close="quickCreateType=null" />
</div>
</template>
......
......@@ -4,83 +4,97 @@
<order-base-info :order="order"></order-base-info>
<div style="margin-top: 20px;display: none">
<span>{{$t('储位')}}{{ ($refs.area ? $refs.area.selected : []).join(',') }}</span>
<el-button type="primary" size="mini" @click="areaVisible = true" style="margin-left: 15px">{{$t('选择')}}</el-button>
<div style="margin-top: 20px; display: none">
<span
>{{ $t("储位") }}{{
($refs.area ? $refs.area.selected : []).join(",")
}}</span
>
<el-button
type="primary"
size="mini"
@click="areaVisible = true"
style="margin-left: 15px"
>{{ $t("选择") }}</el-button
>
</div>
<h2>{{$t('货物信息')}}</h2>
<h2>{{ $t("货物信息") }}</h2>
<el-table
v-if="order.orderItemVOList && order.orderItemVOList.length > 0 && orderItemList && orderItemList.length > 0"
v-if="
order.orderItemVOList &&
order.orderItemVOList.length > 0 &&
orderItemList &&
orderItemList.length > 0
"
:data="order.orderItemVOList || []"
style="width: 100%">
<el-table-column
type="index"
width="50"
:label="$t('序号')">
style="width: 100%"
>
<el-table-column type="index" width="50" :label="$t('序号')">
</el-table-column>
<el-table-column
prop="prodTitleZh"
:label="$t('品名')">
<template v-slot="{row}">
{{ row.prodTitleZh }}<br>
<el-table-column prop="prodTitleZh" :label="$t('品名')">
<template v-slot="{ row }">
{{ row.prodTitleZh }}<br />
{{ row.prodTitleEn }}
</template>
</el-table-column>
<el-table-column
:label="$t('填单货物属性')">
<template v-slot="{row}">
<span v-if="row.isWarehouseInAdd">{{$t('非填单货物信息')}}</span>
<el-table-column :label="$t('填单货物属性')">
<template v-slot="{ row }">
<span v-if="row.isWarehouseInAdd">{{ $t("非填单货物信息") }}</span>
<template v-else>
{{$t('品牌')}}{{ [$t('无牌'), $t('有牌'), $t('中性')][row.brandType] }}<br>
{{$t('箱数')}}{{ row.num }}<br>
{{$t('体积')}}{{ row.volume }}<br>
{{$t('重量')}}{{ row.weight }}Kg
{{ $t("品牌") }}{{
[$t("无牌"), $t("有牌"), $t("中性")][row.brandType]
}}<br />
{{ $t("箱数") }}{{ row.num }}<br />
{{ $t("体积") }}{{ row.volume }}<br />
{{ $t("重量") }}{{ row.weight }}Kg
</template>
</template>
</el-table-column>
<el-table-column
:label="$t('入库货物属性')">
<template v-slot="{row}">
<el-table-column :label="$t('入库货物属性')">
<template v-slot="{ row }">
<template v-if="row.warehouseInInfoVO">
{{$t('品牌')}}{{ row.brandName }}<br>
{{$t('箱数')}}{{ row.warehouseInInfoVO.cartonsNum }}<br>
{{$t('体积')}}{{ row.warehouseInInfoVO.volume }}<br>
{{$t('重量')}}{{ row.warehouseInInfoVO.weight }}Kg
{{ $t("品牌") }}{{ row.brandName }}<br />
{{ $t("箱数") }}{{ row.warehouseInInfoVO.cartonsNum }}<br />
{{ $t("体积") }}{{ row.warehouseInInfoVO.volume }}<br />
{{ $t("重量") }}{{ row.warehouseInInfoVO.weight }}Kg
</template>
<span v-else>{{$t('暂无入仓信息')}}</span>
<span v-else>{{ $t("暂无入仓信息") }}</span>
</template>
</el-table-column>
<el-table-column
prop="expressNo"
v-slot="{row}"
:label="$t('快递单号')">
{{ row.expressNo || (row.warehouseInInfoVO ? row.warehouseInInfoVO.expressNo : '') }}
v-slot="{ row }"
:label="$t('快递单号')"
>
{{
row.expressNo ||
(row.warehouseInInfoVO ? row.warehouseInInfoVO.expressNo : "")
}}
</el-table-column>
<el-table-column
prop="createTime"
:label="$t('最后操作时间')">
<template v-slot="{row}">
<el-table-column prop="createTime" :label="$t('最后操作时间')">
<template v-slot="{ row }">
{{ parseTime(row.updateTime) }}
</template>
</el-table-column>
<el-table-column
prop="diffType"
v-slot="{row}"
:label="$t('状态')">
<el-table-column prop="diffType" v-slot="{ row }" :label="$t('状态')">
<dict-tag
v-if="row.warehouseInInfoVO && row.warehouseInInfoVO.diffType"
:type="DICT_TYPE.ORDER_WAREHOUSE_IN_STATUS"
:value="row.warehouseInInfoVO.diffType"
class="red"
:class="{green: row.warehouseInInfoVO.diffType === 4}"
:class="{ green: row.warehouseInInfoVO.diffType === 4 }"
/>
<span :class="{red: row.itemStatus === 3}" v-else>{{ row.itemStatus === 3 ? ($t('少了') + row.num + $t('箱')) : $t('待入仓') }}</span>
<span class="red" v-if="row.warehouseInInfoVO && row.warehouseInInfoVO.cartonsNumDiff">{{ row.warehouseInInfoVO.cartonsNumDiff }}{{$t('箱')}}</span>
<span :class="{ red: row.itemStatus === 3 }" v-else>{{
row.itemStatus === 3 ? $t("少了") + row.num + $t("箱") : $t("待入仓")
}}</span>
<span
class="red"
v-if="row.warehouseInInfoVO && row.warehouseInInfoVO.cartonsNumDiff"
>{{ row.warehouseInInfoVO.cartonsNumDiff }}{{ $t("箱") }}</span
>
</el-table-column>
<el-table-column
prop="address"
:label="$t('操作')">
<el-table-column prop="address" :label="$t('操作')">
<template v-slot="{ row, column, $index }">
<warehouse
v-if="isEdit"
......@@ -89,21 +103,32 @@
:order-item-b="orderItemList[$index]"
:title="$t('修改')"
:order="order"
@close="getList"></warehouse>
<template v-else-if="
wareItem(row.orderItemId)
&& wareItem(row.orderItemId).orderWarehouseInBackItemDoList
&& wareItem(row.orderItemId).orderWarehouseInBackItemDoList.length > 0">
<!-- <template v-if="!order.parentOrderId">-->
@close="getList"
></warehouse>
<template
v-else-if="
wareItem(row.orderItemId) &&
wareItem(row.orderItemId).orderWarehouseInBackItemDoList &&
wareItem(row.orderItemId).orderWarehouseInBackItemDoList.length >
0
"
>
<!-- <template v-if="!order.parentOrderId">-->
<warehouse
v-if="!isEdit"
:order-item-a="order.orderItemVOList[$index]"
:order-item-b="orderItemList[$index]"
:title="$t('追加')"
:order="order"
@close="getList"></warehouse>
<el-button size="mini" type="text" @click="handleWarehousingReturn(row)">{{$t('退仓')}}</el-button>
<!-- </template>-->
@close="getList"
></warehouse>
<el-button
size="mini"
type="text"
@click="handleWarehousingReturn(row)"
>{{ $t("退仓") }}</el-button
>
<!-- </template>-->
</template>
<warehouse
v-else
......@@ -111,88 +136,182 @@
:order-item-b="orderItemList[$index]"
:title="$t('入仓')"
:order="order"
@close="getList"></warehouse>
@close="getList"
></warehouse>
</template>
</el-table-column>
</el-table>
<el-card v-if="order.parentOrderId" style="margin-top: 20px">
<div slot="header" class="clearfix">
<span style="font-size: 18px">{{$t('标签箱号')}}</span>
<span style="font-size: 18px">{{ $t("标签箱号") }}</span>
</div>
<div v-for="(item, index) in label.orderLabelDtoList" :key="index" style="margin-bottom: 10px">
<el-input-number v-model="item.start" controls-position="right"></el-input-number> -
<el-input-number v-model="item.end" controls-position="right"></el-input-number>
<el-button icon="el-icon-minus" circle v-show="index !== 0" @click="label.orderLabelDtoList.splice(index, 1)" style="margin-left: 10px"></el-button>
<el-button icon="el-icon-plus" circle @click="handleLabelAdd(index)"></el-button>
<div
v-for="(item, index) in label.orderLabelDtoList"
:key="index"
style="margin-bottom: 10px"
>
<el-input-number
v-model="item.start"
controls-position="right"
></el-input-number>
-
<el-input-number
v-model="item.end"
controls-position="right"
></el-input-number>
<el-button
icon="el-icon-minus"
circle
v-show="index !== 0"
@click="label.orderLabelDtoList.splice(index, 1)"
style="margin-left: 10px"
></el-button>
<el-button
icon="el-icon-plus"
circle
@click="handleLabelAdd(index)"
></el-button>
</div>
<div style="text-align: center">
<el-button type="primary" @click="handleLabelSubmit">{{$t('修改箱号')}}</el-button>
<el-button type="primary" @click="handleLabelSubmit">{{
$t("修改箱号")
}}</el-button>
</div>
</el-card>
<h2 v-if="orderSpecialNeeds.length > 0">{{$t('特殊需求')}}</h2>
<h2 v-if="orderSpecialNeeds.length > 0">{{ $t("特殊需求") }}</h2>
<el-form ref="form" :model="form" label-width="200px">
<el-form-item :label="$i18n.locale === 'en_US' ? item.labelEn : item.label" v-for="(item, index) in orderSpecialNeeds" :key="item.value" style="width: 600px">
<el-input-number v-model="form.orderSpecialNeedReceivableReqVoList[index].receivableMoney" type="number" :min="0" step-strictly :placeholder="$t('请输入') + ($i18n.locale === 'en_US' ? item.labelEn : item.label)"></el-input-number>
<el-select v-model="form.orderSpecialNeedReceivableReqVoList[index].receivableMoneyCurrency" :placeholder="$t('请选择')" style="width: 100px">
<el-form-item
:label="$i18n.locale === 'en_US' ? item.labelEn : item.label"
v-for="(item, index) in orderSpecialNeeds"
:key="item.value"
style="width: 600px"
>
<el-input-number
v-model="
form.orderSpecialNeedReceivableReqVoList[index].receivableMoney
"
type="number"
:min="0"
step-strictly
:placeholder="
$t('请输入') +
($i18n.locale === 'en_US' ? item.labelEn : item.label)
"
></el-input-number>
<el-select
v-model="
form.orderSpecialNeedReceivableReqVoList[index]
.receivableMoneyCurrency
"
:placeholder="$t('请选择')"
style="width: 100px"
>
<el-option
v-for="item in currencyList"
:key="item.id"
:label="$i18n.locale === 'en_US' ? item.titleEn : item.titleZh"
:value="item.id">
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<h2>{{$t('订单数据')}}</h2>
<h2>{{ $t("订单数据") }}</h2>
<el-form-item :label="$t('总方数')" style="width: 380px">
<el-input v-model="form.sumVolume" :placeholder="$t('请输入总方数')" readonly>
<el-input
v-model="form.sumVolume"
:placeholder="$t('请输入总方数')"
readonly
>
<span slot="append"></span>
</el-input>
</el-form-item>
<el-form-item :label="$t('总重量')" style="width: 380px">
<el-input v-model="form.sumWeight" :placeholder="$t('请输入总重量')" readonly>
<el-input
v-model="form.sumWeight"
:placeholder="$t('请输入总重量')"
readonly
>
<span slot="append">kg</span>
</el-input>
</el-form-item>
<el-card style="margin-top: 15px;">
<el-card style="margin-top: 15px">
<div slot="header" class="clearfix">
<span style="font-size: 18px">{{$t('入仓影像')}}</span>
<span style="font-size: 18px">{{ $t("入仓影像") }}</span>
</div>
<div>
<image-and-video-upload readonly :fileSize="50" :isShowTip="true" :value="form.urls" ></image-and-video-upload>
<image-and-video-upload
readonly
:fileSize="50"
:isShowTip="true"
:value="form.urls"
></image-and-video-upload>
</div>
</el-card>
<div style="text-align: center;margin-top: 15px" v-if="!(order.status !== 3 && isEdit)">
<el-button @click="escapeBol = true;" type="primary">{{$t('转异')}}</el-button>
<el-button type="primary" @click="finishVisible = true">{{$t('完成入仓')}}</el-button>
<div
style="text-align: center; margin-top: 15px"
v-if="!(order.status !== 3 && isEdit)"
>
<el-button @click="escapeBol = true" type="primary">{{
$t("转异")
}}</el-button>
<el-button type="primary" @click="finishVisible = true">{{
$t("完成入仓")
}}</el-button>
</div>
</el-form>
<warehouse-area-dialog ref="area" :visible.sync="areaVisible" v-model="form.orderLocationCreateReqVOList"
:order-id="orderId" :warehouse-id="warehouseId" :is-editing="isEdit"></warehouse-area-dialog>
<warehouse-area-dialog
ref="area"
:visible.sync="areaVisible"
v-model="form.orderLocationCreateReqVOList"
:order-id="orderId"
:warehouse-id="warehouseId"
:is-editing="isEdit"
></warehouse-area-dialog>
<!-- 完成入仓 -->
<!-- 完成入仓 -->
<el-dialog
:title="$t('确认入仓')"
:visible.sync="finishVisible"
width="300px">
<div style="text-align: center">{{$t('在完成入仓前,您还可以')}}</div>
<div style="text-align: center;padding: 15px 0">
<!-- <el-button type="info" @click="areaVisible = true">{{$t('选择储位')}}</el-button>-->
<el-button type="info" @click="isShowPrintTag = true">{{$t('打印标签')}}</el-button>
width="300px"
>
<div style="text-align: center">{{ $t("在完成入仓前,您还可以") }}</div>
<div style="text-align: center; padding: 15px 0">
<!-- <el-button type="info" @click="areaVisible = true">{{$t('选择储位')}}</el-button>-->
<el-button type="info" @click="isShowPrintTag = true">{{
$t("打印标签")
}}</el-button>
</div>
<div style="text-align: center">
<el-button type="primary" @click="handleSubmit()">{{$t('确 定')}}</el-button>
<el-button type="primary" @click="handleSubmit()">{{
$t("确 定")
}}</el-button>
</div>
</el-dialog>
<el-dialog :title="order.orderNo + $t('订单转异')" center :visible.sync="escapeBol">
<el-form label-position="top" label-width="200" ref="exceptionForm" :model="form" :rules="exceptionRules">
<el-dialog
:title="order.orderNo + $t('订单转异')"
center
:visible.sync="escapeBol"
>
<el-form
label-position="top"
label-width="200"
ref="exceptionForm"
:model="form"
:rules="exceptionRules"
>
<el-form-item :label="$t('原因类型')" prop="manualExceptionType">
<dict-selector v-model="form.manualExceptionType" form-type="checkbox" :type="DICT_TYPE.MANUAL_EXCEPTION_TYPE" multiple ></dict-selector>
<dict-selector
v-model="form.manualExceptionType"
form-type="checkbox"
:type="DICT_TYPE.MANUAL_EXCEPTION_TYPE"
multiple
></dict-selector>
</el-form-item>
<el-form-item :label="$t('附件')">
<image-upload v-model="form.exceptionUrls"></image-upload>
......@@ -202,39 +321,51 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleException">{{$t('确认并完成入仓')}}</el-button>
<el-button @click="escapeBol = false">{{$t('取消')}}</el-button>
<el-button type="primary" @click="handleException">{{
$t("确认并完成入仓")
}}</el-button>
<el-button @click="escapeBol = false">{{ $t("取消") }}</el-button>
</span>
</el-dialog>
<print-tag v-if="isShowPrintTag" :order-id="orderId" @close="isShowPrintTag = false"></print-tag>
<print-tag
v-if="isShowPrintTag"
:order-id="orderId"
@close="isShowPrintTag = false"
></print-tag>
<print-warehouse-receipt v-if="isShowPrint" :order-id="orderId" @close="isShowPrint = false" />
<print-warehouse-receipt
v-if="isShowPrint"
:order-id="orderId"
@close="isShowPrint = false"
/>
</div>
</template>
<script>
import {getCurrencyList} from "@/api/ecw/currency"
import { getCurrencyList } from "@/api/ecw/currency";
import {
getLabelByOrder, getLabelWaitInByOrder,
getLabelByOrder,
getLabelWaitInByOrder,
getOrder,
getOrderWarehouseIn,
getSpecialListByOrderId, listByOrderId,
orderWarehouseInFinish, orderWarehouseInUpdateLabel,
rollbackDelete, warehousePictureList
} from '@/api/ecw/order'
import orderBaseInfo from "@/components/OrderBaseInfo"
import WarehouseAreaDialog from '@/components/WarehouseAreaDialog'
import {DICT_TYPE} from "@/utils/dict"
import PrintTag from "@/views/ecw/order/components/PrintTag"
import PrintWarehouseReceipt from "@/views/ecw/order/components/PrintWarehouseReceipt"
getSpecialListByOrderId,
listByOrderId,
orderWarehouseInFinish,
orderWarehouseInUpdateLabel,
rollbackDelete,
warehousePictureList,
} from "@/api/ecw/order";
import orderBaseInfo from "@/components/OrderBaseInfo";
import WarehouseAreaDialog from "@/components/WarehouseAreaDialog";
import { DICT_TYPE } from "@/utils/dict";
import PrintTag from "@/views/ecw/order/components/PrintTag";
import PrintWarehouseReceipt from "@/views/ecw/order/components/PrintWarehouseReceipt";
import imageUpload from "@/components/ImageUpload";
import {parseTime} from "@/utils/ruoyi"
import ImageAndVideoUpload from '@/components/ImageAndVideoUpload'
import Warehouse from "@/views/ecw/order/warehousing/components/Warehouse"
import { parseTime } from "@/utils/ruoyi";
import ImageAndVideoUpload from "@/components/ImageAndVideoUpload";
import Warehouse from "@/views/ecw/order/warehousing/components/Warehouse";
export default {
name: "Warehousing",
components: {
orderBaseInfo,
WarehouseAreaDialog,
......@@ -242,28 +373,30 @@ export default {
PrintWarehouseReceipt,
imageUpload,
ImageAndVideoUpload,
Warehouse
Warehouse,
},
mounted() {
if(this.$route.query.id){
this.orderId = parseInt(this.$route.query.id || undefined)
this.getOrderItemList()
getSpecialListByOrderId(this.orderId).then(r => this.specialList = r.data)
if (this.$route.query.id) {
this.orderId = parseInt(this.$route.query.id || undefined);
this.getOrderItemList();
getSpecialListByOrderId(this.orderId).then(
(r) => (this.specialList = r.data)
);
Promise.all([
this.getOrder(),
listByOrderId({ orderId: this.orderId }).then(r => {
this.form.orderLocationCreateReqVOList = r.data
})
listByOrderId({ orderId: this.orderId }).then((r) => {
this.form.orderLocationCreateReqVOList = r.data;
}),
]).then(() => {
// 等待仓库id和已选的储位后初始化储位信息
this.$nextTick(() => {
this.$refs.area.updateArea()
})
})
this.$refs.area.updateArea();
});
});
}
getCurrencyList().then(res => this.currencyList = res.data)
getCurrencyList().then((res) => (this.currencyList = res.data));
},
data() {
......@@ -276,14 +409,14 @@ export default {
form: {
orderSpecialNeedReceivableReqVoList: [],
orderLocationCreateReqVOList: [],
exceptionUrls:[],
descZh:'',
manualExceptionType:[],
exceptionUrls: [],
descZh: "",
manualExceptionType: [],
urls: [],
sumVolume: '',
sumWeight: '',
sumVolume: "",
sumWeight: "",
},
currencyList:[],
currencyList: [],
order: {},
orderId: undefined,
orderItemList: [],
......@@ -291,262 +424,287 @@ export default {
warehousing: undefined,
isShowPrintTag: false,
isShowPrint: false,
escapeBol:false,
escapeBol: false,
label: {
"orderId": 0,
"orderLabelDtoList": [
orderId: 0,
orderLabelDtoList: [
{
"end": 0,
"start": 0
}
]
end: 0,
start: 0,
},
],
},
exceptionRules: {
manualExceptionType: [
{ required: true, message: '请勾选原因类型', trigger: 'change' },
{ required: true, message: "请勾选原因类型", trigger: "change" },
{
validator: (rule, value, callback) => {
if (value.length <= 0) {
callback(new Error('请勾选原因类型'))
}
callback()
}, trigger: 'change'
}
]
}
callback(new Error("请勾选原因类型"));
}
callback();
},
trigger: "change",
},
],
},
};
},
methods: {
getOrderItemList(){
this.orderItemList = []
return getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data)
getOrderItemList() {
this.orderItemList = [];
return getOrderWarehouseIn(this.orderId).then(
(r) => (this.orderItemList = r.data)
);
},
getList(){
this.getOrder()
this.getOrderItemList()
getList() {
this.getOrder();
this.getOrderItemList();
},
getWarehousePictureList(){
getWarehousePictureList() {
return warehousePictureList({
bizId: this.order.orderId,
type: 1
}).then(r =>{
this.form.urls = r.data.map(i =>i.url)
})
type: 1,
}).then((r) => {
this.form.urls = r.data.map((i) => i.url);
});
},
include(){
include() {
return (state, arr) => {
return arr.indexOf(state) > -1
}
return arr.indexOf(state) > -1;
};
},
exclude(){
exclude() {
return (state, arr) => {
return arr.indexOf(state) == -1
}
return arr.indexOf(state) == -1;
};
},
handleLabelSubmit(){
handleLabelSubmit() {
orderWarehouseInUpdateLabel({
...this.label,
orderId: this.orderId
}).then(r => {
if (r.code === 0){
this.$message.success(r.msg || this.$t('修改标签箱号成功'))
orderId: this.orderId,
}).then((r) => {
if (r.code === 0) {
this.$message.success(r.msg || this.$t("修改标签箱号成功"));
}
})
});
},
// 箱号标签回显
getLabelByOrder(){
getLabelByOrder(this.orderId).then(r => {
if (r.code === 0 && !! r.data && r.data.length > 0) {
this.label.orderLabelDtoList = r.data
getLabelByOrder() {
getLabelByOrder(this.orderId).then((r) => {
if (r.code === 0 && !!r.data && r.data.length > 0) {
this.label.orderLabelDtoList = r.data;
} else {
// 没有历史数据,查默认值
getLabelWaitInByOrder(this.orderId).then(r => {
console.log(r)
if (r.code === 0 && !! r.data) {
this.label.orderLabelDtoList = [r.data]
getLabelWaitInByOrder(this.orderId).then((r) => {
console.log(r);
if (r.code === 0 && !!r.data) {
this.label.orderLabelDtoList = [r.data];
}
})
});
}
})
});
},
handleLabelAdd(index){
handleLabelAdd(index) {
this.label.orderLabelDtoList.splice(index + 1, 0, {
"end": '',
"start": ''
})
end: "",
start: "",
});
},
getTowSum(){
getTowSum() {
// let sumVolume = 0
// let sumWeight = 0
// this.order.orderItemVOList.forEach(e => {
// if (e?.warehouseInInfoVO?.volume) sumVolume += e.warehouseInInfoVO.volume
// if (e?.warehouseInInfoVO?.weight) sumWeight += e.warehouseInInfoVO.weight
// })
this.form.sumVolume = this.order.sumVolume// || sumVolume
this.form.sumWeight = this.order.sumWeight// || sumWeight
this.form.sumVolume = this.order.sumVolume; // || sumVolume
this.form.sumWeight = this.order.sumWeight; // || sumWeight
},
getOrder(){
return getOrder(this.orderId).then(r => {
this.order = r.data
this.getTowSum()
}).then(() => {
this.getLabelByOrder()
this.getWarehousePictureList()
getOrder() {
return getOrder(this.orderId)
.then((r) => {
this.order = r.data;
this.getTowSum();
})
.then(() => {
this.getLabelByOrder();
this.getWarehousePictureList();
});
},
specialHas0(){
let result = false
this.form.orderSpecialNeedReceivableReqVoList.forEach(e => {
if (e.receivableMoney === '0' || e.receivableMoney === ''){
result = true
specialHas0() {
let result = false;
this.form.orderSpecialNeedReceivableReqVoList.forEach((e) => {
if (e.receivableMoney === "0" || e.receivableMoney === "") {
result = true;
}
})
return result
});
return result;
},
handleException() {
this.$refs.exceptionForm.validate((valid) => {
if (valid) {
this.handleSubmit()
this.handleSubmit();
} else {
this.$message.warning('请勾选原因类型')
this.$message.warning("请勾选原因类型");
}
})
});
},
async handleSubmit() {
if (this.specialHas0()) {
const confirm = await this.$confirm(this.$t('有特需费用为0或未填写,请问是否继续?'), this.$t('注意'), {
confirmButtonText: this.$t('继续'),
cancelButtonText: this.$t('取消'),
type: 'warning'
})
if (confirm !== 'confirm'){
return
const confirm = await this.$confirm(
this.$t("有特需费用为0或未填写,请问是否继续?"),
this.$t("注意"),
{
confirmButtonText: this.$t("继续"),
cancelButtonText: this.$t("取消"),
type: "warning",
}
);
if (confirm !== "confirm") {
return;
}
}
let form = {
orderSpecialNeedReceivableReqVoList: this.form.orderSpecialNeedReceivableReqVoList,
"orderLocationCreateReqVOList": this.form.orderLocationCreateReqVOList,
"orderId": this.order.orderId,
orderSpecialNeedReceivableReqVoList:
this.form.orderSpecialNeedReceivableReqVoList,
orderLocationCreateReqVOList: this.form.orderLocationCreateReqVOList,
orderId: this.order.orderId,
// urls: this.form.urls,
sumVolume: this.form.sumVolume,
sumWeight: this.form.sumWeight,
isAppend: this.isAdd
}
isAppend: this.isAdd,
};
// 标签箱号
if (this.order.parentOrderId) {
form.labelList = this.label.orderLabelDtoList || []
form.labelList = this.label.orderLabelDtoList || [];
}
if (this.escapeBol) {
form.exceptionUrls = this.form.exceptionUrls.length !== 0 ? this.form.exceptionUrls?.split(',') : []
form.exceptionUrls =
this.form.exceptionUrls.length !== 0
? this.form.exceptionUrls?.split(",")
: [];
form.descZh = this.form.descZh;
form.manualExceptionType = this.form.manualExceptionType.join(',')
form.manualExceptionType = this.form.manualExceptionType.join(",");
}
orderWarehouseInFinish(form).then(r => {
orderWarehouseInFinish(form).then((r) => {
if (r.code === 0) {
this.escapeBol = false;
this.finishVisible = false
const message = !r.data ? this.$t('该订单已成功入仓,是否打印?') : `<h3>${this.$t('货物已入仓,存在异常')}</h3>${this.$t('该订单已成功入仓,是否打印?')}`
this.$confirm(
message,
this.$t('货物已入仓'),
{
confirmButtonText: this.$t(''),
cancelButtonText: this.$t(''),
dangerouslyUseHTMLString: true
}
).then(() => {
this.isShowPrint = true
}).catch(() => {
// this.$store.dispatch('tagsView/delVisitedView')
this.$message.success(this.$t('入仓成功'))
this.$tab.closePage()
this.finishVisible = false;
const message = !r.data
? this.$t("该订单已成功入仓,是否打印?")
: `<h3>${this.$t("货物已入仓,存在异常")}</h3>${this.$t(
"该订单已成功入仓,是否打印?"
)}`;
this.$confirm(message, this.$t("货物已入仓"), {
confirmButtonText: this.$t(""),
cancelButtonText: this.$t(""),
dangerouslyUseHTMLString: true,
})
}
.then(() => {
this.isShowPrint = true;
})
.catch(() => {
// this.$store.dispatch('tagsView/delVisitedView')
this.$message.success(this.$t("入仓成功"));
this.$tab.closePage();
});
}
});
},
handleWarehousingReturn(item){
this.$confirm(item.prodTitleZh + this.$t('退仓后不可恢复,是否确认退仓?'), this.$t('确定要退仓?'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
}).then(() => {
handleWarehousingReturn(item) {
this.$confirm(
item.prodTitleZh + this.$t("退仓后不可恢复,是否确认退仓?"),
this.$t("确定要退仓?"),
{
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
}
)
.then(() => {
rollbackDelete({
"orderId": item.orderId,
"orderItemId": item.orderItemId
orderId: item.orderId,
orderItemId: item.orderItemId,
}).then(() => {
this.$message({
type: 'success',
message: this.$t('货物退仓成功!')
type: "success",
message: this.$t("货物退仓成功!"),
});
this.getOrderItemList()
this.getOrder()
})
}).catch(e => {
this.getOrderItemList();
this.getOrder();
});
}
})
.catch((e) => {});
},
},
watch: {
orderSpecialNeeds(val){
val.forEach(e => {
orderSpecialNeeds(val) {
val.forEach((e) => {
this.form.orderSpecialNeedReceivableReqVoList.push({
"id": e.id,
"receivableMoney": e.transFee || '',
"receivableMoneyCurrency": e.transCurrency || 3
})
})
}
id: e.id,
receivableMoney: e.transFee || "",
receivableMoneyCurrency: e.transCurrency || 3,
});
});
},
},
computed: {
// 根据orderItemId获取入仓item
wareItem(){
return orderItemId => {
return this.orderItemList.find(item => item.orderItemId == orderItemId)
}
wareItem() {
return (orderItemId) => {
return this.orderItemList.find(
(item) => item.orderItemId == orderItemId
);
};
},
isAdd() {
return this.$route.path === "/order/warehousing-add"
return this.$route.path === "/order/warehousing-add";
},
isEdit() {
return this.$route.path === "/order/warehousing-update"
return this.$route.path === "/order/warehousing-update";
},
title() {
return this.$i18n.locale === 'en_US' ? this.$route.meta.titleEn : this.$route.name
return this.$i18n.locale === "en_US"
? this.$route.meta.titleEn
: this.$route.name;
},
orderSpecialNeedsDict() {
return this.$store.state.dict.dictDatas.order_special_needs
},
orderSpecialNeeds(){
const result = []
this.specialList.forEach(e => {
const t = this.orderSpecialNeedsDict.find(f => f.value === e.advanceType)
if(t) {
result.push({...e, label: t.label, labelEn: t.labelEn})
}
})
return result
return this.$store.state.dict.dictDatas.order_special_needs;
},
warehouseId(){
return this.order?.logisticsInfoDto?.startWarehouseId
}
orderSpecialNeeds() {
const result = [];
this.specialList.forEach((e) => {
const t = this.orderSpecialNeedsDict.find(
(f) => f.value === e.advanceType
);
if (t) {
result.push({ ...e, label: t.label, labelEn: t.labelEn });
}
}
});
return result;
},
warehouseId() {
return this.order?.logisticsInfoDto?.startWarehouseId;
},
},
};
</script>
<style scoped lang="scss">
@import "src/assets/styles/element-variables";
.red{
.red {
color: $--color-danger;
}
.green{
.green {
color: $--color-success;
}
</style>
<template>
<!-- 订单获取入仓记录 -->
<el-dialog
:title="title"
visible
:before-close="closeDialog"
:close-on-click-modal="false"
width="1000px"
>
<el-table :data="warehouseItem">
<el-table-column type="index" :label="$t('序号')" />
<el-table-column :label="$t('箱数')" prop="cartonsNum">
<template slot-scope="{ row }">
<template
v-if="
row.orderWarehouseInDetailsVOList &&
row.orderWarehouseInDetailsVOList.length
"
>
<WarehouseRecordDetail
v-model="row.orderWarehouseInDetailsVOList"
:num="row.cartonsNum"
text
readonly
/>
</template>
<template v-else>{{ row.cartonsNum }}</template>
</template>
</el-table-column>
<el-table-column :label="$t('入仓类型')" prop="cartonsNum">
<template slot-scope="{ row }">
<dict-tag
:type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE"
:value="row.specificationType"
/>
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')" prop="unit">
<template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="row.unit" />
</template>
</el-table-column>
<el-table-column :label="$t('长')" prop="boxGauge">
<template slot-scope="{ row }">
{{ row.boxGauge.split("*")[0] }}
</template>
</el-table-column>
<el-table-column :label="$t('宽')" prop="boxGauge">
<template slot-scope="{ row }">
{{ row.boxGauge.split("*")[1] }}
</template>
</el-table-column>
<el-table-column :label="$t('高')" prop="boxGauge">
<template slot-scope="{ row }">
{{ row.boxGauge.split("*")[2] }}
</template>
</el-table-column>
<el-table-column :label="$t('体积') + '(m³)'" prop="volume" />
<el-table-column :label="$t('重量') + '(kg)'" prop="weight" />
<el-table-column :label="$t('数量(个)')" prop="quantityAll" />
<el-table-column :label="$t('入仓快递单号')" prop="expressNo" />
<el-table-column :label="$t('首次入仓时间')" prop="inTime">
<template slot-scope="{ row }">{{ row.inTime | parseTime }}</template>
</el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template slot-scope="{ row }">
{{ getLocationName(row.orderLocationBackVOList) }}
</template>
</el-table-column>
<el-table-column :label="$t('入仓影像')" prop="orderLocationBackVOList">
<template slot-scope="{ row }">
<image-display :pictureUrls="warehouseItem.pictureUrls" :type="5">
<el-button type="text"> 查看 </el-button>
</image-display>
</template>
</el-table-column>
<el-table-column :label="$t('备注')" prop="remark">
<template slot-scope="{ row }">
{{ row.remark }}
</template>
</el-table-column>
</el-table>
</el-dialog>
</template>
<script>
import { getOrderWarehouseIn } from "@/api/ecw/order";
import { parseTime } from "@/utils/ruoyi";
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect";
import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue";
import WarehouseRecordDetail from "@/views/ecw/order/warehousing/components/WarehouseRecordDetail.vue";
export default {
components: {
WarehouseRecordDetail,
ImageDisplay,
WarehouseAreaSelect,
},
filters: { parseTime },
props: {
order: Object, // order 和 orderId 二选一
orderId: Number,
orderItemId: Number,
type: Number,
},
data() {
return {
warehouseItem: [],
};
},
computed: {
title() {
return this.$l(this.order, "orderNo") + " - " + this.$t("入仓记录");
},
},
created() {
this.show = true;
getOrderWarehouseIn(this.order.orderId).then((res) => {
this.warehouseItem = [];
for (var i = 0; i < res.data.length; i++) {
for (
var j = 0;
j < res.data[i].orderWarehouseInBackItemDoList.length;
j++
) {
this.warehouseItem.push(
res.data[i].orderWarehouseInBackItemDoList[j]
);
}
}
});
},
methods: {
// 获取储位名称
getLocationName(locationArr) {
if (!locationArr || !locationArr.length) return "";
let arr = [];
locationArr.forEach((item) => {
arr.push(`${item.areaName}${item.locationName || ""}`);
});
return Array.from(new Set(arr)).join(",");
},
closeDialog() {
this.show = false;
this.$emit("close");
},
seePackLog() {
this.$emit("openPackHistory", this.orderItemId);
},
},
};
</script>
......@@ -318,13 +318,19 @@
<tr>
<td><div class="cell"></div></td>
<td>
<div class="cell">总箱数:{{ StatisticalSummary.sumBox }}</div>
<div class="cell">
总箱数:{{ StatisticalSummary.sumBox }}
</div>
</td>
<td>
<div class="cell">总方数:{{ StatisticalSummary.sumM3 }}</div>
<div class="cell">
总方数:{{ StatisticalSummary.sumM3 }}
</div>
</td>
<td>
<div class="cell">总重量:{{ StatisticalSummary.sumKG }}</div>
<div class="cell">
总重量:{{ StatisticalSummary.sumKG }}
</div>
</td>
<td>
<div class="cell">总V值:{{ StatisticalSummary.sumV }}</div>
......@@ -333,31 +339,47 @@
<tr>
<td><div class="cell">新客户</div></td>
<td>
<div class="cell">总箱数:{{ StatisticalSummary.sumBoxNew }}</div>
<div class="cell">
总箱数:{{ StatisticalSummary.sumBoxNew }}
</div>
</td>
<td>
<div class="cell">总方数:{{ StatisticalSummary.sumM3New }}</div>
<div class="cell">
总方数:{{ StatisticalSummary.sumM3New }}
</div>
</td>
<td>
<div class="cell">总重量:{{ StatisticalSummary.sumKGNew }}</div>
<div class="cell">
总重量:{{ StatisticalSummary.sumKGNew }}
</div>
</td>
<td>
<div class="cell">总V值:{{ StatisticalSummary.sumVNew }}</div>
<div class="cell">
总V值:{{ StatisticalSummary.sumVNew }}
</div>
</td>
</tr>
<tr>
<td><div class="cell">旧客户</div></td>
<td>
<div class="cell">总箱数:{{ StatisticalSummary.sumBoxOld }}</div>
<div class="cell">
总箱数:{{ StatisticalSummary.sumBoxOld }}
</div>
</td>
<td>
<div class="cell">总方数:{{ StatisticalSummary.sumM3Old }}</div>
<div class="cell">
总方数:{{ StatisticalSummary.sumM3Old }}
</div>
</td>
<td>
<div class="cell">总重量:{{ StatisticalSummary.sumKGOld }}</div>
<div class="cell">
总重量:{{ StatisticalSummary.sumKGOld }}
</div>
</td>
<td>
<div class="cell">总V值:{{ StatisticalSummary.sumVOld }}</div>
<div class="cell">
总V值:{{ StatisticalSummary.sumVOld }}
</div>
</td>
</tr>
</tbody>
......@@ -465,9 +487,15 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<WarehouseDetail-detail :order="order" :orderItemId="showWarehouseInItemId"
v-if="showWarehouseInItemId" @close="showWarehouseInItemId=null">
</WarehouseDetail-detail>
<warehouse-detail
:order="order"
:orderItemId="showWarehouseInItemId"
:type="type"
@openPackHistory="openPackHistory"
v-if="showWarehouseInItemId"
@close="showWarehouseInItemId = null"
/>
</div>
</template>
......@@ -477,13 +505,17 @@ import { getCountryListAll } from "@/api/ecw/country";
import Treeselect from "@riophae/vue-treeselect";
import "@/assets/styles/vue-treeselect.css";
import { getWarehouseList } from "@/api/ecw/warehouse";
import { getListPage, exportExcel,getStatisticalSummary } from "@/api/report/salesanalysis";
import {
getListPage,
exportExcel,
getStatisticalSummary,
} from "@/api/report/salesanalysis";
import { getCurUserPermission } from "@/api/report/EcwReportPermission";
import { getAllChannelList, getChannelList } from "@/api/ecw/channel";
import { listSimpleDepts } from "@/api/system/dept";
import {getOrder} from "@/api/ecw/order";
import { getOrder } from "@/api/ecw/order";
//入仓记录页面
import WarehouseDetail from "@/views/ecw/order/components/WarehouseDetail";
import WarehouseDetail from "@/views/report/WarehouseInDetail/index.vue";
//2024-05-01合并
export default {
......@@ -509,6 +541,7 @@ export default {
title: "",
// 是否显示弹出层
open: false,
showDetail: false,
deptOptions: undefined,
dateRangeCreateTime: [],
SearchType: [
......@@ -563,20 +596,20 @@ export default {
showWarehouseInItemId: undefined,
order: null,
type: 1,
StatisticalSummary:{
sumBox:0,
sumM3:0,
sumKG:0,
sumV:0,
sumBoxNew:0,
sumM3New:0,
sumKGNew:0,
sumVNew:0,
sumBoxOld:0,
sumM3Old:0,
sumKGOld:0,
sumVOld:0,
}
StatisticalSummary: {
sumBox: 0,
sumM3: 0,
sumKG: 0,
sumV: 0,
sumBoxNew: 0,
sumM3New: 0,
sumKGNew: 0,
sumVNew: 0,
sumBoxOld: 0,
sumM3Old: 0,
sumKGOld: 0,
sumVOld: 0,
},
};
},
created() {
......@@ -631,7 +664,6 @@ export default {
getStatisticalSummary(params).then((response) => {
this.StatisticalSummary = response.data;
});
},
/** 表单重置 */
......@@ -685,10 +717,15 @@ export default {
// 显示入仓记录
showWarehouseLogs(row, type) {
getOrder(row.orderId).then((response) => {
this.order = response.data;
this.showWarehouseInItemId = row.orderItemId;
this.order = response.data;//组件中只用到了此参数
this.type = 2;
this.showWarehouseInItemId = 1;
});
},
openPackHistory(id) {
//查询打包历史
//this.shopPackId = id
},
/** 查询部门下拉树结构 + 岗位下拉 */
getTreeselect() {
if (this.objEcwReportPermission.permissionFw == 3) {
......
......@@ -44,7 +44,7 @@
>
{{ $t("新增") }}</el-button
>
<el-button type="primary" @click="test" v-show="true">测试</el-button>
<el-button type="primary" @click="test" v-show="false">测试</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -170,6 +170,7 @@ import "@/assets/styles/vue-treeselect.css";
import { MessageBox } from "element-ui";
//日期库函数
import dayjs from "dayjs";
import { getToken } from "@/utils/auth";
//2024-05-01合并
export default {
......@@ -356,10 +357,13 @@ export default {
},
test() {
//单元测试函数
/*
var p = 12;
test(p).then((response) => {
this.$modal.msgSuccess("测试成功");
});
});*/
var s = getToken();
alert(s);
},
TestFun() {
var bR = dayjs("2024-05-11").isBefore(dayjs("2024-05-12"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment