|
@@ -35,7 +35,7 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="仿真软件license数量:" prop="numSimulationLicense">
|
|
<el-form-item label="仿真软件license数量:" prop="numSimulationLicense">
|
|
<el-input
|
|
<el-input
|
|
- placeholder="请输入"
|
|
|
|
|
|
+ :placeholder="validNumSimLicense?'请输入仿真软件license数量,最大值:'+validNumSimLicense:'请输入仿真软件license数量'"
|
|
maxlength="20"
|
|
maxlength="20"
|
|
v-autoTrim="{ obj: form, key: 'numSimulationLicense' }"
|
|
v-autoTrim="{ obj: form, key: 'numSimulationLicense' }"
|
|
v-model="form.numSimulationLicense"
|
|
v-model="form.numSimulationLicense"
|
|
@@ -52,7 +52,7 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="动力学软件license数量:" prop="numDynamicLicense">
|
|
<el-form-item label="动力学软件license数量:" prop="numDynamicLicense">
|
|
<el-input
|
|
<el-input
|
|
- placeholder="请输入"
|
|
|
|
|
|
+ :placeholder="validNumDynLicense?('请输入动力学软件license数量,最大值:'+validNumDynLicense):'请输入动力学软件license数量'"
|
|
maxlength="20"
|
|
maxlength="20"
|
|
v-autoTrim="{ obj: form, key: 'numDynamicLicense' }"
|
|
v-autoTrim="{ obj: form, key: 'numDynamicLicense' }"
|
|
v-model="form.numDynamicLicense"
|
|
v-model="form.numDynamicLicense"
|
|
@@ -113,7 +113,7 @@ export default {
|
|
label: "到期时间",
|
|
label: "到期时间",
|
|
prop: "dateSimulationLicense",
|
|
prop: "dateSimulationLicense",
|
|
formatter:(data)=>{
|
|
formatter:(data)=>{
|
|
- return data.dateSimulationLicense.slice(0,10)
|
|
|
|
|
|
+ return data.dateSimulationLicense?data.dateSimulationLicense.slice(0,10):''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -124,7 +124,7 @@ export default {
|
|
label: "到期时间",
|
|
label: "到期时间",
|
|
prop: "dateDynamicLicense",
|
|
prop: "dateDynamicLicense",
|
|
formatter:(data)=>{
|
|
formatter:(data)=>{
|
|
- return data.dateDynamicLicense.slice(0,10)
|
|
|
|
|
|
+ return data.dateDynamicLicense?data.dateDynamicLicense.slice(0,10):''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -145,9 +145,35 @@ export default {
|
|
numDynamicLicense: "",
|
|
numDynamicLicense: "",
|
|
dateDynamicLicense: ""
|
|
dateDynamicLicense: ""
|
|
},
|
|
},
|
|
|
|
+ validNumSimLicense: undefined,
|
|
|
|
+ validNumDynLicense: undefined,
|
|
rules: {
|
|
rules: {
|
|
- numSimulationLicense: [{ required: true, message: "请输入", trigger: "blur" }],
|
|
|
|
- dateSimulationLicense: [{ required: true, message: "请选择", trigger: "blur" }],
|
|
|
|
|
|
+ numSimulationLicense: [
|
|
|
|
+ { required: true, message: "请输入", trigger: "blur" },
|
|
|
|
+ {
|
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
|
+ if(this.$validateInteger(value)){
|
|
|
|
+ callback()
|
|
|
|
+ }else{
|
|
|
|
+ callback(new Error('格式错误'))
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ trigger: "blur"
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ dateSimulationLicense: [
|
|
|
|
+ { required: true, message: "请选择", trigger: "blur" },
|
|
|
|
+ {
|
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
|
+ if(this.$validateInteger(value)){
|
|
|
|
+ callback()
|
|
|
|
+ }else{
|
|
|
|
+ callback(new Error('格式错误'))
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ trigger: "blur"
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
numDynamicLicense: [{ required: true, message: "请输入", trigger: "blur" }],
|
|
numDynamicLicense: [{ required: true, message: "请输入", trigger: "blur" }],
|
|
dateDynamicLicense: [{ required: true, message: "请选择", trigger: "blur" }]
|
|
dateDynamicLicense: [{ required: true, message: "请选择", trigger: "blur" }]
|
|
}
|
|
}
|
|
@@ -158,6 +184,7 @@ export default {
|
|
this.form = {...this.$route.query}
|
|
this.form = {...this.$route.query}
|
|
delete this.form.modifyTime
|
|
delete this.form.modifyTime
|
|
}
|
|
}
|
|
|
|
+ this.getValidNum()
|
|
},
|
|
},
|
|
async mounted() {
|
|
async mounted() {
|
|
if(this.$route.query.userId){
|
|
if(this.$route.query.userId){
|
|
@@ -172,9 +199,31 @@ export default {
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ getValidNum(){
|
|
|
|
+ this.$axios({
|
|
|
|
+ method: 'POST',
|
|
|
|
+ url: this.$api.systemManagement.getValidClusterInfo,
|
|
|
|
+ data:{
|
|
|
|
+ userId: this.$route.query.userId
|
|
|
|
+ }
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ if(res.code == '200' && res.info){
|
|
|
|
+ this.validNumDynLicense = res.info.validNumDynLicense
|
|
|
|
+ this.validNumSimLicense = res.info.validNumSimLicense
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
save(){
|
|
save(){
|
|
this.$refs.form.validate(valid=>{
|
|
this.$refs.form.validate(valid=>{
|
|
if(valid){
|
|
if(valid){
|
|
|
|
+ if(this.validNumSimLicense && this.form.numSimulationLicense > this.validNumSimLicense){
|
|
|
|
+ this.$message.warning('仿真软件license超数量出最大数量')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.validNumDynLicense && this.form.numDynamicLicense > this.validNumDynLicense){
|
|
|
|
+ this.$message.warning('仿真软件license超数量出最大数量')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.$axios({
|
|
this.$axios({
|
|
method:"POST",
|
|
method:"POST",
|
|
url:this.$api.systemManagement.saveCluster,
|
|
url:this.$api.systemManagement.saveCluster,
|