Commit 621e803c authored by dragondean@qq.com's avatar dragondean@qq.com

完善国际化

parent 35f4d3da
<template>
<div>
<el-select v-model="formData.country" :disabled="readonly">
<el-option v-for="(item) in treeList" :value="item.id" :label="item.titleZh" :key="item.id" />
<el-option v-for="(item) in treeList" :value="item.id" :label="$l(item, 'title')" :key="item.id" />
</el-select>
<el-select v-model="formData.province" class="ml-10" :disabled="readonly">
<el-option v-for="(item) in provinceList" :value="item.id" :label="item.titleZh" :key="item.id" />
<el-option v-for="(item) in provinceList" :value="item.id" :label="$l(item, 'title')" :key="item.id" />
</el-select>
<el-select v-model="formData.city" class="ml-10" :disabled="readonly">
<el-option v-for="(item) in cityList" :value="item.id" :label="item.titleZh" :key="item.id" />
<el-option v-for="(item) in cityList" :value="item.id" :label="$l(item, 'title')" :key="item.id" />
</el-select>
</div>
</template>
......
......@@ -6,7 +6,7 @@
clearable
remote
reserve-keyword
placeholder="请输入关键词"
:placeholder="$t('请输入关键词')"
:remote-method="remoteMethod"
:loading="loading">
<el-option
......@@ -16,7 +16,7 @@
:value="index">
</el-option>
</el-select>
<el-button v-if="quickable" type="text" @click="showQuickCreate=true" class="ml-10">快速新建</el-button>
<el-button v-if="quickable" type="text" @click="showQuickCreate=true" class="ml-10">{{$t('快速新建')}}</el-button>
<!-- <quick-create v-if="showQuickCreate" @success="onQuickCreateSuccess" @close="showQuickCreate=false" :default="{type}"></quick-create> -->
</div>
......@@ -128,7 +128,7 @@ export default {
if(index < 0){
getCustomerContactsSelect({ids: this.value}).then(res => {
if(!res.data || !res.data.length){
return this.$message.error('联系人信息获取失败')
return this.$message.error(this.$t('联系人信息获取失败'))
}
this.list.unshift(res.data[0])
this.index = 0
......@@ -149,7 +149,7 @@ export default {
this.showQuickCreate = false
getCustomerContactsListByCustomer({customerId: id}).then(res => {
if(!res.data || !res.data.length){
return this.$message.error('联系人信息获取失败')
return this.$message.error(this.$t('联系人信息获取失败'))
}
let data = res.data[0]
data.contactsName = data.name // 字段名跟getCustomerContactsSelect对齐
......
......@@ -3,9 +3,9 @@
<el-col :span="10">
<el-card>
<div slot="header" class="header">
<el-input v-model="queryParams.searchKey" placeholder="用户名/手机/邮箱" style="width:200px" />
<el-input v-model="queryParams.searchKey" :placeholder="$t('用户名/手机/邮箱')" style="width:200px" />
<!-- <dict-selector :type="DICT_TYPE.USER_TYPE" v-model="queryParams.customerType" style="width:100px" /> -->
<el-button type="primary" @click="reLoad">搜索</el-button>
<el-button type="primary" @click="reLoad">{{$t('搜索')}}</el-button>
</div>
<div class="list">
<template v-for="item in list" >
......@@ -20,7 +20,7 @@
<el-col :span="10">
<el-card>
<div slot="header" class="header">
已选客户
{{$t('已选客户')}}
</div>
<div class="list">
<div class="item" v-for="item in choosedList" :key="item.customerContactsId">
......
......@@ -5,7 +5,7 @@
clearable
remote
reserve-keyword
placeholder="请输入关键词"
:placeholder="$t('请输入关键词')"
:remote-method="remoteMethod"
:loading="loading">
<el-option
......
......@@ -3,9 +3,9 @@
<el-col :span="10">
<el-card>
<div slot="header" class="header">
<el-input v-model="queryParams.searchKey" placeholder="用户名/手机/邮箱" style="width:200px" />
<el-input v-model="queryParams.searchKey" :placeholder="$t('用户名/手机/邮箱')" style="width:200px" />
<dict-selector :type="DICT_TYPE.USER_TYPE" v-model="queryParams.customerType" style="width:100px" />
<el-button type="primary" @click="reLoad">搜索</el-button>
<el-button type="primary" @click="reLoad">{{$t('搜索')}}</el-button>
</div>
<div class="list">
<div class="item" v-for="item in list" :key="item.id">
......@@ -18,7 +18,7 @@
<el-col :span="10">
<el-card>
<div slot="header" class="header">
已选客户
{{$t('已选客户')}}
</div>
<div class="list">
<div class="item" v-for="item in choosedList" :key="item.id">
......@@ -94,7 +94,7 @@ export default {
},
loadNextPage(){
if(this.page >= this.pages){
return this.$message.error('已加载全部')
return this.$message.info(this.$t('已加载全部'))
}
this.queryParams.page ++
this.getList()
......
......@@ -2,13 +2,13 @@
<div class="dict-selector">
<el-select v-if="formType == 'select'" v-model="valueSync" :placeholder="placeholder" clearable :multiple="multiple" :disabled="disabled" @change="val => $emit('change', val)">
<el-option v-for="dict in formattedList"
:key="dict.value" :label="dict.label" :value="dict.value"/>
:key="dict.value" :label="$l(dict, 'label')" :value="dict.value"/>
</el-select>
<el-radio-group v-if="formType == 'radio'" v-model="valueSync" :disabled="disabled">
<el-radio v-for="dict in formattedList" :label="dict.value" :checked="valueSync === dict.value" :key="dict.value">{{dict.label}}</el-radio>
<el-radio v-for="dict in formattedList" :label="dict.value" :checked="valueSync === dict.value" :key="dict.value">{{$l(dict, 'label')}}</el-radio>
</el-radio-group>
<el-checkbox-group v-if="formType == 'checkbox'" v-model="valueSync" :disabled="disabled">
<el-checkbox v-for="dict in formattedList" :label="dict.value" :key="dict.value">{{dict.label}}</el-checkbox>
<el-checkbox v-for="dict in formattedList" :label="dict.value" :key="dict.value">{{$l(dict, 'label')}}</el-checkbox>
</el-checkbox-group>
</div>
</template>
......@@ -68,6 +68,7 @@ export default {
this.dictList.forEach(item => {
arr.push({
label: item.label,
labelEn: item.labelEn,
value: this.format(item.value),
cssClass: item.cssClass,
colorType: item.colorType
......
<template>
<div class="need-know" :id="'need-know_' + keyname" v-if="detail">
<!-- <h2>{{detail.titleZh}}</h2> -->
<div class="body" ref="body" v-html="detail.contentZh"></div>
<div class="body" ref="body" v-html="$l(detail, 'content')"></div>
</div>
</template>
<script>
......
......@@ -5,7 +5,7 @@
clearable
remote
reserve-keyword
placeholder="请输入商品关键词"
:placeholder="$t('请输入商品关键词')"
:disabled="disabled"
:remote-method="remoteMethod"
@focus="remoteMethod()"
......
......@@ -3,14 +3,14 @@
<el-col :span="10">
<el-card>
<div slot="header" class="header">
<el-select v-model="queryParams.typeId" placeholder="选择类型" style="width:120px" clearable>
<el-select v-model="queryParams.typeId" :placeholder="$t('选择类型')" style="width:120px" clearable>
<el-option v-for="item in typeList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
<el-select v-model="queryParams.attrId" placeholder="选择属性" style="width:120px" clearable>
<el-select v-model="queryParams.attrId" :placeholder="$t('选择属性')" style="width:120px" clearable>
<el-option v-for="item in attrList" :key="item.id" :label="item.attrName" :value="item.id" />
</el-select>
<el-input v-model="queryParams.titleZh" placeholder="产品关键字" style="width:120px" clearable />
<el-button type="primary" @click="reLoad">搜索</el-button>
<el-input v-model="queryParams.titleZh" :placeholder="$t('产品关键字')" style="width:120px" clearable />
<el-button type="primary" @click="reLoad">{{$t('搜索')}}</el-button>
</div>
<div class="list">
<div class="item" v-for="item in list" :key="item.id">
......@@ -23,7 +23,7 @@
<el-col :span="10">
<el-card>
<div slot="header" class="header">
已选产品
{{$t('已选产品')}}
</div>
<div class="list">
<div class="item" v-for="(choosed) in choosedList" :key="choosed.id" :data-data="JSON.stringify(choosed)">
......@@ -99,7 +99,7 @@ export default {
},
loadNextPage() {
if (this.page >= this.pages) {
return this.$message.error('已加载全部')
return this.$message.error(this.$t('已加载全部'))
}
this.queryParams.page++
this.getList()
......
<template>
<div>
<div class="filters mb-10">
运输方式
<dict-selector :type='DICT_TYPE.ECW_TRANSPORT_TYPE' v-model="transportType" placeholder="请选择运输方式" style="width:150px" />
{{$t('运输方式')}}
<dict-selector :type='DICT_TYPE.ECW_TRANSPORT_TYPE' v-model="transportType" :placeholder="$t('请选择运输方式')" style="width:150px" />
始发地
<el-select placeholder="请选择始发地" v-model="exportCity" clearable>
{{$t('始发地')}}
<el-select :placeholder="$t('请选择始发地')" v-model="exportCity" clearable>
<el-option v-for="item in exportCityList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
目的地
<el-select placeholder="请选择目的地" v-model="importCity" clearable>
{{$t('目的地')}}
<el-select :placeholder="$t('请选择目的地')" v-model="importCity" clearable>
<el-option v-for="item in importCityList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
出货渠道:
<el-select placeholder="请选择目渠道" v-model="channelId" clearable>
{{$t('出货渠道')}}:
<el-select :placeholder="$t('请选择目渠道')" v-model="channelId" clearable>
<el-option v-for="item in channelList" :key="item.channelId" :label="item.nameZh" :value="item.channelId" />
</el-select>
</div>
<div class="mb-10">
<el-radio-group v-model="checkAll">
<el-radio :label="true">全选</el-radio>
<el-radio :label="false">全不选</el-radio>
<el-radio :label="true">{{$t('全选')}}</el-radio>
<el-radio :label="false">{{$t('全不选')}}</el-radio>
</el-radio-group>
</div>
<el-row class="" :gutter="10">
......@@ -30,19 +30,27 @@
<el-col :span="12" :key="item.value">
<el-card class="mb-10">
<div slot="header">
{{item.label}}
<el-link type="primary" @click.native="toggleHide(item.value)" style="float:right">{{item._hide ? '展开' : '折叠'}}</el-link>
{{$l(item, 'label')}}
<el-link type="primary" @click.native="toggleHide(item.value)" style="float:right">{{item._hide ? $t('展开') : $t('折叠')}}</el-link>
</div>
<!--table需要给一个key,否则全选的时候不会自动更新渲染-->
<el-table v-if="!hideMap[item.value]" :data="item.routerList" :span-method="SpanMethod" border :key="selectedRoutes.length + item.value">
<el-table-column label="始发地" prop="startTitleZh" />
<el-table-column label="目的地" prop="destTitleZh" />
<el-table-column label="渠道" prop="startTitleZh">
<el-table-column :label="$t('始发地')" prop="startTitleZh">
<template slot-scope="{row}">
{{row.channel.nameZh}}
{{$l(row, 'startTitle')}}
</template>
</el-table-column>
<el-table-column label="操作" prop="">
<el-table-column :label="$t('目的地')" prop="destTitleZh" >
<template slot-scope="{row}">
{{$l(row, 'destTitle')}}
</template>
</el-table-column>
<el-table-column :label="$t('渠道')" prop="startTitleZh">
<template slot-scope="{row}">
{{$l(row.channel, 'name')}}
</template>
</el-table-column>
<el-table-column :label="$t('操作')" prop="">
<template slot-scope="{row}">
<el-checkbox :checked="getSelectedIndex(row) > -1" @change="toggleChecker(row, $event)"></el-checkbox>
</template>
......@@ -130,6 +138,7 @@ export default {
let child = {
label: item.label,
labelEn: item.labelEn,
value: item.value,
_hide: false, // 是否折叠
routerList: routerList
......
......@@ -5,7 +5,7 @@
<el-button size="mini" type="primary" icon="el-icon-plus" @click="listData.push({})"></el-button>
</div>
<el-table :data="listData" border>
<el-table-column label="序号" width="90px">
<el-table-column :label="$t('序号')" width="90px">
<template slot-scope="scope">
{{scope.$index + 1}}
</template>
......@@ -22,7 +22,7 @@
<el-input v-model="row.job" />
</template>
</el-table-column> -->
<el-table-column label="操作">
<el-table-column :label="$t('操作')">
<template slot-scope="scope">
<el-button type="danger" size="mini" icon="el-icon-delete" @click="del(scope.$index)"></el-button>
</template>
......@@ -66,7 +66,7 @@ export default {
},
methods:{
del(index){
this.$confirm('确定删除此行?')
this.$confirm(this.$t('确定删除此行?'))
.then(res => {
this.listData.splice(index, 1)
})
......
......@@ -15,6 +15,9 @@ console.log({i18n})
Vue.prototype.$l = (object, field) => {
let prefix = i18n.locale.split('_')[0]
let append = prefix.charAt(0).toUpperCase() + prefix.toLowerCase().substr(1)
// 如果object是null则返回字段名
if(!object) return field + append
return object[field + append] || object[field]
}
/* Vue.filter('$t', Vue.$i18n)
......
......@@ -5,5 +5,6 @@
"编号": "No",
"新增": "Create",
"搜索": "Search",
"重置": "Reset"
"重置": "Reset",
"新建订单": "New Order"
}
\ No newline at end of file
......@@ -3,91 +3,91 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-card>
<div slot="header" class="card-title">{{ editMode ? '编辑订单' : '新建订单'}}</div>
<div slot="header" class="card-title">{{ editMode ? this.$t('编辑订单') : this.$t('新建订单')}}</div>
<!--默认显示类型(selectedRouter==null),如果选择路线后没开通则隐藏-->
<el-form-item label="订单类型" style="margin-bottom: 0" v-if="!selectedRouter || routeOtherServices.indexOf('1') > -1 || routeOtherServices.indexOf('4') > -1">
<el-checkbox-group v-model="form.type">
<el-checkbox label="1" v-if="!selectedRouter || routeOtherServices.indexOf('1') > -1">集运服务</el-checkbox>
<el-checkbox label="2" v-if="!selectedRouter || routeOtherServices.indexOf('2') > -1">海外仓</el-checkbox>
<el-checkbox label="1" v-if="!selectedRouter || routeOtherServices.indexOf('1') > -1">{{$t('集运服务')}}</el-checkbox>
<el-checkbox label="2" v-if="!selectedRouter || routeOtherServices.indexOf('2') > -1">{{$t('海外仓')}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-descriptions :column="3" border v-if="form.type.indexOf('1') < 0">
<el-descriptions-item label="*发货人" :labelStyle="labelStyle">
<el-descriptions-item :label="$t('发货人')" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="consignorContactsId">
<customer-contact-selector v-model="form.consignorContactsId" @change="consignorContact = $event" type="1" />
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="电话" :labelStyle="labelStyle">
{{consignorContact.areaCode}} {{consignorContact.phoneNew || ''}}
<el-descriptions-item :label="$t('电话')" :labelStyle="labelStyle">
{{consignorContact.areaCode}} {{consignorContact.phoneNew || $t('')}}
</el-descriptions-item>
<el-descriptions-item label="发货人公司" :labelStyle="labelStyle">
{{consignorContact.company || ''}}
<el-descriptions-item :label="$t('发货人公司')" :labelStyle="labelStyle">
{{consignorContact.company || $t('')}}
</el-descriptions-item>
<el-descriptions-item label="Email" :labelStyle="labelStyle">
{{consignorContact.email || ''}}
{{consignorContact.email || $t('')}}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="3" border>
<el-descriptions-item label="*收货人" :labelStyle="labelStyle" >
<el-descriptions-item :label="$t('收货人')" :labelStyle="labelStyle" >
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="consigneeContactsId">
<customer-contact-selector v-model="form.consigneeContactsId" @change="consigneeContact = $event" type="2" />
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="电话" :labelStyle="labelStyle">
{{consigneeContact.areaCode}} {{consigneeContact.phoneNew || ''}}
<el-descriptions-item :label="$t('电话')" :labelStyle="labelStyle">
{{consigneeContact.areaCode}} {{consigneeContact.phoneNew || $t('')}}
</el-descriptions-item>
<el-descriptions-item label="收货人公司" :labelStyle="labelStyle">
<el-descriptions-item :label="$t('收货人公司')" :labelStyle="labelStyle">
{{consigneeContact.company || ''}}
</el-descriptions-item>
<el-descriptions-item label="Email" :labelStyle="labelStyle">
{{consigneeContact.email || ''}}
{{consigneeContact.email || $t('')}}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="3" border>
<el-descriptions-item label="*运输方式" :labelStyle="labelStyle">
<el-descriptions-item :label="$t('运输方式')" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="transportId">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="form.transportId" />
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="出货渠道" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'" :labelStyle="labelStyle">
<el-descriptions-item :label="$t('出货渠道')" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="channelId" :required="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'" error="请选择出货渠道">
<selector
:disabled="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass != 'channel'"
v-model="form.channelId"
:options="channelList"
value-field="channelId"
label-field="nameZh"
:label-field="$l(null, 'name')"
></selector>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="2" border>
<el-descriptions-item label="*始发城市" :labelStyle="labelStyle">
<el-descriptions-item :label="$t('始发城市')" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="departureId">
<el-select v-model="form.departureId" placeholder="请选择始发地">
<el-option v-for="item in exportCityList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
<el-select v-model="form.departureId" :placeholder="$t('请选择始发地')">
<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-descriptions-item>
<el-descriptions-item label="*目的城市" :labelStyle="labelStyle">
<el-descriptions-item :label="$t('目的城市')" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="objectiveId">
<el-select v-model="form.objectiveId" placeholder="请选择目的地">
<el-option v-for="item in importCityList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
<el-select v-model="form.objectiveId" :placeholder="$t('请选择目的地')">
<el-option v-for="item in importCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="*请选择线路" :span="2" :labelStyle="labelStyle">
<el-descriptions-item :label="$t('请选择线路')" :span="2" :labelStyle="labelStyle">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="lineId">
<el-input :value="selectedRouter ? selectedRouter.startTitleZh + ' > ' + selectedRouter.destTitleZh : ''" readonly placeholder="请在右侧选择线路"></el-input>
<el-input :value="selectedRouter ? $l(selectedRouter, 'startTitle') + ' > ' + $l(selectedRouter, 'destTitle') : ''" readonly :placeholder="$t('请在右侧选择线路')"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<select size="5" v-model="form.lineId" style="min-width: 300px">
<template v-for="item in routerList">
<option :value="item.id" :key="item.id">{{item.startTitleZh}} >> {{item.destTitleZh}}</option>
<option :value="item.id" :key="item.id">{{$l(item, 'startTitle')}} >> {{$l(item, 'destTitle')}}</option>
</template>
</select>
</el-col>
......@@ -97,22 +97,22 @@
</el-card>
<el-card class="mt-10">
<div slot="header" class="card-title">
<div class="card-name">商品信息</div>
<el-button type="primary" size="mini" @click="addProduct(null)" :disabled="!form.lineId">添加货物</el-button>
<el-button type="primary" size="mini" @click="showBatchImportDialog=true" :disabled="!form.lineId">批量添加货物</el-button>
<div class="card-name">{{$t('商品信息')}}</div>
<el-button type="primary" size="mini" @click="addProduct(null)" :disabled="!form.lineId">{{$t('添加货物')}}</el-button>
<el-button type="primary" size="mini" @click="showBatchImportDialog=true" :disabled="!form.lineId">{{$t('批量添加货物')}}</el-button>
</div>
<el-table :data="productList" border>
<el-table-column label="序号" width="60px" fixed>
<el-table-column :label="$t('序号')" width="60px" fixed>
<template slot-scope="scope">
{{scope.$index + 1}}
</template>
</el-table-column>
<el-table-column label="中文品名" width="160px">
<el-table-column :label="$t('中文品名')" width="160px">
<template slot-scope="{row}">
<product-selector v-model="row.prodId" @change="onProductChange(row, $event)" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="英文品名" width="160px">
<el-table-column :label="$t('英文品名')" width="160px">
<template slot-scope="{row}">
<product-selector lang="En" v-model="row.prodId" @change="onProductChange(row, $event)" :disabled="!form.lineId || !productEditable" />
</template>
......@@ -123,22 +123,22 @@
</template>
</el-table-column> -->
<el-table-column label="品牌" width="100px">
<el-table-column :label="$t('品牌')" width="100px">
<template slot-scope="{row}">
<dict-selector v-model="row.brandType" :type="DICT_TYPE.ECW_IS_BRAND" defaultable @input="calculationPrice(row)" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="件数" width="90px">
<el-table-column :label="$t('件数')" width="90px">
<template slot-scope="{row}">
<el-input v-model.number="row.num" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="包装单位">
<el-table-column :label="$t('包装单位')">
<template slot-scope="{row}">
<dict-selector v-model="row.unit" :type="DICT_TYPE.ECW_PACKAGE_TYPE" defaultable :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="数量(个)" width="120px">
<el-table-column :label="$t('数量') + '(个)'" width="120px">
<template slot-scope="{row}">
<el-input v-model="row.quantity" type="number" :disabled="!form.lineId || !productEditable" />
</template>
......@@ -148,25 +148,25 @@
<el-input v-model="row.boxGauge" @input="calcVolume(row)" />
</template>
</el-table-column> -->
<el-table-column label="体积(m³)" width="100px">
<el-table-column :label="$t('体积') + '(m³)'" width="100px">
<template slot-scope="{row}">
<el-input v-model="row.volume" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="重量(kg)" width="100px">
<el-table-column :label="$t('重量') + '(kg)'" width="100px">
<template slot-scope="{row}">
<el-input v-model="row.weight" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="货值(RMB)" width="100px">
<el-table-column :label="$t('货值') + '(RMB)'" width="100px">
<template slot-scope="{row}">
<el-input v-model="row.worth" :disabled="!form.lineId" />
</template>
</el-table-column>
<el-table-column label="商品特性" width="250px">
<el-table-column :label="$t('商品特性')" width="250px">
<template slot-scope="{row}">
<el-checkbox-group v-model="row.prodAttrArr" @change="onProductAttrChange(row, $event); calculationPrice(row)" :disabled="!form.lineId || !productEditable">
<el-checkbox v-for="item in productAttrList" :label="item.id" :key="item.id">{{item.attrName}}</el-checkbox>
<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>
......@@ -191,87 +191,87 @@
</template>
</el-table-column> -->
<el-table-column label="是否预付">
<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>
</el-table-column>
<el-table-column label="商品链接" width="200px" align="center">
<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)" v-if="productEditable">
{{row.link ? '编辑商品链接' : '添加商品链接'}}
{{row.link ? $t('编辑商品链接') : $t('添加商品链接')}}
</el-button>
</template>
</el-table-column>
<el-table-column label="操作" width="80px" fixed="right">
<el-table-column :label="$t('操作')" width="80px" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="danger" @click="delProduct(scope.$index)">删除</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;">合计</div>
<div class="card-title" style="padding:20px 0;">{{$t('合计')}}</div>
<el-descriptions :column="6" border>
<el-descriptions-item label="总件数">
<el-descriptions-item :label="$t('总件数')">
{{sum.totalNum || 0}}
</el-descriptions-item>
<el-descriptions-item label="总体积">
<el-descriptions-item :label="$t('总体积')">
{{sum.totalVolume || 0}}m³
</el-descriptions-item>
<el-descriptions-item label="总重量">
<el-descriptions-item :label="$t('总重量')">
{{sum.totalWeight || 0}}kg
</el-descriptions-item>
<el-descriptions-item label="总数量">
<el-descriptions-item :label="$t('总数量')">
{{sum.totalQuatity || 0}}
</el-descriptions-item>
<el-descriptions-item label="总货值(RMB)">
<el-descriptions-item :label="$t('总货值') + '(RMB)'">
{{sum.totalWorth || 0}}元
</el-descriptions-item>
<el-descriptions-item label="保价费">
{{fee.insuranceFee || 0}} 美元
<el-descriptions-item :label="$t('保价费')">
{{fee.insuranceFee || 0}} {{$t('美元')}}
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="mt-10" v-if="0">
<div class="card-title" slot="header">预计费用</div>
<div class="card-title" slot="header">{{$t('预计费用')}}</div>
<el-descriptions :column="5" border>
<el-descriptions-item label="保价费">
{{fee.insuranceFee || 0}} 人民币
<el-descriptions-item :label="$t('保价费')">
{{fee.insuranceFee || 0}} {{$t('人民币')}}
</el-descriptions-item>
<el-descriptions-item label="总运费">
<div>{{fee.seaNGN || 0}}奈拉</div>
<div>{{fee.seaRMB || 0}}人民币</div>
<div>{{fee.seaUSD || 0}}美元</div>
<el-descriptions-item :label="$t('总运费')">
<div>{{fee.seaNGN || 0}}{{$t('奈拉')}}</div>
<div>{{fee.seaRMB || 0}}{{$t('人民币')}}</div>
<div>{{fee.seaUSD || 0}}{{$t('美元')}}</div>
</el-descriptions-item>
<!--代收货款,只有非控货订单、并且线路开通了代收货款后,才显示是否代收货款选项-->
<el-descriptions-item label="总清关费">
<div>{{fee.clearanceNGN || 0}}奈拉</div>
<div>{{fee.clearanceRMB || 0}}人民币</div>
<div>{{fee.clearanceUSD || 0}}美元</div>
<el-descriptions-item :label="$t('总清关费')">
<div>{{fee.clearanceNGN || 0}}{{$t('奈拉')}}</div>
<div>{{fee.clearanceRMB || 0}}{{$t('人民币')}}</div>
<div>{{fee.clearanceUSD || 0}}{{$t('美元')}}</div>
</el-descriptions-item>
<el-descriptions-item label="其他费用">
<el-descriptions-item :label="$t('其他费用')">
<el-input v-model="form.otherFee" placeholder="" style="width:100px"></el-input>
<selector v-model="form.otherFeeCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
</el-descriptions-item>
<el-descriptions-item label="原价" :span="2">
<el-descriptions-item :label="$t('原价')" :span="2">
<!--TODO 缺少字段-->
<div>{{fee.clearanceNGN || 0}}奈拉</div>
<div>{{fee.clearanceRMB || 0}}人民币</div>
<div>{{fee.clearanceUSD || 0}}美元</div>
<div>{{fee.clearanceNGN || 0}}{{$t('奈拉')}}</div>
<div>{{fee.clearanceRMB || 0}}{{$t('人民币')}}</div>
<div>{{fee.clearanceUSD || 0}}{{$t('美元')}}</div>
</el-descriptions-item>
</el-descriptions>
<div class="card-title" style="padding:20px 0;">优惠信息</div>
<div class="card-title" style="padding:20px 0;">{{$t('优惠信息')}}</div>
<el-row v-for="(item, index) in couponTypeList" :key="item.value" :gutter="10">
<el-col :span="2">{{index+1}}.{{item.label}}</el-col>
<el-col :span="4">
<el-select placeholder="请选择优惠" v-model="selectedCoupons[item.value]" :data-type="item.value" clearable>
<el-select :placeholder="$t('请选择优惠')" v-model="selectedCoupons[item.value]" :data-type="item.value" clearable>
<template v-for="(coupon, index) in couponList">
<el-option v-if="coupon.type == +item.value" :key="coupon.couponId + '_' + index" :label="coupon.titleZh" :value="coupon.couponId"></el-option>
</template>
......@@ -281,60 +281,60 @@
-{{getCoupon(selectedCoupons[item.value]).reduceAmount}}
{{currentcyMap[getCoupon(selectedCoupons[item.value]).reduceCurrencyId]}}
</el-col>
<el-col :span="5" v-if="getCoupon(selectedCoupons[item.value])">有效期:{{getCoupon(selectedCoupons[item.value]).endTime || '永久有效'}}</el-col>
<el-col :span="5" v-if="getCoupon(selectedCoupons[item.value])">{{$t('有效期')}}:{{getCoupon(selectedCoupons[item.value]).endTime || $t('永久有效')}}</el-col>
</el-row>
<el-descriptions :column="1" border>
<el-descriptions-item label="优惠合计">
{{discount}}美元
<el-descriptions-item :label="$t('优惠合计')">
{{discount}}{{$t('美元')}}
</el-descriptions-item>
<el-descriptions-item label="预计费用">
<el-descriptions-item :label="$t('预计费用')">
// TODO
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="mt-10">
<div class="card-title" slot="header">通用</div>
<div class="card-title" slot="header">{{$t('通用')}}</div>
<el-descriptions :column="2" border>
<el-descriptions-item label="唛头">
<el-descriptions-item :label="$t('唛头')">
<el-form-item label="" prop="marks" label-width="0" style="margin-bottom: 0" >
<el-input v-model="form.marks" placeholder=""></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="是否控货">
<el-descriptions-item :label="$t('是否控货')">
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" formatter="bool" v-model="form.isCargoControl" form-type="radio" />
</el-descriptions-item>
<!--代收货款,只有非控货订单、并且线路开通了代收货款后,才显示是否代收货款选项-->
<el-descriptions-item label="是否代收货款" v-if="collectionProxy">
<el-descriptions-item :label="$t('是否代收货款')" v-if="collectionProxy">
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" formatter="bool" v-model="form.isCollection" form-type="radio" />
</el-descriptions-item>
<el-descriptions-item label="代收货款金额" v-if="collectionProxy">
<el-descriptions-item :label="$t('代收货款金额')" v-if="collectionProxy">
<el-input v-model="form.collectionProxy" placeholder="" class="w-200 mr-10"></el-input>
<selector v-model="form.collectionProxyCurrency" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-descriptions-item>
<el-descriptions-item label="单证报关" :span="2">
<el-descriptions-item :label="$t('单证报关')" :span="2">
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="form.customsType" form-type="radio" defaultable />
</el-descriptions-item>
<el-descriptions-item label="出单方式">
<el-descriptions-item :label="$t('出单方式')">
<dict-selector :type="DICT_TYPE.ECW_SUING_METHOD" v-model="form.issuingMethod" form-type="radio" defaultable />
</el-descriptions-item>
<el-descriptions-item label="送货日期">
<el-descriptions-item :label="$t('送货日期')">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="deliveryDate">
<el-date-picker v-model="form.deliveryDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="入仓类型">
<el-descriptions-item :label="$t('入仓类型')">
<dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="form.warehouseType" defaultable />
</el-descriptions-item>
<el-descriptions-item label="收货方式">
<el-descriptions-item :label="$t('收货方式')">
<dict-selector :type="DICT_TYPE.ECW_HARVEST_METHOD" v-model="form.harvestMethod" :filter="item => item.value == 1 || homeDeliveryService" defaultable />
</el-descriptions-item>
<el-descriptions-item label="收货地区" :span="2" v-if="homeDeliveryService">
<el-descriptions-item :label="$t('收货地区')" :span="2" v-if="homeDeliveryService">
<area-selector
:country="form.consigneeVO ? form.consigneeVO.country : undefined"
:province="form.consigneeVO ? form.consigneeVO.province : undefined"
......@@ -344,16 +344,16 @@
@cityChange="onAreaChange('city', $event)"
></area-selector>
</el-descriptions-item>
<el-descriptions-item label="收货详细地址" :span="2" v-if="homeDeliveryService">
<el-descriptions-item :label="$t('收货详细地址')" :span="2" v-if="homeDeliveryService">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="consigneeAddress">
<el-input v-model="form.consigneeAddress" placeholder=""></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="付款人" :span="2">
<el-descriptions-item :label="$t('付款人')" :span="2">
<dict-selector :type="DICT_TYPE.DRAWEE" v-model="form.drawee" defaultable form-type="radio" />
</el-descriptions-item>
<el-descriptions-item v-if="form.drawee==3" label="费用类型" :span="2">
<el-descriptions-item v-if="form.drawee==3" :label="$t('费用类型')" :span="2">
<template v-for="(item,index) in customDraweeList" v-key="index">
<el-form-item :label="item.label" :key="index" >
<dict-selector :type="DICT_TYPE.DRAWEE" :filter="(e) => e.value == '1' || e.value == '2'" v-model="item.value" form-type="radio" />
......@@ -365,26 +365,26 @@
<el-card class="mt-10" v-if="transport">
<div class="card-title" slot="header">{{transport.label}}</div>
<el-form-item label="快递单号">
<el-input v-model="form.number" placeholder="请输入购买商品的快递单号">
<el-button type="primary" slot="append" @click="getOrderCourierNumber">生成单号</el-button>
<el-form-item :label="$t('快递单号')">
<el-input v-model="form.number" :placeholder="$t('请输入购买商品的快递单号')">
<el-button type="primary" slot="append" @click="getOrderCourierNumber">{{$t('生成单号')}}</el-button>
</el-input>
</el-form-item>
<el-form-item label="是否双清" v-if="[2,3,4].indexOf(+form.transportId) > -1">
<el-form-item :label="$t('是否双清')" v-if="[2,3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.doubleClear" form-type="radio" :type="DICT_TYPE.ECW_DOUBLE_CLEAR" />
</el-form-item>
<el-form-item label="航空公司" 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>
</el-form-item>
<el-form-item label="船公司" 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>
</el-form-item>
<el-form-item label="清关证书" v-if="[2,3,4].indexOf(+form.transportId) > -1">
<el-form-item :label="$t('清关证书')" v-if="[2,3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.customsClearCert" form-type="radio" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" />
</el-form-item>
<el-form-item label="清关证书备注" v-if="[2,3,4].indexOf(+form.transportId) > -1">
......@@ -393,58 +393,58 @@
<el-form-item label="是否拆包" v-if="[3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.isUnpack" form-type="radio" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" />
</el-form-item>
<el-form-item label="单票立刻转运" v-if="[3,4].indexOf(+form.transportId) > -1">
<el-form-item :label="$t('单票立刻转运')" v-if="[3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.isSingleTicketTransport" form-type="radio" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" />
<span style="margin-left:10px">注:若只有一件,货到仓库立即发,选“是”,多件需仓库集运待发,选“否”</span>
<span style="margin-left:10px">{{$t('注:若只有一件,货到仓库立即发,选“是”,多件需仓库集运待发,选“否”')}}</span>
</el-form-item>
<el-form-item label="特殊要求" >
<el-form-item :label="$t('特殊要求')" >
<dict-selector v-model="form.packageType" form-type="checkbox" :type="DICT_TYPE.ORDER_SPECIAL_NEEDS" multiple />
</el-form-item>
<el-form-item label="特殊要求备注">
<el-form-item :label="$t('特殊要求备注')">
<el-input v-model="form.packageRemarks" ></el-input>
</el-form-item>
</el-card>
<el-form-item label="" style="margin: 30px 0">
<el-button type="primary" @click="submitForm(0)">保 存</el-button> <!--草稿-->
<el-button type="primary" @click="submitForm(2)">新建</el-button> <!--待入仓-->
<el-button @click="$router.back()">返回</el-button>
<el-button type="primary" @click="submitForm(0)">{{$t('保存')}}</el-button> <!--草稿-->
<el-button type="primary" @click="submitForm(2)">{{$t('新建')}}</el-button> <!--待入仓-->
<el-button @click="$router.back()">{{$t('返回')}}</el-button>
</el-form-item>
</el-form>
<el-dialog title="批量导入" :visible.sync="showBatchImportDialog" width="1000px" :close-on-click-modal="false">
<el-dialog :title="$t('批量导入')" :visible.sync="showBatchImportDialog" width="1000px" :close-on-click-modal="false">
<el-steps :active="importList.length > 0 ? 1 : 0" finish-status="success" class="w-500" style="margin: 20px auto">
<el-step title="上传集装箱"></el-step>
<el-step title="开始导入"></el-step>
<el-step title="完成"></el-step>
<el-step :title="$t('上传集装箱')"></el-step>
<el-step :title="$t('开始导入')"></el-step>
<el-step :title="$t('完成')"></el-step>
</el-steps>
<div class="mt-20">
<el-upload :http-request="upload" :show-file-list="false" action="" class="mr-10" style="display:inline-block; ">
<el-button size="small" type="primary">点击上传</el-button>
<el-button size="small" type="primary">{{$t('点击上传')}}</el-button>
</el-upload>
<el-button type="info" @click="downloadTpl" size="small" :loading="exportLoading">装箱单模板</el-button>
<el-button type="info" @click="downloadTpl" size="small" :loading="exportLoading">{{$t('装箱单模板')}}</el-button>
</div>
<el-table :data="importList" class="mt-10" height="300">
<el-table-column label="序号">
<el-table-column :label="$t('序号')">
<template slot-scope="scope">{{scope.$index + 1}}</template>
</el-table-column>
<el-table-column label="中文品名" prop="prodTitleZh"></el-table-column>
<el-table-column label="英文品名" prop="prodTitleEn"></el-table-column>
<el-table-column label="品牌" prop="brand"></el-table-column>
<el-table-column label="件数" prop="num"></el-table-column>
<el-table-column label="重量(kg)" prop="weight"></el-table-column>
<el-table-column label="体积(m³)" prop="volume"></el-table-column>
<el-table-column :label="$t('中文品名')" prop="prodTitleZh"></el-table-column>
<el-table-column :label="$t('英文品名')" prop="prodTitleEn"></el-table-column>
<el-table-column :label="$t('品牌')" prop="brand"></el-table-column>
<el-table-column :label="$t('件数')" prop="num"></el-table-column>
<el-table-column :label="$t('重量') + '(kg)'" prop="weight"></el-table-column>
<el-table-column :label="$t('体积') + '(m³)'" prop="volume"></el-table-column>
<!-- <el-table-column label="有无单证" prop="">// TODO</el-table-column> -->
<!-- <el-table-column label="缺货箱数" prop="lessNum"></el-table-column> -->
<el-table-column label="数量" prop="quantity"></el-table-column>
<el-table-column label="材质" prop="material"></el-table-column>
<el-table-column :label="$t('数量')" prop="quantity"></el-table-column>
<el-table-column :label="$t('材质')" prop="material"></el-table-column>
</el-table>
<div class="mt-10 center">
<el-button type="primary" @click="addToProductList">下一步</el-button>
<el-button type="default" @click="showBatchImportDialog=false">取消</el-button>
<el-button type="primary" @click="addToProductList">{{$t('下一步')}}</el-button>
<el-button type="default" @click="showBatchImportDialog=false">{{$t('取消')}}</el-button>
</div>
</el-dialog>
</div>
......@@ -504,16 +504,16 @@ export default {
},
// 表单校验
rules: {
marks : [{required: true, message: '请填写唛头'}],
consignorContactsId : [{required: true, message: '发货人不能为空'}],
consigneeContactsId : [{required: true, message: '收货人不能为空'}],
transportId : [{required: true, message: '请选择运输方式'}],
departureId : [{required: true, message: '请选择始发城市'}],
objectiveId : [{required: true, message: '请选择目的城市'}],
lineId : [{required: true, message: '请选择路线'}],
channelId : [{required: true, message: '请选择出货渠道'}],
deliveryDate : [{required: true, message: '请选择送货日期'}],
consigneeAddress : [{required: true, message: '请填写详细地址'}]
marks : [{required: true, message: this.$t('请填写唛头')}],
consignorContactsId : [{required: true, message: this.$t('发货人不能为空')}],
consigneeContactsId : [{required: true, message: this.$t('收货人不能为空')}],
transportId : [{required: true, message: this.$t('请选择运输方式')}],
departureId : [{required: true, message: this.$t('请选择始发城市')}],
objectiveId : [{required: true, message: this.$t('请选择目的城市')}],
lineId : [{required: true, message: this.$t('请选择路线')}],
channelId : [{required: true, message: this.$t('请选择出货渠道')}],
deliveryDate : [{required: true, message: this.$t('请选择送货日期')}],
consigneeAddress : [{required: true, message: this.$t('请填写详细地址')}]
},
labelStyle: 'width:120px',
showBatchImportDialog: false, // 显示批量导入弹窗
......@@ -741,12 +741,12 @@ export default {
downloadTpl(){
this.exportLoading = true;
exportPackingList().then(response => {
this.$download.excel(response, '装箱单模板.xls');
this.$download.excel(response, this.$t('装箱单模板') + '.xls');
this.exportLoading = false;
}).catch(() => { });
},
setLink(row){
this.$prompt('请输入商品链接', {inputValue: row.link}).then(({value}) => {
this.$prompt(this.$t('请输入商品链接'), {inputValue: row.link}).then(({value}) => {
console.log('value', value)
this.$set(row, 'link', value)
})
......@@ -848,7 +848,7 @@ export default {
},
// 删除一条产品
delProduct(index){
this.$confirm('确定删除此条内容么?')
this.$confirm(this.$t('确定删除此条内容么?'))
.then(res => {
this.productList.splice(index, 1)
})
......@@ -893,7 +893,7 @@ export default {
})
data.type = data.type.join(',')
updateOrder(data).then(response => {
this.$modal.msgSuccess("修改成功");
this.$modal.msgSuccess(this.$t("修改成功"));
this.$router.back()
});
return;
......@@ -912,7 +912,7 @@ export default {
data.type = data.type.join(',')
// 添加的提交
createOrder(data).then(response => {
this.$modal.msgSuccess("新增成功");
this.$modal.msgSuccess(this.$t("新增成功"));
this.$router.replace('success?orderId=' + response.data)
});
});
......
......@@ -2,44 +2,44 @@
<div class="app-container">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="适用商品" prop="idList">
<el-form-item :label="$t('适用商品')" prop="idList">
<products-selector :defaultIds="form.idList" v-model="form.idList" />
</el-form-item>
<el-form-item label="货柜位置" prop="containerLocation">
<el-form-item :label="$t('货柜位置')" prop="containerLocation">
<dict-selector :type="DICT_TYPE.ECW_CONTAINER_LOCATION" v-model="form.containerLocation" />
</el-form-item>
<el-form-item label="出运要求" prop="requirements">
<el-checkbox true-label="1" v-model="form.requirements">证书要求(支持多证书)</el-checkbox>
<el-form-item :label="$t('出运要求')" prop="requirements">
<el-checkbox true-label="1" v-model="form.requirements">{{$t('证书要求(支持多证书)')}}</el-checkbox>
</el-form-item>
<el-form-item label="订单方数上限" prop="square">
<el-form-item :label="$t('订单方数上限')" prop="square">
<el-input v-model="form.square" placeholder="" class="w-200"></el-input>
</el-form-item>
<el-form-item label="包装要求" prop="packaging">
<el-form-item :label="$t('包装要求')" prop="packaging">
<dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="form.packaging" />
</el-form-item>
<el-form-item label="是否预约入仓" prop="needBook">
<el-form-item :label="$t('是否预约入仓')" prop="needBook">
<dict-selector formatter="bool" form-type="radio" :type="DICT_TYPE.ECW_YESNO" v-model="form.needBook" :formater="Boolean" />
</el-form-item>
<el-form-item label="每日入仓上限" prop="dayLimit" v-if="form.needBook">
<el-form-item :label="$t('每日入仓上限')" prop="dayLimit" v-if="form.needBook">
<el-input placeholder="" v-model="form.dayLimit" class="w-200">
<template slot="suffix">立方米</template>
<template slot="suffix">{{$t('立方米')}}</template>
</el-input>
</el-form-item>
<el-form-item label="商品特性" prop="attrId">
<el-form-item :label="$t('商品特性')" prop="attrId">
<!-- <dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_ORDER_ATTR" v-model="form.attrId" multiple /> -->
<el-checkbox-group v-model="attrIds">
<el-checkbox v-for="item in attrList" :label="item.id" :key="item.id">{{item.attrName}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="商品材质" prop="materialType">
<el-form-item :label="$t('商品材质')" prop="materialType">
<dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form.materialType" multiple />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="$router.back()">返 回</el-button>
<el-button type="default" @click="reset">重 置</el-button>
<el-button type="primary" @click="submitForm">{{$t('确定')}}</el-button>
<el-button @click="$router.back()">{{$t('返回')}}</el-button>
<el-button type="default" @click="reset">{{$t('重置')}}</el-button>
</el-form-item>
</el-form>
</div>
......@@ -128,7 +128,7 @@ export default {
}
let data = Object.assign({}, this.form)
batchUpdateProduct(data).then((response) => {
this.$modal.msgSuccess("修改成功");
this.$modal.msgSuccess(this.$t("修改成功"));
this.$router.back();
});
});
......
......@@ -3,13 +3,13 @@
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="关键字" prop="attrName">
<el-input v-model="queryParams.attrName" placeholder="请输入关键字" clearable @keyup.enter.native="handleQuery"/>
<el-form-item :label="$t('关键字')" prop="attrName">
<el-input v-model="queryParams.attrName" :placeholder="$t('请输入关键字')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</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>
......@@ -17,7 +17,7 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ecw:product-attr:create']">新增</el-button>
v-hasPermi="['ecw:product-attr:create']">{{$t('新增')}}</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
......@@ -25,23 +25,23 @@
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="编号" align="center" prop="id" />
<el-table-column label="排序" align="center" prop="sort" />
<el-table-column label="属性名称" align="center" prop="attrName" />
<el-table-column label="属性代码" align="center" prop="attrCode" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column prop="status" label="状态" width="100">
<el-table-column :label="$t('编号')" align="center" prop="id" />
<el-table-column :label="$t('排序')" align="center" prop="sort" />
<el-table-column :label="$t('属性名称')" align="center" prop="attrName" />
<el-table-column :label="$t('属性代码')" align="center" prop="attrCode" />
<el-table-column :label="$t('备注')" align="center" prop="remark" />
<el-table-column prop="status" :label="$t('状态')" width="100">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" :active-value="CommonStatusEnum.ENABLE" :inactive-value="CommonStatusEnum.DISABLE" @change="handleStatusChange(scope.row)" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:product-attr:update']">修改</el-button>
v-hasPermi="['ecw:product-attr:update']">{{$t('修改')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:product-attr:delete']">删除</el-button>
v-hasPermi="['ecw:product-attr:delete']">{{$t('删除')}}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -51,28 +51,31 @@
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" placeholder="请输入排序" />
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item :label="$t('排序')" prop="sort">
<el-input v-model="form.sort" :placeholder="$t('请输入排序')" />
</el-form-item>
<el-form-item label="属性名称" prop="attrName">
<el-input v-model="form.attrName" placeholder="请输入属性名称" />
<el-form-item :label="$t('属性名称')" prop="attrName">
<el-input v-model="form.attrName" :placeholder="$t('请输入属性名称')" />
</el-form-item>
<el-form-item label="属性代码" prop="attrCode">
<el-input v-model="form.attrCode" placeholder="请输入属性代码" />
<el-form-item :label="$t('属性英文名')" prop="attrName">
<el-input v-model="form.attrNameEn" :placeholder="$t('请输入属性英文名')" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
<el-form-item :label="$t('属性代码')" prop="attrCode">
<el-input v-model="form.attrCode" :placeholder="$t('请输入属性代码')" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="form.status" placeholder="请选择状态">
<el-option v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/>
<el-form-item :label="$t('备注')" prop="remark">
<el-input v-model="form.remark" :placeholder="$t('请输入备注')" />
</el-form-item>
<el-form-item :label="$t('状态')" prop="status">
<el-select v-model="form.status" :placeholder="$t('请选择状态')">
<el-option v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="$l(dict, 'label')" :value="parseInt(dict.value)"/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="submitForm">{{$t('确定')}}</el-button>
<el-button @click="cancel">{{$t('取消')}}</el-button>
</div>
</el-dialog>
</div>
......@@ -119,9 +122,9 @@ export default {
form: {},
// 表单校验
rules: {
attrName: [{ required: true, message: "属性名称不能为空", trigger: "blur" }],
attrCode: [{ required: true, message: "属性代码不能为空", trigger: "blur" }],
sort: [{ required: true, message: "排序不能为空", trigger: "blur" }],
attrName: [{ required: true, message: this.$t("属性名称不能为空"), trigger: "blur" }],
attrCode: [{ required: true, message: this.$t("属性代码不能为空"), trigger: "blur" }],
sort: [{ required: true, message: this.$t("排序不能为空"), trigger: "blur" }],
},
// 枚举
CommonStatusEnum: CommonStatusEnum,
......@@ -178,7 +181,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = "添加产品属性";
this.title = this.$t("添加产品属性");
},
/** 修改按钮操作 */
handleUpdate(row) {
......@@ -187,7 +190,7 @@ export default {
getProductAttr(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改产品属性";
this.title = this.$t("修改产品属性");
});
},
/** 提交按钮 */
......@@ -199,7 +202,7 @@ export default {
// 修改的提交
if (this.form.id != null) {
updateProductAttr(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.$modal.msgSuccess(this.$t("修改成功"));
this.open = false;
this.getList();
});
......@@ -207,7 +210,7 @@ export default {
}
// 添加的提交
createProductAttr(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.$modal.msgSuccess(this.$t("新增成功"));
this.open = false;
this.getList();
});
......@@ -215,12 +218,12 @@ export default {
},
handleStatusChange(row) {
let text = row.status === CommonStatusEnum.ENABLE ? "启用" : "停用";
this.$modal.confirm('确认要' + text + '编号为' + row.id + '的数据吗?').then(function() {
let text = row.status === CommonStatusEnum.ENABLE ? this.$t("确定要启用此数据么?") : this.$t("确定要停用此数据么?");
this.$modal.confirm(text).then(function() {
return updateProductAttr(row);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
this.$modal.msgSuccess("操作成功");
}).catch(function() {
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE
: CommonStatusEnum.ENABLE;
......@@ -230,11 +233,11 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除产品属性编号为"' + id + '"的数据项?').then(function() {
this.$modal.confirm(this.$t('是否确认删除产品属性编号为{id}的数据项?', {id})).then(function() {
return deleteProductAttr(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
this.$modal.msgSuccess(this.$t("删除成功"));
}).catch(() => {});
},
/** 导出按钮操作 */
......@@ -245,7 +248,7 @@ export default {
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm('是否确认导出所有产品属性数据项?').then(() => {
this.$modal.confirm(this.$t('是否确认导出所有产品属性数据项?')).then(() => {
this.exportLoading = true;
return exportProductAttrExcel(params);
}).then(response => {
......
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