Browse Source

检查内部编号

lipengtao 6 years ago
parent
commit
d317f0d973

+ 4 - 4
src/views/baseInfoManage/boxesConfig/index.vue

101
          return
101
          return
102
        }
102
        }
103
        if (this.edit) {
103
        if (this.edit) {
104
          checkDeviceInternalCode({ seq: value, id: this.edit, serverId: this.ruleForm2.serverId }).then(response => {
104
          checkDeviceInternalCode({ seq: value, id: this.edit, serverId: this.ruleForm2.serverId, active: 1 }).then(response => {
105
            if (response.data) {
105
            if (response.data) {
106
              callback(new Error('内部编号已存在,请重新输入'))
106
              callback(new Error('内部编号已存在,请重新输入'))
107
            } else {
107
            } else {
109
            }
109
            }
110
          })
110
          })
111
        } else {
111
        } else {
112
          checkDeviceInternalCode({ seq: value, serverId: this.ruleForm2.serverId }).then(response => {
112
          checkDeviceInternalCode({ seq: value, serverId: this.ruleForm2.serverId, active: 1 }).then(response => {
113
            if (response.data) {
113
            if (response.data) {
114
              callback(new Error('内部编号已存在,请重新输入'))
114
              callback(new Error('内部编号已存在,请重新输入'))
115
            } else {
115
            } else {
124
        callback(new Error('请输入采集盒编号'))
124
        callback(new Error('请输入采集盒编号'))
125
      } else {
125
      } else {
126
        if (this.edit) {
126
        if (this.edit) {
127
          checkDeviceCode({ code: value, id: this.edit }).then(response => {
127
          checkDeviceCode({ code: value, id: this.edit, active: 1 }).then(response => {
128
            if (response.data) {
128
            if (response.data) {
129
              callback(new Error('采集盒编号已存在,请重新输入'))
129
              callback(new Error('采集盒编号已存在,请重新输入'))
130
            } else {
130
            } else {
132
            }
132
            }
133
          })
133
          })
134
        } else {
134
        } else {
135
          checkDeviceCode({ code: value }).then(response => {
135
          checkDeviceCode({ code: value, active: 1 }).then(response => {
136
            if (response.data) {
136
            if (response.data) {
137
              callback(new Error('采集盒编号已存在,请重新输入'))
137
              callback(new Error('采集盒编号已存在,请重新输入'))
138
            } else {
138
            } else {

+ 4 - 4
src/views/baseInfoManage/sensorsConfig/index.vue

122
          return
122
          return
123
        }
123
        }
124
        if (this.edit) {
124
        if (this.edit) {
125
          checkDeviceInternalCode({ seq: value, id: this.edit, deviceId: this.ruleForm2.deviceId }).then(response => {
125
          checkDeviceInternalCode({ seq: value, id: this.edit, deviceId: this.ruleForm2.deviceId, active: 1 }).then(response => {
126
            if (response.data) {
126
            if (response.data) {
127
              callback(new Error('内部编号已存在,请重新输入'))
127
              callback(new Error('内部编号已存在,请重新输入'))
128
            } else {
128
            } else {
130
            }
130
            }
131
          })
131
          })
132
        } else {
132
        } else {
133
          checkDeviceInternalCode({ seq: value, deviceId: this.ruleForm2.deviceId }).then(response => {
133
          checkDeviceInternalCode({ seq: value, deviceId: this.ruleForm2.deviceId, active: 1 }).then(response => {
134
            if (response.data) {
134
            if (response.data) {
135
              callback(new Error('内部编号已存在,请重新输入'))
135
              callback(new Error('内部编号已存在,请重新输入'))
136
            } else {
136
            } else {
145
        callback(new Error('请输入传感器编号'))
145
        callback(new Error('请输入传感器编号'))
146
      } else {
146
      } else {
147
        if (this.edit) {
147
        if (this.edit) {
148
          checkDeviceCode({ code: value, id: this.edit }).then(response => {
148
          checkDeviceCode({ code: value, id: this.edit, active: 1 }).then(response => {
149
            if (response.data) {
149
            if (response.data) {
150
              callback(new Error('传感器编号已存在,请重新输入'))
150
              callback(new Error('传感器编号已存在,请重新输入'))
151
            } else {
151
            } else {
153
            }
153
            }
154
          })
154
          })
155
        } else {
155
        } else {
156
          checkDeviceCode({ code: value }).then(response => {
156
          checkDeviceCode({ code: value, active: 1 }).then(response => {
157
            if (response.data) {
157
            if (response.data) {
158
              callback(new Error('传感器编号已存在,请重新输入'))
158
              callback(new Error('传感器编号已存在,请重新输入'))
159
            } else {
159
            } else {

+ 4 - 4
src/views/baseInfoManage/serversConfig/index.vue

101
          return
101
          return
102
        }
102
        }
103
        if (this.edit) {
103
        if (this.edit) {
104
          checkDeviceInternalCode({ seq: value, id: this.edit, bridgeId: this.ruleForm2.bridgeId }).then(response => {
104
          checkDeviceInternalCode({ seq: value, id: this.edit, bridgeId: this.ruleForm2.bridgeId, active: 1 }).then(response => {
105
            if (response.data) {
105
            if (response.data) {
106
              callback(new Error('内部编号已存在,请重新输入'))
106
              callback(new Error('内部编号已存在,请重新输入'))
107
            } else {
107
            } else {
109
            }
109
            }
110
          })
110
          })
111
        } else {
111
        } else {
112
          checkDeviceInternalCode({ seq: value, bridgeId: this.ruleForm2.bridgeId }).then(response => {
112
          checkDeviceInternalCode({ seq: value, bridgeId: this.ruleForm2.bridgeId, active: 1 }).then(response => {
113
            if (response.data) {
113
            if (response.data) {
114
              callback(new Error('内部编号已存在,请重新输入'))
114
              callback(new Error('内部编号已存在,请重新输入'))
115
            } else {
115
            } else {
124
        callback(new Error('请输入服务器编号'))
124
        callback(new Error('请输入服务器编号'))
125
      } else {
125
      } else {
126
        if (this.edit) {
126
        if (this.edit) {
127
          checkDeviceCode({ code: value, id: this.edit }).then(response => {
127
          checkDeviceCode({ code: value, id: this.edit, active: 1 }).then(response => {
128
            if (response.data) {
128
            if (response.data) {
129
              callback(new Error('服务器编号已存在,请重新输入'))
129
              callback(new Error('服务器编号已存在,请重新输入'))
130
            } else {
130
            } else {
132
            }
132
            }
133
          })
133
          })
134
        } else {
134
        } else {
135
          checkDeviceCode({ code: value }).then(response => {
135
          checkDeviceCode({ code: value, active: 1 }).then(response => {
136
            if (response.data) {
136
            if (response.data) {
137
              callback(new Error('服务器编号已存在,请重新输入'))
137
              callback(new Error('服务器编号已存在,请重新输入'))
138
            } else {
138
            } else {