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

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