Commit b0ca8baf authored by caicaicai's avatar caicaicai

修改

parent 44841a6a
......@@ -752,6 +752,24 @@ var HttpReq = function(){
data:data,
})
},
//设备管理——添加通信账号
communicationAccountAdd: function(data){
return request({
url: '/instantMessage/createUsers',
method: 'POST',
data:data,
}).then((res) => {
return res
})
},
//设备管理——删除通信账号
communicationAccountDel: function(data){
return request({
url: '/instantMessage/deleteUsers',
method: 'Delete',
data:data,
})
},
//设备管理——报警管理
callPoliceQuery: function(param){
return request({
......
......@@ -66,10 +66,10 @@
</el-select>
</el-form-item>
<el-form-item label="通信账号" prop="number">
<el-input v-model="form.item.number" style="width:280px;" placeholder="请输入通信账号"/>
<el-input v-model="form.item.number" style="width:280px;" placeholder="请输入通信账号" :disabled="form.reqType == 'edit'" />
</el-form-item>
<el-form-item label="通信密码" prop="password">
<el-input v-model="form.item.password" style="width:280px;" show-password placeholder="请输入通信密码"/>
<el-input v-model="form.item.password" style="width:280px;" show-password placeholder="请输入通信密码" :disabled="form.reqType == 'edit'"/>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input type="textarea" v-model="form.item.remarks" style="width:280px;"></el-input>
......@@ -186,12 +186,13 @@ export default {
},
toDelete(item) {
var id = item.id;
var communicationName = item.number
this.$confirm('确认删除该条数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then((e) => {
this.reqRemoveProject([id])
this.reqRemoveProject([id],communicationName)
}).catch((e) => {})
},
pageChange(e) {
......@@ -222,6 +223,7 @@ export default {
//新增设备
reqAddItem(form, item){
let lastData = {...item};
//新增设备数据
HttpReq.truckDispatching.deviceManagementAdd(lastData).then((res) => {
form.visible = false;
if(res.code == 200){
......@@ -241,6 +243,9 @@ export default {
}).catch(function(error) {
form.status.cu = 0
});
//新增通信账号
let communicationAccount = lastData.number;
HttpReq.truckDispatching.communicationAccountAdd({name:communicationAccount}).then((res) => {})
},
//修改设备
reqUpdateItem(form, item){
......@@ -266,7 +271,8 @@ export default {
});
},
//删除设备
reqRemoveProject(item){
reqRemoveProject(item,communicationName){
//删除设备信息
HttpReq.truckDispatching.deviceManagementDel(item).then((res) => {
if(res.status == 400){
this.$notify({
......@@ -283,6 +289,8 @@ export default {
}
this.loadData();
})
//删除通信账号
HttpReq.truckDispatching.communicationAccountDel({name:communicationName}).then((res) => {})
},
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment