|
|
|
@ -1,23 +1,24 @@ |
|
|
|
<template> |
|
|
|
<div class="customer-css"> |
|
|
|
<el-dialog :title="titleCon" v-drag :visible.sync="visible" :close-on-click-modal="false" |
|
|
|
width="660px" style="height: 650px;" class="customer-dialog"> |
|
|
|
width="680px" style="height: 650px;" class="customer-dialog"> |
|
|
|
<el-container style="height: 275px;"> |
|
|
|
<el-form :inline="true" :model="pageData" :rules="rules" label-position="top" label-width="80px" > |
|
|
|
<!-- 第一行 --> |
|
|
|
<el-row class="customer-row" > |
|
|
|
<el-col :span="6" class="first-col"> |
|
|
|
<el-form-item :label=labels.toolId prop="toolId"> |
|
|
|
<span slot="label" >工具标识号 <el-button type="primary" v-if="addFlag" class="customer-button" @click="nextToolIdFun">Next Tool ID</el-button></span> |
|
|
|
<el-input v-model="pageData.toolId" style="width: 180px;" :disabled="!this.addFlag"></el-input> |
|
|
|
<span slot="label" >工具标识号 <el-button type="primary" v-if="addFlag" class="customer-button" @click="nextToolIdFun">Next Tool ID</el-button></span> |
|
|
|
<el-input v-model="pageData.toolId" :disabled="!this.addFlag"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="5" class="first-col" style="margin-left: 10px"> |
|
|
|
<el-form-item :label=labels.toolDesc prop="toolDesc"> |
|
|
|
<el-input v-model="pageData.toolDesc" ></el-input> |
|
|
|
<span slot="label">工具描述 <el-button type="primary" v-if="addFlag" class="customer-button" @click="nextNumberFun">Next Number</el-button></span> |
|
|
|
<el-input v-model="pageData.toolDesc"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="5" style="margin-left: 35px"> |
|
|
|
<el-form-item :label=labels.site prop="site"> |
|
|
|
<span slot="label" style="" @click="getBaseList(1017)"><a herf="#">域</a></span> |
|
|
|
<el-input v-model="pageData.site" :disabled="!this.addFlag"></el-input> |
|
|
|
@ -128,6 +129,7 @@ import { |
|
|
|
insertToolInfo, |
|
|
|
modifyToolInfo, |
|
|
|
getNextToolId, |
|
|
|
getNextToolDesc, |
|
|
|
getBaseConfigData, |
|
|
|
} from '@/api/tool/com_tool_info_add_update.js'; |
|
|
|
|
|
|
|
@ -496,6 +498,31 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
/*获取工具描述的下一个序号(7位固定长度)*/ |
|
|
|
nextNumberFun(){ |
|
|
|
let site = this.pageData.site; |
|
|
|
let toolDesc = this.pageData.toolDesc; |
|
|
|
if(site == null || site === ''){ |
|
|
|
this.$message.error('工厂不能为空!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
if(toolDesc == null || toolDesc === ''){ |
|
|
|
this.$message.error('请先输入工具描述的前缀!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
if(toolDesc.length >= 7){ |
|
|
|
this.$message.error('工具描述前缀长度不能超过6位!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
getNextToolDesc(this.pageData).then(({data}) =>{ |
|
|
|
if(data.code === 200){ |
|
|
|
this.pageData.toolDesc = data.resultRow.toolDesc; |
|
|
|
}else{ |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
/*修改工具的前缀*/ |
|
|
|
changeToolPrefix(){ |
|
|
|
let requestData = {'site': this.pageData.site, 'firstType': 'tool', 'secondType': 'default_tool_prefix'} |
|
|
|
|