|
@@ -110,7 +110,7 @@
|
|
|
<i class="el-icon-question question-icon">:</i>
|
|
<i class="el-icon-question question-icon">:</i>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
</template>
|
|
</template>
|
|
|
- <span>{{ form.sheBeiShiBieH }}</span>
|
|
|
|
|
|
|
+ <span>{{ form.sheBeiShiBieH || '/' }}</span>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
@@ -878,9 +878,6 @@ export default {
|
|
|
sheBeiMingCheng: [
|
|
sheBeiMingCheng: [
|
|
|
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
|
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
|
- sheBeiShiBieH: [
|
|
|
|
|
- { required: true, message: '设备编号不能为空', trigger: 'blur' }
|
|
|
|
|
- ],
|
|
|
|
|
yuanSheBeiBian: [
|
|
yuanSheBeiBian: [
|
|
|
{ required: true, message: '原设备编号不能为空', trigger: 'blur' }
|
|
{ required: true, message: '原设备编号不能为空', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
@@ -1125,6 +1122,7 @@ export default {
|
|
|
async goAdd () {
|
|
async goAdd () {
|
|
|
try {
|
|
try {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
|
|
+ this.form.sheBeiShiBieH = await this.getNextAlias()
|
|
|
await saveEquipmentCard(this.form)
|
|
await saveEquipmentCard(this.form)
|
|
|
this.$message.success('添加成功')
|
|
this.$message.success('添加成功')
|
|
|
this.closeDialog(true)
|
|
this.closeDialog(true)
|
|
@@ -1209,6 +1207,17 @@ export default {
|
|
|
generateRandomString () {
|
|
generateRandomString () {
|
|
|
return `JYK-${Math.floor(Math.random() * 88888) + 10000}`
|
|
return `JYK-${Math.floor(Math.random() * 88888) + 10000}`
|
|
|
},
|
|
},
|
|
|
|
|
+ getNextAlias () {
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ this.$common.getNextIdByAlias({
|
|
|
|
|
+ 'alias': 'sbbh'
|
|
|
|
|
+ }).then(response => {
|
|
|
|
|
+ resolve(response.data)
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ reject(error)
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
async init () {
|
|
async init () {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
this.isEdit = !!(this.params && this.params.id)
|
|
this.isEdit = !!(this.params && this.params.id)
|
|
@@ -1237,10 +1246,10 @@ export default {
|
|
|
this.isFirstbianZhiBuMen = false
|
|
this.isFirstbianZhiBuMen = false
|
|
|
this.isFirstyiXiaoRiQi = false
|
|
this.isFirstyiXiaoRiQi = false
|
|
|
// 随机生成一个不重复的设备编号
|
|
// 随机生成一个不重复的设备编号
|
|
|
- this.form.sheBeiShiBieH = this.generateRandomString()
|
|
|
|
|
- for (; await this.checkIsRepeat(this.form.sheBeiShiBieH);) {
|
|
|
|
|
- this.form.sheBeiShiBieH = this.generateRandomString()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // this.form.sheBeiShiBieH = this.generateRandomString()
|
|
|
|
|
+ // for (; await this.checkIsRepeat(this.form.sheBeiShiBieH);) {
|
|
|
|
|
+ // this.form.sheBeiShiBieH = this.generateRandomString()
|
|
|
|
|
+ // }
|
|
|
this.form.jieShouRiQi = dayjs().format('YYYY-MM-DD')
|
|
this.form.jieShouRiQi = dayjs().format('YYYY-MM-DD')
|
|
|
this.form.qiYongRiQi = dayjs().format('YYYY-MM-DD')
|
|
this.form.qiYongRiQi = dayjs().format('YYYY-MM-DD')
|
|
|
this.form.xiaoZhunWuCha = '否'
|
|
this.form.xiaoZhunWuCha = '否'
|