标签绑定管理-绑定弹框-设备编码去除自动生成编码

This commit is contained in:
binbin_pan 2024-06-14 10:16:49 +08:00
parent 25210e04b6
commit f6fe1a0a36
1 changed files with 30 additions and 25 deletions

View File

@ -365,7 +365,7 @@
<el-form-item label="设备编码" prop="maCode"> <el-form-item label="设备编码" prop="maCode">
<el-input <el-input
v-model="form.maCode" v-model="form.maCode"
placeholder="请输入设备编码,如NSJJ+类型编码+规格编码" placeholder="请输入设备编码,如: 类型编码+规格编码"
:clearable="true" :clearable="true"
maxlength="50" maxlength="50"
/> />
@ -732,15 +732,20 @@ export default {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
if (this.form.level == '4') { if (this.form.level == '4') {
if (this.form.maCode.indexOf('null') > 0) { addLabelBind(this.form).then((response) => {
this.$modal.msgError('请输入正确规则的设备编码!') this.$modal.msgSuccess('绑定成功')
} else { this.open = false
addLabelBind(this.form).then((response) => { this.getList()
this.$modal.msgSuccess('绑定成功') })
this.open = false // if (this.form.maCode.indexOf('null') > 0) {
this.getList() // this.$modal.msgError('')
}) // } else {
} // addLabelBind(this.form).then((response) => {
// this.$modal.msgSuccess('')
// this.open = false
// this.getList()
// })
// }
} else { } else {
this.$modal.msgError( this.$modal.msgError(
'当前类型无法生成标签,请选择设备类型-规格型号!', '当前类型无法生成标签,请选择设备类型-规格型号!',
@ -754,23 +759,23 @@ export default {
if (!val.children) { if (!val.children) {
console.log(val) console.log(val)
let nTime = new Date() // let nTime = new Date()
let nYear = nTime.getFullYear() + '' // let nYear = nTime.getFullYear() + ''
let nMonth = nTime.getMonth() + 1 // let nMonth = nTime.getMonth() + 1
console.log(nYear) // console.log(nYear)
console.log(nMonth) // console.log(nMonth)
this.form.level = '4' this.form.level = '4'
// let arr = this.form.arrivalTime.split('-') // let arr = this.form.arrivalTime.split('-')
this.$set( // this.$set(
this.form, // this.form,
'maCode', // 'maCode',
'NSJJ' + // 'NSJJ' +
val.code + // val.code +
val.modelCode + // val.modelCode +
nYear[2] + // nYear[2] +
nYear[3] + // nYear[3] +
nMonth, // nMonth,
) // )
} else { } else {
this.form.level = '' this.form.level = ''
this.$set(this.form, 'maCode', '') this.$set(this.form, 'maCode', '')