|
@@ -3,19 +3,19 @@
|
|
|
<!--工具条-->
|
|
|
<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
|
<el-form :inline="true">
|
|
|
- <el-form-item label="客户列表">
|
|
|
+ <el-form-item :label="$t('clientlist')">
|
|
|
|
|
|
</el-form-item>
|
|
|
<el-form-item >
|
|
|
<div>
|
|
|
- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入客户名称关键字" clearable="true">
|
|
|
+ <el-input style="float:left;" v-model="keyword" class="input-with-select" :placeholder="$t('pleaseenterthecustomernamekeyword')" clearable="true">
|
|
|
<el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float:right;">
|
|
|
- <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">新增客户</el-link>
|
|
|
- <el-link type="primary" :underline="false" @click="intocustomerRatio">批量导入客户</el-link>
|
|
|
+ <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">{{ $t('newcustomer') }}</el-link>
|
|
|
+ <el-link type="primary" :underline="false" @click="intocustomerRatio">{{ $t('importingCustomersinBatches') }}</el-link>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
@@ -27,29 +27,29 @@
|
|
|
{{scope.$index+1+(page-1)*size}}
|
|
|
</template> -->
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="customerCode" label="客户编码" width="120" sortable="custom"></el-table-column>
|
|
|
- <el-table-column prop="customerName" label="客户名称" >
|
|
|
+ <el-table-column prop="customerCode" :label="$t('clientcode')" width="160" sortable="custom"></el-table-column>
|
|
|
+ <el-table-column prop="customerName" :label="$t('customername')" >
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="contactName" label="联系人" width="120">
|
|
|
+ <el-table-column prop="contactName" :label="$t('contact')" width="120">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="contactPhone" label="联系电话" width="150">
|
|
|
+ <el-table-column prop="contactPhone" :label="$t('contactphonenumber')" width="150">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="email" label="邮箱" width="180">
|
|
|
+ <el-table-column prop="email" :label="$t('email')" width="180">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="地址" sortable="custom">
|
|
|
+ <el-table-column prop="address" :label="$t('address')" sortable="custom">
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="操作" width="150">
|
|
|
+ <el-table-column :label="$t('operation')" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="primary" @click="handleAdd(scope.$index, scope.row)">编辑</el-button>
|
|
|
- <el-button size="mini" @click="deletePro(scope.$index, scope.row)">删除</el-button>
|
|
|
+ <el-button size="mini" type="primary" @click="handleAdd(scope.$index, scope.row)">{{ $t('bian-ji') }}</el-button>
|
|
|
+ <el-button size="mini" @click="deletePro(scope.$index, scope.row)">{{ $t('btn.delete') }}</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<!--工具条-->
|
|
|
<el-col :span="24" class="toolbar">
|
|
|
- <el-button type="primary" size="small" @click="batchDelete" :loading="delLoading">批量删除</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="batchDelete" :loading="delLoading">{{ $t('Batchdelete') }}</el-button>
|
|
|
<el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
@@ -64,49 +64,49 @@
|
|
|
<!--新增界面-->
|
|
|
<el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
|
|
|
<el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
|
|
|
- <el-form-item label="客户编号" >
|
|
|
- <el-input v-model="addForm.customerCode" :max="20" placeholder="请输入客户编号" clearable></el-input>
|
|
|
+ <el-form-item label="$t('ustomernumber')" >
|
|
|
+ <el-input v-model="addForm.customerCode" :max="20" :placeholder="$t('peaseenterthe')" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="客户名称" prop="customerName">
|
|
|
- <el-input v-model="addForm.customerName" :max="20" placeholder="请输入客户名称" clearable></el-input>
|
|
|
+ <el-form-item label="$t('customername')" prop="customerName">
|
|
|
+ <el-input v-model="addForm.customerName" :max="20" :placeholder="$t('peaseenterthe')" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="联系人" prop="contactName">
|
|
|
- <el-input v-model="addForm.contactName" :max="20" placeholder="请输入客户联系人" clearable></el-input>
|
|
|
+ <el-form-item label="$t('contact')" prop="contactName">
|
|
|
+ <el-input v-model="addForm.contactName" :max="20" :placeholder="$t('peaseenterthe')" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="联系电话" prop="contactPhone">
|
|
|
- <el-input v-model="addForm.contactPhone" :max="20" placeholder="请输入客户联系电话" clearable></el-input>
|
|
|
+ <el-form-item label="$t('contactphonenumber')" prop="contactPhone">
|
|
|
+ <el-input v-model="addForm.contactPhone" :max="20" :placeholder="$t('peaseenterthe')" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="邮箱" prop="email">
|
|
|
- <el-input v-model="addForm.email" :max="25" placeholder="请输入客户邮箱" clearable></el-input>
|
|
|
+ <el-form-item label="$t('email')" prop="email">
|
|
|
+ <el-input v-model="addForm.email" :max="25" :placeholder="$t('peaseenterthe')" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="地址" prop="address">
|
|
|
- <el-input v-model="addForm.address" :max="50" placeholder="请输入客户联系地址" clearable></el-input>
|
|
|
+ <el-form-item label="$t('address')" prop="address">
|
|
|
+ <el-input v-model="addForm.address" :max="50" :placeholder="$t('peaseenterthe')" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer;">
|
|
|
- <el-button @click.native="addFormVisible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
|
|
|
+ <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
|
|
|
+ <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 导入结果说明 -->
|
|
|
- <el-dialog title="分摊比例导入结果" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
|
|
|
+ <el-dialog :title="$t('importingtheallocationratio')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
|
|
|
<div>
|
|
|
<span>{{importResultMsg}}</span>
|
|
|
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="showImportResult=false">确定</el-button>
|
|
|
+ <el-button type="primary" @click="showImportResult=false">{{ $t('btn.determine') }}</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="导入客户数据" v-if="intocustomerDialog" :visible.sync="intocustomerDialog" customClass="customWidth" width="500px">
|
|
|
- <p>1. 下载
|
|
|
- <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/新增客户导入模板.xlsx" download="新增客户导入模板.xlsx">新增客户导入模板.xlsx</el-link>
|
|
|
+ <el-dialog :title="$t('importingCustomerData')" v-if="intocustomerDialog" :visible.sync="intocustomerDialog" customClass="customWidth" width="500px">
|
|
|
+ <p>1. {{ $t('other.download') }}
|
|
|
+ <el-link type="primary" style="margin-left:5px;" :underline="false" :href="'./upload/'+$t('customerimporttemplatisadded')+'.xlsx'" :download="$t('customerimporttemplatisadded')+'.xlsx'">{{$t('customerimporttemplatisadded')}}.xlsx</el-link>
|
|
|
</p>
|
|
|
<!-- <p>2. 填写excel模板,请确保模板中的项目和人员已添加到系统中。</p> -->
|
|
|
<p style="display: flex;justify-content: center;padding:1em 0">
|
|
|
<el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
|
|
|
- <el-button type="primary" :underline="false" :loading="importingData">开始导入</el-button>
|
|
|
+ <el-button type="primary" :underline="false" :loading="importingData">{{ $t('other.startImporting') }}</el-button>
|
|
|
</el-upload>
|
|
|
</p>
|
|
|
</el-dialog>
|
|
@@ -131,10 +131,10 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- roleArray:["普通员工","超级管理员", "系统管理员", "公司高层","财务管理员", "项目管理员"],
|
|
|
+ roleArray:[this.$t('role.ordinaryEmployees'),this.$t('role.superAdministrator'), this.$t('role.systemAdministrator'), this.$t('role.companyTop'),this.$t('role.financialAdministrator'), this.$t('role.projectManager')],
|
|
|
status:null,
|
|
|
- statusTxt:["-","进行中","已完成","已撤销"],
|
|
|
- importanceList:[{id:1,label:'正常'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}],
|
|
|
+ statusTxt:["-",this.$t('ongoing'),this.$t('state.completed'),this.$t('state.undone')],
|
|
|
+ importanceList:[{id:1,label:this.$t('zheng-chang')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}],
|
|
|
searchField:null,
|
|
|
keyword:null,
|
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
@@ -163,7 +163,7 @@
|
|
|
level:1,
|
|
|
},
|
|
|
rules: {
|
|
|
- customerName: [{ required: true, message: "请输入客户名称", trigger: "blur" }],
|
|
|
+ customerName: [{ required: true, message: this.$t('pleaseenterthecustomername'), trigger: "blur" }],
|
|
|
},
|
|
|
intocustomerDialog:false,
|
|
|
importingData: false,
|
|
@@ -204,7 +204,7 @@
|
|
|
},
|
|
|
batchDelete(){
|
|
|
if(this.selectArr.length == 0){
|
|
|
- this.$message('请选择要删除的客户数据')
|
|
|
+ this.$message(this.$t('selecttheustomerdatayouwanttodelete'))
|
|
|
return
|
|
|
}else{
|
|
|
let nametext = ''
|
|
@@ -212,9 +212,9 @@
|
|
|
nametext += this.selectArr[i].customerName + '、'
|
|
|
}
|
|
|
nametext = nametext.substring(0,nametext.length - 1)
|
|
|
- this.$confirm("确定要批量删除客户:" + nametext + "\u3000吗?","删除客户", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
+ this.$confirm(this.$t('determinethatyouwantodelete') +":" + nametext + "\u3000"+this.$t('ma')+"?",this.$t('deleteCustomer'), {
|
|
|
+ confirmButtonText: this.$t('btn.determine'),
|
|
|
+ cancelButtonText: this.$t('btn.cancel'),
|
|
|
type: "warning"
|
|
|
}).then(()=>{
|
|
|
this.delLoading = true
|
|
@@ -229,7 +229,7 @@
|
|
|
this.delLoading = false
|
|
|
if(res.code == 'ok'){
|
|
|
this.$message({
|
|
|
- message: '删除成功',
|
|
|
+ message: this.$t('message.successfullyDeleted'),
|
|
|
type: 'success'
|
|
|
})
|
|
|
this.getList()
|
|
@@ -259,7 +259,7 @@
|
|
|
let format = str[str.length - 1];
|
|
|
if (format != "xls" && format != "xlsx") {
|
|
|
this.$message({
|
|
|
- message: "请选择.xls或.xlsx文件",
|
|
|
+ message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
|
|
|
type: "error"
|
|
|
});
|
|
|
} else {
|
|
@@ -273,10 +273,10 @@
|
|
|
this.showImportResult = true;
|
|
|
if (res.code == "ok") {
|
|
|
//换成弹出框,以免有人等了半天回来啥也没看到
|
|
|
- this.importResultMsg = "成功导入/更新"+res.data+"条客户数据。"+(res.msg?res.msg:"");
|
|
|
+ this.importResultMsg = this.$t('importedupdatedsuccessfully')+res.data+this.$t('customerdata')+(res.msg?res.msg:"");
|
|
|
this.getList();
|
|
|
} else {
|
|
|
- this.importResultMsg = "导入失败:"+res.msg;
|
|
|
+ this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
|
|
|
}
|
|
|
},
|
|
|
error => {
|
|
@@ -295,7 +295,7 @@
|
|
|
let format = str[str.length - 1];
|
|
|
if (format != "xls" && format != "xlsx") {
|
|
|
this.$message({
|
|
|
- message: "请选择.xls或.xlsx文件",
|
|
|
+ message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
|
|
|
type: "error"
|
|
|
});
|
|
|
} else {
|
|
@@ -309,7 +309,7 @@
|
|
|
this.listLoading = false;
|
|
|
if (res.code == "ok") {
|
|
|
this.$message({
|
|
|
- message: "导入成功",
|
|
|
+ message: this.$t('other.importSuccess'),
|
|
|
type: "success"
|
|
|
});
|
|
|
this.getList();
|
|
@@ -335,9 +335,9 @@
|
|
|
// this.addForm.budget = this.addForm.budget.replace('.','');
|
|
|
},
|
|
|
deleteSubPro(subProject) {
|
|
|
- this.$confirm("确定要删除子项目" + subProject.name + "吗?","删除子项目", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
+ this.$confirm(this.$t('makesuretodeletethesubproject') + subProject.name + this.$t('ma'),this.$t('deletesubproject'), {
|
|
|
+ confirmButtonText: this.$t('btn.determine'),
|
|
|
+ cancelButtonText: this.$t('btn.cancel'),
|
|
|
type: "warning"
|
|
|
})
|
|
|
.then(() => {
|
|
@@ -349,7 +349,7 @@
|
|
|
this.listLoading = false;
|
|
|
if (res.code == "ok") {
|
|
|
this.$message({
|
|
|
- message: "删除成功",
|
|
|
+ message: this.$t('message.successfullyDeleted'),
|
|
|
type: "success"
|
|
|
});
|
|
|
this.subProject(this.currentProject);
|
|
@@ -499,11 +499,11 @@
|
|
|
//显示新增界面
|
|
|
handleAdd(i, item) {
|
|
|
if(i == -1) {
|
|
|
- this.title = "新增客户";
|
|
|
+ this.title = this.$t('newcustomer');
|
|
|
this.addForm = {
|
|
|
}
|
|
|
} else {
|
|
|
- this.title = "修改客户";
|
|
|
+ this.title = this.$t('modifythecustomer');
|
|
|
this.addForm = JSON.parse(JSON.stringify(item));
|
|
|
}
|
|
|
this.addFormVisible = true;
|
|
@@ -539,9 +539,9 @@
|
|
|
|
|
|
// 删除
|
|
|
deletePro(i, item) {
|
|
|
- this.$confirm("确定要删除客户" + item.customerName + "吗?","删除客户", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
+ this.$confirm(this.$t('makeuretodeletethecustomer') + item.customerName + this.$t('ma'),this.$t('deleteCustomer'), {
|
|
|
+ confirmButtonText: this.$t('btn.determine'),
|
|
|
+ cancelButtonText: this.$t('btn.cancel'),
|
|
|
type: "warning"
|
|
|
})
|
|
|
.then(() => {
|
|
@@ -553,7 +553,7 @@
|
|
|
this.listLoading = false;
|
|
|
if (res.code == "ok") {
|
|
|
this.$message({
|
|
|
- message: "删除成功",
|
|
|
+ message: this.$t('message.successfullyDeleted'),
|
|
|
type: "success"
|
|
|
});
|
|
|
this.getList();
|