Просмотр исходного кода

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

6 лет назад
Родитель
Сommit
f086e84f9c
35 измененных файлов с 3507 добавлено и 2940 удалено
  1. 1 1
      ys_int/config/index.js
  2. 12 2
      ys_int/src/http.js
  3. 18 0
      ys_int/src/i18n/i18n.js
  4. 380 0
      ys_int/src/i18n/lang/en.js
  5. 348 0
      ys_int/src/i18n/lang/zh.js
  6. 23 13
      ys_int/src/main.js
  7. 0 25
      ys_int/src/mock/data/user.js
  8. 0 3
      ys_int/src/mock/index.js
  9. 0 153
      ys_int/src/mock/mock.js
  10. 24 14
      ys_int/src/routes.js
  11. 2 2
      ys_int/src/views/404.vue
  12. 499 557
      ys_int/src/views/Home.vue
  13. 55 7
      ys_int/src/views/Login.vue
  14. 96 148
      ys_int/src/views/base/allocation.vue
  15. 77 56
      ys_int/src/views/base/comp.vue
  16. 81 56
      ys_int/src/views/base/factory.vue
  17. 155 160
      ys_int/src/views/detection/detection.vue
  18. 379 436
      ys_int/src/views/detection/maintenance.vue
  19. 6 6
      ys_int/src/views/map/map.vue
  20. 243 244
      ys_int/src/views/message.vue
  21. 492 506
      ys_int/src/views/mold/moldDetail.vue
  22. 237 246
      ys_int/src/views/mold/moldDownload.vue
  23. 99 68
      ys_int/src/views/mold/moldList.vue
  24. 23 27
      ys_int/src/views/project/competence.vue
  25. 41 27
      ys_int/src/views/project/project.vue
  26. 106 83
      ys_int/src/views/project/projectDetail.vue
  27. 83 65
      ys_int/src/views/project/staff.vue
  28. 10 10
      ys_vue/src/views/base/allocation.vue
  29. 1 1
      ys_vue/src/views/base/comp.vue
  30. 3 3
      ys_vue/src/views/base/factory.vue
  31. 1 1
      ys_vue/src/views/detection/detection.vue
  32. 8 16
      ys_vue/src/views/detection/maintenance.vue
  33. 1 1
      ys_vue/src/views/mold/moldDetail.vue
  34. 1 1
      ys_vue/src/views/project/competence.vue
  35. 2 2
      ys_vue/src/views/project/staff.vue

+ 1 - 1
ys_int/config/index.js

@@ -14,7 +14,7 @@ module.exports = {
   },
   dev: {
     env: require('./dev.env'),
-    port: 8090,
+    port: 8001,
     autoOpenBrowser: true,
     assetsSubDirectory: 'static',
     assetsPublicPath: '/',

+ 12 - 2
ys_int/src/http.js

@@ -1,13 +1,23 @@
 import axios from 'axios'
 import qs from 'qs'
 
-const TIME_OUT_MS = 60 * 1000 // 默认请求超时时间
+import { lang } from './i18n/lang/en';
+import i18n from './i18n/i18n'
 
+const TIME_OUT_MS = 60 * 1000 // 默认请求超时时间
 /*
  * @param response 返回数据列表
  */
 function handleResults (response) {
     let remoteResponse = response.data;
+    if(remoteResponse.code != "ok" && i18n.locale == "en-US") {
+        var list = lang.port;
+        for(var i in list) {
+            if(i == remoteResponse.msg) {
+                remoteResponse.msg = list[i];
+            }
+        }
+    }
     return remoteResponse
 }
 
@@ -32,7 +42,7 @@ export default {
      * @param exception 异常的回调函数
      */
     post (url, data, response, exception) {
-        var user = sessionStorage.getItem('user') , token = "";
+        var user = sessionStorage.getItem('user') , token = "" , that = this;
         if(user != null){
             token = JSON.parse(user).headImgurl
             data.token = token

+ 18 - 0
ys_int/src/i18n/i18n.js

@@ -0,0 +1,18 @@
+import Vue from 'vue'
+import VueI18n from 'vue-i18n'
+import locale from 'element-ui/lib/locale'
+
+Vue.use(VueI18n)
+
+const i18n = new VueI18n({
+    locale: localStorage.lang || 'zh-CN',    // 语言标识
+    messages: {
+      'zh-CN': require('./lang/zh').default,   // 中文语言包
+      'en-US': require('./lang/en').default    // 英文语言包
+    },
+    silentTranslationWarn: true,
+})
+
+locale.i18n((key, value) => i18n.t(key, value)) 
+
+export default i18n

+ 380 - 0
ys_int/src/i18n/lang/en.js

@@ -0,0 +1,380 @@
+import locale from 'element-ui/lib/locale/lang/en'
+const lang = {
+    // 基础
+    base: {
+        title: "YunSu CMS",
+        account: "Account",
+        password: "Password",
+        login: "Login",
+        prompt: "Prompt",
+        query: "Query",
+        add: "Add",
+        operate: "Operate",
+        edit: "Edit",
+		imput: "Batch Imput",
+		use: "Start",
+		run: "run",
+		static: "static",
+		warning: "warning",
+		scrap: "scrap",
+		choose: "Please choose",
+		num: "Number",
+		name: "Name",
+		detail: "Detail",
+		back: "Back",
+		upload: "Upload",
+		invite: "Invite",
+		state: "State",
+    },
+    prompt: {
+        success: "Modify Success",
+        success1: "Success,please login again",
+        success2: "Created Success",
+        success3: "Delete Success",
+		success4: "Upload Success",
+		success5: "Maintenance Completed",
+		success6: "Copy Success",
+		fail: "Copy Failed",
+		success7: "Approval Success",
+		success8: "Application Success",
+		success9: "Update 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",
+		keySearch: "Please enter a keyword to search",
+		uploadType: "Uploaded images can only be in JPG or PNG format!",
+		uploadSize: "Uploaded images should not exceed 5MB in size!",
+		nameSearch: "Please enter your name or cell phone number for search",
+    },
+    // 主页
+    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",
+    },
+	// 运行监测
+	runTest: {
+		state: "current state",
+		stage: "Equipment warning",
+		stage0: "Normal",
+		stage1: "High temperature",
+		stage2: "Low battery",
+		stage3: "High temperature、Low battery",
+		stage4: "Unknown",
+		isMaintain: "Mold Maintenance",
+		isMaintain0: "Need",
+		isMaintain1: "Normal",
+		process: "Process",
+		processMold: "Process Mold",
+		nowState: "Current maintenance status",
+		immediate: "Immediate Treatment",
+		record: "Processing records",
+		maintainUser: "Maintenance Person",
+		maintainType: "Maintenance Plan",
+		fileName: "Maintenance Photo",
+		closeTime: "Close Time",
+		maintenance: "Treatment",
+		type: "Maintenance Type",
+		inputType: "Please select the type of maintenance",
+		vulnerable: "Wearing Part",
+		inputVulnerable: "Please select wearing part",
+		action: "Action",
+		inputAction: "Please select action",
+		spray: "spray paint",
+		check: "inspect",
+		dealWarning: "Deal With Warning",
+		warningType: "Warning Type",
+		inputWarningType: "Please enter warning type",
+		moldSet: "Equipment Set",
+		inputMoldSet: "Please select the equipment",
+		completed: "The alarm has been dealt with.",
+		mustUpload: "Must upload photos",
+	},
+	// 项目管理
+    project: {
+		// 项目列表
+		proName: "Project Name",
+		inputProName: "Please enter the project name",
+		assName: "Asset Company",
+		cusName: "Producer Company",
+		moldName: "Project Mold",
+		inputMoldName: "Please select the project mold",
+		manager: "Project Manager",
+		inputManager: "Please select project manager",
+		indate: "Creat Time",
+		addPro: "Add Project",
+		// 项目详情
+		detail: "Basic Project Information",
+		projectNo: "Project No",
+		ownerApprover: "Asset Approver",
+		inputOwnerApprover: "Please select the approver of the asset side",
+		customerApprover: "Producer Approver",
+		inputCustomerApprover: "Please select the approver of the producer side",
+		users: "General User",
+		inputUsers: "Please select the general user of the project",
+		proFile: "Project Documentation",
+		fileName: "Name",
+		fileSize: "Size",
+		uploader: "Uploader",
+		uploadTime: "Upload Time",
+		operation: "Operation Record",
+		operFileName: "Operation Name",
+		operator: "Operator",
+		operTime: "Operation Time",
+		editPro: "Edit Project",
+		addUser: "Add Person",
+		uploadAndAdd: "Submit and Add",
+		delFile: "Are you sure to delete this document??",
+        // 人员管理
+        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 select Company",
+		partake: "Participate Project",
+		inputPartake: "Please choose to participate in the project.",
+		remark: "Remark",
+		inputRemark:"Please enter remark",
+		type: "Type",
+		addPeo: "Add Person",
+		editPeo: "Edit Person",
+		copy: "Copy Link",
+		copyInv: "Please copy the invitation link",
+		delPeo: "Are you sure to delete this person?",
+		// 权限管理
+		choosePro: "Please select the project",
+		inputNameSearch: "Please enter your name for search",
+		upload: "Upload",
+		download: "Download",
+		view: "View",
+		approve: "Approve",
+		editPower: "Edit Power",
+		config: "Config Power",
+    },
+	// 模具管理
+	mold: {
+		// 模具列表
+		moldNo: "Mold Num",
+		modelName: "Mold Name",
+		projectName: "Project Name",
+		factoryName: "Producer",
+		factoryName1: "Asset",
+		area: "Area",
+		runTimes: "Number of runs",
+		ocCycle: "Cycle",
+		hillNumber: "Electricity",
+		delMold: "Are you sure to delete the die?",
+		initial: "Initial Mold Times",
+		life: "Mold Lifetime",
+		hole: "Hole Number",
+		rfid: "RFID Code",
+		addMold: "Add Mold",
+		inputmoldNo: "Please enter the mould number.",
+		inputmodelName: "Please enter the name of the mould.",
+		inputequipment: "Please select equipment number",
+		inputinitial: "Please enter the initial module number.",
+		inputlife: "Please enter module life",
+		inputhole: "Please enter the number of points.",
+		inputrfid: "Please enter RIFD code",
+		inputfactoryName: "Please select the manufacturer to which you belong.",
+		maintainCount: "Maintenance times",
+		inputmaintainCount: "Please choose the number of maintenance times.",
+		num0: "Please fill in numbers greater than 0",
+		num1: "Please fill in a number less than or equal to 100 million",
+		// 模具详情
+		beScrapped: "To be scrapped",
+		scraped: "Scrap",
+		view: "Click to see the running status",
+		moldDetail: "Mold Basic Information",
+		file: "Documentation",
+		file2D: "2D drawing file",
+		file3D: "3D drawing file",
+		addComponents: "Add Components",
+		singleAdd: "Single Add",
+		downloadMould: "Download Template",
+		batchImport: "Batch Import",
+		apply: "Apply",
+		moldFile: "Mold Document",
+		state0: "Producer Audit failed",
+		state1: "Asset Audit failed",
+		state2: "Pending Audit",
+		state3: "Producer Audit",
+		state4: "Asset Audit",
+		state5: "Audit Pass",
+		componentsFile: "Part Document",
+		partNo: "Part Number",
+		partName: "Part Name",
+		partLife: "Lifetime",
+		yes: "Yes",
+		no: "No",
+		test: "Test Mode and Acceptance",
+		plan: "Maintenance Plan",
+		update: "Mold Update",
+		applicant: "Applicant",
+		applicationTime: "Application Time",
+		updateM: "Update Mold",
+		pass: "Pass",
+		fail: "Fail",
+		scrapMold: "Mold Scrapping",
+		applicationName: "Application Name",
+		applicationSize: "Application Size",
+		scrapName: "Scrap Name",
+		scrapSize: "Scrap Size",
+		updateRecord: "Update Record",
+		approver: "Approver",
+		time: "Time",
+		application: "Application",
+		scrap: "Scrap",
+		scrapUpload: "Mold Scrap Upload",
+		partUpload: "Part Document Upload",
+		rule: "File naming rules: part number + 2D / 3D, such as LJ001 + 2D.dwg",
+		export: "Batch Export Operation Record",
+		to: "To",
+		addPart: "Add Part",
+		editPart: "Edit Part",
+		inputpartNo: "Please enter the part number",
+		inputpartName: "Please enter the part name",
+		inputpartLife: "Please enter the part life",
+		approvalTitle1: "Confirmed approval?",
+		approvalTitle2: "Are you sure you have not approved?",
+		must: "Must upload one file each",
+		toApply: "Want to apply for an updated mold?",
+		noTime: "No time entered",
+		// 文档下载
+		searchByName: "Please enter the mold name to search",
+		allDown: "Download all",
+		down3DMold: "Mold 3D Image file",
+		down2DMold: "Mold 2D Image file",
+		down3DPart: "Part 3D Image file",
+		down2DPart: "Part 2D Image file",
+		fileState0: "Not Uploaded",
+		fileState1: "Passed",
+		fileState2: "Not Pass",
+		chooseFile: "Please select the document to download",
+	},
+    // 基础管理
+    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",
+		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",
+		equipmentState: "Equipment State",
+		diffTime: "Count Down",
+		year: "year",
+		compName: "Corporate Name",
+		state0: "Not Enabled",
+		state1: "Enabled",
+		use: "Use"
+    },
+    // 后台翻译
+    port: {
+        "用户不存在或者未登录": "User does not exist or is not logged in",
+        "数据不可为空": "Data cannot be empty",
+        "公司已存在,请勿重复添加": "The company already exists, please do not add it repeatedly",
+        "当前公司所关联的生产方公司中已被用用到项目,不可执行修改操作。": "The current production company associated with the company has been used in the project, and the modification operation cannot be performed.",
+        "当前公司所关联的资产方公司已被用用到项目,不可执行修改操作。": "The current asset company associated with the company has been used in the project and no modification operations can be performed.",
+        "该公司已被应用到用户中,暂不提供删除操作": "The company has been applied to users, and no deletion is provided at this time.",
+        "当前设备编号已存在,请重新输入其他模具编号": "The current device number already exists. Please re-enter other mold numbers",
+        "该设备没有所属公司,请添加所属公司后再启用": "This device does not have a company, please add your company and then enable it.",
+        "对不起,您不是超级管理员,不具备启用设备的权限": "Sorry, you are not a super administrator and do not have permission to enable the device.",
+        "对不起,您不含有查看该列表的权利": "Sorry, you do not have the right to view this list.",
+        "云模盒编号已被占用,请修改后重新上传": "The cloud model box number is already occupied. Please re-upload after modification.",
+        "只有生产方和资产方审批人才能审核": "Only producer and asset approvers can review",
+        "您没有该权限!": "You do not have this permission!!",
+        "暂无文件": "No file",
+        "该模具已被应用到项目,不提供删除操作": "The mold has been applied to the project and no delete operation is provided",
+        "模具id不存在": "Mold id does not exist",
+        "零件编号已被占用,请修改后重新上传": "The part number is already occupied. Please re-upload after modification.",
+        "零件寿命数字过长,请修改后重试": "The part life number is too long, please modify and try again",
+        "添加项目参与人失败,人员id不存在": "Adding project participants failed, staff id does not exist",
+        "密码错误": "Wrong password",
+        "账号不存在": "Account does not exist",
+        "该用户已被应用到项目,暂不提供删除操作": "The user has been applied to the project and no delete operation is currently available.",
+        "该公司下的管理员已存在": "The administrator under the company already exists",
+        "账号已存在": "Account already exists",
+        "有新的模具文档上传,待您审批。": "New mould documents are uploaded for your approval.",
+		"有新的模具更新申请记录,待您审批。": "There are new application records for mould updating pending your approval.",
+		"有新的模具报废文档上传,待您审批。": "There are new scrap die documents uploaded for your approval.",
+		"有新的试模验收文档上传,待您审批。": "There are new acceptance documents for the test mould are uploaded, which are waiting for your approval.",
+		"有新的零件文档上传,待您审批。": "New parts documents are uploaded for your approval.",
+		"有新的保养方案文档上传,待您审批。": "There are new maintenance plan documents uploaded for your approval.",
+    },
+    ...locale
+}
+export default lang

+ 348 - 0
ys_int/src/i18n/lang/zh.js

@@ -0,0 +1,348 @@
+import locale from 'element-ui/lib/locale/lang/zh-CN'
+const lang = {
+    // 基础
+    base: {
+        title: "云塑网后台管理系统",
+        account: "账号",
+        password: "密码",
+        login: "登录",
+        prompt: "提示",
+        query: "查询",
+        add: "新增",
+        operate: "操作",
+        edit: "编辑",
+		imput: "批量导入",
+		use: "启用",
+		run: "运行",
+		static: "静止",
+		warning: "告警",
+		scrap: "报废",
+		choose: "请选择查询条件",
+		num: "编号",
+		name: "名称",
+		detail: "详情",
+		back: "返回",
+		upload: "上传",
+		invite: "邀请",
+		state: "状态",
+    },
+    prompt: {
+        success: "修改成功",
+        success1: "修改成功,请重新登录",
+        success2: "创建成功",
+        success3: "删除成功",
+		success4: "上传成功",
+		success5: "保养完成",
+		success6: "复制成功",
+		fail: "复制失败",
+		success7: "审批成功",
+		success8: "申请成功",
+		success9: "更新成功",
+    },
+    msg: {
+        changeLanguage: "是否切换语言?",
+        signOut: "是否退出登录?",
+        loginAcc: "请输入账号",
+        loginPass: "请输入密码",
+        inputNewPwd: "请输入新密码",
+		keySearch: "请输入关键字进行搜索",
+		uploadType: "上传的图片只能是 JPG 或 PNG 格式!",
+		uploadSize: "上传的图片大小不能超过 5MB!",
+		nameSearch: "请输入姓名或手机号进行搜索",
+    },
+    // 主页
+    home: {
+        approval: "审批",
+        noApproval: "暂无审批消息",
+        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: "云模盒管理",
+    },
+	// 运行监测
+	runTest: {
+		state: "当前状态",
+		stage: "云模盒告警",
+		stage0: "正常",
+		stage1: "温度过高",
+		stage2: "电量过低",
+		stage3: "温度过高、电量过低",
+		stage4: "不明",
+		isMaintain: "模具保养",
+		isMaintain0: "需要",
+		isMaintain1: "正常",
+		process: "处理",
+		processMold: "模具处理",
+		nowState: "当前保养状态",
+		immediate: "立即处理",
+		record: "处理记录",
+		maintainUser: "保养人",
+		maintainType: "保养方案",
+		fileName: "保养照片",
+		closeTime: "关闭时间",
+		maintenance: "处理保养",
+		type: "保养类型",
+		inputType: "请选择保养类型",
+		vulnerable: "易损件",
+		inputVulnerable: "请选择易损件",
+		action: "动作",
+		inputAction: "请选择动作",
+		spray: "喷漆",
+		check: "检查",
+		dealWarning: "告警处理",
+		warningType: "告警类型",
+		inputWarningType: "请输入告警类型",
+		moldSet: "云模盒设置",
+		inputMoldSet: "请选择云模盒",
+		completed: "告警处理完毕",
+		mustUpload: "必须上传照片",
+	},
+	// 项目管理
+    project: {
+		// 项目列表
+		proName: "项目名称",
+		inputProName: "请输入项目名称",
+		assName: "资产方公司",
+		cusName: "生产方公司",
+		moldName: "项目模具",
+		inputMoldName: "请选择项目模具",
+		manager: "项目经理",
+		inputManager: "请选择项目经理",
+		indate: "创建时间",
+		addPro: "新增项目",
+		// 项目详情
+		detail: "项目基本信息",
+		projectNo: "项目编号",
+		ownerApprover: "资产方审批人",
+		inputOwnerApprover: "请选择资产方审批人",
+		customerApprover: "生产方审批人",
+		inputCustomerApprover: "请选择生产方审批人",
+		users: "项目普通用户",
+		inputUsers: "请选择项目普通用户",
+		proFile: "项目文档",
+		fileName: "名称",
+		fileSize: "大小",
+		uploader: "上传者",
+		uploadTime: "上传时间",
+		operation: "操作记录",
+		operFileName: "操作文档名称",
+		operator: "操作人",
+		operTime: "操作时间",
+		editPro: "编辑项目",
+		addUser: "添加人员",
+		uploadAndAdd: "提交并新增",
+		delFile: "确认删除该文档吗?",
+        // 人员管理
+        initial: "初始密码",
+        name: "姓名",
+        inputName: "请输入姓名",
+        mobile: "手机号",
+        inputMobile: "请输入手机号",
+        inputTrueMobile: "请输入正确的手机号",   
+        role: "角色",
+		inputRole: "请输入角色",
+        company: "所属公司",
+        inputCompany: "请选择所属公司",
+		partake: "参与项目",
+		inputPartake: "请选择参与项目",
+		remark: "备注",
+		inputRemark:"请输入备注",
+		type: "类型",
+		addPeo: "新增人员",
+		editPeo: "编辑人员",
+		copy: "复制链接",
+		copyInv: "请复制邀请链接",
+		delPeo: "确认删除该人员吗?",
+		// 权限管理
+		choosePro: "请选择项目",
+		inputNameSearch: "请输入姓名进行搜索",
+		upload: "上传",
+		download: "下载",
+		view: "浏览",
+		approve: "审批",
+		editPower: "编辑权限",
+		config: "权限配置",
+		
+    },
+	// 模具管理
+	mold: {
+		// 模具列表
+		moldNo: "模具编号",
+		modelName: "模具名称",
+		projectName: "所属项目",
+		factoryName: "所属生产方",
+		factoryName1: "所属资产方",
+		area: "位置",
+		runTimes: "运行次数",
+		ocCycle: "每模平均周期",
+		hillNumber: "电量",
+		delMold: "确认删除该模具吗?",
+		initial: "初始模次",
+		life: "模次寿命",
+		hole: "穴数",
+		rfid: "RFID码",
+		addMold: "新建模具",
+		inputmoldNo: "请输入模具编号",
+		inputmodelName: "请输入模具名称",
+		inputequipment: "请选择云模盒编号",
+		inputinitial: "请输入初始模次",
+		inputlife: "请输入模次寿命",
+		inputhole: "请输入穴数",
+		inputrfid: "请输入RIFD码",
+		inputfactoryName: "请选择所属生产方",
+		maintainCount: "保养次数",
+		inputmaintainCount: "请选择保养次数",
+		num0: "请填写大于0的数字",
+		num1: "请填写小于等于1亿的数字",
+		// 模具详情
+		beScrapped: "待报废",
+		scraped: "已报废",
+		view: "点击查看运行状态",
+		moldDetail: "模具基本信息",
+		file: "文档资料",
+		file2D: "2D图档",
+		file3D: "3D图档",
+		addComponents: "新建零件",
+		singleAdd: "单个新建",
+		downloadMould: "下载模板",
+		batchImport: "批量导入",
+		apply: "申请",
+		moldFile: "模具文档",
+		state0: "生产方审核不通过",
+		state1: "资产方审核不通过",
+		state2: "待双方审核",
+		state3: "待生产方审核",
+		state4: "待资产方审核",
+		state5: "审核通过",
+		componentsFile: "零件文档",
+		partNo: "零件编号",
+		partName: "零件名称",
+		partLife: "寿命次数",
+		yes: "是",
+		no: "否",
+		test: "试模及验收",
+		plan: "保养方案",
+		update: "模具更新",
+		applicant: "申请人",
+		applicationTime: "申请时间",
+		updateM: "更新模具",
+		pass: "通过",
+		fail: "不通过",
+		scrapMold: "模具报废",
+		applicationName: "申请单名称",
+		applicationSize: "申请单大小",
+		scrapName: "报废单名称",
+		scrapSize: "报废单大小",
+		updateRecord: "更新记录",
+		approver: "审批人",
+		time: "时间",
+		application: "申请单",
+		scrap: "报废单",
+		scrapUpload: "模具报废上传",
+		partUpload: "零件文档上传",
+		rule: "文件命名规则:零件编号+2D/3D,  如 LJ001+2D.dwg",
+		export: "批量导出操作记录",
+		to: "至",
+		addPart: "新增零件",
+		editPart: "编辑零件",
+		inputpartNo: "请输入零件编号",
+		inputpartName: "请输入零件名称",
+		inputpartLife: "请输入零件寿命",
+		approvalTitle1: "确认通过审批吗?",
+		approvalTitle2: "确认不通过审批吗?",
+		must: "必须各上传一个文件",
+		toApply: "要申请更新模具吗?",
+		noTime: "未输入时间",
+		// 文档下载
+		searchByName: "请输入模具名称进行搜索",
+		allDown: "全部下载",
+		down3DMold: "模具3D图档",
+		down2DMold: "模具2D图档",
+		down3DPart: "零件3D图档",
+		down2DPart: "零件2D图档",
+		fileState0: "未上传",
+		fileState1: "已通过",
+		fileState2: "未通过",
+		chooseFile: "请选择要下载的文档",
+	},
+    // 基础管理
+    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: "请选择公司",		
+		equipmentNo: "云模盒编号",
+		inputequipmentNo: "请输入云模盒编号",
+		useLife: "使用年限",
+		inputUseLife: "请输入使用年限",
+		inputUseLifeNum: "使用年限必须为数字值",
+		agent: "代理商",
+		inputAgent: "请输入代理商",
+		inputBlongComp: "填写所属公司后才能启用模具",
+		inUse: "设备已启用",
+		equipmentState: "云模盒状态",
+		diffTime: "倒计时",
+		year: "年",
+		compName: "公司名称",
+		state0: "未启用",
+		state1: "已启用",
+		use: "启用"	
+    },
+    ...locale
+}
+export default lang

+ 23 - 13
ys_int/src/main.js

@@ -1,10 +1,17 @@
 import Vue from 'vue'
 import App from './App'
 
+import VueClipboard from 'vue-clipboard2'
+Vue.use(VueClipboard)
+
 import VueRouter from 'vue-router'
+Vue.use(VueRouter)
 
 import ElementUI from 'element-ui'
 import 'element-ui/lib/theme-chalk/index.css'
+Vue.use(ElementUI)
+
+import i18n from './i18n/i18n'
 
 import store from './vuex/store'
 import Vuex from 'vuex'
@@ -16,23 +23,25 @@ Vue.prototype.http = http
 import port from './port'
 Vue.prototype.port = port
 
-import VueClipboard from 'vue-clipboard2'
-Vue.use(VueClipboard)
-
 import 'font-awesome/css/font-awesome.min.css'
 import './assets/iconfont/iconfont.css'
 
-Vue.use(ElementUI)
-Vue.use(VueRouter)
 Vue.use(Vuex)
 
 const router = new VueRouter({
     routes
 })
 
-
 router.beforeEach((to, from, next) => {
     if(to.name != '邀请') {
+        var navigation = {};
+
+        if(i18n.locale == "en-US") {
+            navigation = require('./i18n/lang/en').default.navigation;
+        } else {
+            navigation = require('./i18n/lang/zh').default.navigation;
+        }
+
         if (to.path == '/login') {
             sessionStorage.removeItem('user');
         }
@@ -43,17 +52,17 @@ router.beforeEach((to, from, next) => {
         } else {
             if(user){
                 for(var i in routes){
-                    if(routes[i].name == "基础管理" && user.parentId != 0){
+                    if(routes[i].name == navigation.base && user.parentId != 0){//基础管理
                         routes[i].hidden = true
-                    } else if(routes[i].name == "基础管理"){
+                    } else if(routes[i].name == navigation.base){//基础管理
                         routes[i].hidden = false
                     }
                     
-                    if(routes[i].name == "项目管理" && user.parentId > 1){
+                    if(routes[i].name == navigation.pro && user.parentId > 1){//项目管理
                         var children = routes[i].children;
                         for(var j in children){
     
-                            if(children[j].name == "人员管理"){
+                            if(children[j].name == navigation.staff){//人员管理
                                 if(user.isManager == 0){
                                     children[j].hidden = true
                                 } else {
@@ -61,7 +70,7 @@ router.beforeEach((to, from, next) => {
                                 }
                             }
     
-                            if(children[j].name == "权限管理"){
+                            if(children[j].name == navigation.power){//权限管理
                                 if(user.isManager == 0){
                                     children[j].hidden = true
                                 } else {
@@ -69,14 +78,14 @@ router.beforeEach((to, from, next) => {
                                 }
                             }
                         }
-                    } else if(routes[i].name == "项目管理") {
+                    } else if(routes[i].name == navigation.pro) {//项目管理
                         var children = routes[i].children;
                         for(var j in children){
                             if(children[j].name != "项目详情"){
                                 children[j].hidden = false
                             }
                             
-                            if(children[j].name == "权限管理"){
+                            if(children[j].name == navigation.power){//权限管理
                                 if((user.parentId == 0 || user.parentId == 1) && user.isManager == 0){
                                     children[j].hidden = true
                                 }
@@ -95,6 +104,7 @@ router.beforeEach((to, from, next) => {
 new Vue({
     router,
     store,
+    i18n,
     render: h => h(App)
 }).$mount('#app')
 

+ 0 - 25
ys_int/src/mock/data/user.js

@@ -1,25 +0,0 @@
-import Mock from 'mockjs';
-const LoginUsers = [
-  {
-    id: 1,
-    username: 'admin',
-    password: '123456',
-    avatar: 'https://raw.githubusercontent.com/taylorchen709/markdown-images/master/vueadmin/user.png',
-    name: '张某某'
-  }
-];
-
-const Users = [];
-
-for (let i = 0; i < 86; i++) {
-  Users.push(Mock.mock({
-    id: Mock.Random.guid(),
-    name: Mock.Random.cname(),
-    addr: Mock.mock('@county(true)'),
-    'age|18-60': 1,
-    birth: Mock.Random.date(),
-    sex: Mock.Random.integer(0, 1)
-  }));
-}
-
-export { LoginUsers, Users };

+ 0 - 3
ys_int/src/mock/index.js

@@ -1,3 +0,0 @@
-import mock from './mock';
-
-export default mock;

+ 0 - 153
ys_int/src/mock/mock.js

@@ -1,153 +0,0 @@
-import axios from 'axios';
-import MockAdapter from 'axios-mock-adapter';
-import { LoginUsers, Users } from './data/user';
-let _Users = Users;
-
-export default {
-  /**
-   * mock bootstrap
-   */
-    bootstrap() {
-        let mock = new MockAdapter(axios);
-
-        // mock success request
-        mock.onGet('/success').reply(200, {
-            msg: 'success'
-        });
-
-        // mock error request
-        mock.onGet('/error').reply(500, {
-            msg: 'failure'
-        });
-
-        //登录
-        mock.onPost('/login').reply(config => {
-            let {username, password} = JSON.parse(config.data);
-            return new Promise((resolve, reject) => {
-                let user = null;
-                setTimeout(() => {
-                    let hasUser = LoginUsers.some(u => {
-                        if (u.username === username && u.password === password) {
-                            user = JSON.parse(JSON.stringify(u));
-                            user.password = undefined;
-                            return true;
-                        }
-                    });
-
-                    if (hasUser) {
-                        resolve([200, { code: 200, msg: '请求成功', user }]);
-                    } else {
-                        resolve([200, { code: 500, msg: '账号或密码错误' }]);
-                    }
-                }, 1000);
-            });
-        });
-
-        //获取用户列表
-        mock.onGet('/user/list').reply(config => {
-            let {name} = config.params;
-            let mockUsers = _Users.filter(user => {
-                if (name && user.name.indexOf(name) == -1) return false;
-                return true;
-            });
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        users: mockUsers
-                    }]);
-                }, 1000);
-            });
-        });
-
-        //获取用户列表(分页)
-        mock.onGet('/user/listpage').reply(config => {
-            let {page, name} = config.params;
-            let mockUsers = _Users.filter(user => {
-                if (name && user.name.indexOf(name) == -1) return false;
-                return true;
-            });
-            let total = mockUsers.length;
-            mockUsers = mockUsers.filter((u, index) => index < 20 * page && index >= 20 * (page - 1));
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        total: total,
-                        users: mockUsers
-                    }]);
-                }, 1000);
-            });
-        });
-
-        //删除用户
-        mock.onGet('/user/remove').reply(config => {
-            let { id } = config.params;
-            _Users = _Users.filter(u => u.id !== id);
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        code: 200,
-                        msg: '删除成功'
-                    }]);
-                }, 500);
-            });
-        });
-
-        //批量删除用户
-        mock.onGet('/user/batchremove').reply(config => {
-            let { ids } = config.params;
-            ids = ids.split(',');
-            _Users = _Users.filter(u => !ids.includes(u.id));
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        code: 200,
-                        msg: '删除成功'
-                    }]);
-                }, 500);
-            });
-        });
-
-        //编辑用户
-        mock.onGet('/user/edit').reply(config => {
-            let { id, name, addr, age, birth, sex } = config.params;
-            _Users.some(u => {
-                if (u.id === id) {
-                    u.name = name;
-                    u.addr = addr;
-                    u.age = age;
-                    u.birth = birth;
-                    u.sex = sex;
-                    return true;
-                }
-            });
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        code: 200,
-                        msg: '编辑成功'
-                    }]);
-                }, 500);
-            });
-        });
-
-        //新增用户
-        mock.onGet('/user/add').reply(config => {
-            let { name, addr, age, birth, sex } = config.params;
-            _Users.push({
-                name: name,
-                addr: addr,
-                age: age,
-                birth: birth,
-                sex: sex
-            });
-            return new Promise((resolve, reject) => {
-                setTimeout(() => {
-                    resolve([200, {
-                        code: 200,
-                        msg: '新增成功'
-                    }]);
-                }, 500);
-            });
-        });
-    }
-};

+ 24 - 14
ys_int/src/routes.js

@@ -22,6 +22,16 @@ import comp from './views/base/comp.vue'
 import factory from './views/base/factory.vue'
 import allocation from './views/base/allocation.vue'
 
+import i18n from './i18n/i18n';
+
+var navigation = {};
+
+if(i18n.locale == "en-US") {
+    navigation = require('./i18n/lang/en').default.navigation;
+} else {
+    navigation = require('./i18n/lang/zh').default.navigation;
+}
+
 let routes = [
     {
         path: '/login',
@@ -37,8 +47,8 @@ let routes = [
         iconCls: 'iconfont icon-ditu',
         leaf: true,//只有一个节点
         children: [
-            { path: '/map', component: map, name: '地图概览' },
-            { path: '/message', component: message, name: '消息中心', hidden: true }
+            { path: '/map', component: map, name: navigation.map },
+            { path: '/message', component: message, name: navigation.msg, hidden: true }
         ]
     },
     //运行监测
@@ -49,7 +59,7 @@ let routes = [
         iconCls: 'iconfont icon-jiance',
         leaf: true,//只有一个节点
         children: [
-            { path: '/detection', component: detection, name: '运行检测' },
+            { path: '/detection', component: detection, name: navigation.test },
             { path: '/detection/:id', component: maintenance, name: '运行检测详情', hidden: true }
         ]
     },
@@ -57,37 +67,37 @@ let routes = [
     {
         path: '/',
         component: Home,
-        name: '项目管理',
+        name: navigation.pro,
         iconCls: 'iconfont icon-ic_dashboard',
         children: [
-            { path: '/project', component: project, name: '项目列表' },
+            { path: '/project', component: project, name: navigation.proList },
             { path: '/project/:id', component: projectDetail, name: '项目详情', hidden: true },
-            { path: '/staff', component: staff, name: '人员管理' },
-            { path: '/competence', component: competence, name: '权限管理' }
+            { path: '/staff', component: staff, name: navigation.staff },
+            { path: '/competence', component: competence, name: navigation.power }
         ]
     },
     //模具管理
     {
         path: '/',
         component: Home,
-        name: '模具管理',
+        name: navigation.mold,
         iconCls: 'iconfont icon-moxing',
         children: [
-            { path: '/moldList', component: moldList, name: '模具列表' },
+            { path: '/moldList', component: moldList, name: navigation.moldList },
             { path: '/moldList/:id/:type', component: moldDetail, name: '模具详情', hidden: true },
-            { path: '/moldDownload', component: moldDownload, name: '文档下载' }
+            { path: '/moldDownload', component: moldDownload, name: navigation.moldDown }
         ]
     },
     //基础管理
     {
         path: '/',
         component: Home,
-        name: '基础管理',
+        name: navigation.base,
         iconCls: 'iconfont icon-setting-fill',
         children: [
-            { path: '/comp', component: comp, name: '资产方管理' },
-            { path: '/factory', component: factory, name: '生产方管理' },
-            { path: '/allocation', component: allocation, name: '云模盒管理' }
+            { path: '/comp', component: comp, name: navigation.asset },
+            { path: '/factory', component: factory, name: navigation.producer },
+            { path: '/allocation', component: allocation, name: navigation.device }
         ]
     },
     //邀请

+ 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>

Разница между файлами не показана из-за своего большого размера
+ 499 - 557
ys_int/src/views/Home.vue


+ 55 - 7
ys_int/src/views/Login.vue

@@ -1,18 +1,23 @@
 <template>
     <div class="login-par">
+        <div class="changeLanguage">
+            <span @click="changeLanguage" :class="$i18n.locale=='zh-CN'?'choseColor':'noColor'">中文</span>
+                /
+            <span @click="changeLanguage" :class="$i18n.locale=='zh-CN'?'noColor':'choseColor'">Engilsh</span>
+        </div>
         <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="left" label-width="0px" class="demo-ruleForm login-container">
             <div class="login-logo">
                 <img src="../assets/image/login_logo.png" style="width:80px;height:80px;"/>
             </div>
-            <h3 class="title">云塑网后台管理系统</h3>
+            <h3 class="title">{{$t('base.title')}}</h3>
             <el-form-item class="login-input" prop="account">
-                <el-input type="text" v-model="ruleForm.account" autocomplete="off" placeholder="账号" clearable prefix-icon="el-icon-user-solid"></el-input>
+                <el-input type="text" v-model="ruleForm.account" autocomplete="off" :placeholder="$t('base.account')" clearable prefix-icon="el-icon-user-solid"></el-input>
             </el-form-item>
             <el-form-item class="login-input" prop="password">
-                <el-input type="password" v-model="ruleForm.password" @keyup.enter.native="handleSubmit" autocomplete="off" placeholder="密码" show-password prefix-icon="el-icon-lock"></el-input>
+                <el-input type="password" v-model="ruleForm.password" @keyup.enter.native="handleSubmit" autocomplete="off" :placeholder="$t('base.password')" show-password prefix-icon="el-icon-lock"></el-input>
             </el-form-item>
             <el-form-item class="login-button" style="width:100%;">
-                <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit" :loading="logining">登录</el-button>
+                <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit" :loading="logining">{{$t('base.login')}}</el-button>
             </el-form-item>
         </el-form>
         <div class="login-backImg">
@@ -24,6 +29,17 @@
 <script>
     export default {
         data() {
+            const msg = (rule, value, callback) => {
+                if (!value) {
+                    if(rule.field == "account") {
+                        return callback(new Error(this.$t('msg.loginAcc')));
+                    } else {
+                        return callback(new Error(this.$t('msg.loginPass')));
+                    }
+                } else {
+                    callback();
+                }
+            };
             return {
                 logining: false,
                 // 登录信息
@@ -33,10 +49,10 @@
                 },
                 rules: {
                     account: [
-                        { required: true, message: '请输入账号', trigger: 'blur' },
+                        { required: true, validator: msg , trigger: 'blur' },
                     ],
                     password: [
-                        { required: true, message: '请输入密码', trigger: 'blur' },
+                        { required: true, validator: msg , trigger: 'blur' },
                     ]
                 }
             };
@@ -45,7 +61,23 @@
             handleReset2() {
                 this.$refs.ruleForm.resetFields();
             },
-            handleSubmit(ev) {
+            changeLanguage() {
+                this.$confirm(this.$t('msg.changeLanguage'), this.$t('el.messagebox.title'), {
+                    confirmButtonText: this.$t('el.messagebox.confirm'),
+                    cancelButtonText: this.$t('el.messagebox.cancel'),
+                    type: 'warning'
+                }).then(() => {
+                    this.$router.go(0);
+                    if ( this.$i18n.locale === 'zh-CN' ) {
+                        this.$i18n.locale = 'en-US';
+                        localStorage.lang = 'en-US';
+                    }else {
+                        this.$i18n.locale = 'zh-CN';
+                        localStorage.lang = 'zh-CN';
+                    }
+                }).catch(() => {});
+            },
+            handleSubmit() {
                 this.$refs.ruleForm.validate((valid) => {
                     if (valid) {
                         var _this = this;
@@ -80,6 +112,22 @@
         position: relative;
     }
 
+    .changeLanguage {
+        position: absolute;
+        right:30px;
+        top:-160px;
+        font-size: 17px;
+        cursor: pointer;
+
+        .choseColor {
+            color: #409EFF;
+        }
+
+        .noColor {
+            color: #cac6c6;
+        }
+    }
+
     .login-logo {
         text-align: center;
         margin: 0 0 20px 0;

+ 96 - 148
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('msg.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>
@@ -38,172 +31,104 @@
         <!--列表-->
         <el-table :data="allocations" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
             <el-table-column type="index" width="60"></el-table-column>
-            <el-table-column prop="equipmentNo" label="云模盒编号" width="130" sortable></el-table-column>
-            <el-table-column prop="hillNumber" label="电量" width="80" align="center" sortable></el-table-column>
-            <el-table-column prop="useLife" label="使用年限" width="100" align="center" sortable>
-                <template slot-scope="scope">{{scope.row.useLife}}</template>
+            <el-table-column prop="equipmentNo" :label="$t('basic.equipmentNo')" width="130" sortable></el-table-column>
+            <el-table-column prop="hillNumber" :label="$t('mold.hillNumber')" width="80" align="center" sortable></el-table-column>
+            <el-table-column prop="useLife" :label="$t('mold.useLife')" width="100" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.useLife}}{{$t('basic.year')}}</template>
             </el-table-column>
-            <el-table-column prop="useLife" label="倒计时" width="100" align="center" sortable>
+            <el-table-column prop="useLife" :label="$t('basic.diffTime')" width="100" align="center" sortable>
                 <template slot-scope="scope">{{scope.row.diffTime}}</template>
             </el-table-column>
-            <el-table-column prop="modelName" label="模具名称" sortable></el-table-column>
-            <el-table-column prop="modelNo" label="模具编号" width="120" align="center" sortable></el-table-column>
-            <el-table-column prop="companyName" label="公司名称" sortable></el-table-column>
-            <el-table-column prop="agent" label="代理商" width="120" sortable></el-table-column>
-            <el-table-column label="云模盒状态" align="center" width="120" sortable>
+            <el-table-column prop="modelName" :label="$t('mold.modelName')" sortable></el-table-column>
+            <el-table-column prop="modelNo" :label="$t('mold.moldNo')" width="120" align="center" sortable></el-table-column>
+            <el-table-column prop="companyName" :label="$t('basic.compName')" sortable></el-table-column>
+            <el-table-column prop="agent" :label="$t('basic.agent')" width="120" sortable></el-table-column>
+            <el-table-column :label="$t('basic.equipmentState')" align="center" width="120" sortable>
                 <template slot-scope="scope">
-                    <span v-if="scope.row.isUse == 0">未启用</span>
-                    <span v-else>已启用</span>
+                    <span v-if="scope.row.isUse == 0">{{$t('basic.state0')}}</span>
+                    <span v-else>{{$t('basic.state1')}}</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>
+                    <el-button size="small" v-if="scope.row.modelNo != null" type="primary" @click="openEnable(scope.$index)">{{$t('basic.use')}}</el-button>
                     <!--  :disabled="scope.row.isUse == 1" -->
-                    <el-button size="small" :style="scope.row.modelNo!=null?'':'float:right;margin-right:6px'" @click="showEdit(scope.$index, scope.row, scope.row.isUse == 1)">修改</el-button>
+                    <el-button size="small" :style="scope.row.modelNo!=null?'':'float:right;margin-right:6px'" @click="showEdit(scope.$index, scope.row, scope.row.isUse == 1)">{{$t('base.edit')}}</el-button>
                 </template>
             </el-table-column>
         </el-table>
 
         <!--工具条-->
         <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();

+ 155 - 160
ys_int/src/views/detection/detection.vue

@@ -1,172 +1,167 @@
 <template>
-  <section>
-    <!--工具条-->
-    <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-      <el-form :inline="true" :model="filters">
-        <el-col :span="2">
-          <el-form-item>
-            <el-select v-model="filters.value" placeholder="请选择">
-              <el-option label="编号" value="0"></el-option>
-              <el-option label="名称" value="1"></el-option>
-            </el-select>
-          </el-form-item>
+    <section>
+        <!--工具条-->
+        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+            <el-form :inline="true" :model="filters">
+                <el-col :span="2">
+                    <el-form-item>
+                        <el-select v-model="filters.value" :placeholder="$t('base.choose')">
+                            <el-option :label="$t('base.num')" value="0"></el-option>
+                            <el-option :label="$t('base.name')" value="1"></el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-form-item>
+                    <el-input v-model="filters.name" :placeholder="$t('msg.keySearch')" style="width: 300px;" clearable></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="primary" @click="getMoulds(filters.name)">{{$t('base.query')}}</el-button>
+                </el-form-item>
+            </el-form>
         </el-col>
-        <el-form-item>
-          <el-input v-model="filters.name" placeholder="请输入关键字进行搜索" style="width: 300px;" clearable></el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="getMoulds(filters.name)">查询</el-button>
-        </el-form-item>
-      </el-form>
-    </el-col>
 
-    <!--列表-->
-    <el-table
-      :data="moulds"
-      :height="tableHeight"
-      highlight-current-row
-      v-loading="listLoading"
-      style="width: 100%;"
-    >
-      <el-table-column type="index" width="60"></el-table-column>
-      <el-table-column prop="modelNo" label="模具编号" width="100" sortable></el-table-column>
-      <el-table-column label="模具名称" width="200" sortable>
-        <template slot-scope="scope">
-          <a
-            style="color: #409EFF; cursor: pointer"
-            @click="toMould(scope.row.id)"
-          >{{scope.row.modelName}}</a>
-        </template>
-      </el-table-column>
-      <el-table-column prop="equipmentNo" label="云模盒编号" width="120" sortable></el-table-column>
-      <el-table-column prop="projectName" label="所属项目" width="200" sortable></el-table-column>
-      <el-table-column prop="factoryName" label="制造工厂" width="200" sortable></el-table-column>
-      <el-table-column prop="area" label="位置" width="200" sortable></el-table-column>
-      <el-table-column prop="runTimes" label="运行次数" align="center" width="100" sortable></el-table-column>
-      <el-table-column prop="ocCycle" label="每模平均周期" align="center" width="140" sortable></el-table-column>
-      <el-table-column prop="hillNumber" label="电量" align="center" width="80" sortable></el-table-column>
-      <el-table-column prop="state" label="当前状态" align="center" width="100" sortable></el-table-column>
-      <el-table-column label="云模盒报警" align="center" width="160">
-          <template slot-scope="scope">
-          <span v-if="scope.row.stage == 0">正常</span>
-          <span v-else-if="scope.row.stage == 1">温度过高</span>
-          <span v-else-if="scope.row.stage == 2">电量过低</span>
-          <span v-else-if="scope.row.stage == 3">温度过高、电量过低</span>
-          <span v-else>不明</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="模具保养" align="center" width="100">
-        <template slot-scope="scope">
-          <span v-if="scope.row.isMaintain == 1">需要</span>
-          <span v-else>正常</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="处理" align="center" width="85">
-        <template slot-scope="scope">
-          <el-button size="small" type="primary" @click="toMaintenance(scope.row.id)">详情</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
+        <!--列表-->
+        <el-table :data="moulds" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
+            <el-table-column type="index" width="60"></el-table-column>
+            <el-table-column prop="modelNo" :label="$t('mold.moldNo')" width="100" sortable></el-table-column>
+            <el-table-column :label="$t('mold.modelName')" width="200" sortable>
+                <template slot-scope="scope">
+                    <a style="color: #409EFF; cursor: pointer" @click="toMould(scope.row.id)">{{scope.row.modelName}}</a>
+                </template>
+            </el-table-column>
+            <el-table-column prop="equipmentNo" :label="$t('basic.equipmentNo')" width="120" sortable></el-table-column>
+            <el-table-column prop="projectName" :label="$t('mold.projectName')" width="200" sortable></el-table-column>
+            <el-table-column prop="factoryName" :label="$t('mold.factoryName')" width="200" sortable></el-table-column>
+            <el-table-column prop="area" :label="$t('mold.area')" width="200" sortable></el-table-column>
+            <el-table-column prop="runTimes" :label="$t('mold.runTimes')" align="center" width="100" sortable></el-table-column>
+            <el-table-column prop="ocCycle" :label="$t('mold.ocCycle')" align="center" width="140" sortable></el-table-column>
+            <el-table-column prop="hillNumber" :label="$t('mold.hillNumber')" align="center" width="80" sortable></el-table-column>
+            <el-table-column prop="state" :label="$t('runTest.state')" align="center" width="100" sortable></el-table-column>
+            <el-table-column :label="$t('runTest.stage')" align="center" width="160">
+                <template slot-scope="scope">
+                    <span v-if="scope.row.stage == 0">{{$t('runTest.stage0')}}</span>
+                    <span v-else-if="scope.row.stage == 1">{{$t('runTest.stage1')}}</span>
+                    <span v-else-if="scope.row.stage == 2">{{$t('runTest.stage2')}}</span>
+                    <span v-else-if="scope.row.stage == 3">{{$t('runTest.stage3')}}</span>
+                    <span v-else>{{$t('runTest.stage4')}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column :label="$t('runTest.isMaintain')" align="center" width="100">
+                <template slot-scope="scope">
+                    <span v-if="scope.row.isMaintain == 1">{{$t('runTest.isMaintain0')}}</span>
+                    <span v-else>{{$t('runTest.isMaintain1')}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column :label="$t('runTest.process')" align="center" width="85">
+                <template slot-scope="scope">
+                    <el-button size="small" type="primary" @click="toMaintenance(scope.row.id)">{{$t('base.detail')}}</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
 
-    <!--工具条-->
-    <el-col :span="24" class="toolbar">
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :page-sizes="[20 , 50 , 80 , 100 , 200]"
-        :page-size="20"
-        layout="total, sizes, prev, pager, next"
-        :total="total"
-        style="float:right;"
-      ></el-pagination>
-    </el-col>
-  </section>
+        <!--工具条-->
+        <el-col :span="24" class="toolbar">
+            <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100 , 200]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;"
+            ></el-pagination>
+        </el-col>
+    </section>
 </template>
 
 <script>
-import util from "../../common/js/util";
-export default {
-  data() {
-    return {
-      moulds: [],
-      filters: {
-        name: "",
-        value: "0"
-      },
-      listLoading: false,
-      total: 0,
-      tableHeight: 0,
-      page: 1,
-      size: 20
-    };
-  },
-  methods: {
-    //分页
-    handleCurrentChange(val) {
-      this.page = val;
-      this.getMoulds();
-    },
-    handleSizeChange(val) {
-      this.size = val;
-      this.getMoulds();
-    },
-    //跳转到运行监测详情
-    toMaintenance(id) {
-      this.$router.push("/detection/" + id);
-    },
-    //跳转到模具详情
-    toMould(id) {
-      this.$router.push("/moldList/" + id + "/0");
-    },
-    //获取模具信息
-    getMoulds(keyWord) {
-      this.listLoading = true;
-      if (keyWord == null) {
-        var type = 0;
-      } else {
-        var type = this.filters.value;
-      }
-      var params = {
-        pageNum: this.page,
-        pageSize: this.size,
-        projectId: -1,
-        searchType: type,
-        keyName: keyWord,
-        type: 0
-      };
-      this.http.post(
-        this.port.mold.molds,
-        params,
-        res => {
-          this.listLoading = false;
-          if (res.code == "ok") {
-            this.moulds = res.data.list;
-            this.total = res.data.total;
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
+    import util from "../../common/js/util";
+
+    export default {
+        data() {
+            return {
+                moulds: [],
+                filters: {
+                    name: "",
+                    value: "0"
+                },
+                listLoading: false,
+                total: 0,
+                tableHeight: 0,
+                page: 1,
+                size: 20
+            };
+        },
+        methods: {
+            //分页
+            handleCurrentChange(val) {
+                this.page = val;
+                this.getMoulds();
+            },
+
+            handleSizeChange(val) {
+                this.size = val;
+                this.getMoulds();
+            },
+
+            //跳转到运行监测详情
+            toMaintenance(id) {
+                this.$router.push("/detection/" + id);
+            },
+
+            //跳转到模具详情
+            toMould(id) {
+                this.$router.push("/moldList/" + id + "/0");
+            },
+
+            //获取模具信息
+            getMoulds(keyWord) {
+                this.listLoading = true;
+                if (keyWord == null) {
+                    var type = 0;
+                } else {
+                    var type = this.filters.value;
+                }
+                var params = {
+                    pageNum: this.page,
+                    pageSize: this.size,
+                    projectId: -1,
+                    searchType: type,
+                    keyName: keyWord,
+                    type: 0
+                };
+                this.http.post( this.port.mold.molds , params,
+                res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.moulds = res.data.list;
+                        this.total = res.data.total;
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            }
+        },
+
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 210;
         },
-        error => {
-          this.listLoading = false;
-          this.$message({
-            message: error,
-            type: "error"
-          });
+
+        mounted() {
+            this.getMoulds();
         }
-      );
-    }
-  },
-  created() {
-    let height = window.innerHeight;
-    this.tableHeight = height - 210;
-  },
-  mounted() {
-    this.getMoulds();
-  }
-};
+    };
 </script>
 
 <style scoped>

+ 379 - 436
ys_int/src/views/detection/maintenance.vue

@@ -4,48 +4,48 @@
         <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
             <el-form :inline="true">
                 <el-form-item>
-                    <el-button type="text" @click="backToDetection" icon="el-icon-back" class="back">返回</el-button>
+                    <el-button type="text" @click="backToDetection" icon="el-icon-back" class="back">{{$t('base.back')}}</el-button>
                 </el-form-item>
                 <el-form-item class="divLine"></el-form-item>
                 <el-form-item>{{mouldName}}</el-form-item>
-                <el-form-item class="state" style="float: right;">当前状态
-                    <span v-if="mouldState == 0">静止</span>
-                    <span v-else-if="mouldState == 1">运行</span>
+                <el-form-item class="state" style="float: right;">{{$t('runTest.state')}}
+                    <span v-if="mouldState == 0">{{$t('base.static')}}</span>
+                    <span v-else-if="mouldState == 1">{{$t('base.run')}}</span>
                     <!-- 因为目前还不知道mouldState的意义 -->
-                    <span v-else>不明</span>
+                    <span v-else>{{$t('runTest.stage4')}}</span>
                 </el-form-item>
             </el-form>
         </el-col>
+
         <!-- v-if="requirement" -->
         <!-- 模具处理 -->
-        <el-col :span="24" class="title">模具处理</el-col>
-        <el-col :span="6" style="line-height: 32px; border-right: #c3c3c3 1px solid;">
-            当前保养状态:
-            <span v-if="requirement" style="color: #ff4949;">需要</span>
-            <span v-else style="color: black;">正常</span>
-            <el-button size="small" type="primary" 
-                @click="showMaintenance" 
-                v-if="!(user.parentId == 1 && user.subordinateType == 1) && requirement" style="margin-left: 16px;">
-                立即处理
+        <el-col :span="24" class="title">{{$t('runTest.processMold')}}</el-col>
+        <el-col :span="9" style="line-height: 32px; border-right: #c3c3c3 1px solid;">
+            {{$t('runTest.nowState')}}:
+            <span v-if="requirement" style="color: #ff4949;">{{$t('runTest.isMaintain0')}}</span>
+            <span v-else style="color: black;">{{$t('runTest.isMaintain1')}}</span>
+            <el-button size="small" type="primary" @click="showMaintenance"   style="margin-left: 16px;">
+                <!-- v-if="!(user.parentId == 1 && user.subordinateType == 1) && requirement" -->
+                {{$t('runTest.immediate')}}
             </el-button>
         </el-col>
-        <el-col :span="8" :offset="2" style="line-height: 32px;">
-            云模盒告警:{{warningInfo}}
-            <el-button size="small" type="primary"
-                v-if="!(user.parentId == 1 && user.subordinateType == 1) && stage != 0"
-                @click="warningFormVisible = true" style="margin-left: 16px;">
-                立即处理
+        <el-col :span="8" :offset="1" style="line-height: 32px;">
+            {{$t('runTest.stage')}}:{{warningInfo}}
+            <el-button size="small" type="primary"  @click="warningFormVisible = true" style="margin-left: 16px;">
+                <!-- v-if="!(user.parentId == 1 && user.subordinateType == 1) && stage != 0" -->
+                {{$t('runTest.immediate')}}
             </el-button>
         </el-col>
 
         <!-- 操作记录 -->
-        <el-col :span="24" class="title">处理记录</el-col>
+        <el-col :span="24" class="title">{{$t('runTest.record')}}</el-col>
+        
         <!-- 列表 -->
         <el-table :data="records" highlight-current-row v-loading="listLoading" style="width: 100%;" :height="tableHeight">
             <el-table-column type="index" width="60"></el-table-column>
-            <el-table-column prop="maintainUserName" label="保养人" width="100" sortable></el-table-column>
-            <el-table-column prop="maintainType" label="保养方案" sortable></el-table-column>
-            <el-table-column prop="fileName" label="保养照片" width="200" sortable>
+            <el-table-column prop="maintainUserName" :label="$t('runTest.maintainUser')" width="250" sortable></el-table-column>
+            <el-table-column prop="maintainType" :label="$t('runTest.maintainType')" sortable></el-table-column>
+            <el-table-column prop="fileName" :label="$t('runTest.fileName')" width="200" sortable>
                 <template slot-scope="scope" v-if="scope.row.fileUrl != null">
                     <a style="color: #409EFF; cursor: pointer; text-decoration: none;"
                         :href="scope.row.fileUrl" :download="scope.row.fileName">
@@ -57,7 +57,7 @@
                     </a>
                 </template>
             </el-table-column>
-            <el-table-column prop="indate" label="关闭时间" width="200" sortable></el-table-column>
+            <el-table-column prop="indate" :label="$t('runTest.closeTime')" width="200" sortable></el-table-column>
         </el-table>
 
         <!--工具条-->
@@ -74,443 +74,386 @@
         </el-col>
 
         <!--新增界面-->
-        <el-dialog title="处理保养" v-if="maintenanceFormVisible" :visible.sync="maintenanceFormVisible" :close-on-click-modal="false" customClass="customWidth">
-            <el-form :model="maintenanceForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
-                <el-form-item label="保养类型" prop="type">
+        <el-dialog :title="$t('runTest.maintenance')" v-if="maintenanceFormVisible" :visible.sync="maintenanceFormVisible" :close-on-click-modal="false" customClass="customWidth">
+            <el-form :model="maintenanceForm" label-width="135px" :rules="formRules" ref="addForm">
                 <!-- 保养类型选择 -->
-                <el-select v-model="type.value" filterable placeholder="请选择保养类型" style="width:202px">
-                    <el-option
-                    v-for="item in type"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                    ></el-option>
-                </el-select>
+                <el-form-item :label="$t('runTest.type')" prop="type">
+                    <el-select v-model="type.value" filterable :placeholder="$t('runTest.inputType')" style="width:500px">
+                        <el-option v-for="item in type" :key="item.value" :label="item.label" :value="item.value"></el-option>
+                    </el-select>
                 </el-form-item>
+
                 <!-- 保养类型为1时 选择易损件ID -->
-                <el-form-item v-if="type.value == 1" label="选择易损件" prop="vulnerable">
-                <el-select
-                    v-model="vulnerable.value"
-                    clearable
-                    filterable
-                    placeholder="请选择易损件"
-                    style="width:202px"
-                >
-                    <el-option
-                    v-for="item in vulnerable"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                    ></el-option>
-                </el-select>
+                <el-form-item v-if="type.value == 1" :label="$t('runTest.vulnerable')" prop="vulnerable">
+                    <el-select v-model="vulnerable.value" clearable filterable :placeholder="$t('runTest.inputVulnerable')" style="width: 500px;">
+                        <el-option v-for="item in vulnerable" :key="item.value" :label="item.label" :value="item.value"></el-option>
+                    </el-select>
                 </el-form-item>
+
                 <!-- 保养类型为0时 选择保养动作 -->
-                <el-form-item v-else label="选择动作" prop="action">
-                    <el-select v-model="action.value" filterable placeholder="请选择动作" style="width:202px">
-                        <el-option
-                        v-for="item in action"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value"
-                        ></el-option>
+                <el-form-item v-else :label="$t('runTest.action')" prop="action">
+                    <el-select v-model="action.value" filterable :placeholder="$t('runTest.inputAction')" style="width: 500px;">
+                        <el-option v-for="item in action" :key="item.value" :label="item.label" :value="item.value"></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="选择照片">
-                <el-upload ref="upload" action="customize" :http-request="maintain" :limit="1" :auto-upload="false" :before-upload="beforeUpload">
-                    <el-button size="small" type="primary">上传</el-button>
-                </el-upload>
+
+                <el-form-item :label="$t('runTest.fileName')">
+                    <el-upload ref="upload" action="customize" :http-request="maintain" :limit="1" :auto-upload="false" :before-upload="beforeUpload">
+                        <el-button size="small" type="primary">{{$t('base.upload')}}</el-button>
+                    </el-upload>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
-                <el-button @click.native="maintenanceFormVisible = false">取消</el-button>
-                <el-button type="primary" @click.native="maintainConfirm" :loading="maintenanceLoading">立即处理</el-button>
+                <el-button @click.native="maintenanceFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button type="primary" @click.native="maintainConfirm" :loading="maintenanceLoading">{{$t('runTest.process')}}</el-button>
             </div>
         </el-dialog>
 
         <!--告警处理界面-->
-        <el-dialog
-        title="告警处理"
-        v-if="warningFormVisible"
-        :visible.sync="warningFormVisible"
-        :close-on-click-modal="false"
-        customClass="customWidth"
-        >
-        <el-form
-            :model="warningForm"
-            label-width="100px"
-            :rules="formRules"
-            ref="addForm"
-            :inline="true"
-            class="demo-form-inline"
-        >
-            <el-form-item label="报警类型">
-            <el-input placeholder="报警类型" v-model="warningInfo" :disabled="true"></el-input>
-            </el-form-item>
-            <el-form-item label="云模盒设置" prop="action">
-            <el-select
-                v-model="warningForm.equipmentId"
-                filterable
-                placeholder="请选择云模盒"
-                style="width:202px"
-            >
-                <el-option
-                v-for="item in equipments"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-                ></el-option>
-            </el-select>
-            </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-            <el-button @click.native="warningArrangement = false">取消</el-button>
-            <el-button type="primary" @click.native="warningArrangement" :loading="warningLoading">立即处理</el-button>
-        </div>
+        <el-dialog :title="$t('runTest.dealWarning')" v-if="warningFormVisible" :visible.sync="warningFormVisible" :close-on-click-modal="false" customClass="customWidth">
+            <el-form :model="warningForm" label-width="105px" :rules="formRules" ref="addForm">
+                <el-form-item :label="$t('runTest.warningType')">
+                    <el-input :placeholder="$t('runTest.inputWarningType')" v-model="warningInfo" :disabled="true"></el-input>
+                </el-form-item>
+                <el-form-item :label="$t('runTest.moldSet')" prop="action">
+                    <el-select v-model="warningForm.equipmentId" filterable :placeholder="$t('runTest.inputMoldSet')" style="width:530px">
+                        <el-option v-for="item in equipments" :key="item.value" :label="item.label" :value="item.value"></el-option>
+                    </el-select>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click.native="warningFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button type="primary" @click.native="warningArrangement" :loading="warningLoading">{{$t('runTest.process')}}</el-button>
+            </div>
         </el-dialog>
     </section>
 </template>
 
 <script>
-import util from "../../common/js/util";
-export default {
-  data() {
-    return {
-      user: JSON.parse(sessionStorage.getItem("user")),
-      //本页模具ID
-      mouldId: null,
-      //模具名字
-      mouldName: null,
-      //模具状态
-      mouldState: 0,
-      options: [{ value: "aaa", label: "123" }, { value: "bbb", label: "456" }],
-      //记录
-      records: [],
-      //警告信息
-      warningInfo: "",
-      stage: 0,
-      //告警时需要更换的设备的列表
-      equipments: [
-        { value: 1, label: "临时设备1" },
-        { value: 2, label: "临时设备2" },
-        { value: 3, label: "临时设备3" }
-      ],
-      //标题栏过滤器
-      filters: {
-        name: "",
-        value: ""
-      },
-      listLoading: false,
-      page: 1,
-      size: 20,
-      total: 0,
-      tableHeight: 0,
-      //活跃页面
-      activePage: 0,
-      formRules: {},
-      //保养界面 种类
-      type: [{ label: "动作", value: 0 }, { label: "易损件", value: 1 }],
-      //保养界面 动作
-      action: [{ label: "喷漆", value: 0 }, { label: "检查", value: 1 }],
-      //易损件 假数据
-      vulnerable: [
-        { label: "易损件1", value: 0 },
-        { label: "易损件12450", value: 1 },
-        { label: "易损件114514", value: 2 }
-      ],
-      //是否需要保养 提示
-      requirement: false,
-      prompt: true,
-      //保养详情界面显示
-      maintenanceFormVisible: false,
-      maintenanceLoading: false,
-      //告警详情界面显示
-      warningFormVisible: false,
-      warningLoading: false,
-      //保养详情界面数据
-      maintenanceForm: {
-        username: "",
-        account: "",
-        mobile: "",
-        teamName: "",
-        companyId: "",
-        roleType: "",
-        flag: 0
-      },
-      //告警处理截面数据
-      warningForm: {
-        mouldId: null,
-        equipmentId: null
-      },
-      imageUrl: ""
-    };
-  },
-  methods: {
-    //分页
-    handleCurrentChange(val) {
-      this.page = val;
-      this.getList();
-    },
-    handleSizeChange(val) {
-      this.size = val;
-      this.getList();
-    },
-    //标签页面切换时
-    handleClick(tab, event) {
-      this.activeTab = tab.name;
-      //应该是取得对应的消息 目前还没写
-    },
-    selsChange: function(sels) {
-      this.sels = sels;
-    },
-    backToDetection() {
-      this.$router.go(-1);
-    },
-    //上传格式和大小限制
-    beforeUpload(file) {
-      const isJPG = file.type === "image/jpg";
-      const isJPEG = file.type === "image/jpeg";
-      const isPNG = file.type === "image/png";
-      var rightType = isJPG || isPNG || isJPEG;
-      const isLt5M = file.size / 1024 / 1024 < 5;
-      if (!rightType) {
-        this.$message.error("上传的图片只能是 JPG 或 PNG 格式!");
-      }
-      if (!isLt5M) {
-        this.$message.error("上传的图片大小不能超过 5MB!");
-      }
-      return rightType && isLt5M;
-    },
-    //显示保养界面
-    showMaintenance: function() {
-      this.maintenanceFormVisible = true;
-    },
-    //获取记录
-    getList() {
-      this.listLoading = true;
-      this.http.post(
-        this.port.mold.moldMaintainList,
-        { mouldId: this.mouldId, pageSize: this.size, pageNum: this.page },
-        res => {
-          this.listLoading = false;
-          if (res.code == "ok") {
-            this.records = res.data.list;
-            this.total = res.data.total;
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
-        },
-        error => {
-          this.listLoading = false;
-          this.$message({
-            message: error,
-            type: "error"
-          });
-        }
-      );
-    },
-    //模具详情 获取模具名字用的
-    getDetail() {
-      this.http.post(
-        this.port.mold.moldDetail,
-        {
-          id: this.mouldId
+    import util from "../../common/js/util";
+    export default {
+        data() {
+            return {
+                user: JSON.parse(sessionStorage.getItem("user")),
+                //本页模具ID
+                mouldId: null,
+                //模具名字
+                mouldName: null,
+                //模具状态
+                mouldState: 0,
+                options: [{ value: "aaa", label: "123" }, { value: "bbb", label: "456" }],
+                //记录
+                records: [],
+                //警告信息
+                warningInfo: "",
+                stage: 0,
+                //告警时需要更换的设备的列表
+                equipments: [],
+                //标题栏过滤器
+                filters: {
+                    name: "",
+                    value: ""
+                },
+                listLoading: false,
+                page: 1,
+                size: 20,
+                total: 0,
+                tableHeight: 0,
+                //活跃页面
+                activePage: 0,
+                formRules: {},
+                //保养界面 种类
+                type: [{ label: this.$t('runTest.action'), value: 0 }, { label: this.$t('runTest.vulnerable'), value: 1 }],
+                //保养界面 动作
+                action: [{ label: this.$t('runTest.spray'), value: 0 }, { label: this.$t('runTest.check'), value: 1 }],
+                //易损件 假数据
+                vulnerable: [],
+                //是否需要保养 提示
+                requirement: false,
+                prompt: true,
+                //保养详情界面显示
+                maintenanceFormVisible: false,
+                maintenanceLoading: false,
+                //告警详情界面显示
+                warningFormVisible: false,
+                warningLoading: false,
+                //保养详情界面数据
+                maintenanceForm: {
+                    username: "",
+                    account: "",
+                    mobile: "",
+                    teamName: "",
+                    companyId: "",
+                    roleType: "",
+                    flag: 0
+                },
+                //告警处理截面数据
+                warningForm: {
+                    mouldId: null,
+                    equipmentId: null
+                },
+                imageUrl: ""
+            };
         },
-        res => {
-          if (res.code == "ok") {
-            this.mouldName = res.data.vo.modelName;
-            this.mouldState = res.data.vo.state;
-            this.requirement = res.data.vo.isMaintain == 1;
-            this.stage = res.data.vo.stage;
-            if(this.stage == 0){
-                this.warningInfo = "正常";
-            }else if(this.stage == 1){
-                this.warningInfo = "温度过高";
-            }else if(this.stage == 2){
-                this.warningInfo = "电量过低";
-            }else if(this.stage == 3){
-                this.warningInfo = "温度过高、电量过低";
-            }else{
-                this.warningInfo = "状况不明";
+        methods: {
+            //分页
+            handleCurrentChange(val) {
+                this.page = val;
+                this.getList();
+            },
+            handleSizeChange(val) {
+                this.size = val;
+                this.getList();
+            },
+            //标签页面切换时
+            handleClick(tab, event) {
+                this.activeTab = tab.name;
+                //应该是取得对应的消息 目前还没写
+            },
+            selsChange: function(sels) {
+                this.sels = sels;
+            },
+            backToDetection() {
+                this.$router.go(-1);
+            },
+            //上传格式和大小限制
+            beforeUpload(file) {
+                const isJPG = file.type === "image/jpg";
+                const isJPEG = file.type === "image/jpeg";
+                const isPNG = file.type === "image/png";
+                var rightType = isJPG || isPNG || isJPEG;
+                const isLt5M = file.size / 1024 / 1024 < 5;
+                if (!rightType) {
+                    this.$message.error(this.$t('msg.uploadType'));
+                }
+                if (!isLt5M) {
+                    this.$message.error(this.$t('msg.uploadSize'));
+                }
+                return rightType && isLt5M;
+            },
+            //显示保养界面
+            showMaintenance: function() {
+                this.maintenanceFormVisible = true;
+            },
+            //获取记录
+            getList() {
+                this.listLoading = true;
+                this.http.post( this.port.mold.moldMaintainList, { 
+                    mouldId: this.mouldId, 
+                    pageSize: this.size, 
+                    pageNum: this.page 
+                },
+                res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.records = res.data.list;
+                        this.total = res.data.total;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            //模具详情 获取模具名字用的
+            getDetail() {
+                this.http.post( this.port.mold.moldDetail, {
+                    id: this.mouldId
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.mouldName = res.data.vo.modelName;
+                        this.mouldState = res.data.vo.state;
+                        this.requirement = res.data.vo.isMaintain == 1;
+                        this.stage = res.data.vo.stage;
+                        if(this.stage == 0){
+                            this.warningInfo = this.$t('runTest.stage0');
+                        }else if(this.stage == 1){
+                            this.warningInfo = this.$t('runTest.stage1');
+                        }else if(this.stage == 2){
+                            this.warningInfo = this.$t('runTest.stage2');
+                        }else if(this.stage == 3){
+                            this.warningInfo = this.$t('runTest.stage3');
+                        }else{
+                            this.warningInfo = this.$t('runTest.stage4');
+                        }
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            //模具保养的按钮按下之后(关闭之后也要清理文件但是还没写)
+            maintainConfirm() {
+                if (this.$refs.upload.uploadFiles.length == 1) {
+                    this.$refs.upload.submit();
+                } else {
+                    this.$message({
+                        message: this.$t('runTest.mustUpload'),
+                        type: "error"
+                    });
+                }
+            },
+            //模具保养
+            maintain(params) {
+                if (this.type.value != null) {
+                    var fileObj = params.file;
+                    var form = new FormData();
+                    form.append("file", fileObj);
+                    form.append("mouldId", this.mouldId);
+                    form.append("maintainType", this.type.value);
+                    if (this.type.value == 0) {
+                        if (this.action.value == null) {
+                            return;
+                        }
+                        form.append("ways", this.action.value);
+                    } else {
+                        if (this.vulnerable.value == null) {
+                            return;
+                        }
+                        form.append("ways", this.vulnerable.value); //后面应该换成易损件的ID
+                    }
+                    this.http.uploadFile( this.port.mold.moldMaintain, form,
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: this.$t('prompt.success5'),
+                                type: "success"
+                            });
+                            this.maintenanceFormVisible = false;
+                            this.requirement = false;
+                            this.$refs.upload.clearFiles();
+                            this.getList();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
+            },
+            //获取告警时可以更换的设备列表
+            getAlternativeEquipment() {
+                this.http.post( this.port.mold.moldChangeRequirement, {
+                    mouldId: this.mouldId
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.equipments = [];
+                        res.data.forEach(item => {
+                            this.equipments.push({ label: item.equipmentNo, value: item.id });
+                        });
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            //告警处理
+            warningArrangement() {
+                if (this.warningForm.equipmentId == null) {
+                    this.$message({
+                        message: this.$t('runTest.inputMoldSet'),
+                        type: "error"
+                    });
+                } else {
+                    this.http.post( this.port.mold.moldChange, this.warningForm,
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: this.$t('runTest.completed'),
+                                type: "success"
+                            });
+                            this.warningFormVisible = false;
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
             }
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
         },
-        error => {
-          this.$message({
-            message: error,
-            type: "error"
-          });
-        }
-      );
-    },
-    //模具保养的按钮按下之后(关闭之后也要清理文件但是还没写)
-    maintainConfirm() {
-      if (this.$refs.upload.uploadFiles.length == 1) {
-        this.$refs.upload.submit();
-      } else {
-        this.$message({
-          message: "必须上传照片",
-          type: "error"
-        });
-      }
-    },
-    //模具保养
-    maintain(params) {
-      if (this.type.value != null) {
-        var fileObj = params.file;
-        var form = new FormData();
-        form.append("file", fileObj);
-        form.append("mouldId", this.mouldId);
-        form.append("maintainType", this.type.value);
-        if (this.type.value == 0) {
-          if (this.action.value == null) {
-            return;
-          }
-          form.append("ways", this.action.value);
-        } else {
-          if (this.vulnerable.value == null) {
-            return;
-          }
-          form.append("ways", this.vulnerable.value); //后面应该换成易损件的ID
-        }
-        this.http.uploadFile(
-          this.port.mold.moldMaintain,
-          form,
-          res => {
-            if (res.code == "ok") {
-              this.$message({
-                message: "保养完成",
-                type: "success"
-              });
-              this.maintenanceFormVisible = false;
-              this.requirement = false;
-              this.$refs.upload.clearFiles();
-              this.getList();
-            } else {
-              this.$message({
-                message: res.msg,
-                type: "error"
-              });
-            }
-          },
-          error => {
-            this.listLoading = false;
-            this.$message({
-              message: error,
-              type: "error"
-            });
-          }
-        );
-      }
-    },
-    //获取告警时可以更换的设备列表
-    getAlternativeEquipment() {
-      this.http.post(
-        this.port.mold.moldChangeRequirement,
-        {
-          mouldId: this.mouldId
-        },
-        res => {
-          if (res.code == "ok") {
-            this.equipments = [];
-            res.data.forEach(item => {
-              this.equipments.push({ label: item.equipmentNo, value: item.id });
-            });
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 370;
         },
-        error => {
-          this.$message({
-            message: error,
-            type: "error"
-          });
+        mounted() {
+            this.mouldId = this.$route.params.id; //传到当前页面的模具编号
+            this.warningForm.mouldId = this.mouldId; //顺便把相关的告警中的模具ID赋值一下
+            this.getList();
+            this.getDetail();
+            this.getAlternativeEquipment();
         }
-      );
-    },
-    //告警处理
-    warningArrangement() {
-      if (this.warningForm.equipmentId == null) {
-        this.$message({
-          message: "请选择云模盒",
-          type: "error"
-        });
-      } else {
-        this.http.post(
-          this.port.mold.moldChange,
-          this.warningForm,
-          res => {
-            if (res.code == "ok") {
-              this.$message({
-                message: "告警处理完毕",
-                type: "success"
-              });
-              this.warningFormVisible = false;
-            } else {
-              this.$message({
-                message: res.msg,
-                type: "error"
-              });
-            }
-          },
-          error => {
-            this.$message({
-              message: error,
-              type: "error"
-            });
-          }
-        );
-      }
-    }
-  },
-  created() {
-    let height = window.innerHeight;
-    this.tableHeight = height - 370;
-  },
-  mounted() {
-    this.mouldId = this.$route.params.id; //传到当前页面的模具编号
-    this.warningForm.mouldId = this.mouldId; //顺便把相关的告警中的模具ID赋值一下
-    this.getList();
-    this.getDetail();
-    this.getAlternativeEquipment();
-  }
-};
+    };
 </script>
 
 <style scoped>
-.title {
-  padding-left: 10px;
-  padding-bottom: 0px;
-  margin: 20px 0;
-  font-size: 16px;
-  line-height: 24px;
-  border-left: 1px #20a0ff solid;
-}
-.toolbar .el-form-item {
-  font-size: 14px;
-  vertical-align: middle;
-}
-.back {
-  font-size: 16px;
-}
-.divLine {
-  width: 2px;
-  background: #c3c3c3;
-  height: 100%;
-}
+    .title {
+        padding-left: 10px;
+        padding-bottom: 0px;
+        margin: 20px 0;
+        font-size: 16px;
+        line-height: 24px;
+        border-left: 1px #20a0ff solid;
+    }
 
-.projectTitle {
-  font-size: 18px;
-  color: #333;
-}
+    .toolbar .el-form-item {
+        font-size: 14px;
+        vertical-align: middle;
+    }
+
+    .back {
+        font-size: 16px;
+    }
+
+    .divLine {
+        width: 2px;
+        background: #c3c3c3;
+        height: 100%;
+    }
+
+    .projectTitle {
+        font-size: 18px;
+        color: #333;
+    }
 </style>

+ 6 - 6
ys_int/src/views/map/map.vue

@@ -46,9 +46,9 @@
                                         for(var i in data.target.msg.list){
                                             str += "<div class='info-item'><a @click='jumpToMold("+ data.target.msg.list[i].id +")'>" + data.target.msg.list[i].modelName + "(" + data.target.msg.list[i].modelNo + ")</a>"
                                                 if(data.target.msg.list[i].state=='0'){
-                                                    str += "<span class='info-state'><span class='info-ball' style='background:#999999;'></span>静止</span>"
+                                                    str += "<span class='info-state'><span class='info-ball' style='background:#999999;'></span>" + _this.$t('base.static') + "</span>"
                                                 } else {
-                                                    str += "<span class='info-state'><span class='info-ball' style='background:#00CD66;'></span>运行</span>"
+                                                    str += "<span class='info-state'><span class='info-ball' style='background:#00CD66;'></span>" + _this.$t('base.run') + "</span>"
                                                 }
                                             str += "</div>"
                                         }
@@ -138,13 +138,13 @@
                     getHoverTitle: function(dataItem, idx) {
                         var state = "";
                         if(dataItem.state == '0'){
-                            state = "静止"
+                            state = _this.$t('base.static') // 静止
                         } else if(dataItem.state == '1'){
-                            state = "运动"
+                            state = _this.$t('base.run') // 运行
                         } else if(dataItem.state == '2'){
-                            state = "告警"
+                            state = _this.$t('base.warning') // 告警
                         } else if(dataItem.state == '3'){
-                            state = "报废"
+                            state = _this.$t('base.scrap') // 报废
                         }
                         return dataItem.modelName + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + state;
                     },

+ 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>

Разница между файлами не показана из-за своего большого размера
+ 492 - 506
ys_int/src/views/mold/moldDetail.vue


+ 237 - 246
ys_int/src/views/mold/moldDownload.vue

@@ -1,257 +1,248 @@
 <template slot-scope="scope">
-  <section>
-    <!--工具条-->
-    <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-      <el-form :inline="true" :model="filters">
-        <el-form-item>
-          <el-input v-model="filters.name" placeholder="请输入模具名称进行搜索"></el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="getFileList(filters.name)">查询</el-button>
-        </el-form-item>
-        <el-form-item style="float: right;">
-          <el-dropdown>
-            <el-button type="primary">
-              下载
-              <i class="el-icon-arrow-down el-icon--right"></i>
-            </el-button>
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item @click.native="download(0)">全部下载</el-dropdown-item>
-              <el-dropdown-item @click.native="download(1)" divided>模具3D图档</el-dropdown-item>
-              <el-dropdown-item @click.native="download(2)">模具2D图档</el-dropdown-item>
-              <el-dropdown-item @click.native="download(3)">零件3D图档</el-dropdown-item>
-              <el-dropdown-item @click.native="download(4)">零件2D图档</el-dropdown-item>
-              <el-dropdown-item @click.native="download(5)">保养方案</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-        </el-form-item>
-      </el-form>
-    </el-col>
+    <section>
+        <!--工具条-->
+        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+            <el-form :inline="true" :model="filters">
+                <el-form-item>
+                    <el-input v-model="filters.name" placeholder="请输入模具名称进行搜索"></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="primary" @click="getFileList(filters.name)">{{$t('base.query')}}</el-button>
+                </el-form-item>
+                <el-form-item style="float: right;">
+                    <el-dropdown>
+                        <el-button type="primary">{{$t('project.download')}}<i class="el-icon-arrow-down el-icon--right"></i></el-button>
+                        <el-dropdown-menu slot="dropdown">
+                            <el-dropdown-item @click.native="download(0)">全部下载</el-dropdown-item>
+                            <el-dropdown-item @click.native="download(1)" divided>{{$t('mold.down3DMold')}}</el-dropdown-item>
+                            <el-dropdown-item @click.native="download(2)">{{$t('mold.down2DMold')}}</el-dropdown-item>
+                            <el-dropdown-item @click.native="download(3)">{{$t('mold.down3DPart')}}</el-dropdown-item>
+                            <el-dropdown-item @click.native="download(4)">{{$t('mold.down2DPart')}}</el-dropdown-item>
+                            <el-dropdown-item @click.native="download(5)">{{$t('mold.plan')}}</el-dropdown-item>
+                        </el-dropdown-menu>
+                    </el-dropdown>
+                </el-form-item>
+            </el-form>
+        </el-col>
 
-    <!--列表-->
-    <el-table
-      :data="documents"
-      :height="tableHeight"
-      highlight-current-row
-      v-loading="listLoading"
-      style="width: 100%;"
-      @selection-change="selectionChanged"
-    >
-      <el-table-column type="selection" width="40"></el-table-column>
-      <el-table-column type="index" width="60"></el-table-column>
-      <el-table-column label="模具名称">
-        <template slot-scope="scope">
-            <router-link :to="'/moldList/' + scope.row.id + '/0'" tag="span" style="color: #409eff;cursor: pointer;">{{scope.row.modelName}}</router-link>
-        </template>
-      </el-table-column>
-      <el-table-column width="250" label="模具3D图档">
-        <template slot-scope="scope">
-          <span v-if="scope.row.mould3DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.mould3DFilesState">已通过</span>
-          <span v-else>未通过</span>
-        </template>
-      </el-table-column>
-      <el-table-column width="250" label="模具2D图档">
-        <template slot-scope="scope">
-          <span v-if="scope.row.mould2DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.mould2DFilesState">已通过</span>
-          <span v-else>未通过</span>
-        </template>
-      </el-table-column>
-      <el-table-column width="250" label="零件3D图档">
-        <template slot-scope="scope">
-          <span v-if="scope.row.sparepart3DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.sparepart3DFilesState">已通过</span>
-          <span v-else>未通过</span>
-        </template>
-      </el-table-column>
-      <el-table-column width="250" label="零件2D图档">
-        <template slot-scope="scope">
-          <span v-if="scope.row.sparepart2DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.sparepart2DFilesState">已通过</span>
-          <span v-else>未通过</span>
-        </template>
-      </el-table-column>
-      <el-table-column width="250" label="保养方案">
-        <template slot-scope="scope">
-          <span v-if="scope.row.maintainFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.maintainFilesState">已通过</span>
-          <span v-else>未通过</span>
-        </template>
-      </el-table-column>
-    </el-table>
+        <!--列表-->
+        <el-table :data="documents" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;" @selection-change="selectionChanged">
+            <el-table-column type="selection" width="40"></el-table-column>
+            <el-table-column type="index" width="60"></el-table-column>
+            <el-table-column :label="$t('mold.modelName')">
+                <template slot-scope="scope">
+                    <router-link :to="'/moldList/' + scope.row.id + '/0'" tag="span" style="color: #409eff;cursor: pointer;">{{scope.row.modelName}}</router-link>
+                </template>
+            </el-table-column>
+            <el-table-column width="250" :label="$t('mold.down3DMold')">
+                <template slot-scope="scope">
+                    <span v-if="scope.row.mould3DFiles.length == 0">{{$t('mold.fileState0')}}</span>
+                    <span v-else-if="scope.row.mould3DFilesState">{{$t('mold.fileState1')}}</span>
+                    <span v-else>{{$t('mold.fileState2')}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column width="250" :label="$t('mold.down2DMold')">
+                <template slot-scope="scope">
+                    <span v-if="scope.row.mould2DFiles.length == 0">{{$t('mold.fileState0')}}</span>
+                    <span v-else-if="scope.row.mould2DFilesState">{{$t('mold.fileState1')}}</span>
+                    <span v-else>{{$t('mold.fileState2')}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column width="250" :label="$t('mold.down3DPart')">
+                <template slot-scope="scope">
+                    <span v-if="scope.row.sparepart3DFiles.length == 0">{{$t('mold.fileState0')}}</span>
+                    <span v-else-if="scope.row.sparepart3DFilesState">{{$t('mold.fileState1')}}</span>
+                    <span v-else>{{$t('mold.fileState2')}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column width="250" :label="$t('mold.down2DPart')">
+                <template slot-scope="scope">
+                    <span v-if="scope.row.sparepart2DFiles.length == 0">{{$t('mold.fileState0')}}</span>
+                    <span v-else-if="scope.row.sparepart2DFilesState">{{$t('mold.fileState1')}}</span>
+                    <span v-else>{{$t('mold.fileState2')}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column width="250" :label="$t('mold.plan')">
+                <template slot-scope="scope">
+                    <span v-if="scope.row.maintainFiles.length == 0">{{$t('mold.fileState0')}}</span>
+                    <span v-else-if="scope.row.maintainFilesState">{{$t('mold.fileState1')}}</span>
+                    <span v-else>{{$t('mold.fileState2')}}</span>
+                </template>
+            </el-table-column>
+        </el-table>
 
-    <!--工具条-->
-    <el-col :span="24" class="toolbar">
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :page-sizes="[20 , 50 , 80 , 100 , 200]"
-        :page-size="20"
-        layout="total, sizes, prev, pager, next"
-        :total="total"
-        style="float:right;"
-      ></el-pagination>
-    </el-col>
-  </section>
+        <!--工具条-->
+        <el-col :span="24" class="toolbar">
+            <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100 , 200]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;"
+            ></el-pagination>
+        </el-col>
+    </section>
 </template>
 
 <script>
-import util from "../../common/js/util";
-export default {
-  data() {
-    return {
-      documents: [],
-      filters: {
-        name: "",
-        value: ""
-      },
-      listLoading: false,
-      page: 1,
-      size: 20,
-      total: 0,
-      tableHeight: 0,
-      selectedArray: []
-    };
-  },
-  methods: {
-    //分页
-    handleCurrentChange(val) {
-      this.page = val;
-      this.getFileList();
-    },
-    handleSizeChange(val) {
-      this.size = val;
-      this.getFileList();
-    },
-    //获取列表
-    getFileList(keyword) {
-      this.http.post(
-        this.port.mold.moldFileDowloadList,
-        {
-          keyName: keyword,
-          pageSize: this.size,
-          pageNum: this.page
-        },
-        res => {
-          if (res.code == "ok") {
-            this.documents = res.data.list;
-            this.total = res.data.total;
-            //对于拿到的所有数据
-            this.documents.forEach(file => {
-              var mould2DFilesState = true;
-              var mould3DFilesState = true;
-              var sparepart2DFilesState = true;
-              var sparepart3DFilesState = true;
-              var maintainFilesState = true;
-              //看看每种文档中的所有文件
-              file.mould2DFiles.forEach(item => {
-                if (item.state != 3) {
-                  mould2DFilesState = false;
-                }
-              });
-              file.mould3DFiles.forEach(item => {
-                if (item.state != 3) {
-                  mould3DFilesState = false;
-                }
-              });
-              file.sparepart2DFiles.forEach(item => {
-                if (item.state != 3) {
-                  sparepart2DFilesState = false;
-                }
-              });
-              file.sparepart3DFiles.forEach(item => {
-                if (item.state != 3) {
-                  sparepart3DFilesState = false;
-                }
-              });
-              file.maintainFiles.forEach(item => {
-                if (item.state != 3) {
-                  maintainFilesState = false;
-                }
-              });
-              //把计算好的状态装进这个模具对象中
-              file.mould2DFilesState = mould2DFilesState;
-              file.mould3DFilesState = mould3DFilesState;
-              file.sparepart2DFilesState = sparepart2DFilesState;
-              file.sparepart3DFilesState = sparepart3DFilesState;
-              file.maintainFilesState = maintainFilesState;
-            });
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
-        },
-        error => {
-          this.$message({
-            message: error,
-            type: "error"
-          });
-        }
-      );
-    },
-    //点击复选时
-    selectionChanged(row) {
-      this.selectedArray = [];
-      row.forEach(item => {
-        this.selectedArray.push(item.id);
-      });
-    },
-    //下载
-    download(type) {
-      if (this.selectedArray.length == 0) {
-        this.$message("请选择要下载的文档");
-      } else {
-        this.downloadPost(type);
-      }
-    },
-    //具体的下载
-    downloadPost(type) {
-        var user = sessionStorage.getItem('user') , token = "";
-        if(user != null){
-            token = JSON.parse(user).headImgurl
-        }
-        this.http.get(
-            this.port.mold.moldFileDowloadFile + 
-                "?ids="+ this.selectedArray.join(",") + 
-                "&dwgType=" + type +
-                "&token=" + token
-            ,
-            res => {
-                this.listLoading = false;
-                if (res.code == "ok") {
-                    let a = document.createElement('a')
-                    a.setAttribute('download', res.data.split("/")[2]);
-                    a.setAttribute("href", res.data);
-                    a.click();
-                } else {
-                    this.$message({
-                        message: res.msg,
-                        type: "error"
+        import util from "../../common/js/util";
+
+        export default {
+            data() {
+                return {
+                    documents: [],
+                    filters: {
+                        name: "",
+                        value: ""
+                    },
+                    listLoading: false,
+                    page: 1,
+                    size: 20,
+                    total: 0,
+                    tableHeight: 0,
+                    selectedArray: []
+                };
+            },
+            methods: {
+                //分页
+                handleCurrentChange(val) {
+                    this.page = val;
+                    this.getFileList();
+                },
+
+                handleSizeChange(val) {
+                    this.size = val;
+                    this.getFileList();
+                },
+
+                //获取列表
+                getFileList(keyword) {
+                    this.http.post( this.port.mold.moldFileDowloadList, {
+                        keyName: keyword,
+                        pageSize: this.size,
+                        pageNum: this.page
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.documents = res.data.list;
+                            this.total = res.data.total;
+                            //对于拿到的所有数据
+                            this.documents.forEach(file => {
+                                var mould2DFilesState = true;
+                                var mould3DFilesState = true;
+                                var sparepart2DFilesState = true;
+                                var sparepart3DFilesState = true;
+                                var maintainFilesState = true;
+                                //看看每种文档中的所有文件
+                                file.mould2DFiles.forEach(item => {
+                                    if (item.state != 3) {
+                                        mould2DFilesState = false;
+                                    }
+                                });
+                                file.mould3DFiles.forEach(item => {
+                                    if (item.state != 3) {
+                                        mould3DFilesState = false;
+                                    }
+                                });
+                                file.sparepart2DFiles.forEach(item => {
+                                    if (item.state != 3) {
+                                        sparepart2DFilesState = false;
+                                    }
+                                });
+                                file.sparepart3DFiles.forEach(item => {
+                                    if (item.state != 3) {
+                                        sparepart3DFilesState = false;
+                                    }
+                                });
+                                file.maintainFiles.forEach(item => {
+                                    if (item.state != 3) {
+                                        maintainFilesState = false;
+                                    }
+                                });
+                                //把计算好的状态装进这个模具对象中
+                                file.mould2DFilesState = mould2DFilesState;
+                                file.mould3DFilesState = mould3DFilesState;
+                                file.sparepart2DFilesState = sparepart2DFilesState;
+                                file.sparepart3DFilesState = sparepart3DFilesState;
+                                file.maintainFilesState = maintainFilesState;
+                            });
+                        } else {
+                            this.$message({
+                            message: res.msg,
+                            type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                },
+
+                //点击复选时
+                selectionChanged(row) {
+                    this.selectedArray = [];
+                    row.forEach(item => {
+                        this.selectedArray.push(item.id);
+                    });
+                },
+
+                //下载
+                download(type) {
+                    if (this.selectedArray.length == 0) {
+                        this.$message(this.$t('mold.chooseFile'));
+                    } else {
+                        this.downloadPost(type);
+                    }
+                },
+
+                //具体的下载
+                downloadPost(type) {
+                    var user = sessionStorage.getItem('user') , token = "";
+                    if(user != null){
+                        token = JSON.parse(user).headImgurl
+                    }
+                    this.http.get( this.port.mold.moldFileDowloadFile + 
+                        "?ids="+ this.selectedArray.join(",") + 
+                        "&dwgType=" + type +
+                        "&token=" + token ,
+                        res => {
+                            this.listLoading = false;
+                            if (res.code == "ok") {
+                                let a = document.createElement('a')
+                                a.setAttribute('download', res.data.split("/")[2]);
+                                a.setAttribute("href", res.data);
+                                a.click();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: "error"
+                                });
+                            }
+                        },
+                        error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
                     });
                 }
             },
-            error => {
-            this.listLoading = false;
-            this.$message({
-                message: error,
-                type: "error"
-            });
+            created() {
+                 let height = window.innerHeight;
+                this.tableHeight = height - 210;
+                const that = this;
+                window.onresize = function temp() {
+                    that.tableHeight = window.innerHeight - 210;
+                };
+            },
+            mounted() {
+                this.getFileList();
             }
-        );
-    }
-  },
-  created() {
-    let height = window.innerHeight;
-    this.tableHeight = height - 210;
-  },
-  mounted() {
-    this.getFileList();
-  }
-};
+        };
 </script>
-
-<style scoped>
-</style>

+ 99 - 68
ys_int/src/views/mold/moldList.vue

@@ -5,27 +5,27 @@
             <el-form :inline="true" :model="filters">
                 <el-col :span="3">
                     <el-form-item>
-                        <el-select v-model="filters.projectId" clearable placeholder="请选择项目">
+                        <el-select v-model="filters.projectId" clearable :placeholder="$t('project.choosePro')">
                         <el-option v-for="item in projects" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
                         </el-select>
                     </el-form-item>
                 </el-col>
                 <el-col :span="2">
                     <el-form-item>
-                        <el-select v-model="filters.searchType" placeholder="请选择查询条件">
-                        <el-option label="编号" value="0"></el-option>
-                        <el-option label="名称" value="1"></el-option>
+                        <el-select v-model="filters.searchType" :placeholder="$t('base.choose')">
+                        <el-option :label="$t('base.num')" value="0"></el-option>
+                        <el-option :label="$t('base.name')" value="1"></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('msg.keySearch')"></el-input>
                 </el-form-item>
                 <el-form-item>
-                    <el-button type="primary" @click="getMoldList">查询</el-button>
+                    <el-button type="primary" @click="getMoldList">{{$t('base.query')}}</el-button>
                 </el-form-item>
                 <el-form-item style="float: right" v-if="user.parentId == 1 && user.subordinateType == 0">
-                    <el-button type="primary" @click="showAdd">新建</el-button>
+                    <el-button type="primary" @click="showAdd">{{$t('base.add')}}</el-button>
                 </el-form-item>
             </el-form>
         </el-col>
@@ -33,31 +33,31 @@
         <!--列表-->
         <el-table :data="molds" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
             <el-table-column type="index" width="40"></el-table-column>
-            <el-table-column prop="modelName" label="模具名称" width="140" sortable>
+            <el-table-column prop="modelName" :label="$t('mold.modelName')" width="140" sortable>
                 <template slot-scope="scope">
                     <el-link :underline="false" type="primary" @click="toDetail(scope.row)">{{scope.row.modelName}}</el-link>
                 </template>
             </el-table-column>
-            <el-table-column prop="modelNo" label="模具编号" width="120" sortable></el-table-column>
-            <el-table-column prop="equipmentNo" label="云模盒编号" width="120" sortable></el-table-column>
-            <el-table-column prop="hillNumber" label="电量" align="center" width="100" sortable></el-table-column>
-            <el-table-column prop="diffTime" label="倒计时" align="center" width="100" sortable></el-table-column>
-            <el-table-column prop="projectName" label="所属项目" width="140" sortable></el-table-column>
-            <el-table-column prop="companyName" label="所属资产方" width="300" sortable></el-table-column>
-            <el-table-column prop="produceCompany" label="所属生产方" width="200" sortable></el-table-column>
-            <el-table-column prop="initialModulus" label="初始模次" width="100" align="center" sortable></el-table-column>
-            <el-table-column prop="settingLife" label="模次寿命" width="100" align="center" sortable></el-table-column>
-            <el-table-column prop="holes" label="穴数" width="100" align="center" sortable></el-table-column>
-            <el-table-column prop="rfid" label="对应RFID码" width="120" align="center" sortable></el-table-column>
-            <el-table-column label="状态" width="100" align="center" sortable>
+            <el-table-column prop="modelNo" :label="$t('mold.moldNo')" width="120" sortable></el-table-column>
+            <el-table-column prop="equipmentNo" :label="$t('basic.equipmentNo')" width="120" sortable></el-table-column>
+            <el-table-column prop="hillNumber" :label="$t('mold.hillNumber')" align="center" width="100" sortable></el-table-column>
+            <el-table-column prop="diffTime" :label="$t('basic.diffTime')" align="center" width="100" sortable></el-table-column>
+            <el-table-column prop="projectName" :label="$t('mold.projectName')" width="140" sortable></el-table-column>
+            <el-table-column prop="companyName" :label="$t('mold.factoryName1')" width="300" sortable></el-table-column>
+            <el-table-column prop="produceCompany" :label="$t('mold.factoryName')" width="200" sortable></el-table-column>
+            <el-table-column prop="initialModulus" :label="$t('mold.initial')" width="100" align="center" sortable></el-table-column>
+            <el-table-column prop="settingLife" :label="$t('mold.life')" width="100" align="center" sortable></el-table-column>
+            <el-table-column prop="holes" :label="$t('mold.hole')" width="100" align="center" sortable></el-table-column>
+            <el-table-column prop="rfid" :label="$t('mold.rfid')" width="120" align="center" sortable></el-table-column>
+            <el-table-column :label="$t('runTest.state')" width="100" align="center" sortable>
                 <template slot-scope="scope">
-                    <span v-if="scope.row.state == 1" style="color:#00CD66;">运行</span>
-                    <span v-else style="color:#999999;">静止</span>
+                    <span v-if="scope.row.state == 1" style="color:#00CD66;">{{$t('base.run')}}</span>
+                    <span v-else style="color:#999999;">{{$t('base.static')}}</span>
                 </template>
             </el-table-column>
-            <el-table-column label="操作" width="150" align="center" sortable v-if="user.parentId == 1 && user.subordinateType == 0">
+            <el-table-column :label="$t('base.operate')" width="150" align="center" sortable v-if="user.parentId == 1 && user.subordinateType == 0">
                 <template slot-scope="scope">
-                    <el-button size="small" type="danger" @click="handleDel(scope.row)">删除</el-button>
+                    <el-button size="small" type="danger" @click="handleDel(scope.row)">{{$t('el.upload.delete')}}</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -76,45 +76,45 @@
         </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" :inline="true" class="demo-form-inline">
-                <el-form-item label="模具名称" prop="modelName">
-                    <el-input v-model="addForm.modelName" autocomplete="off" placeholder="请输入模具名称" style="width:202px"></el-input>
+        <el-dialog :title="$t('mold.addMold')" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth">
+            <el-form :model="addForm" label-width="140px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
+                <el-form-item :label="$t('mold.modelName')" prop="modelName">
+                    <el-input v-model="addForm.modelName" autocomplete="off" :placeholder="$t('mold.inputmodelName')" style="width:480px"></el-input>
                 </el-form-item>
-                <el-form-item label="模具编号" prop="modelNo">
-                    <el-input v-model="addForm.modelNo" autocomplete="off" placeholder="请输入模具编号" style="width:202px"></el-input>
+                <el-form-item :label="$t('mold.moldNo')" prop="modelNo">
+                    <el-input v-model="addForm.modelNo" autocomplete="off" :placeholder="$t('mold.inputmoldNo')" style="width:480px"></el-input>
                 </el-form-item>
-                <el-form-item label="云模盒编号" prop="equipmentId">
-                    <el-select v-model="addForm.equipmentId" clearable filterable placeholder="请选择云模盒编号" style="width:202px">
+                <el-form-item :label="$t('basic.equipmentNo')" prop="equipmentId">
+                    <el-select v-model="addForm.equipmentId" clearable filterable :placeholder="$t('mold.inputequipment')" style="width:480px">
                         <el-option v-for="item in boxes" :key="item.id" :label="item.equipmentNo" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="初始模次" prop="initialModulus">
-                    <el-input v-model="addForm.initialModulus" autocomplete="off" placeholder="请输入初始模次" style="width:202px"></el-input>
+                <el-form-item :label="$t('mold.initial')" prop="initialModulus">
+                    <el-input v-model="addForm.initialModulus" autocomplete="off" :placeholder="$t('mold.inputinitial')" style="width:480px"></el-input>
                 </el-form-item>
-                <el-form-item label="模次寿命" prop="settingLife">
-                    <el-input v-model="addForm.settingLife" autocomplete="off" placeholder="请输入模次寿命" style="width:202px"></el-input>
+                <el-form-item :label="$t('mold.life')" prop="settingLife">
+                    <el-input v-model="addForm.settingLife" autocomplete="off" :placeholder="$t('mold.inputlife')" style="width:480px"></el-input>
                 </el-form-item>
-                <el-form-item label="RIFD码" prop="rfid">
-                    <el-input v-model="addForm.rfid" autocomplete="off" placeholder="请输入RIFD码" style="width:202px"></el-input>
+                <el-form-item :label="$t('mold.rfid')" prop="rfid">
+                    <el-input v-model="addForm.rfid" autocomplete="off" :placeholder="$t('mold.inputrfid')" style="width:480px"></el-input>
                 </el-form-item>
-                <el-form-item label="穴数" prop="holes">
-                    <el-input v-model="addForm.holes" autocomplete="off" placeholder="请输入穴数" style="width:202px"></el-input>
+                <el-form-item :label="$t('mold.hole')" prop="holes">
+                    <el-input v-model="addForm.holes" autocomplete="off" :placeholder="$t('mold.inputhole')" style="width:480px"></el-input>
                 </el-form-item>
-                <el-form-item label="所属生产方" prop="produceCompanyId">
-                    <el-select v-model="addForm.produceCompanyId" clearable filterable placeholder="请选择所属生产方" style="width:202px">
+                <el-form-item :label="$t('mold.factoryName')" prop="produceCompanyId">
+                    <el-select v-model="addForm.produceCompanyId" clearable filterable :placeholder="$t('mold.inputfactoryName')" style="width:480px">
                         <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="maintainCount">
-                    <el-select v-model="addForm.maintainCount" clearable multiple allow-create filterable default-first-option placeholder="请选择保养次数" style="width:515px">
+                <el-form-item :label="$t('mold.maintainCount')" prop="maintainCount">
+                    <el-select v-model="addForm.maintainCount" clearable multiple allow-create filterable default-first-option :placeholder="$t('mold.inputmaintainCount')" style="width:480px">
                         <el-option v-for="item in maintainCount" :key="item" :label="item" :value="item"></el-option>
                     </el-select>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
-                <el-button @click.native="addFormVisible = false">取消</el-button>
-                <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
+                <el-button @click.native="addFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button type="primary" @click.native="addSubmit" :loading="addLoading">{{$t('el.messagebox.confirm')}}</el-button>
             </div>
         </el-dialog>
     </section>
@@ -126,13 +126,13 @@
         data() {
             const checkInitialModulus = (rule, value, callback) => {
                 if (!value) {
-                    return callback(new Error('请输入初始模次'));
+                    return callback(new Error(this.$t('mold.inputinitial')));
                 } else {
                     if((/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(value) == false){
-                        callback(new Error("请填写大于0的数字"));
+                        callback(new Error(this.$t('mold.num0')));
                     }else{
                         if (value > 100000000) {
-                            callback(new Error("请填写小于等于1亿的数字"));
+                            callback(new Error(this.$t('mold.num1')));
                         }else{
                             callback();
                         }
@@ -141,58 +141,87 @@
             };
             const checkSettingLife = (rule, value, callback) => {
                 if (!value) {
-                    return callback(new Error('请输入模次寿命'));
+                    return callback(this.$t('mold.inputlife'));
                 } else {
                     if((/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(value) == false){
-                        callback(new Error("请填写大于0的数字"));
+                        callback(new Error(this.$t('mold.num0')));
                     }else{
                         if (value > 100000000) {
-                            callback(new Error("请填写小于等于1亿的数字"));
+                            callback(new Error(this.$t('mold.num1')));
                         }else{
                             callback();
                         }
                     }
                 }
             };
+            const msg = (rule, value, callback) => {
+                if (!value) {
+                    switch(rule.field) {
+                        case "modelNo":
+                            return callback(new Error(this.$t('mold.inputmoldNo')));
+                            break;
+                        case "modelName":
+                            return callback(new Error(this.$t('mold.inputmodelName')));
+                            break;
+                        case "equipmentId":
+                            return callback(new Error(this.$t('mold.inputequipment')));
+                            break;
+                        case "rfid":
+                            return callback(new Error(this.$t('mold.inputrfid')));
+                            break;
+                        case "holes":
+                            return callback(new Error(this.$t('mold.inputhole')));
+                            break;
+                        case "produceCompanyId":
+                            return callback(new Error(this.$t('mold.inputfactoryName')));
+                            break;
+                        case "maintainCount":
+                            return callback(new Error(this.$t('mold.inputmaintainCount')));
+                            break;
+                        default:
+                            callback();
+                    } 
+                } else {
+                    callback();
+                }
+            };
             return {
                 user: JSON.parse(sessionStorage.getItem("user")),
                 molds: [],
                 filters: {
                     keyName: "",
-                    searchType: "编号",
+                    searchType: this.$t('base.num'),
                     projectId: ""
                 },
-                team: [{label:'资产方',value:0},{label:'生产方',value:1}],
+                team: [{label:this.$t('basic.asset'),value:0},{label:this.$t('basic.producer'),value:1}],
 
                 formRules: {
                     modelNo: [
-                        { required: true, message: "请输入模具编号", trigger: "blur" }
+                        { required: true, validator: msg, trigger: "blur" }
                     ],
                     modelName: [
-                        { required: true, message: "请输入模具名称", trigger: "blur" }
+                        { required: true, validator: msg, trigger: "blur" }
                     ],
                     equipmentId: [
-                        { required: true, message: "请选择云模盒编号", trigger: ["blur", "change"] }
+                        { required: true, validator: msg, trigger: ["blur", "change"] }
                     ],
                     initialModulus: [
-                        // { required: true, message: "请输入初始模次", trigger: "blur" }
                         { required: true, validator: checkInitialModulus, trigger: 'blur'}
                     ],
                     settingLife: [
-                        // { required: true, message: "请输入模次寿命", trigger: "blur" }
                         { required: true, validator: checkSettingLife, trigger: 'blur'}
                     ],
                     rfid: [
-                        { required: true, message: "请输入RIFD码", trigger: "blur" }
+                        { required: true, validator: msg, trigger: "blur" }
                     ],
                     holes: [
-                        { required: true, message: "请输入穴数", trigger: "blur" }
+                        { required: true, validator: msg, trigger: "blur" }
                     ],
                     produceCompanyId: [
-                        { required: true, message: "请选择所属生产方", trigger: ["blur", "change"] }
+                        { required: true, validator: msg, trigger: ["blur", "change"] }
                     ],
                     maintainCount: [
-                        { required: true, message: "请输入保养次数", trigger: ["blur", "change"] }
+                        { required: true, validator: msg, trigger: ["blur", "change"] }
                     ]
                 },
                 listLoading: false,
@@ -308,7 +337,7 @@
                     pageNum: this.page,
                     pageSize: this.size,
                     projectId: this.filters.projectId == "" ? -1 : this.filters.projectId,
-                    searchType: this.filters.searchType == "编号"? 0:1
+                    searchType: this.filters.searchType == this.$t('base.num')? 0:1
                 },
                 res => {
                     this.listLoading = false;
@@ -350,15 +379,17 @@
 
             //删除
 			handleDel: function (row) {
-                this.$confirm('确认删除该模具吗?', '提示', {
-					type: 'warning'
+                this.$confirm(this.$t('mold.delMold'), 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.mold.delMold, {
                         id: row.id
                     }, res => {
                         if (res.code == "ok") {
                             this.$message({
-                                message: '删除成功',
+                                message: this.$t('prompt.success3'),
                                 type: 'success'
                             });
                             this.getMoldList();
@@ -413,7 +444,7 @@
                             if (res.code == "ok") {
                                 this.addFormVisible = false;
                                 this.$message({
-                                    message: "创建成功",
+                                    message: this.$t('prompt.success2'),
                                     type: "success"
                                 });
                                 this.getMoldList();

+ 23 - 27
ys_int/src/views/project/competence.vue

@@ -5,54 +5,50 @@
 			<el-form :inline="true" :model="filters">
                 <el-col :span="3">
                     <el-form-item>
-                        <el-select v-model="filters.projectId" clearable filterable placeholder="请选择项目">
+                        <el-select v-model="filters.projectId" clearable filterable :placeholder="$t('project.choosePro')">
                             <el-option v-for="item in projects" :key="item.id" :label="item.projectName" :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('project.inputNameSearch')"></el-input>
 				</el-form-item>
 				<el-form-item>
-					<el-button type="primary" @click="getPowerList">查询</el-button>
+					<el-button type="primary" @click="getPowerList">{{$t('base.query')}}</el-button>
 				</el-form-item>
 			</el-form>
 		</el-col>
 
 		<!--列表-->
-		<el-table :data="list" highlight-current-row v-loading="listLoading" style="width: 100%;">
-			<el-table-column type="index" width="60">
-			</el-table-column>
-			<el-table-column prop="username" label="姓名" width="150" sortable>
-			</el-table-column>
-			<el-table-column prop="companyName" label="所属公司" sortable>
-			</el-table-column>
-			<el-table-column prop="projectName" label="项目名称" width="220" sortable>
-			</el-table-column>
-			<el-table-column prop="addr" label="上传" align="center" width="150">
+		<el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
+			<el-table-column type="index" width="60"></el-table-column>
+			<el-table-column prop="username" :label="$t('project.name')" width="150" sortable></el-table-column>
+			<el-table-column prop="companyName" :label="$t('project.company')" sortable></el-table-column>
+			<el-table-column prop="projectName" :label="$t('project.partake')" width="220" sortable></el-table-column>
+			<el-table-column prop="addr" :label="$t('project.upload')" align="center" width="150">
                 <template slot-scope="scope">
                     <el-checkbox :value="scope.row.update==1?true:false"></el-checkbox>
                 </template>
 			</el-table-column>
-            <el-table-column prop="addr" label="下载" align="center" width="150">
+            <el-table-column prop="addr" :label="$t('project.download')" align="center" width="150">
                 <template slot-scope="scope">
                     <el-checkbox :value="scope.row.download==1?true:false"></el-checkbox>
                 </template>
 			</el-table-column>
-            <el-table-column prop="addr" label="浏览" align="center" width="150">
+            <el-table-column prop="addr" :label="$t('project.view')" align="center" width="150">
                 <template slot-scope="scope">
                     <el-checkbox :value="scope.row.view==1?true:false"></el-checkbox>
                 </template>
 			</el-table-column>
-            <el-table-column prop="addr" label="审批" align="center" width="150">
+            <el-table-column prop="addr" :label="$t('project.approve')" align="center" width="150">
                 <template slot-scope="scope">
                     <el-checkbox :value="scope.row.approve==1?true:false"></el-checkbox>
                 </template>
 			</el-table-column>
-			<el-table-column label="操作" width="150" align="center">
+			<el-table-column :label="$t('base.operate')" width="150" align="center">
 				<template slot-scope="scope">
-					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
+					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">{{$t('base.edit')}}</el-button>
 				</template>
 			</el-table-column>
 		</el-table>
@@ -71,10 +67,10 @@
 		</el-col>
 
 		<!--编辑界面-->
-		<el-dialog title="编辑权限" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+		<el-dialog :title="$t('project.editPower')" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
 			<el-form :model="editForm" label-width="80px" ref="editForm">
 				<el-col :span="24">
-                    <el-form-item label="权限配置">
+                    <el-form-item :label="$t('project.config')">
                         <el-row>
                             <el-col :span="6" v-for="(item,index) in roleList" :key="item.val" style="text-align:center;">
                                 <el-checkbox v-model="editForm[item.label]" :disabled="index==3?true:false" :checked="editForm[item.label]">{{item.name}}</el-checkbox>
@@ -84,8 +80,8 @@
                 </el-col>
 			</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>
@@ -114,10 +110,10 @@
 				editFormVisible: false,//编辑界面是否显示
                 editLoading: false,
                 roleList: [
-                    {name:'上传',val:0,label:'uploadPower',uploadPower:false},
-                    {name:'下载',val:1,label:'dowloadPower',dowloadPower:false},
-                    {name:'浏览',val:2,label:'viewPower',viewPower:false},
-                    {name:'审批',val:3,label:'approvalPower',approvalPower:false}
+                    {name:this.$t('project.upload'),val:0,label:'uploadPower',uploadPower:false},
+                    {name:this.$t('project.download'),val:1,label:'dowloadPower',dowloadPower:false},
+                    {name:this.$t('project.view'),val:2,label:'viewPower',viewPower:false},
+                    {name:this.$t('project.approve'),val:3,label:'approvalPower',approvalPower:false}
                 ],
 				//编辑界面数据
 				editForm: {
@@ -249,7 +245,7 @@
                     this.editFormVisible = false;
                     if (res.code == "ok") {
                         this.$message({
-                            message: '修改成功',
+                            message: this.$t('prompt.success'),
                             type: 'success'
                         });
                         this.getPowerList();

+ 41 - 27
ys_int/src/views/project/project.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="请输入项目名称"></el-input>
+					<el-input v-model="filters.keyName" :placeholder="$t('project.inputProName')"></el-input>
 				</el-form-item>
 				<el-form-item>
-					<el-button type="primary" v-on:click="getProject">查询</el-button>
+					<el-button type="primary" v-on:click="getProject">{{$t('base.query')}}</el-button>
 				</el-form-item>
 				<el-form-item style="float:right;" v-if="user.parentId == 1 && user.subordinateType == 0">
-					<el-button type="primary" @click="handleAdd">新增</el-button>
+					<el-button type="primary" @click="handleAdd">{{$t('base.add')}}</el-button>
 				</el-form-item>
 			</el-form>
 		</el-col>
@@ -19,18 +19,18 @@
 		<el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
 			<el-table-column type="index" width="60">
 			</el-table-column>
-			<el-table-column prop="projectName" label="项目名称" width="250" sortable>
+			<el-table-column prop="projectName" :label="$t('project.proName')" width="250" sortable>
                 <template slot-scope="scope">
                     <el-link :underline="false" type="primary" @click="toDetail(scope.row)">{{scope.row.projectName}}</el-link>
 				</template>
 			</el-table-column>
-            <el-table-column prop="ownerCompanyName" label="资产方公司" sortable>
+            <el-table-column prop="ownerCompanyName" :label="$t('project.assName')" sortable>
 			</el-table-column>
-            <el-table-column prop="customCompaniesStr" label="生产方公司" width="450">
+            <el-table-column prop="customCompaniesStr" :label="$t('project.cusName')" width="450">
 			</el-table-column>
-            <el-table-column prop="manager" label="项目经理" width="100" align="center" sortable>
+            <el-table-column prop="manager" :label="$t('project.manager')" width="100" align="center" sortable>
 			</el-table-column>
-			<el-table-column prop="indate" label="创建时间" width="250" align="center" sortable>
+			<el-table-column prop="indate" :label="$t('project.indate')" width="250" align="center" sortable>
 			</el-table-column>
 			<!-- <el-table-column label="操作" width="250" align="center">
 				<template slot-scope="scope">
@@ -55,16 +55,16 @@
 		</el-col>
 
         <!--新增界面-->
-		<el-dialog title="新增项目" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+		<el-dialog :title="$t('project.addPro')" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
 			<el-form :model="addForm" label-width="120px" :rules="formRules" ref="addForm">
                 <el-col :span="24">
-                    <el-form-item label="项目名称" prop="projectName">
-                        <el-input v-model="addForm.projectName" autocomplete="off" placeholder="请输入项目名称" style="width:510px"></el-input>
+                    <el-form-item :label="$t('project.proName')" prop="projectName">
+                        <el-input v-model="addForm.projectName" autocomplete="off" :placeholder="$t('project.inputProName')" style="width:510px"></el-input>
                     </el-form-item>
                 </el-col>
                 <el-col :span="24">
-                    <el-form-item label="项目模具" prop="mold">
-                        <el-select v-model="addForm.mold" @change="companyChange" clearable filterable multiple placeholder="请选择项目模具" value-key='id' style="width:510px">
+                    <el-form-item :label="$t('project.moldName')" prop="mold">
+                        <el-select v-model="addForm.mold" @change="companyChange" clearable filterable multiple :placeholder="$t('project.inputMoldName')" value-key='id' style="width:510px">
                             <el-option v-for="item in molds" :key="item.id" :label="item.modelName" :value="item">
                                 <span style="float: left">{{ item.modelName }}</span>
                                 <span style="float: right; color: #8492a6; font-size: 6px;margin-right:17px;">{{ item.produceCompany }}</span>
@@ -73,8 +73,8 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="24">
-                    <el-form-item label="项目经理" prop="managerId">
-                        <el-select v-model="addForm.managerId" clearable filterable placeholder="请选择项目经理" value-key='id' style="width:510px">
+                    <el-form-item :label="$t('project.manager')" prop="managerId">
+                        <el-select v-model="addForm.managerId" clearable filterable :placeholder="$t('project.inputManager')" value-key='id' style="width:510px">
                             <!-- <el-option v-for="item in charger" :key="item.id" :label="item.username" :value="item">
                             </el-option> -->
                             <el-option v-for="item in charger" :key="item.id" :label="item.username" :value="item">
@@ -86,8 +86,8 @@
                 </el-col>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button @click.native="addFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
+				<el-button @click.native="addFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+				<el-button type="primary" @click.native="addSubmit" :loading="addLoading">{{$t('el.messagebox.confirm')}}</el-button>
 			</div>
 		</el-dialog>
 	</section>
@@ -98,6 +98,25 @@
 
 	export default {
 		data() {
+            const msg = (rule, value, callback) => {
+                if (!value) {
+                    switch(rule.field) {
+                        case "projectName":
+                            return callback(new Error(this.$t('project.inputProName')));
+                            break;
+                        case "mold":
+                            return callback(new Error(this.$t('project.inputMoldName')));
+                            break;
+                        case "managerId":
+                            return callback(new Error(this.$t('project.inputManager')));
+                            break;
+                        default:
+                            callback();
+                    } 
+                } else {
+                    callback();
+                }
+            };
 			return {
 				filters: {
 					keyName: ''
@@ -115,13 +134,13 @@
 
                 formRules: {
 					projectName: [
-						{ required: true, message: '请输入项目名称', trigger: 'blur' }
+						{ required: true, validator: msg, trigger: 'blur' }
                     ],
                     mold: [
-                        { required: true, message: '请选择项目模具', trigger: ['blur','change'] }
+                        { required: true, validator: msg, trigger: ['blur','change'] }
                     ],
                     managerId: [
-                        { required: true, message: '请选择项目经理', trigger: ['blur','change'] }
+                        { required: true, validator: msg, trigger: ['blur','change'] }
                     ]
                 },
                 
@@ -311,7 +330,7 @@
                             if (res.code == "ok") {
                                 this.addFormVisible = false;
                                 this.$message({
-                                    message: '创建成功',
+                                    message: this.$t('prompt.success2'),
                                     type: 'success'
                                 });
                                 this.getProject();
@@ -346,9 +365,4 @@
 			this.getProject();
 		}
 	}
-
-</script>
-
-<style scoped>
-
-</style>
+</script>

+ 106 - 83
ys_int/src/views/project/projectDetail.vue

@@ -4,7 +4,7 @@
         <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
             <el-form :inline="true">
                 <el-form-item>
-                    <el-button type="text" @click="backToList" icon="el-icon-back" class="back">返回</el-button>
+                    <el-button type="text" @click="backToList" icon="el-icon-back" class="back">{{$t('base.back')}}</el-button>
                 </el-form-item>
                 <el-form-item class="divLine">
                 </el-form-item>
@@ -16,28 +16,29 @@
 
 
         <el-col :span="24" :style="allDetail">
-            <el-col :span="24" class="title">项目基本信息
+            <el-col :span="24" class="title">
+                {{$t('project.detail')}}
                 <i class="el-icon-edit editDetail" v-if="user.id == proDetail.managerId || user.id == proDetail.creatorId" @click="edit"></i>
             </el-col>
             <el-col :span="24" class="main">
                 <el-col :span="6" class="detail">
-                    项目编号
+                    {{$t('project.projectNo')}}
                     <span class="info">{{proDetail.projectNo}}</span>
                 </el-col>
                 <el-col :span="6" class="detail">
-                    项目经理
+                    {{$t('project.manager')}}
                     <span class="info">{{proDetail.manager}}</span>
                 </el-col>
                 <el-col :span="6" class="detail">
-                    资产方审批人
+                    {{$t('project.ownerApprover')}}
                     <span class="info">{{proDetail.ownerApprover}}</span>
                 </el-col>
                 <el-col :span="6" class="detail">
-                    生产方审批人
+                    {{$t('project.customerApprover')}}
                     <span class="info">{{proDetail.customerApprover}}</span>
                 </el-col>
                 <el-col :span="24" class="detail">
-                    生产方公司
+                    {{$t('project.cusName')}}
                     <span class="info" v-for="(item, index) in proDetail.customCompanies">
                         {{item.companyName}}
                         <span v-if="index != proDetail.customCompanies.length-1">、</span>
@@ -51,7 +52,7 @@
                     </span>
                 </el-col> -->
                 <el-col :span="24" class="detail">
-                    普通成员
+                    {{$t('project.users')}}
                     <span class="info" v-for="(item, index) in proDetail.participateUsers">
                         {{item.username}}
                         <span v-if="index != proDetail.participateUsers.length-1">、</span>
@@ -70,29 +71,29 @@
                 <el-collapse class="activeNames" v-model="activeNames">
                     <el-collapse-item name="1">
                         <template slot="title">
-                            <el-col :span="24" class="title">项目模具</el-col>
+                            <el-col :span="24" class="title">{{$t('project.moldName')}}</el-col>
                         </template>
                         <el-col :span="24" class="detail">
                             <el-table :data="proDetail.models" highlight-current-row v-loading="modelsLoading" style="width: 100%;">
                                 <el-table-column type="index" width="40"></el-table-column>
-                                <el-table-column prop="modelNo" label="模具编号" width="200" sortable>
+                                <el-table-column prop="modelNo" :label="$t('mold.moldNo')" width="200" sortable>
                                     <template slot-scope="scope">
                                         <span class="model" @click="toMold(scope.row.id)">{{scope.row.modelNo}}</span>
                                     </template>
                                 </el-table-column>
-                                <el-table-column prop="modelName" label="模具名称" width="500" sortable></el-table-column>
-                                <el-table-column prop="produceCompanyName" label="所属生产商" sortable></el-table-column>
+                                <el-table-column prop="modelName" :label="$t('mold.modelName')" width="500" sortable></el-table-column>
+                                <el-table-column prop="produceCompanyName" :label="$t('mold.factoryName')" sortable></el-table-column>
                             </el-table>
                         </el-col>
                     </el-collapse-item>
 
                     <el-collapse-item name="2">
                         <template slot="title">
-                            <el-col :span="24" class="title">项目文档
+                            <el-col :span="24" class="title">{{$t('project.proFile')}}
                                 <!-- update == 1 -->
                                 <span @click='doSomething'>
                                     <el-upload v-if="user.id == proDetail.managerId" ref="upload" action="customize" :http-request="uploadFile" :show-file-list="false" :limit="1" style="float:right;margin-right:20px;">
-                                        <el-button size="mini" type="primary" :loading="upLoading">点击上传</el-button>
+                                        <el-button size="mini" type="primary" :loading="upLoading">{{$t('base.upload')}}</el-button>
                                     </el-upload>
                                 </span>
                             </el-col>
@@ -100,23 +101,18 @@
                         <el-col :span="24" class="detail">
                             <el-table :data="files" highlight-current-row v-loading="listLoading" style="width: 100%;">
                                 <el-table-column type="index" width="40"></el-table-column>
-                                <el-table-column prop="fileName" label="名称" sortable></el-table-column>
-                                <el-table-column prop="fileSize" label="大小" width="150" align="center" sortable></el-table-column>
-                                <el-table-column prop="uploader" label="上传者" width="120" align="center" sortable></el-table-column>
-                                <el-table-column prop="indate" label="上传时间" width="200" align="center" sortable></el-table-column>
-                                <el-table-column label="操作" width="220" align="center" sortable>
+                                <el-table-column prop="fileName" :label="$t('project.fileName')" sortable></el-table-column>
+                                <el-table-column prop="fileSize" :label="$t('project.fileSize')" width="150" align="center" sortable></el-table-column>
+                                <el-table-column prop="uploader" :label="$t('project.uploader')" width="120" align="center" sortable></el-table-column>
+                                <el-table-column prop="indate" :label="$t('project.uploadTime')" width="200" align="center" sortable></el-table-column>
+                                <el-table-column :label="$t('base.operate')" width="220" align="center" sortable>
                                     <template slot-scope="scope" v-if="download == 1">
                                         <a :href="scope.row.url" :download="scope.row.fileName">
-                                            <el-button size="small" @click="dowloadFile(scope.row)">
-                                                下载
-                                            </el-button>
+                                            <el-button size="small" @click="dowloadFile(scope.row)">{{$t('project.download')}}</el-button>
                                         </a>
-                                        <el-button size="small" type="danger" @click="fileDel(scope.row.id)"
-                                            v-if="scope.row.uploaderId == user.id">删除</el-button>
-                                    </template>
-                                    <template slot-scope="scope" v-else>
-                                        -
+                                        <el-button size="small" type="danger" @click="fileDel(scope.row.id)"v-if="scope.row.uploaderId == user.id">{{$t('el.upload.delete')}}</el-button>
                                     </template>
+                                    <template slot-scope="scope" v-else>-</template>
                                 </el-table-column>
                             </el-table>
                         </el-col>
@@ -124,15 +120,15 @@
 
                     <el-collapse-item name="3">
                         <template slot="title">
-                            <el-col :span="24" class="title">操作记录</el-col>
+                            <el-col :span="24" class="title">{{$t('project.operation')}}</el-col>
                         </template>
                         <el-col :span="24" class="detail">
                             <el-table :data="opers" highlight-current-row v-loading="oplistLoading" style="width: 100%;">
                                 <el-table-column type="index" width="40"></el-table-column>
-                                <el-table-column prop="content" label="操作" width="120" sortable></el-table-column>
-                                <el-table-column prop="fileName" label="操作文档名称" sortable></el-table-column>
-                                <el-table-column prop="operator" label="操作人" width="120" align="center" sortable></el-table-column>
-                                <el-table-column prop="indate" label="操作时间" width="200" align="center" sortable></el-table-column>
+                                <el-table-column prop="content" :label="$t('base.operate')" width="120" sortable></el-table-column>
+                                <el-table-column prop="fileName" :label="$t('project.operFileName')" sortable></el-table-column>
+                                <el-table-column prop="operator" :label="$t('project.operator')" width="120" align="center" sortable></el-table-column>
+                                <el-table-column prop="indate" :label="$t('project.operTime')" width="200" align="center" sortable></el-table-column>
                             </el-table>
                         </el-col>
                     </el-collapse-item>
@@ -142,16 +138,16 @@
         </el-col>
 
         <!--编辑界面-->
-		<el-dialog title="编辑项目" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+		<el-dialog :title="$t('project.editPro')" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
 			<el-form :model="editForm" label-width="120px" :rules="formRules" ref="editForm">
                 <el-col :span="24">
-                    <el-form-item label="项目名称" prop="projectName">
-                        <el-input v-model="editForm.projectName" autocomplete="off" placeholder="请输入项目名称" style="width:510px"></el-input>
+                    <el-form-item :label="$t('project.proName')" prop="projectName">
+                        <el-input v-model="editForm.projectName" autocomplete="off" :placeholder="$t('project.inputProName')" style="width:510px"></el-input>
                     </el-form-item>
                 </el-col>
                 <el-col :span="24" v-if="user.parentId == 1 && user.subordinateType == 0">
-                    <el-form-item label="项目模具" prop="modelIds">
-                        <el-select v-model="editForm.modelIds" @change="companyChange" clearable filterable multiple placeholder="请选择项目模具" value-key='id' style="width:510px">
+                    <el-form-item :label="$t('project.moldName')" prop="modelIds">
+                        <el-select v-model="editForm.modelIds" @change="companyChange" clearable filterable multiple :placeholder="$t('project.inputMoldName')" value-key='id' style="width:510px">
                             <el-option v-for="item in molds" :key="item.id" :label="item.modelName" :value="item">
                                 <span style="float: left">{{ item.modelName }}</span>
                                 <span style="float: right; color: #8492a6; font-size: 13px;margin-right:17px;">{{ item.produceCompanyName }}</span>
@@ -160,8 +156,8 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="24" v-if="user.parentId == 1 && user.subordinateType == 0">
-                    <el-form-item label="项目经理" prop="managerId">
-                        <el-select v-model="editForm.managerId" @change="changeStaff(0)" clearable filterable placeholder="请选择项目经理" value-key='id' style="width:510px">
+                    <el-form-item :label="$t('project.manager')" prop="managerId">
+                        <el-select v-model="editForm.managerId" @change="changeStaff(0)" clearable filterable :placeholder="$t('project.inputManager')" value-key='id' style="width:510px">
                             <!-- <el-option v-for="item in charger" :key="item.id" :label="item.username" :value="item">
                             </el-option> -->
                             <el-option v-for="item in charger" :key="item.id" :label="item.username" :value="item">
@@ -172,9 +168,9 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="24">
-                    <el-form-item label="资产方审批人">
+                    <el-form-item :label="$t('project.ownerApprover')">
                         <!--  prop="ownerApproverId" -->
-                        <el-select v-model="editForm.ownerApproverId" @change="changeStaff(0)" clearable filterable placeholder="请选择资产方审批人" value-key='id' style="width:510px">
+                        <el-select v-model="editForm.ownerApproverId" @change="changeStaff(0)" clearable filterable :placeholder="$t('project.inputOwnerApprover')" value-key='id' style="width:510px">
                             <!-- <el-option v-for="item in assets" :key="item.id" :label="item.username" :value="item.id">
                             </el-option> -->
                             <el-option v-for="item in assets" :key="item.id" :label="item.username" :value="item.id">
@@ -185,9 +181,9 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="24">
-                    <el-form-item label="生产方审批人">
+                    <el-form-item :label="$t('project.customerApprover')">
                         <!--  prop="customerApproverId" -->
-                        <el-select v-model="editForm.customerApproverId" @change="changeStaff(0)" clearable filterable placeholder="请选择生产方审批人" value-key='id' style="width:510px">
+                        <el-select v-model="editForm.customerApproverId" @change="changeStaff(0)" clearable filterable :placeholder="$t('project.inputCustomerApprover')" value-key='id' style="width:510px">
                             <!-- <el-option v-for="item in produce" :key="item.id" :label="item.username" :value="item.id">
                             </el-option> -->
                             <el-option v-for="item in produce" :key="item.id" :label="item.username" :value="item.id">
@@ -198,8 +194,8 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="24">
-                    <el-form-item label="项目普通用户">
-                        <el-select v-model="editForm.users" @change="changeStaff(1)" clearable filterable multiple placeholder="请选择项目普通用户" style="width:510px">
+                    <el-form-item :label="$t('project.users')">
+                        <el-select v-model="editForm.users" @change="changeStaff(1)" clearable filterable multiple :placeholder="$t('project.inputUsers')" style="width:510px">
                             <!-- <el-option v-for="item in general" :key="item.id" :label="item.username" :value="item.id">
                             </el-option> -->
                             <el-option v-for="item in general" :key="item.id" :label="item.username" :value="item.id">
@@ -227,36 +223,36 @@
                 </el-col> -->
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-                <el-button size="small" style="float:left;margin-left:20px;" type="primary" @click.native="addStaff" :loading="editLoading">添加人员</el-button>
-				<el-button @click.native="editFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="addSubmit" :loading="editLoading">提交</el-button>
+                <el-button size="small" style="float:left;margin-left:20px;" type="primary" @click.native="addStaff" :loading="editLoading">{{$t('project.addUser')}}</el-button>
+				<el-button @click.native="editFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+				<el-button type="primary" @click.native="addSubmit" :loading="editLoading">{{$t('el.messagebox.confirm')}}</el-button>
 			</div>
 		</el-dialog>
 
         <!--新增界面-->
-		<el-dialog title="新增人员" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+		<el-dialog :title="$t('project.addPeo')" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
 			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
-				<el-form-item label="姓名" prop="username">
-					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名" style="width:202px"></el-input>
+				<el-form-item :label="$t('project.name')" prop="username">
+					<el-input v-model="addForm.username" autocomplete="off" :placeholder="$t('project.inputName')" style="width:202px"></el-input>
 				</el-form-item>
-				<el-form-item label="手机号" prop="account">
-					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号(登录账号)" style="width:202px"></el-input>
+				<el-form-item :label="$t('project.mobile')" prop="account">
+					<el-input v-model="addForm.account" autocomplete="off" :placeholder="$t('project.inputMobile')" style="width:202px"></el-input>
 				</el-form-item>
-                <el-form-item label="公司" prop="companyId">
-					<el-select v-model="addForm.companyId" clearable filterable placeholder="请选择所属公司" style="width:202px">
+                <el-form-item :label="$t('project.company')" prop="companyId">
+					<el-select v-model="addForm.companyId" clearable filterable :placeholder="$t('project.inputCompany')" style="width:202px">
                         <el-option v-for="item in staffComp" :key="item.id" :label="item.companyName" :value="item.id">
                         </el-option>
                     </el-select>
 				</el-form-item>
-                <el-form-item label="备注">
-                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入备注" style="width:202px"></el-input>
+                <el-form-item :label="$t('project.remark')">
+                    <el-input v-model="addForm.roleName" autocomplete="off" :placeholder="$t('project.inputRemark')" style="width:202px"></el-input>
 				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-                <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
-				<el-button @click.native="addFormVisible = false">取消</el-button>
-                <el-button type="primary" @click.native="addPeople(1)" :loading="addLoading">提交并新增</el-button>
-				<el-button type="primary" @click.native="addPeople(0)" :loading="addLoading">提交</el-button>
+                <span 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 type="primary" @click.native="addPeople(1)" :loading="addLoading">{{$t('project.uploadAndAdd')}}</el-button>
+				<el-button type="primary" @click.native="addPeople(0)" :loading="addLoading">{{$t('el.messagebox.confirm')}}</el-button>
 			</div>
 		</el-dialog>
     </section>
@@ -266,18 +262,49 @@
     import util from "../../common/js/util";
     export default {
         data() {
-            var checkPhone = (rule, value, callback) => {
+            const checkPhone = (rule, value, callback) => {
                 if (!value) {
-                    return callback(new Error('请输入联系方式'));
+                    return callback(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 "projectName":
+                            return callback(new Error(this.$t('project.inputProName')));
+                            break;
+                        case "modelIds":
+                            return callback(new Error(this.$t('project.inputMoldName')));
+                            break;
+                        case "managerId":
+                            return callback(new Error(this.$t('project.inputManager')));
+                            break;
+                        case "ownerApproverId":
+                            return callback(new Error(this.$t('project.inputOwnerApprover')));
+                            break;
+                        case "customerApproverId":
+                            return callback(new Error(this.$t('project.inputCustomerApprover')));
+                            break;
+                        case "username":
+                            return callback(new Error(this.$t('project.inputName')));
+                            break;
+                        case "companyId":
+                            return callback(new Error(this.$t('project.inputCompany')));
+                            break;
+                        default:
+                            callback();
+                    } 
+                } else {
+                    callback();
+                }
+            };
             return {
                 activeNames: ['1','2','3'],
 
@@ -316,35 +343,29 @@
 
                 formRules: {
 					projectName: [
-						{ required: true, message: '请输入项目名称', trigger: 'blur' }
-                    ],
-                    customerCompany: [
-                        { required: true, message: '请选择客户公司', trigger: 'blur' }
+						{ required: true, validator: msg, trigger: 'blur' }
                     ],
                     modelIds: [
-                        { required: true, message: '请选择项目模具', trigger: ['blur','change'] }
+                        { required: true, validator: msg, trigger: ['blur','change'] }
                     ],
                     managerId: [
-                        { required: true, message: '请选择项目经理', trigger: ['blur','change'] }
+                        { required: true, validator: msg, trigger: ['blur','change'] }
                     ],
                     ownerApproverId: [
-                        { required: true, message: '请选择资产方审批人', trigger: ['blur','change'] }
+                        { required: true, validator: msg, trigger: ['blur','change'] }
                     ],
                     customerApproverId: [
-                        { required: true, message: '请选择生产方审批人', trigger: ['blur','change'] }
+                        { required: true, validator: msg, trigger: ['blur','change'] }
                     ],
                     // 新建人员
                     username: [
-						{ required: true, message: '请输入姓名', trigger: 'blur' }
+						{ required: true, validator: msg, trigger: 'blur' }
                     ],
                     account: [
 						{ required: true, validator: checkPhone, trigger: 'blur'}
                     ],
-                    teamName: [
-						{ required: true, message: '请选择人员类型', trigger: ["blur",'change'] }
-					],
                     companyId: [
-						{ required: true, message: '请选择所属公司', trigger: ["blur",'change'] }
+						{ required: true, validator: msg, trigger: ["blur",'change'] }
 					],
                 },
                 
@@ -831,7 +852,7 @@
                             this.editFormVisible = false;
                             if (res.code == "ok") {
                                 this.$message({
-                                    message: '修改成功',
+                                    message: this.$t('prompt.success'),
                                     type: 'success'
                                 });
                                 this.getDetail();
@@ -880,7 +901,7 @@
                                 if(i == 0){ this.addFormVisible = false; }
                                 this.getStaff();
                                 this.$message({
-                                    message: '创建成功',
+                                    message: this.$t('prompt.success2'),
                                     type: 'success'
                                 });
                             } else {
@@ -913,7 +934,7 @@
                     this.$refs.upload.clearFiles();
                     if (res.code == "ok") {
                         this.$message({
-                            message: '上传成功',
+                            message: this.$t('prompt.success4'),
                             type: 'success'
                         });
                         this.getFileList();
@@ -954,15 +975,17 @@
 
             //删除上传文件
 			fileDel(id) {
-                this.$confirm('确认删除该文档吗?', '提示', {
-					type: 'warning'
+                 this.$confirm(this.$t('project.delFile'), 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.project.delFile, {
                         id: id
                     }, res => {
                         if (res.code == "ok") {
                             this.$message({
-                                message: '删除成功',
+                                message: this.$t('prompt.success3'),
                                 type: 'success'
                             });
                             this.getFileList();

+ 83 - 65
ys_int/src/views/project/staff.vue

@@ -5,7 +5,7 @@
 			<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 allCompanies" :key="item.id" :label="item.companyName" :value="item.id">
                             </el-option>
                         </el-select>
@@ -13,20 +13,20 @@
                 </el-col>
                 <el-col :span="3">
                     <el-form-item>
-                        <el-select v-model="filters.flag" placeholder="请选择查询条件">
-                            <el-option label="姓名" value="0"></el-option>
-                            <el-option label="用户名" value="1"></el-option>
+                        <el-select v-model="filters.flag" :placeholder="$t('base.choose')">
+                            <el-option :label="$t('project.name')" value="0"></el-option>
+                            <el-option :label="$t('project.mobile')" value="1"></el-option>
                         </el-select>
                     </el-form-item>
                 </el-col>
                 <el-form-item>
-                    <el-input v-model="filters.keyName" clearable placeholder="请输入姓名或账号进行搜索" style="width:250px;"></el-input>
+                    <el-input v-model="filters.keyName" clearable :placeholder="$t('msg.nameSearch')" style="width:250px;"></el-input>
                 </el-form-item>
 				<el-form-item>
-					<el-button type="primary" @click="getUsers">查询</el-button>
+					<el-button type="primary" @click="getUsers">{{$t('base.query')}}</el-button>
 				</el-form-item>
 				<el-form-item style="float:right;" v-if="user.subordinateType == 0">
-					<el-button type="primary" @click="handleAdd">新增</el-button>
+					<el-button type="primary" @click="handleAdd">{{$t('base.add')}}</el-button>
 				</el-form-item>
 			</el-form>
 		</el-col>
@@ -34,10 +34,10 @@
 		<!--列表-->
 		<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="username" label="姓名" width="120" sortable></el-table-column>
-			<el-table-column prop="account" label="手机号" width="180" sortable></el-table-column>
+			<el-table-column prop="username" :label="$t('project.name')" width="120" sortable></el-table-column>
+			<el-table-column prop="account" :label="$t('project.mobile')" width="180" sortable></el-table-column>
 			<!-- <el-table-column prop="mobile" label="联系方式" width="150" sortable></el-table-column> -->
-            <el-table-column prop="projects" label="参与项目" sortable>
+            <el-table-column prop="projects" :label="$t('project.partake')" sortable>
                 <template slot-scope="scope">
                     <span class="info" v-for="(item, index) in scope.row.projects">
                         {{item.projectName}}
@@ -45,14 +45,14 @@
                     </span>
                 </template>
 			</el-table-column>
-            <el-table-column prop="roleName" label="备注" width="180" sortable></el-table-column>
-            <el-table-column prop="teamName" label="类型" width="120" align="center" sortable></el-table-column>
-			<el-table-column prop="companyName" label="所属公司" sortable></el-table-column>
-			<el-table-column label="操作" align="left" width="230">
+            <el-table-column prop="roleName" :label="$t('project.remark')" width="180" sortable></el-table-column>
+            <el-table-column prop="teamName" :label="$t('project.type')" width="120" align="center" sortable></el-table-column>
+			<el-table-column prop="companyName" :label="$t('project.company')" sortable></el-table-column>
+			<el-table-column :label="$t('base.operate')" align="left" width="230">
 				<template slot-scope="scope" v-if="user.id == scope.row.parentId || user.isManager == 1 || (user.parentId == 1 && user.subordinateType == 0)">
-					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
-					<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
-                    <el-button type="primary" size="small" @click="invite(scope.$index, scope.row)" v-if="user.id != 1 && scope.row.projects != null && scope.row.projects.length == 1">邀请</el-button>
+					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">{{$t('base.edit')}}</el-button>
+					<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">{{$t('el.upload.delete')}}</el-button>
+                    <el-button type="primary" size="small" @click="invite(scope.$index, scope.row)" v-if="user.id != 1 && scope.row.projects != null && scope.row.projects.length == 1">{{$t('base.invite')}}</el-button>
 				</template>
 			</el-table-column>
 		</el-table>
@@ -71,64 +71,64 @@
 		</el-col>
 
         <!--新增界面-->
-		<el-dialog title="新增人员" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+		<el-dialog :title="$t('project.addPeo')" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
 			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
-				<el-form-item label="姓名" prop="username">
-					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
+				<el-form-item :label="$t('project.name')" prop="username">
+					<el-input v-model="addForm.username" autocomplete="off" :placeholder="$t('project.inputName')" style="width:202px"></el-input>
 				</el-form-item>
-				<el-form-item label="手机号" prop="account">
-					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
+				<el-form-item :label="$t('project.mobile')" prop="account">
+					<el-input v-model="addForm.account" autocomplete="off" :placeholder="$t('project.inputMobile')" style="width:202px"></el-input>
 				</el-form-item>
-                <el-form-item v-if="!(user.parentId == 1 && user.subordinateType == 0)" label="参与项目" prop="projectIds">
-					<el-select v-model="addForm.projectIds" @change="choseProject" clearable filterable placeholder="请选择参与项目" style="width:202px">
+                <el-form-item v-if="!(user.parentId == 1 && user.subordinateType == 0)" :label="$t('project.partake')" prop="projectIds">
+					<el-select v-model="addForm.projectIds" @change="choseProject" clearable filterable :placeholder="$t('project.inputPartake')" style="width:202px">
                         <el-option v-for="item in projects" :key="item.id" :label="item.projectName" :value="item.id">
                         </el-option>
                     </el-select>
 				</el-form-item>
-                <el-form-item label="公司" prop="companyId">
-					<el-select v-model="addForm.companyId" clearable filterable placeholder="请选择所属公司" style="width:202px">
+                <el-form-item :label="$t('project.company')" prop="companyId">
+					<el-select v-model="addForm.companyId" clearable filterable :placeholder="$t('project.inputCompany')" style="width:202px">
                         <el-option v-for="item in company" :key="item.id" :label="item.companyName" :value="item.id">
                         </el-option>
                     </el-select>
 				</el-form-item>
-                <el-form-item label="备注">
-                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入备注"></el-input>
+                <el-form-item :label="$t('project.remark')">
+                    <el-input v-model="addForm.roleName" autocomplete="off" :placeholder="$t('project.inputRemark')" style="width:202px"></el-input>
 				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-                <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
-				<el-button @click.native="addFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
+                <span 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 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="80px" :rules="formRules" ref="editForm" :inline="true" class="demo-form-inline">
-				<el-form-item label="姓名" prop="username">
-					<el-input v-model="editForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
+		<el-dialog :title="$t('project.editPeo')" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-form :model="editForm" label-width="100px" :rules="formRules" ref="editForm" :inline="true" class="demo-form-inline">
+				<el-form-item :label="$t('project.name')" prop="username">
+					<el-input v-model="editForm.username" autocomplete="off" :placeholder="$t('project.inputName')"></el-input>
 				</el-form-item>
-				<el-form-item label="手机号" prop="account">
-					<el-input v-model="editForm.account" disabled autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
+				<el-form-item :label="$t('project.mobile')" prop="account">
+					<el-input v-model="editForm.account" disabled autocomplete="off" :placeholder="$t('project.inputPartake')"></el-input>
 				</el-form-item>
-                <el-form-item label="公司" prop="companyId">
-                    <el-input v-model="editForm.companyId" disabled autocomplete="off" placeholder="请选择所属公司"></el-input>
+                <el-form-item :label="$t('project.company')" prop="companyId">
+                    <el-input v-model="editForm.companyId" disabled autocomplete="off" :placeholder="$t('project.inputCompany')"></el-input>
 				</el-form-item>
-                <el-form-item label="备注">
-                    <el-input v-model="editForm.roleName" autocomplete="off" placeholder="请输入备注"></el-input>
+                <el-form-item :label="$t('project.remark')">
+                    <el-input v-model="editForm.roleName" autocomplete="off" :placeholder="$t('project.inputRemark')"></el-input>
 				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-                 <span style="color:#f00;float:left;margin-left:60px;">初始密码:000000</span>
-				<el-button @click.native="editFormVisible = false">取消</el-button>
-				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
+                 <span style="color:#f00;float:left;margin-left:60px;">{{$t('project.initial')}}:000000</span>
+				<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>
 
         <!--邀请界面-->
-		<el-dialog title="邀请" v-if="inviteVisible" :visible.sync="inviteVisible" :close-on-click-modal="false" customClass='customWidth'>
-			<el-input placeholder="请复制邀请链接" v-model="inviteLink" class="input-with-select">
-                <el-button slot="append" v-clipboard:copy="inviteLink" v-clipboard:success="copyLink" v-clipboard:error="onError" type="primary" icon="el-icon-share">复制链接</el-button>
+		<el-dialog :title="$t('base.invite')" v-if="inviteVisible" :visible.sync="inviteVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-input :placeholder="$t('project.copyInv')" v-model="inviteLink" class="input-with-select">
+                <el-button slot="append" v-clipboard:copy="inviteLink" v-clipboard:success="copyLink" v-clipboard:error="onError" type="primary" icon="el-icon-share">{{$t('project.copy')}}</el-button>
             </el-input>
 		</el-dialog>
 	</section>
@@ -139,23 +139,42 @@
 
 	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 "username":
+                            return callback(new Error(this.$t('project.inputName')));
+                            break;
+                        case "projectIds":
+                            return callback(new Error(this.$t('project.inputPartake')));
+                            break;
+                        case "companyId":
+                            return callback(new Error(this.$t('project.inputCompany')));
+                            break;
+                        default:
+                            callback();
+                    } 
+                } else {
+                    callback();
+                }
             };
 			return {
 				filters: {
                     keyName: '',
                     roleName: '',
-                    flag: '姓名',
+                    flag: this.$t('project.name'),
                     companyId: ''
                 },
                 
@@ -174,19 +193,16 @@
 
                 formRules: {
                     username: [
-						{ required: true, message: '请输入姓名', trigger: 'blur' }
+						{ required: true, validator: msg, trigger: 'blur' }
                     ],
                     account: [
                         { required: true, validator: checkPhone, trigger: 'blur'}
                     ],
-                    teamName: [
-						{ required: true, message: '请选择人员类型', trigger: ["blur",'change'] }
-                    ],
                     projectIds: [
-						{ required: true, message: '请选择参与项目', trigger: ["blur",'change'] }
+						{ required: true, validator: msg, trigger: ["blur",'change'] }
 					],
                     companyId: [
-						{ required: true, message: '请选择所属公司', trigger: ["blur",'change'] }
+						{ required: true, validator: msg, trigger: ["blur",'change'] }
 					]
                 },
 
@@ -307,7 +323,7 @@
                     currentPage: this.page,
                     pageSize: this.size,
                     companyId: this.filters.companyId==''?-1:this.filters.companyId,
-                    flag: this.filters.flag=='姓名'?0:this.filters.flag
+                    flag: this.filters.flag==this.$t('project.name')?0:this.filters.flag
                 }, res => {
                     this.listLoading = false;
                     if (res.code == "ok") {
@@ -353,7 +369,7 @@
                             if (res.code == "ok") {
                                 this.addFormVisible = false;
                                 this.$message({
-                                    message: '创建成功',
+                                    message: this.$t('prompt.success2'),
                                     type: 'success'
                                 });
                                 this.getUsers();
@@ -377,15 +393,17 @@
 
 			//删除
 			handleDel(index, row) {
-                this.$confirm('确认删除该人员吗?', '提示', {
-					type: 'warning'
+                this.$confirm(this.$t('project.delPeo'), 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.project.delUser, {
                         id: row.id
                     }, res => {
                         if (res.code == "ok") {
                             this.$message({
-                                message: '删除成功',
+                                message: this.$t("prompt.success3"),
                                 type: 'success'
                             });
                             this.getUsers();
@@ -434,7 +452,7 @@
                             if (res.code == "ok") {
                                 this.editFormVisible = false;
                                 this.$message({
-                                    message: '修改成功',
+                                    message: this.$t("prompt.success"),
                                     type: 'success'
                                 });
                                 this.getUsers();
@@ -510,7 +528,7 @@
             copyLink() {
                 //this.inviteVisible = false;
                 this.$message({
-                    message: "复制成功!",
+                    message: this.$t('prompt.success6'),
                     type: 'success'
                 });
             },
@@ -518,7 +536,7 @@
             onError(e) {
                 //this.inviteVisible = false;
                 this.$message({
-                    message: "复制失败!",
+                    message: this.$t('prompt.fail'),
                     type: 'error'
                 });
             }

+ 10 - 10
ys_vue/src/views/base/allocation.vue

@@ -79,7 +79,7 @@
         </el-col>
 
         <!--新增界面-->
-        <el-dialog title="新建模具" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth">
+        <el-dialog title="新建云模盒" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth">
             <el-form
                 :model="newAllocation"
                 label-width="100px"
@@ -89,7 +89,7 @@
                 class="demo-form-inline"
             >
                 <el-form-item label="云模盒编号" prop="equipmentNo">
-                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写云模盒编号"></el-input>
+                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请输入云模盒编号"></el-input>
                 </el-form-item>
                 <el-form-item label="所属公司" prop="belongCompanyId">
                     <el-select
@@ -112,14 +112,14 @@
                         v-model.number="newAllocation.useLife"
                         type="age"
                         autocomplete="off"
-                        placeholder="请填写使用年限"
+                        placeholder="请输入使用年限"
                     ></el-input>
                 </el-form-item>
                 <el-form-item label="代理商" prop="agent">
                     <el-input
                         v-model="newAllocation.agent"
                         autocomplete="off"
-                        placeholder="请填写代理商"
+                        placeholder="请输入代理商"
                         style="width: 202px"
                     ></el-input>
                 </el-form-item>
@@ -132,7 +132,7 @@
 
         <!--修改界面-->
         <el-dialog
-            title="修改模具"
+            title="修改云模盒"
             v-if="editFormVisible"
             :visible.sync="editFormVisible"
             :close-on-click-modal="false"
@@ -147,7 +147,7 @@
                 class="demo-form-inline"
             >
                 <el-form-item label="云模盒编号" prop="equipmentNo">
-                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请填写"></el-input>
+                    <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请输入云模盒编号"></el-input>
                 </el-form-item>
                 <el-form-item label="所属公司" prop="belongCompanyId">
                     <el-select
@@ -171,14 +171,14 @@
                         v-model.number="newAllocation.useLife"
                         type="age"
                         autocomplete="off"
-                        placeholder="请填写使用年限"
+                        placeholder="请输入使用年限"
                     ></el-input>
                 </el-form-item>
                 <el-form-item label="代理商" prop="agent">
                     <el-input
                         v-model="newAllocation.agent"
                         autocomplete="off"
-                        placeholder="请填写代理商"
+                        placeholder="请输入代理商"
                         style="width: 202px"
                     ></el-input>
                 </el-form-item>
@@ -241,7 +241,7 @@
                         { required: true, message: "请选择所属公司", trigger: ["blur", "change"] }
                     ],
                     agent: [
-                        { required: true, message: "请填写代理商", trigger: "blur" }
+                        { required: true, message: "请输入代理商", trigger: "blur" }
                     ]
                 },
 
@@ -454,7 +454,7 @@
             enable() {
                 if(this.allocations[this.activeIndex].belongCompanyId == null){
                     this.$message({
-                        message: "填写所属公司后才能启用模具",
+                        message: "输入所属公司后才能启用模具",
                         type: "error"
                     });
                 }else{

+ 1 - 1
ys_vue/src/views/base/comp.vue

@@ -74,7 +74,7 @@
 					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></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-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号"></el-input>
 				</el-form-item>
                 <el-form-item label="角色" v-show="!addState">
                     <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入角色名称"></el-input>

+ 3 - 3
ys_vue/src/views/base/factory.vue

@@ -52,7 +52,7 @@
 		</el-col>
 
         <!--新增界面-->
-		<el-dialog title="新增生产方" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
+		<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>
@@ -71,7 +71,7 @@
 					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></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-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号"></el-input>
 				</el-form-item>
                 <el-form-item label="角色" v-show="!addState">
                     <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入角色名称"></el-input>
@@ -287,7 +287,7 @@
 			handleAdd() {
                 this.addFormVisible = true;
                 this.addState = true;
-                this.addTitle = '新增产方';
+                this.addTitle = '新增产方';
 				this.addForm = {
                     companyName: '',
                     companyAddress: '',

+ 1 - 1
ys_vue/src/views/detection/detection.vue

@@ -5,7 +5,7 @@
       <el-form :inline="true" :model="filters">
         <el-col :span="2">
           <el-form-item>
-            <el-select v-model="filters.value" placeholder="请选择">
+            <el-select v-model="filters.value" placeholder="请选择查询条件">
               <el-option label="编号" value="0"></el-option>
               <el-option label="名称" value="1"></el-option>
             </el-select>

+ 8 - 16
ys_vue/src/views/detection/maintenance.vue

@@ -88,7 +88,7 @@
                 </el-select>
                 </el-form-item>
                 <!-- 保养类型为1时 选择易损件ID -->
-                <el-form-item v-if="type.value == 1" label="选择易损件" prop="vulnerable">
+                <el-form-item v-if="type.value == 1" label="易损件" prop="vulnerable">
                 <el-select
                     v-model="vulnerable.value"
                     clearable
@@ -105,7 +105,7 @@
                 </el-select>
                 </el-form-item>
                 <!-- 保养类型为0时 选择保养动作 -->
-                <el-form-item v-else label="选择动作" prop="action">
+                <el-form-item v-else label="动作" prop="action">
                     <el-select v-model="action.value" filterable placeholder="请选择动作" style="width:202px">
                         <el-option
                         v-for="item in action"
@@ -115,7 +115,7 @@
                         ></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="选择照片">
+                <el-form-item label="保养照片">
                 <el-upload ref="upload" action="customize" :http-request="maintain" :limit="1" :auto-upload="false" :before-upload="beforeUpload">
                     <el-button size="small" type="primary">上传</el-button>
                 </el-upload>
@@ -143,8 +143,8 @@
             :inline="true"
             class="demo-form-inline"
         >
-            <el-form-item label="警类型">
-            <el-input placeholder="警类型" v-model="warningInfo" :disabled="true"></el-input>
+            <el-form-item label="警类型">
+            <el-input placeholder="请选择告警类型" v-model="warningInfo" :disabled="true"></el-input>
             </el-form-item>
             <el-form-item label="云模盒设置" prop="action">
             <el-select
@@ -163,7 +163,7 @@
             </el-form-item>
         </el-form>
         <div slot="footer" class="dialog-footer">
-            <el-button @click.native="warningArrangement = false">取消</el-button>
+            <el-button @click.native="warningFormVisible = false">取消</el-button>
             <el-button type="primary" @click.native="warningArrangement" :loading="warningLoading">立即处理</el-button>
         </div>
         </el-dialog>
@@ -189,11 +189,7 @@ export default {
       warningInfo: "",
       stage: 0,
       //告警时需要更换的设备的列表
-      equipments: [
-        { value: 1, label: "临时设备1" },
-        { value: 2, label: "临时设备2" },
-        { value: 3, label: "临时设备3" }
-      ],
+      equipments: [],
       //标题栏过滤器
       filters: {
         name: "",
@@ -212,11 +208,7 @@ export default {
       //保养界面 动作
       action: [{ label: "喷漆", value: 0 }, { label: "检查", value: 1 }],
       //易损件 假数据
-      vulnerable: [
-        { label: "易损件1", value: 0 },
-        { label: "易损件12450", value: 1 },
-        { label: "易损件114514", value: 2 }
-      ],
+      vulnerable: [],
       //是否需要保养 提示
       requirement: false,
       prompt: true,

+ 1 - 1
ys_vue/src/views/mold/moldDetail.vue

@@ -633,7 +633,7 @@
                     name: "",
                     life: ""
                 },
-                maintainCount: [5000,10000],
+                maintainCount: [5000,10000,15000,20000,25000],
                 formRules: {
                     modelName: [
                         { required: true, message: "请输入模具名称", trigger: "blur" }

+ 1 - 1
ys_vue/src/views/project/competence.vue

@@ -21,7 +21,7 @@
 		</el-col>
 
 		<!--列表-->
-		<el-table :data="list" highlight-current-row v-loading="listLoading" style="width: 100%;">
+		<el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
 			<el-table-column type="index" width="60">
 			</el-table-column>
 			<el-table-column prop="username" label="姓名" width="150" sortable>

+ 2 - 2
ys_vue/src/views/project/staff.vue

@@ -15,12 +15,12 @@
                     <el-form-item>
                         <el-select v-model="filters.flag" placeholder="请选择查询条件">
                             <el-option label="姓名" value="0"></el-option>
-                            <el-option label="用户名" value="1"></el-option>
+                            <el-option label="手机号" value="1"></el-option>
                         </el-select>
                     </el-form-item>
                 </el-col>
                 <el-form-item>
-                    <el-input v-model="filters.keyName" clearable placeholder="请输入姓名或号进行搜索" style="width:250px;"></el-input>
+                    <el-input v-model="filters.keyName" clearable placeholder="请输入姓名或手机号进行搜索" style="width:250px;"></el-input>
                 </el-form-item>
 				<el-form-item>
 					<el-button type="primary" @click="getUsers">查询</el-button>