Commit 35724433 by liimin

合并代码

2 parents 15f7b168 552338de
......@@ -157,7 +157,7 @@ export default {
if (this.deviceNum === value && this.deviceName === this.editForm.deviceName) {
const res = await isExistApi({ deviceNum: value, deviceName: this.editForm.deviceName, stationCode: this.editForm.stationCode })
// console.log(res)
res ? callback(new Error(rule.message)) : callback()
res.deviceNum ? callback(new Error(rule.message)) : callback()
}
},
......
......@@ -282,7 +282,7 @@ export default {
params.method = 'fims.device.import'// params.method
// console.log(params)
params = sign(params, noSignAttr)
axios.post('http://192.168.3.191:8944/router', qs.stringify({
axios.post(process.env.VUE_APP_API, qs.stringify({
...params
}),
{
......
......@@ -3,7 +3,7 @@ import { constants } from 'fs';
<template>
<div>
<el-dialog
:title="!editForm.subsystemCode ? '添加子系统' : '编辑子系统'"
:title="title"
:visible.sync="isVisible"
:before-close="handleClose"
>
......@@ -77,6 +77,7 @@ export default {
data () {
return {
disabled: false,
title: '添加子系统',
rules: {
subsystemCode: [
{ required: true, message: '请输入子系统编号', trigger: 'blur' },
......@@ -118,6 +119,7 @@ export default {
watch: {
isVisible (val) {
this.disabled = !!this.editForm.subsystemCode
this.title = !this.editForm.subsystemCode ? '添加子系统' : '编辑子系统'
this.$refs.editRuleForm && this.$refs.editRuleForm.resetFields()
}
},
......@@ -126,7 +128,7 @@ export default {
async isCodeExist (rule, value, callback) {
if (this.editForm.trafficCode) {
const res = await isExistApi({ subsystemCode: value, trafficCode: this.editForm.trafficCode })
res ? callback(new Error(rule.message)) : callback()
res.subsystemCode ? callback(new Error(rule.message)) : callback()
}
},
......
......@@ -99,7 +99,7 @@ export default {
methods: {
async isCodeExist (rule, value, callback) {
const res = await isExistApi({ trafficCode: value })
res ? callback(new Error(rule.message)) : callback()
res.trafficCode ? callback(new Error(rule.message)) : callback()
},
handleClose () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!