Przeglądaj źródła

国际化版本修改——基础管理页面

sunyadv 5 lat temu
rodzic
commit
5f3b088e3e

+ 78 - 23
ys_int/src/i18n/lang/en.js

@@ -1,72 +1,128 @@
 import locale from 'element-ui/lib/locale/lang/en'
 const lang = {
+    // 基础
     base: {
         title: "YunSu CMS",
         account: "Account",
         password: "Password",
         login: "Login",
         prompt: "Prompt",
-
-        name: "Name",
-        mobile: "Mobile",
-        company: "Company",
+        query: "Query",
+        add: "Add",
+        operate: "Operate",
+        edit: "Edit",
+		imput: "Batch Imput",
+		use: "Start",
+    },
+    prompt: {
+        success: "Modify Success",
+        success1: "Success,please login again",
+        success2: "Created Success",
+        success3: "Delete Success",
+		success4: "Upload Success",
     },
     msg: {
         changeLanguage: "Whether to change the language?",
         signOut: "Whether to log out?",
         loginAcc: "Please input Accounts",
         loginPass: "Please input Password",
-
         inputNewPwd: "Please enter a new password",
-        inputName: "Please input Name",
-        inputMobile: "Please input Mobile",
-        inputCompany: "Please input Company",
     },
+    // 主页
     home: {
         approval: "Approval",
         noApproval: "No approval message",
-
         warning: "Warning",
         noWarning: "No warning message",
-
         maintain: "Maintain",
         noMaintain: "No maintenance message",
-
         all: "View All",
-
         pwd: "Change Password",
-
         newPwd: "New Password",
-
         msg: "Modify Information",
         exit: "Sign Out",
+        noPage: "No Page!!!",
+        back: "Back To Home",
     },
+    // 路由
     navigation: {
         map: "Map",
         test: "Running Test",
         msg: "Message Center",
-
         pro: "Project Manage",
         proList: "Project List",
         staff: "Personnel Manage",
         power: "Competence Manage",
-
         mold: "Mold Manage",
         moldList: "Mold List",
         moldDown: "Document Download",
-
         base: "Basic Manage",
         asset: "Asset Manage",
         producer: "Producer Manage",
         device: "YM Mold Manage",
     },
-    prompt: {
-        success: "Success",
-        success1: "Success,please login again",
+    project: {
+        // 人员管理
+        initial: "Initial Password",
+        name: "Name",
+        inputName: "Please input Name",
+        mobile: "Mobile",
+        inputMobile: "Please input Mobile",
+        inputTrueMobile: "Please enter a valid phone number",
+        role: "Role",
+        inputRole: "Please input Role",
+        company: "Company",
+        inputCompany: "Please input Company",
     },
-    sys: {
-
+    // 基础管理
+    basic: {
+        next: "Next",
+        prev: "Prev",
+        system: "System Admin",
+        asset: "Asset",
+        addAsset: "Add Asset",
+        editAsset: "Edit Asset",
+        addSystem: "Add Asset Manager",
+        producer: "Producer",
+        addProducer: "Add Producer",
+        editProducer: "Edit Producer",
+        addProSystem: "Add Producer Manager",
+        // 资产方管理
+        inputAss: "Please enter the asset name to search",
+        assName: "Asset Name",
+        inputAssName: "Please enter the asset name",
+        assManager: "Asset Manager",
+        assProducer: "Associated Producer",
+        inputAssProducer: "Please select the producer",
+        assAddress: "Asset Address",
+        inputAssAddress: "Please enter the asset address",
+        delAss: "Are you sure to delete the asset?",
+        // 生产方管理
+        inputPro: "Please enter the producer name to search",
+        proName: "Producer Name",
+        inputProName: "Please enter the producer name",
+        proManager: "Producer Manager",
+        proAsset: "Associated Asset",
+        inputProAsset: "Please select the asset",
+        proAddress: "Producer Address",
+        inputProAddress: "Please enter the producer address",
+        delPro: "Are you sure to delete the producer?",
+		// 云模盒管理
+		addYM: "Add Equipment",
+		editYM: "Edit Equipment",
+		chooseComp: "Please select a company",
+		keySearch: "Please select a keyword to search",
+		equipmentNo: "Equipment Num",
+		inputequipmentNo: "Please enter the equipment number",
+		useLife: "Years of use",
+		inputUseLife: "Please enter the years of use",
+		inputUseLifeNum: "The age must be a numeric value",
+		agent: "Agent",
+		inputAgent: "Please enter the agent",
+		inputBlongComp: "You can activate the mold after entering your company.",
+		inUse: "Equipment is enabled",
     },
+    // 后台翻译
     port: {
         "用户不存在或者未登录": "User does not exist or is not logged in",
         "数据不可为空": "Data cannot be empty",
@@ -96,5 +152,4 @@ const lang = {
     },
     ...locale
 }
-
 export default lang

+ 78 - 25
ys_int/src/i18n/lang/zh.js

@@ -1,73 +1,126 @@
 import locale from 'element-ui/lib/locale/lang/zh-CN'
 const lang = {
+    // 基础
     base: {
         title: "云塑网后台管理系统",
         account: "账号",
         password: "密码",
         login: "登录",
         prompt: "提示",
-
-        name: "姓名",
-        mobile: "手机号",
-        company: "所属公司",
+        query: "查询",
+        add: "新增",
+        operate: "操作",
+        edit: "编辑",
+		imput: "批量导入",
+		use: "启用",
+    },
+    prompt: {
+        success: "修改成功",
+        success1: "修改成功,请重新登录",
+        success2: "创建成功",
+        success3: "删除成功",
+		success4: "上传成功",
     },
     msg: {
         changeLanguage: "是否切换语言?",
         signOut: "是否退出登录?",
         loginAcc: "请输入账号",
         loginPass: "请输入密码",
-
         inputNewPwd: "请输入新密码",
-        inputName: "请输入姓名",
-        inputMobile: "请输入手机号",
-        inputCompany: "请输入所属公司",
     },
+    // 主页
     home: {
         approval: "审批",
         noApproval: "暂无审批消息",
-
-        caveat: "警告",
-        noCaveat: "暂无警告消息",
-
+        warning: "警告",
+        noWarning: "暂无警告消息",
         maintain: "保养",
         noMaintain: "暂无保养消息",
-
         all: "查看全部",
-
         pwd: "修改密码",
         newPwd: "新密码",
-
         msg: "修改信息",
-
         exit: "退出登录",
+        noPage: "非常抱歉你访问的页面不存在!!!",
+        back: "返回首页",
     },
+    // 路由
     navigation: {
         map: "地图概览",
         test: "运行监测",
         msg: "消息中心",
-
         pro: "项目管理",
         proList: "项目列表",
         staff: "人员管理",
         power: "权限管理",
-
         mold: "模具管理",
         moldList: "模具列表",
         moldDown: "文档下载",
-
         base: "基础管理",
         asset: "资产方管理",
         producer: "生产方管理",
         device: "云模盒管理",
     },
-    prompt: {
-        success: "修改成功",
-        success1: "修改成功,请重新登录",
+    project: {
+        // 人员管理
+        initial: "初始密码",
+        name: "姓名",
+        inputName: "请输入姓名",
+        mobile: "手机号",
+        inputMobile: "请输入手机号",
+        inputTrueMobile: "请输入正确的手机号",   
+        role: "角色",
+        company: "所属公司",
+        inputCompany: "请输入所属公司",
     },
-    sys: {
-
+    // 基础管理
+    basic: {
+        next: "下一步",
+        prev: "上一步",
+        system: "系统管理员",
+        // 资产方管理
+		asset: "资产方",
+        addAsset: "新增资产方",
+        editAsset: "编辑资产方",
+        addSystem: "新增资产方管理员",
+        inputAss: "请输入资产方名称进行搜索",
+        assName: "资产方名称",
+        inputAssName: "请输入资产方名称",
+        assManager: "资产方管理员",
+        assProducer: "关联生产方",
+        inputAssProducer: "请选择生产方",
+        assAddress: "资产方地址",
+        inputAssAddress: "请输入资产方地址",
+        delAss: "确认删除该资产方吗?",
+        // 生产方管理
+        producer: "生产方",
+        addProducer: "新增生产方",
+        editProducer: "编辑生产方",
+        addProSystem: "新增生产方管理员",
+        inputPro: "请输入生产方名称进行搜索",
+        proName: "生产方名称",
+        inputProName: "请输入生产方名称",
+        proManager: "生产方管理员",
+        proAsset: "关联资产方",
+        inputProAsset: "请选择资产方",
+        proAddress: "生产方地址",
+        inputProAddress: "请输入生产方地址",
+        delPro: "确认删除该生产方吗?",
+		// 云模盒管理
+		addYM: "新建云模盒",
+		editYM: "编辑云模盒",
+		chooseComp: "请选择公司",
+		keySearch: "请选择关键字进行搜索",
+		equipmentNo: "云模盒编号",
+		inputequipmentNo: "请输入云模盒编号",
+		useLife: "使用年限",
+		inputUseLife: "请输入使用年限",
+		inputUseLifeNum: "使用年限必须为数字值",
+		agent: "代理商",
+		inputAgent: "请输入代理商",
+		inputBlongComp: "填写所属公司后才能启用模具",
+		inUse: "设备已启用",
     },
     ...locale
 }
-
 export default lang

+ 2 - 2
ys_int/src/views/404.vue

@@ -3,9 +3,9 @@
         <div class="page-img">
             <img src="../assets/image/404.png" />
         </div>
-        <p class="page-container"><b>Error</b>  非常抱歉你访问的页面不存在!!!</p>
+        <p class="page-container"><b>Error</b>  {{$t('home.noPage')}}</p>
         <div class="page-button">
-            <el-button type="primary" round @click="back" icon="el-icon-s-promotion">返回首页</el-button>
+            <el-button type="primary" round @click="back" icon="el-icon-s-promotion">{{$t('home.back')}}</el-button>
         </div>
     </div>
 </template>

+ 10 - 10
ys_int/src/views/Home.vue

@@ -89,7 +89,7 @@
                     <el-dropdown-menu slot="dropdown">
                         <el-dropdown-item @click.native="reset">{{$t('home.pwd')}}</el-dropdown-item>
                         <el-dropdown-item @click.native="editInfoOpen">{{$t('home.msg')}}</el-dropdown-item>
-                        <el-dropdown-item @click.native="changeLanguage">{{$i18n.locale=="zh-CN"?"Switch Engilsh":"切换中文"}}</el-dropdown-item>
+                        <el-dropdown-item @click.native="changeLanguage">{{$i18n.locale=="zh-CN"?"Engilsh":"中文"}}</el-dropdown-item>
                         <el-dropdown-item divided @click.native="logout">{{$t('home.exit')}}</el-dropdown-item>
                     </el-dropdown-menu>
                 </el-dropdown>
@@ -164,19 +164,19 @@
 
                 <!--修改信息-->
                 <el-dialog :title="$t('home.msg')" v-if="editInformation" :visible.sync="editInformation" :close-on-click-modal="false" customClass="customWidth">
-                    <el-form :model="editInfoForm" label-width="120px" :rules="passRule" ref="editInfoForm">
-                        <el-form-item :label="$t('base.name')" prop="username">
-                        <el-input v-model="editInfoForm.username" autocomplete="off" :placeholder="$t('msg.inputName')"></el-input>
+                    <el-form :model="editInfoForm" label-width="80px" :rules="passRule" ref="editInfoForm">
+                        <el-form-item :label="$t('project.name')" prop="username">
+                        <el-input v-model="editInfoForm.username" autocomplete="off" :placeholder="$t('project.inputName')"></el-input>
                         </el-form-item>
                     </el-form>
                     <el-form :model="editInfoForm" label-width="80px" :rules="passRule" ref="editInfoForm">
-                        <el-form-item :label="$t('base.mobile')" prop="mobile">
-                            <el-input v-model="editInfoForm.mobile" autocomplete="off" :placeholder="$t('msg.inputMobile')" :disabled="true"></el-input>
+                        <el-form-item :label="$t('project.mobile')" prop="mobile">
+                            <el-input v-model="editInfoForm.mobile" autocomplete="off" :placeholder="$t('project.inputMobile')" :disabled="true"></el-input>
                         </el-form-item>
                     </el-form>
                     <el-form :model="editInfoForm" label-width="80px" :rules="passRule" ref="editInfoForm">
-                        <el-form-item :label="$t('base.company')" prop="companyName">
-                            <el-input v-model="editInfoForm.companyName" autocomplete="off" :placeholder="$t('msg.inputCompany')" :disabled="true"></el-input>
+                        <el-form-item :label="$t('project.company')" prop="companyName">
+                            <el-input v-model="editInfoForm.companyName" autocomplete="off" :placeholder="$t('project.inputCompany')" :disabled="true"></el-input>
                         </el-form-item>
                     </el-form>
                     <div slot="footer" class="dialog-footer">
@@ -224,8 +224,8 @@
                     companyName: ""
                 },
                 passRule: {
-                    password: [{ validator: msg , trigger: "blur" }],
-                    username: [{ validator: msg , trigger: "blur" }]
+                    password: [{ required: true, validator: msg , trigger: "blur" }],
+                    username: [{ required: true, validator: msg , trigger: "blur" }]
                 },
                 //消息数据
                 popoverData: ["", "", ""],

+ 2 - 2
ys_int/src/views/Login.vue

@@ -49,10 +49,10 @@
                 },
                 rules: {
                     account: [
-                        { validator: msg , trigger: 'blur' },
+                        { required: true, validator: msg , trigger: 'blur' },
                     ],
                     password: [
-                        { validator: msg , trigger: 'blur' },
+                        { required: true, validator: msg , trigger: 'blur' },
                     ]
                 }
             };

+ 82 - 134
ys_int/src/views/base/allocation.vue

@@ -5,32 +5,25 @@
             <el-form :inline="true" :model="filters">
                 <el-col :span="3">
                     <el-form-item>
-                        <el-select v-model="filters.companyId" clearable filterable placeholder="请选择公司">
+                        <el-select v-model="filters.companyId" clearable filterable :placeholder="$t('basic.chooseComp')">
                             <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id">
                             </el-option>
                         </el-select>
                     </el-form-item>
                 </el-col>
                 <el-form-item>
-                    <el-input v-model="filters.keyName" placeholder="请输入关键字进行搜索"></el-input>
+                    <el-input v-model="filters.keyName" :placeholder="$t('basic.keySearch')"></el-input>
                 </el-form-item>
                 <el-form-item>
-                    <el-button type="primary" @click="getMoulds">查询</el-button>
+                    <el-button type="primary" @click="getMoulds">{{$t('base.query')}}</el-button>
                 </el-form-item>
-                <!-- <el-form-item style="float: right;">
-                    <a class="download" href="/upload/零件信息导入模板示例.xlsx" download="零件信息导入模板示例.xlsx">
-                        <el-button type="primary">
-                            下载模板
-                        </el-button>
-                    </a>
-                </el-form-item> -->
                 <el-form-item style="float: right;">
                     <el-upload ref="upload" action="customize" :show-file-list="false" :http-request="uploadFile" :limit="1">
-                        <el-button type="primary" :loading="uploading">批量导入</el-button>
+                        <el-button type="primary" :loading="uploading">{{$t('base.imput')}}</el-button>
                     </el-upload>
                 </el-form-item>
                 <el-form-item style="float: right;">
-                    <el-button type="primary" @click="showAllocation">新建</el-button>
+                    <el-button type="primary" @click="showAllocation">{{$t('base.add')}}</el-button>
                 </el-form-item>
             </el-form>
         </el-col>
@@ -56,7 +49,7 @@
                     <span v-else>已启用</span>
                 </template>
             </el-table-column>
-            <el-table-column label="操作" align="center" width="160">
+            <el-table-column :label="$t('base.operate')" align="center" width="160">
                 <template slot-scope="scope">
                     <el-button size="small" v-if="scope.row.modelNo != null" type="primary" @click="openEnable(scope.$index)">启用</el-button>
                     <!--  :disabled="scope.row.isUse == 1" -->
@@ -67,143 +60,75 @@
 
         <!--工具条-->
         <el-col :span="24" class="toolbar">
-        <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :page-sizes="[20 , 50 , 80 , 100]"
-            :page-size="20"
-            layout="total, sizes, prev, pager, next"
-            :total="total"
-            style="float:right;"
-        ></el-pagination>
+            <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;"
+            ></el-pagination>
         </el-col>
 
         <!--新增界面-->
-        <el-dialog title="新建模具" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth">
-            <el-form
-                :model="newAllocation"
-                label-width="100px"
-                :rules="formRules"
-                ref="newAllocation"
-                :inline="true"
-                class="demo-form-inline"
-            >
-                <el-form-item label="云模盒编号" prop="equipmentNo">
-                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写云模盒编号"></el-input>
+        <el-dialog :title="$t('basic.addYM')" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth">
+            <el-form :model="newAllocation" label-width="130px" :rules="formRules" ref="newAllocation">
+                <el-form-item :label="$t('basic.equipmentNo')" prop="equipmentNo">
+                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" :placeholder="$t('basic.inputequipmentNo')" style="width:505px;"></el-input>
                 </el-form-item>
-                <el-form-item label="所属公司" prop="belongCompanyId">
-                    <el-select
-                        v-model="newAllocation.belongCompanyId"
-                        filterable
-                        clearable
-                        placeholder="请选择所属公司"
-                        style="width: 202px"
-                    >
-                        <el-option
-                        v-for="item in companies"
-                        :key="item.id"
-                        :label="item.companyName"
-                        :value="item.id"
-                        ></el-option>
+                <el-form-item :label="$t('project.company')" prop="belongCompanyId">
+                    <el-select v-model="newAllocation.belongCompanyId" filterable clearable :placeholder="$t('project.inputCompany')" style="width:505px;">
+                        <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="使用年限" prop="useLife">
-                    <el-input
-                        v-model.number="newAllocation.useLife"
-                        type="age"
-                        autocomplete="off"
-                        placeholder="请填写使用年限"
-                    ></el-input>
+                <el-form-item :label="$t('basic.useLife')" prop="useLife">
+                    <el-input v-model.number="newAllocation.useLife" type="age" autocomplete="off" :placeholder="$t('basic.inputUseLife')" style="width:505px;"></el-input>
                 </el-form-item>
-                <el-form-item label="代理商" prop="agent">
-                    <el-input
-                        v-model="newAllocation.agent"
-                        autocomplete="off"
-                        placeholder="请填写代理商"
-                        style="width: 202px"
-                    ></el-input>
+                <el-form-item :label="$t('basic.agent')" prop="agent">
+                    <el-input v-model="newAllocation.agent" autocomplete="off" :placeholder="$t('basic.inputAgent')" style="width:505px;"></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="addMould()">提交</el-button>
+                <el-button @click.native="addFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button type="primary" @click="addMould()">{{$t('el.messagebox.confirm')}}</el-button>
             </div>
         </el-dialog>
 
         <!--修改界面-->
-        <el-dialog
-            title="修改模具"
-            v-if="editFormVisible"
-            :visible.sync="editFormVisible"
-            :close-on-click-modal="false"
-            customClass="customWidth"
-        >
-            <el-form
-                :model="newAllocation"
-                label-width="100px"
-                :rules="formRules"
-                ref="newAllocation"
-                :inline="true"
-                class="demo-form-inline"
-            >
-                <el-form-item label="云模盒编号" prop="equipmentNo">
-                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写"></el-input>
+        <el-dialog :title="$t('basic.editYM')" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass="customWidth">
+            <el-form :model="newAllocation" label-width="130px" :rules="formRules" ref="newAllocation">
+                <el-form-item :label="$t('basic.equipmentNo')" prop="equipmentNo">
+                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" :placeholder="$t('basic.inputequipmentNo')" style="width:505px;"></el-input>
                 </el-form-item>
-                <el-form-item label="所属公司" prop="belongCompanyId">
-                    <el-select
-                        v-model="newAllocation.belongCompanyId"
-                        filterable
-                        clearable
-                        placeholder="请选择所属公司"
-                        style="width: 202px"
-                        :disabled="newAllocation.usage"
-                    >
-                        <el-option
-                        v-for="item in companies"
-                        :key="item.id"
-                        :label="item.companyName"
-                        :value="item.id"
-                        ></el-option>
+                <el-form-item :label="$t('project.company')" prop="belongCompanyId">
+                    <el-select v-model="newAllocation.belongCompanyId" filterable clearable :placeholder="$t('project.inputCompany')"  style="width:505px;" :disabled="newAllocation.usage">
+                        <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="使用年限" prop="useLife">
-                    <el-input
-                        v-model.number="newAllocation.useLife"
-                        type="age"
-                        autocomplete="off"
-                        placeholder="请填写使用年限"
-                    ></el-input>
+                <el-form-item :label="$t('basic.useLife')" prop="useLife">
+                    <el-input v-model.number="newAllocation.useLife" type="age" autocomplete="off" :placeholder="$t('basic.inputUseLife')" style="width:505px;"></el-input>
                 </el-form-item>
-                <el-form-item label="代理商" prop="agent">
-                    <el-input
-                        v-model="newAllocation.agent"
-                        autocomplete="off"
-                        placeholder="请填写代理商"
-                        style="width: 202px"
-                    ></el-input>
+                <el-form-item :label="$t('basic.agent')" prop="agent">
+                    <el-input v-model="newAllocation.agent" autocomplete="off" :placeholder="$t('basic.inputAgent')" style="width:505px;"></el-input>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
-                <el-button @click.native="editFormVisible = false">取消</el-button>
-                <el-button type="primary" @click="editMould(newAllocation.id)">提交</el-button>
+                <el-button @click.native="editFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button type="primary" @click="editMould(newAllocation.id)">{{$t('el.messagebox.confirm')}}</el-button>
             </div>
         </el-dialog>
 
         <!-- 启用弹窗 -->
-        <el-dialog title="启用" :visible.sync="operateDialogVisible" width="400px">
-            <el-form
-                label-width="100px"
-                :rules="formRules"
-                :inline="true"
-                class="demo-form-inline"
-            >
-                <el-form-item label="某个参数">
+        <el-dialog :title="$t('base.use')" :visible.sync="operateDialogVisible" width="400px">
+            <el-form label-width="100px" :rules="formRules" :inline="true" class="demo-form-inline">
+                <!-- <el-form-item label="某个参数">
                     <el-input autocomplete="off" placeholder="填了也不会发生什么"></el-input>
-                </el-form-item>
+                </el-form-item> -->
             </el-form>
             <span slot="footer" class="dialog-footer">
-                <el-button @click="operateDialogVisible = false">取消</el-button>
-                <el-button type="primary" @click="enable">启用</el-button>
+                <el-button @click="operateDialogVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button type="primary" @click="enable">{{$t('base.use')}}</el-button>
             </span>
         </el-dialog>
     </section>
@@ -213,6 +138,28 @@
     import util from "../../common/js/util";
     export default {
         data() {
+            const msg = (rule, value, callback) => {
+                if (!value) {
+                    switch(rule.field) {
+                        case "equipmentNo":
+                            return callback(new Error(this.$t('basic.inputequipmentNo')));
+                            break;
+                        case "useLife":
+                            return callback(new Error(this.$t('basic.inputUseLife')));
+                            break;
+                        case "belongCompanyId":
+                            return callback(new Error(this.$t('project.inputCompany')));
+                            break;
+                        case "agent":
+                            return callback(new Error(this.$t('basic.inputAgent')));
+                            break;
+                        default:
+                            callback();
+                    } 
+                } else {
+                    callback();
+                }
+            };
             return {
                 allocations: [],
                 companies: {},
@@ -231,17 +178,18 @@
                 },
                 formRules: {
                     equipmentNo: [
-                        { required: true, message: "请输入云模盒编号", trigger: "blur" }
+                        { required: true, validator: msg , trigger: "blur" }
                     ],
                     useLife: [
-                        { required: true, message: '请输入使用年限'},
-                        { type: 'number', message: '使用年限必须为数字值'}
+                        { required: true, validator: msg },
+                        { type: 'number', message: this.$t('basic.inputUseLifeNum')}
+                        // message: '使用年限必须为数字值'
                     ],
                     belongCompanyId: [
-                        { required: true, message: "请选择所属公司", trigger: ["blur", "change"] }
+                        { required: true, validator: msg , trigger: ["blur", "change"] }
                     ],
                     agent: [
-                        { required: true, message: "请填写代理商", trigger: "blur" }
+                        { required: true, validator: msg , trigger: "blur" }
                     ]
                 },
 
@@ -322,8 +270,8 @@
                         this.total = res.data.total;
                     } else {
                         this.$message({
-                        message: res.msg,
-                        type: "error"
+                            message: res.msg,
+                            type: "error"
                         });
                     }
                 },
@@ -366,7 +314,7 @@
                             if (res.code == "ok") {
                                 this.addFormVisible = false;
                                 this.$message({
-                                    message: "添加成功",
+                                    message: this.$t('prompt.success2'),
                                     type: "success"
                                 });
                                 this.getMoulds();
@@ -421,7 +369,7 @@
                             if (res.code == "ok") {
                                 this.editFormVisible = false;
                                 this.$message({
-                                    message: "修改成功",
+                                    message: this.$t('prompt.success'),
                                     type: "success"
                                 });
                                 this.getMoulds();
@@ -454,7 +402,7 @@
             enable() {
                 if(this.allocations[this.activeIndex].belongCompanyId == null){
                     this.$message({
-                        message: "填写所属公司后才能启用模具",
+                        message: this.$t("basic.inputBlongComp"),
                         type: "error"
                     });
                 }else{
@@ -467,7 +415,7 @@
                     res => {
                         if (res.code == "ok") {
                             this.$message({
-                                message: "设备已启用",
+                                message: this.$t("basic.inUse"),
                                 type: "success"
                             });
                             this.getMoulds();
@@ -499,7 +447,7 @@
                     this.$refs.upload.clearFiles();
                     if (res.code == "ok") {
                         this.$message({
-                            message: "上传成功",
+                            message: this.$t("prompt.success4"),
                             type: "success"
                         });
                         this.getMoulds();

+ 77 - 56
ys_int/src/views/base/comp.vue

@@ -4,13 +4,13 @@
 		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
 			<el-form :inline="true" :model="filters">
                 <el-form-item>
-                    <el-input v-model="filters.keyName" placeholder="请输入资产方名称进行搜索" clearable></el-input>
+                    <el-input v-model="filters.keyName" :placeholder="$t('basic.inputAss')" clearable></el-input>
                 </el-form-item>
 				<el-form-item>
-					<el-button type="primary" @click.native="getComp">查询</el-button>
+					<el-button type="primary" @click.native="getComp">{{$t('base.query')}}</el-button>
 				</el-form-item>
 				<el-form-item style="float:right;">
-					<el-button type="primary" @click.native="handleAdd">新增</el-button>
+					<el-button type="primary" @click.native="handleAdd">{{$t('base.add')}}</el-button>
 				</el-form-item>
 			</el-form>
 		</el-col>
@@ -18,14 +18,14 @@
 		<!--列表-->
 		<el-table :data="list" highlight-current-row :height="tableHeight" v-loading="listLoading" style="width: 100%;">
             <el-table-column type="index" width="60"></el-table-column>
-			<el-table-column prop="companyName" label="资产方名称" width="250" sortable>
+			<el-table-column prop="companyName" :label="$t('basic.assName')" width="250" sortable>
             </el-table-column>
-            <el-table-column prop="administrator" label="资产方管理员" width="150" sortable>
+            <el-table-column prop="administrator" :label="$t('basic.assManager')" width="150" sortable>
                 <template slot-scope="scope">
                     <router-link to="/staff" tag="span" style="cursor: pointer; color: #409eff;">{{scope.row.administrator}}</router-link>
                 </template>
             </el-table-column>
-            <el-table-column prop="relateCompanyList" label="关联生产方" width="400" sortable>
+            <el-table-column prop="relateCompanyList" :label="$t('basic.assProducer')" width="400" sortable>
                 <template slot-scope="scope">
                     <span class="info" v-for="(item, index) in scope.row.relateCompanyList">
                         {{item.companyName}}
@@ -33,11 +33,11 @@
                     </span>
                 </template>
             </el-table-column>
-            <el-table-column prop="companyAddress" label="资产方地址" sortable></el-table-column>
-			<el-table-column label="操作" width="150">
+            <el-table-column prop="companyAddress" :label="$t('basic.assAddress')" sortable></el-table-column>
+			<el-table-column :label="$t('base.operate')" width="200">
 				<template slot-scope="scope">
-					<el-button size="small" @click.native="handleEdit(scope.$index, scope.row)">编辑</el-button>
-					<el-button type="danger" size="small" @click.native.native="handleDel(scope.$index, scope.row)">删除</el-button>
+					<el-button size="small" @click.native="handleEdit(scope.$index, scope.row)">{{$t('base.edit')}}</el-button>
+					<el-button type="danger" size="small" @click.native.native="handleDel(scope.$index, scope.row)">{{$t('el.upload.delete')}}</el-button>
 				</template>
 			</el-table-column>
 		</el-table>
@@ -57,57 +57,57 @@
 
         <!--新增界面-->
 		<el-dialog :title="addTitle" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm">
-				<el-form-item label="资产方名称" prop="companyName" v-show="addState">
-					<el-input v-model="addForm.companyName" autocomplete="off" placeholder="请输入资产方地址"></el-input>
+			<el-form :model="addForm" :rules="formRules" ref="addForm">
+				<el-form-item label-width="150px" :label="$t('basic.assName')" prop="companyName" v-show="addState">
+					<el-input v-model="addForm.companyName" autocomplete="off" :placeholder="$t('basic.inputAssName')" style="width:485px"></el-input>
 				</el-form-item>
-                <el-form-item label="关联生产方" v-show="addState">
-                    <el-select v-model="addForm.companyIds" clearable multiple filterable placeholder="请选择生产方" style="width:533px">
+                <el-form-item  label-width="150px" :label="$t('basic.assProducer')" v-show="addState">
+                    <el-select v-model="addForm.companyIds" clearable multiple filterable :placeholder="$t('basic.inputAssProducer')" style="width:485px">
                         <el-option v-for="item in companys" :key="item.id" :label="item.companyName" :value="item.id">
                         </el-option>
                     </el-select>
 				</el-form-item>
-                <el-form-item label="资产方地址" prop="companyAddress" v-show="addState">
-					<el-input v-model="addForm.companyAddress" autocomplete="off" placeholder="请输入资产方地址"></el-input>
+                <el-form-item label-width="150px" :label="$t('basic.assAddress')" prop="companyAddress" v-show="addState">
+					<el-input v-model="addForm.companyAddress" autocomplete="off" :placeholder="$t('basic.inputAssAddress')" style="width:485px"></el-input>
 				</el-form-item>
-                <el-form-item label="姓名" prop="username" v-show="!addState">
-					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
+                <el-form-item label-width="80px" :label="$t('project.name')" prop="username" v-show="!addState">
+					<el-input v-model="addForm.username" autocomplete="off" :placeholder="$t('project.inputName')"></el-input>
 				</el-form-item>
-				<el-form-item label="手机号" prop="account" v-show="!addState">
-					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
+				<el-form-item label-width="80px" :label="$t('project.mobile')" prop="account" v-show="!addState">
+					<el-input v-model="addForm.account" autocomplete="off" :placeholder="$t('project.inputMobile')"></el-input>
 				</el-form-item>
-                <el-form-item label="角色" v-show="!addState">
-                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入角色名称"></el-input>
+                <el-form-item label-width="80px" :label="$t('project.role')" v-show="!addState">
+                    <el-input v-model="addForm.roleName" autocomplete="off" :placeholder="$t('project.inputRole')"></el-input>
 				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-                <span v-if="!addState" style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
-				<el-button @click.native="addFormVisible = false">取消</el-button>
-                <el-button v-if="addState" type="primary" @click.native="toNext(0)">下一步</el-button>
-                <el-button v-if="!addState" type="primary" @click.native="toPart(0)">上一步</el-button>
-				<el-button v-if="!addState" type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
+                <span v-if="!addState" style="color:#f00;float:left;margin-left:60px;">{{$t('project.initial')}}:000000</span>
+				<el-button @click.native="addFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button v-if="addState" type="primary" @click.native="toNext(0)">{{$t('basic.next')}}</el-button>
+                <el-button v-if="!addState" type="primary" @click.native="toPart(0)">{{$t('basic.prev')}}</el-button>
+				<el-button v-if="!addState" type="primary" @click.native="addSubmit" :loading="addLoading">{{$t('el.messagebox.confirm')}}</el-button>
 			</div>
 		</el-dialog>
 
 		<!--编辑界面-->
-		<el-dialog title="编辑资产方" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-form :model="editForm" label-width="100px" :rules="formRules" ref="editForm">
-				<el-form-item label="资产方名称" prop="companyName">
-					<el-input v-model="editForm.companyName" autocomplete="off" placeholder="请输入资产方地址"></el-input>
+		<el-dialog :title="$t('basic.editAsset')" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="editForm" label-width="150px" :rules="formRules" ref="editForm">
+				<el-form-item :label="$t('basic.assName')" prop="companyName">
+					<el-input v-model="editForm.companyName" autocomplete="off" :placeholder="$t('basic.inputAssName')" style="width:485px"></el-input>
 				</el-form-item>
-                <el-form-item label="关联生产方">
-                    <el-select v-model="editForm.companyIds" clearable multiple filterable placeholder="请选择生产方" style="width:533px">
+                <el-form-item :label="$t('basic.assProducer')">
+                    <el-select v-model="editForm.companyIds" clearable multiple filterable :placeholder="$t('basic.inputAssProducer')" style="width:485px">
                         <el-option v-for="item in companys" :key="item.id" :label="item.companyName" :value="item.id">
                         </el-option>
                     </el-select>
 				</el-form-item>
-                <el-form-item label="资产方地址" prop="companyAddress">
-					<el-input v-model="editForm.companyAddress" autocomplete="off" placeholder="请输入资产方地址"></el-input>
+                <el-form-item :label="$t('basic.assAddress')" prop="companyAddress">
+					<el-input v-model="editForm.companyAddress" autocomplete="off" :placeholder="$t('basic.inputAssAddress')" style="width:485px"></el-input>
 				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button @click.native="editFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
+				<el-button @click.native="editFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">{{$t('el.messagebox.confirm')}}</el-button>
 			</div>
 		</el-dialog>
 	</section>
@@ -118,17 +118,36 @@
 
 	export default {
 		data() {
-            var checkPhone = (rule, value, callback) => {
+            const checkPhone = (rule, value, callback) => {
                 if (!value) {
-                    return callback(new Error('请输入联系方式'));
+                    return callback(new Error(this.$t('project.inputMobile')));
                 } else {
                     const reg = /^1[0-9]\d{9}$/
                     if (reg.test(value)) {
                         callback();
                     } else {
-                        return callback(new Error('请输入正确的联系方式'));
+                        return callback(new Error(this.$t('project.inputTrueMobile')));
                     }
                 }
+            };
+            const msg = (rule, value, callback) => {
+                if (!value) {
+                    switch(rule.field) {
+                        case "companyName":
+                            return callback(new Error(this.$t('basic.inputAssName')));
+                            break;
+                        case "companyAddress":
+                            return callback(new Error(this.$t('basic.inputAssAddress')));
+                            break;
+                        case "username":
+                            return callback(new Error(this.$t('project.inputName')));
+                            break;
+                        default:
+                            callback();
+                    } 
+                } else {
+                    callback();
+                }
             };
 			return {
 				filters: {
@@ -146,26 +165,26 @@
                 
                 formRules: {
 					companyName: [
-						{ required: true, message: '请输入资产方名称', trigger: 'blur' }
+						{ required: true, validator: msg , trigger: 'blur' }
                     ],
                     companyAddress: [
-                        { required: true, message: '请输入资产方地址', trigger: 'blur' }
+                        { required: true, validator: msg , trigger: 'blur' }
                     ],
                     username: [
-						{ required: true, message: '请输入姓名', trigger: 'blur' }
+						{ required: true, validator: msg , trigger: 'blur' }
                     ],
                     account: [
                         { required: true, validator: checkPhone, trigger: 'blur'}
                     ]
                 },
 
-                team: [{label:'资产方',value:0},{label:'生产方',value:1}],
+                team: [{label:this.$t('basic.asset'),value:0},{label:this.$t('basic.producer'),value:1}],
 
                 // 新增界面
 				addFormVisible: false,
                 addLoading: false,
                 addState: true,
-                addTitle: '新增资产方',
+                addTitle: this.$t('basic.addAsset'),
 				addForm: {
                     companyName: '',
                     companyAddress: '',
@@ -173,7 +192,7 @@
                     username: '',
                     account: '',
                     companyId: '',
-                    roleName: "系统管理员",
+                    roleName: this.$t('basic.system'),
                     flag: 0
 				},
                 
@@ -254,14 +273,14 @@
             toNext(i) {
                 if(i == 0) {
                     this.addState = false;
-                     this.addTitle = '新增资产方管理员';
+                    this.addTitle = this.$t('basic.addSystem');
                 }
             },
 
             toPart(i) {
                 if(i == 0) {
                     this.addState = true;
-                    this.addTitle = '新增资产方';
+                    this.addTitle = this.$t('basic.addAsset');
                 }
             },
 
@@ -269,7 +288,7 @@
 			handleAdd() {
                 this.addFormVisible = true;
                 this.addState = true;
-                this.addTitle = '新增资产方';
+                this.addTitle = this.$t('basic.addAsset');
 				this.addForm = {
                     companyName: '',
                     companyAddress: '',
@@ -277,7 +296,7 @@
                     username: '',
                     account: '',
                     companyId: '',
-                    roleName: "系统管理员",
+                    roleName: this.$t('basic.system'),
                     flag: 0
 				};
             },
@@ -339,7 +358,7 @@
                             if (res.code == "ok") {
                                 this.addFormVisible = false;
                                 this.$message({
-                                    message: '创建成功',
+                                    message: this.$t('prompt.success2'),
                                     type: 'success'
                                 });
                                 this.getComp();
@@ -363,15 +382,17 @@
             
 			//删除
 			handleDel(index, row) {
-				this.$confirm('确认删除该资产方吗?', '提示', {
-					type: 'warning'
+				this.$confirm(this.$t('basic.delAss'), this.$t('el.messagebox.title'), {
+					confirmButtonText: this.$t('el.messagebox.confirm'),
+                    cancelButtonText: this.$t('el.messagebox.cancel'),
+                    type: 'warning'
 				}).then(() => {
                     this.http.post(this.port.base.delCompany, {
                         id: row.id
                     }, res => {
                         if (res.code == "ok") {
                             this.$message({
-                                message: '删除成功',
+                                message: this.$t('prompt.success3'),
                                 type: 'success'
                             });
                             this.getComp();
@@ -432,7 +453,7 @@
                             if (res.code == "ok") {
                                 this.editFormVisible = false;
                                 this.$message({
-                                    message: '修改成功',
+                                    message: this.$t("prompt.success"),
                                     type: 'success'
                                 });
                                 this.getComp();

+ 81 - 56
ys_int/src/views/base/factory.vue

@@ -4,13 +4,13 @@
 		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
 			<el-form :inline="true" :model="filters">
                 <el-form-item>
-                    <el-input v-model="filters.keyName" placeholder="请输入生产方名称进行搜索" clearable></el-input>
+                    <el-input v-model="filters.keyName" :placeholder="$t('basic.inputPro')" clearable></el-input>
                 </el-form-item>
 				<el-form-item>
-					<el-button type="primary" @click.native="getFactory">查询</el-button>
+					<el-button type="primary" @click.native="getFactory">{{$t('base.query')}}</el-button>
 				</el-form-item>
 				<el-form-item style="float:right;">
-					<el-button type="primary" @click.native="handleAdd">新增</el-button>
+					<el-button type="primary" @click.native="handleAdd">{{$t('base.add')}}</el-button>
 				</el-form-item>
 			</el-form>
 		</el-col>
@@ -18,10 +18,13 @@
 		<!--列表-->
 		<el-table :data="list" highlight-current-row :height="tableHeight" v-loading="listLoading" style="width: 100%;">
             <el-table-column type="index" width="60"></el-table-column>
-			<el-table-column prop="companyName" label="生产方名称" width="250" sortable></el-table-column>
-            <el-table-column prop="administrator" label="生产方管理员" width="150" sortable>
+			<el-table-column prop="companyName" :label="$t('basic.proName')" width="250" sortable></el-table-column>
+            <el-table-column prop="administrator" :label="$t('basic.proManager')" width="150" sortable>
+                <template slot-scope="scope">
+                    <router-link to="/staff" tag="span" style="cursor: pointer; color: #409eff;">{{scope.row.administrator}}</router-link>
+                </template>
             </el-table-column>
-            <el-table-column prop="relateCompanyList" label="关联资产方" width="400" sortable>
+            <el-table-column prop="relateCompanyList" :label="$t('basic.proAsset')" width="400" sortable>
                 <template slot-scope="scope">
                     <span class="info" v-for="(item, index) in scope.row.relateCompanyList">
                         {{item.companyName}}
@@ -29,11 +32,11 @@
                     </span>
                 </template>
             </el-table-column>
-            <el-table-column prop="companyAddress" label="生产方地址" sortable></el-table-column>
-			<el-table-column label="操作" width="150">
+            <el-table-column prop="companyAddress" :label="$t('basic.proAddress')" sortable></el-table-column>
+			<el-table-column :label="$t('base.operate')" width="200">
 				<template slot-scope="scope">
-					<el-button size="small" @click.native="handleEdit(scope.$index, scope.row)">编辑</el-button>
-					<el-button type="danger" size="small" @click.native.native="handleDel(scope.$index, scope.row)">删除</el-button>
+					<el-button size="small" @click.native="handleEdit(scope.$index, scope.row)">{{$t('base.edit')}}</el-button>
+					<el-button type="danger" size="small" @click.native.native="handleDel(scope.$index, scope.row)">{{$t('el.upload.delete')}}</el-button>
 				</template>
 			</el-table-column>
 		</el-table>
@@ -52,60 +55,61 @@
 		</el-col>
 
         <!--新增界面-->
-		<el-dialog title="新增生产方" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm">
-				<el-form-item label="生产方名称" prop="companyName" v-show="addState">
-					<el-input v-model="addForm.companyName" autocomplete="off" placeholder="请输入生产方名称"></el-input>
+		<el-dialog :title="addTitle" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="addForm" :rules="formRules" ref="addForm">
+				<el-form-item label-width="150px" :label="$t('basic.proName')" prop="companyName" v-show="addState">
+					<el-input v-model="addForm.companyName" autocomplete="off" :placeholder="$t('basic.inputProName')" style="width:485px"></el-input>
 				</el-form-item>
-                <el-form-item label="关联资产方" v-show="addState">
-                    <el-select v-model="addForm.companyIds" clearable multiple filterable placeholder="请选择资产方" style="width:533px">
+                <el-form-item label-width="150px" :label="$t('basic.proAsset')" v-show="addState">
+                    <el-select v-model="addForm.companyIds" clearable multiple filterable :placeholder="$t('basic.inputProAsset')" style="width:485px">
                         <el-option v-for="item in companys" :key="item.id" :label="item.companyName" :value="item.id">
                         </el-option>
                     </el-select>
 				</el-form-item>
-                <el-form-item label="生产方地址" prop="companyAddress" v-show="addState">
-					<el-input v-model.lazy="addForm.companyAddress" autocomplete="off" @change="changeFactoryArea('addContainer')" placeholder="请输入生产方地址"></el-input>
+                <el-form-item label-width="150px" :label="$t('basic.proAddress')" prop="companyAddress" v-show="addState">
+					<el-input v-model.lazy="addForm.companyAddress" autocomplete="off" @change="changeFactoryArea('addContainer')" :placeholder="$t('basic.inputProAddress')" style="width:485px"></el-input>
 				</el-form-item>
                 <div id="addContainer" class="formMap" v-show="addState"></div>
-                <el-form-item label="姓名" prop="username" v-show="!addState">
-					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
+
+                <el-form-item label-width="80px" :label="$t('project.name')" prop="username" v-show="!addState">
+					<el-input v-model="addForm.username" autocomplete="off" :placeholder="$t('project.inputName')"></el-input>
 				</el-form-item>
-				<el-form-item label="手机号" prop="account" v-show="!addState">
-					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
+				<el-form-item label-width="80px" :label="$t('project.mobile')" prop="account" v-show="!addState">
+					<el-input v-model="addForm.account" autocomplete="off" :placeholder="$t('project.inputMobile')"></el-input>
 				</el-form-item>
-                <el-form-item label="角色" v-show="!addState">
-                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入角色名称"></el-input>
+                <el-form-item label-width="80px" :label="$t('project.role')" v-show="!addState">
+                    <el-input v-model="addForm.roleName" autocomplete="off" :placeholder="$t('project.inputRole')"></el-input>
 				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-                 <span v-if="!addState" style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
-				<el-button @click.native="addFormVisible = false">取消</el-button>
-                <el-button v-if="addState" type="primary" @click.native="toNext(0)">下一步</el-button>
-                <el-button v-if="!addState" type="primary" @click.native="toPart(0)">上一步</el-button>
-				<el-button v-if="!addState" type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
+                 <span v-if="!addState" style="color:#f00;float:left;margin-left:60px;">{{$t('project.initial')}}:000000</span>
+				<el-button @click.native="addFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button v-if="addState" type="primary" @click.native="toNext(0)">{{$t('basic.next')}}</el-button>
+                <el-button v-if="!addState" type="primary" @click.native="toPart(0)">{{$t('basic.prev')}}</el-button>
+				<el-button v-if="!addState" type="primary" @click.native="addSubmit" :loading="addLoading">{{$t('el.messagebox.confirm')}}</el-button>
 			</div>
 		</el-dialog>
 
 		<!--编辑界面-->
-		<el-dialog title="编辑生产方" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+		<el-dialog :title="$t('basic.editProducer')" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
 			<el-form :model="editForm" label-width="100px" :rules="formRules" ref="editForm">
-				<el-form-item label="生产方名称" prop="companyName">
-					<el-input v-model="editForm.companyName" autocomplete="off" placeholder="请输入生产方名称"></el-input>
+				<el-form-item :label="$t('basic.proName')" prop="companyName">
+					<el-input v-model="editForm.companyName" autocomplete="off" :placeholder="$t('basic.inputProName')" style="width:485px"></el-input>
 				</el-form-item>
-                <el-form-item label="关联资产方">
-                    <el-select v-model="editForm.companyIds" clearable multiple filterable placeholder="请选择资产方" style="width:533px">
+                <el-form-item :label="$t('basic.proAsset')">
+                    <el-select v-model="editForm.companyIds" clearable multiple filterable :placeholder="$t('basic.inputProAsset')" style="width:485px">
                         <el-option v-for="item in companys" :key="item.id" :label="item.companyName" :value="item.id">
                         </el-option>
                     </el-select>
 				</el-form-item>
-                <el-form-item label="生产方地址" prop="companyAddress">
-					<el-input v-model="editForm.companyAddress" autocomplete="off" :change="changeFactoryArea('editContainer')" placeholder="请输入生产方地址"></el-input>
+                <el-form-item :label="$t('basic.proAddress')" prop="companyAddress">
+					<el-input v-model="editForm.companyAddress" autocomplete="off" :change="changeFactoryArea('editContainer')" :placeholder="$t('basic.inputProAddress')" style="width:485px"></el-input>
 				</el-form-item>
                 <div id="editContainer" class="formMap"></div>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button @click.native="editFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
+				<el-button @click.native="editFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">{{$t('el.messagebox.confirm')}}</el-button>
 			</div>
 		</el-dialog>
 	</section>
@@ -117,17 +121,36 @@
 
 	export default {
 		data() {
-            var checkPhone = (rule, value, callback) => {
+            const checkPhone = (rule, value, callback) => {
                 if (!value) {
-                    return callback(new Error('请输入联系方式'));
+                    return callback(new Error(this.$t('project.inputMobile')));
                 } else {
                     const reg = /^1[0-9]\d{9}$/
                     if (reg.test(value)) {
                         callback();
                     } else {
-                        return callback(new Error('请输入正确的联系方式'));
+                        return callback(new Error(this.$t('project.inputTrueMobile')));
                     }
                 }
+            };
+            const msg = (rule, value, callback) => {
+                if (!value) {
+                    switch(rule.field) {
+                        case "companyName":
+                            return callback(new Error(this.$t('basic.inputProName')));
+                            break;
+                        case "companyAddress":
+                            return callback(new Error(this.$t('basic.inputProAddress')));
+                            break;
+                        case "username":
+                            return callback(new Error(this.$t('project.inputName')));
+                            break;
+                        default:
+                            callback();
+                    } 
+                } else {
+                    callback();
+                }
             };
 			return {
 				filters: {
@@ -145,13 +168,13 @@
                 
                 formRules: {
 					companyName: [
-						{ required: true, message: '请输入生产方名称', trigger: 'blur' }
+						{ required: true, validator: msg , trigger: 'blur' }
                     ],
                     companyAddress: [
-                        { required: true, message: '请输入生产方地址', trigger: 'blur' }
+                        { required: true, validator: msg , trigger: 'blur' }
                     ],
                     username: [
-						{ required: true, message: '请输入姓名', trigger: 'blur' }
+						{ required: true, validator: msg , trigger: 'blur' }
                     ],
                     account: [
                         { required: true, validator: checkPhone, trigger: 'blur'}
@@ -166,7 +189,7 @@
 				addFormVisible: false,
                 addLoading: false,
                 addState: true,
-                addTitle: '新增生产方',
+                addTitle: this.$t('basic.addProducer'),
 				addForm: {
                     companyName: '',
                     companyType: 1,
@@ -177,7 +200,7 @@
                     username: '',
                     account: '',
                     companyId: '',
-                    roleName: "系统管理员",
+                    roleName: this.$t('basic.system'),
                     flag: 0
 				},
                 
@@ -229,7 +252,7 @@
                 })
             },
 
-			//获取列表
+			//获取生产方列表
 			getFactory() {
 				this.listLoading = true;
                 this.http.post(this.port.base.companyList, {
@@ -270,14 +293,14 @@
             toNext(i) {
                 if(i == 0) {
                     this.addState = false;
-                     this.addTitle = '新增生产方管理员';
+                     this.addTitle = this.$t('basic.addProSystem');
                 }
             },
 
             toPart(i) {
                 if(i == 0) {
                     this.addState = true;
-                    this.addTitle = '新增生产方';
+                    this.addTitle = this.$t('basic.addProducer');
                 }
                 var _this = this
                 setTimeout(function(){ _this.setMap('addContainer'); }, 100);
@@ -287,7 +310,7 @@
 			handleAdd() {
                 this.addFormVisible = true;
                 this.addState = true;
-                this.addTitle = '新增资产方';
+                this.addTitle = this.$t('basic.addProducer');
 				this.addForm = {
                     companyName: '',
                     companyAddress: '',
@@ -297,7 +320,7 @@
                     username: '',
                     account: '',
                     companyId: '',
-                    roleName: "系统管理员",
+                    roleName: this.$t('basic.system'),
                     flag: 0
                 };
             },
@@ -362,7 +385,7 @@
                             if (res.code == "ok") {
                                 this.addFormVisible = false;
                                 this.$message({
-                                    message: '创建成功',
+                                    message: this.$t('prompt.success2'),
                                     type: 'success'
                                 });
                                 this.getFactory();
@@ -386,15 +409,17 @@
             
 			//删除
 			handleDel(index, row) {
-				this.$confirm('确认删除该生产方吗?', '提示', {
-					type: 'warning'
+				this.$confirm(this.$t('basic.delPro'), this.$t('el.messagebox.title'), {
+					confirmButtonText: this.$t('el.messagebox.confirm'),
+                    cancelButtonText: this.$t('el.messagebox.cancel'),
+                    type: 'warning'
 				}).then(() => {
                     this.http.post(this.port.base.delCompany, {
                         id: row.id
                     }, res => {
                         if (res.code == "ok") {
                             this.$message({
-                                message: '删除成功',
+                                message: this.$t('prompt.success3'),
                                 type: 'success'
                             });
                             this.getFactory();
@@ -459,7 +484,7 @@
                             if (res.code == "ok") {
                                 this.editFormVisible = false;
                                 this.$message({
-                                    message: '修改成功',
+                                    message: this.$t("prompt.success"),
                                     type: 'success'
                                 });
                                 this.getFactory();

+ 243 - 244
ys_int/src/views/message.vue

@@ -1,264 +1,263 @@
 <template>
-  <section>
-    <!--工具条-->
-    <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-      <el-form :inline="true">
-        <el-col :span="2">
-          <el-form-item>消息中心</el-form-item>
+    <section>
+        <!--工具条-->
+        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+            <el-form :inline="true">
+                <el-col :span="4">
+                    <el-form-item>{{$t('navigation.msg')}}</el-form-item>
+                </el-col>
+            </el-form>
         </el-col>
-      </el-form>
-    </el-col>
 
-    <!--选项卡-->
-    <el-col :span="24">
-      <el-tabs v-model="activePage" @tab-click="handleClick" type="card">
-        <el-tab-pane name="0" label="审批">
-          <div :style="heightString">
-            <span v-if="messages[0].length == 0">目前暂无消息</span>
-            <div
-              class="message-div"
-              v-for="item in messages[0]"
-              @click="locationHerf(item.id, item.refId, item.noticeType, item.belongType)"
-            >
-              <p>
-                <span class="message-title isRead" v-if="item.isRead == 1">{{item.projectName}}</span>
-                <span class="message-title" v-else>{{item.projectName}}</span>
-                <span class="message-time">{{item.indate}}</span>
-              </p>
-              <p class="message-article">{{item.content}}</p>
-            </div>
-          </div>
-          <!--分页1-->
-          <el-col :span="24" class="toolbar">
-            <el-pagination
-              @size-change="handleSizeChange0"
-              @current-change="handleCurrentChange0"
-              :page-sizes="[20 , 50 , 80 , 100 , 200]"
-              :page-size="20"
-              layout="total, sizes, prev, pager, next"
-              :total="total[0]"
-              style="float:right;"
-            ></el-pagination>
-          </el-col>
-        </el-tab-pane>
-        <el-tab-pane name="1" label="警告">
-          <div :style="heightString">
-            <span v-if="messages[1].length == 0">目前暂无消息</span>
-            <div
-              class="message-div"
-              v-for="item in messages[1]"
-              @click="locationHerf(item.id, item.refId, item.noticeType, null)"
-            >
-              <p>
-                <span class="message-title isRead" v-if="item.isRead == 1">{{item.projectName}}</span>
-                <span class="message-title" v-else>{{item.projectName}}</span>
-                <span class="message-time">{{item.indate}}</span>
-              </p>
-              <p class="message-article">{{item.content}}</p>
-            </div>
-          </div>
-          <!--分页2-->
-          <el-col :span="24" class="toolbar">
-            <el-pagination
-              @size-change="handleSizeChange1"
-              @current-change="handleCurrentChange1"
-              :page-sizes="[20 , 50 , 80 , 100 , 200]"
-              :page-size="20"
-              layout="total, sizes, prev, pager, next"
-              :total="total[1]"
-              style="float:right;"
-            ></el-pagination>
-          </el-col>
-        </el-tab-pane>
-        <el-tab-pane name="2" label="保养">
-          <div :style="heightString">
-            <span v-if="messages[2].length == 0">目前暂无消息</span>
-            <div
-              class="message-div"
-              v-for="item in messages[2]"
-              @click="locationHerf(item.id, item.refId, item.noticeType, null)"
-            >
-              <p>
-                <span class="message-title isRead" v-if="item.isRead == 1">{{item.projectName}}</span>
-                <span class="message-title" v-else>{{item.projectName}}</span>
-                <span class="message-time">{{item.indate}}</span>
-              </p>
-              <p class="message-article">{{item.content}}</p>
-            </div>
-          </div>
-          <!--分页3-->
-          <el-col :span="24" class="toolbar">
-            <el-pagination
-              @size-change="handleSizeChange2"
-              @current-change="handleCurrentChange2"
-              :page-sizes="[20 , 50 , 80 , 100 , 200]"
-              :page-size="20"
-              layout="total, sizes, prev, pager, next"
-              :total="total[2]"
-              style="float:right;"
-            ></el-pagination>
-          </el-col>
-        </el-tab-pane>
-      </el-tabs>
-    </el-col>
-  </section>
+        <!--选项卡-->
+        <el-col :span="24">
+            <el-tabs v-model="activePage" @tab-click="handleClick" type="card">
+                <el-tab-pane name="0" :label="$t('home.approval')">
+                    <div :style="heightString">
+                        <div class="noMsg" v-if="messages[0].length == 0">{{$t('home.noApproval')}}</div>
+                        <div class="message-div" v-for="item in messages[0]" @click="locationHerf(item.id, item.refId, item.noticeType, item.belongType)">
+                            <p>
+                                <span class="message-title isRead" v-if="item.isRead == 1">{{item.projectName}}</span>
+                                <span class="message-title" v-else>{{item.projectName}}</span>
+                                <span class="message-time">{{item.indate}}</span>
+                            </p>
+                            <p class="message-article">{{item.content}}</p>
+                        </div>
+                    </div>
+                    <!--分页1-->
+                    <el-col :span="24" class="toolbar">
+                        <el-pagination
+                            @size-change="handleSizeChange0"
+                            @current-change="handleCurrentChange0"
+                            :page-sizes="[20 , 50 , 80 , 100 , 200]"
+                            :page-size="20"
+                            layout="total, sizes, prev, pager, next"
+                            :total="total[0]"
+                            style="float:right;"
+                        ></el-pagination>
+                    </el-col>
+                </el-tab-pane>
+
+                <el-tab-pane name="1" :label="$t('home.warning')">
+                    <div :style="heightString">
+                        <div class="noMsg" v-if="messages[1].length == 0">{{$t('home.noWarning')}}</div>
+                        <div class="message-div" v-for="item in messages[1]" @click="locationHerf(item.id, item.refId, item.noticeType, null)">
+                            <p>
+                                <span class="message-title isRead" v-if="item.isRead == 1">{{item.projectName}}</span>
+                                <span class="message-title" v-else>{{item.projectName}}</span>
+                                <span class="message-time">{{item.indate}}</span>
+                            </p>
+                            <p class="message-article">{{item.content}}</p>
+                        </div>
+                    </div>
+                    <!--分页2-->
+                    <el-col :span="24" class="toolbar">
+                        <el-pagination
+                            @size-change="handleSizeChange1"
+                            @current-change="handleCurrentChange1"
+                            :page-sizes="[20 , 50 , 80 , 100 , 200]"
+                            :page-size="20"
+                            layout="total, sizes, prev, pager, next"
+                            :total="total[1]"
+                            style="float:right;"
+                        ></el-pagination>
+                    </el-col>
+                </el-tab-pane>
+
+                <el-tab-pane name="2" :label="$t('home.maintain')">
+                    <div :style="heightString">
+                        <div class="noMsg" v-if="messages[2].length == 0">{{$t('home.noMaintain')}}</div>
+                        <div class="message-div" v-for="item in messages[2]" @click="locationHerf(item.id, item.refId, item.noticeType, null)">
+                            <p>
+                                <span class="message-title isRead" v-if="item.isRead == 1">{{item.projectName}}</span>
+                                <span class="message-title" v-else>{{item.projectName}}</span>
+                                <span class="message-time">{{item.indate}}</span>
+                            </p>
+                            <p class="message-article">{{item.content}}</p>
+                        </div>
+                    </div>
+                    <!--分页3-->
+                    <el-col :span="24" class="toolbar">
+                        <el-pagination
+                            @size-change="handleSizeChange2"
+                            @current-change="handleCurrentChange2"
+                            :page-sizes="[20 , 50 , 80 , 100 , 200]"
+                            :page-size="20"
+                            layout="total, sizes, prev, pager, next"
+                            :total="total[2]"
+                            style="float:right;"
+                        ></el-pagination>
+                    </el-col>
+                </el-tab-pane>
+            </el-tabs>
+        </el-col>
+    </section>
 </template>
 
 <script>
-import util from "../common/js/util";
-export default {
-  data() {
-    return {
-      messages: [[], [], []],
-      page0: 1,
-      page1: 1,
-      page2: 1,
-      size: 20,
-      total: [0, 0, 0],
-      tableHeight: 0,
-      activePage: 0,
-      heightString: ""
-    };
-  },
-  methods: {
-    //分页1
-    handleCurrentChange0(val) {
-      this.page0 = val;
-      this.loadNotice();
-    },
-    handleSizeChange0(val) {
-      this.size1 = val;
-      this.loadNotice();
-    },
-    //分页2
-    handleCurrentChange1(val) {
-      this.page2 = val;
-      this.loadNotice();
-    },
-    handleSizeChange1(val) {
-      this.size = val;
-      this.loadNotice();
-    },
-    //分页3
-    handleCurrentChange2(val) {
-      this.page = val;
-      this.loadNotice();
-    },
-    handleSizeChange2(val) {
-      this.size = val;
-      this.loadNotice();
-    },
-    //标签页面切换时
-    handleClick(tab, event) {
-      this.activeTab = tab.name;
-    },
-    //读取消息提示
-    loadNotice() {
-      this.http.post(
-        this.port.notice.list,
-        {
-          pageNum: this.page,
-          pageSize: this.size
-        },
-        res => {
-          if (res.code == "ok") {
-            this.messages = [];
-            this.messages.push(res.data[0].approvelList.list);
-            this.messages.push(res.data[1].matainList.list);
-            this.messages.push(res.data[2].emergencyList.list);
-            this.total[0] = res.data[0].approvelList.total;
-            this.total[1] = res.data[1].matainList.total;
-            this.total[2] = res.data[2].emergencyList.total;
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
+    import util from "../common/js/util";
+
+    export default {
+        data() {
+            return {
+                messages: [[], [], []],
+                page0: 1,
+                page1: 1,
+                page2: 1,
+                size: 20,
+                total: [0, 0, 0],
+                tableHeight: 0,
+                activePage: 0,
+                heightString: ""
+            };
         },
-        error => {
-          this.$message({
-            message: error,
-            type: "error"
-          });
-        }
-      );
-    },
-    //点击消息的跳转
-    locationHerf(id, refid, type, approval) {
-      this.http.post(
-        this.port.notice.read,
-        {
-          id: id
+        methods: {
+            //分页1
+            handleCurrentChange0(val) {
+                this.page0 = val;
+                this.loadNotice();
+            },
+            
+            handleSizeChange0(val) {
+                this.size1 = val;
+                this.loadNotice();
+            },
+
+            //分页2
+            handleCurrentChange1(val) {
+                this.page2 = val;
+                this.loadNotice();
+            },
+
+            handleSizeChange1(val) {
+                this.size = val;
+                this.loadNotice();
+            },
+
+            //分页3
+            handleCurrentChange2(val) {
+                this.page = val;
+                this.loadNotice();
+            },
+
+            handleSizeChange2(val) {
+                this.size = val;
+                this.loadNotice();
+            },
+
+            //标签页面切换时
+            handleClick(tab, event) {
+                this.activeTab = tab.name;
+            },
+
+            //读取消息提示
+            loadNotice() {
+                this.http.post( this.port.notice.list, {
+                    pageNum: this.page,
+                    pageSize: this.size
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.messages = [];
+                        this.messages.push(res.data[0].approvelList.list);
+                        this.messages.push(res.data[1].matainList.list);
+                        this.messages.push(res.data[2].emergencyList.list);
+                        this.total[0] = res.data[0].approvelList.total;
+                        this.total[1] = res.data[1].matainList.total;
+                        this.total[2] = res.data[2].emergencyList.total;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            //点击消息的跳转
+            locationHerf(id, refid, type, approval) {
+                this.http.post( this.port.notice.read, {
+                    id: id
+                },
+                res => {
+                    if (res.code == "ok") {
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+                if (type == 0) {
+                    //审批 跳转到模具详情
+                    this.$router.push("/moldList/" + refid + "/" + approval);
+                } else if (type == 1) {
+                    //警告 跳转到运行监测
+                    this.$router.push("/detection");
+                } else if (type == 2) {
+                    //保养 跳转到运行监测详情
+                    this.$router.push("/detection/" + refid);
+                }
+            }
         },
-        res => {
-          if (res.code == "ok") {
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 260;
+            this.heightString = "height: " + this.tableHeight + "px";
         },
-        error => {
-          this.$message({
-            message: error,
-            type: "error"
-          });
+        mounted() {
+            this.loadNotice();
         }
-      );
-      if (type == 0) {
-        //审批 跳转到模具详情
-        this.$router.push("/moldList/" + refid + "/" + approval);
-      } else if (type == 1) {
-        //警告 跳转到运行监测
-        this.$router.push("/detection");
-      } else if (type == 2) {
-        //保养 跳转到运行监测详情
-        this.$router.push("/detection/" + refid);
-      }
-    }
-  },
-  created() {
-    let height = window.innerHeight;
-    this.tableHeight = height - 260;
-    this.heightString = "height: " + this.tableHeight + "px";
-  },
-  mounted() {
-    this.loadNotice();
-  }
-};
+    };
 </script>
 
 <style scoped>
-.message-div {
-  cursor: pointer;
-  padding: 5px 0;
-}
+    .message-div {
+        cursor: pointer;
+        padding: 5px 0;
+    }
+
+    .message-div > p {
+        line-height: 25px;
+        margin: 0;
+    }
 
-.message-div > p {
-  line-height: 25px;
-  margin: 0;
-}
+    .noMsg {
+        text-align: center;
+        font-size: 20px;
+        color: #c0c0c0;
+        padding: 200px 0;
+    }
 
-.message-type {
-  font-weight: 700;
-}
+    .message-type {
+        font-weight: 700;
+    }
 
-.message-time {
-  padding-left: 30px;
-  color: #777;
-}
+    .message-time {
+        padding-left: 30px;
+        color: #777;
+    }
 
-.message-title {
-  color: #409eff;
-}
+    .message-title {
+        color: #409eff;
+    }
 
-.message-article {
-  color: #555;
-}
+    .message-article {
+        color: #555;
+    }
 
-.isRead {
-  color: #999 !important;
-}
+    .isRead {
+        color: #999 !important;
+    }
 </style>