Sfoglia il codice sorgente

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

5 anni fa
parent
commit
31cd2cbee7

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

@@ -136,6 +136,8 @@ const lang = {
         temperature: "Temperature",
         initialModulus: "Accumulative Open Frequency",
         theoryCycle: "Theoretical Cycle",
+        changeIp: "Change IP",
+        IPWrong: "IP address format is incorrect",
 	},
 	// 项目管理
     project: {

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

@@ -136,6 +136,8 @@ const lang = {
         temperature: "温度",
         initialModulus: "累计开合次数",
         theoryCycle: "理论周期",
+        changeIp: "切换IP",
+        IPWrong: "IP地址格式不正确",
 	},
 	// 项目管理
     project: {

+ 2 - 0
ys_int/src/port.js

@@ -47,6 +47,8 @@ export default {
         modelList: '/mould/modelList', //给项目分配模具获取该公司下的模具列表
         delMold: '/mould/delMould', //删除模具
 
+        changeIp: '/mouldequipment/changeIp',//切换IP
+
         moldDetail: '/mould/detail', //模具详情
         moldFileList: '/mouldfile/list', //获取模具文档
         moldFileListAll: '/mouldfile/allList', //获取全部模具文档

+ 42 - 1
ys_int/src/views/base/allocation.vue

@@ -32,6 +32,9 @@
                 <el-form-item style="float: right;">
                     <el-button type="primary" @click="showAllocation">{{$t('base.add')}}</el-button>
                 </el-form-item>
+                <el-form-item style="float:right;" v-if="user.parentId == 0">
+					<el-button type="primary" @click="showChangeIp()">{{$t('runTest.changeIp')}}</el-button>
+				</el-form-item>
                 <!-- <el-form-item style="float: right;">
                     <el-button type="primary" @click="issued">{{$t('base.issued')}}</el-button>
                 </el-form-item> -->
@@ -135,7 +138,8 @@
                     <el-input v-model="newAllocation.equipmentName" autocomplete="off" :placeholder="$t('basic.inputProNum')"></el-input>
                 </el-form-item>
                 <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-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>
@@ -676,6 +680,43 @@
                         });
                     });
                 }
+            },
+
+            //改变ip
+            showChangeIp() {
+                this.$prompt('', this.$t('runTest.changeIp'), {
+                    confirmButtonText: this.$t('el.datepicker.confirm'),
+                    cancelButtonText: this.$t('el.datepicker.cancel'),
+                    inputPattern: /^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?):([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{4}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/,
+                    inputErrorMessage: this.$t('runTest.IPWrong')
+                }).then(({ value }) => {
+                    var ip = value.split(':')[0] , port = value.split(':')[1];
+                    this.http.post( this.port.mold.changeIp , {
+                        "ip": ip,
+                        "port": port,
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                type: 'success',
+                                message: this.$t('prompt.success')
+                            });
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }).catch(() => {
+
+                });
             }
         },
         created() {

+ 3 - 2
ys_int/src/views/detection/detection.vue

@@ -77,7 +77,7 @@
                     <span v-else>{{$t('runTest.isMaintain1')}}</span>
                 </template>
             </el-table-column>
-            <el-table-column :label="$t('runTest.process')" align="center" width="85">
+            <el-table-column :label="$t('runTest.process')" align="center" width="200">
                 <template slot-scope="scope">
                     <el-button size="small" type="primary" @click="toMaintenance(scope.row.id)">{{$t('base.detail')}}</el-button>
                 </template>
@@ -105,6 +105,7 @@
     export default {
         data() {
             return {
+                user: JSON.parse(sessionStorage.getItem('user')),
                 moulds: [],
                 filters: {
                     name: "",
@@ -175,7 +176,7 @@
                         type: "error"
                     });
                 });
-            }
+            },
         },
 
         created() {

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

@@ -51,7 +51,7 @@
                 </el-col> -->
                 <el-col :span="6" class="detail">
                     {{$t('mold.initialR')}}:
-                    <span class="info">{{moldDetail.runTimes==null?'':moldDetail.runTimes.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}</span>
+                    <span class="info">{{(moldDetail.runTimes==null?0:moldDetail.runTimes + moldDetail.initialModulus).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}</span>
                 </el-col>
                 <el-col :span="6" class="detail">
                     {{$t('mold.life')}}:

+ 1 - 1
ys_int/src/views/mold/moldList.vue

@@ -54,7 +54,7 @@
             </el-table-column> -->
             <el-table-column prop="runTimes" :label="$t('mold.initialR')" width="100" align="center" sortable>
                 <template slot-scope="scope">
-                    {{scope.row.runTimes.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}
+                    {{(scope.row.runTimes==null?0:scope.row.runTimes + scope.row.initialModulus).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}
                 </template>
             </el-table-column>
             <el-table-column prop="settingLife" :label="$t('mold.life')" width="100" align="center" sortable>