Commit b4d89170 by xue_wengang

移动警务管理

parent 0deb32bb
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1087,7 +1087,7 @@ export default {
var self = this;
if (this.pageBs == "ydjwZdbbgl") {
return Http({
url: url.rzURL + self.cxUrl,
url: url.ydjwURL + self.cxUrl,
data: form,
method: "post",
headers: {
......
......@@ -13,6 +13,14 @@ export default [
component: () => import("@/views/Home.vue")
},
{
path: "/addJw",
name: "addJw",
component: () => import("@/views/rzcx/addJw.vue"),
meta: {
title: "运控管理"
}
},
{
path: "/tjpg",
name: "tjpg",
meta: {
......
<template>
<div>
<form-compontent :formField="propFormField"
:formLabelAligns="formLabelAlign"
@submit="submit"
:propTitle="title"
@getDialogSeletedDw="getDialogSeletesd"
:base64Transform="true"
@removePhoto="removePhoto"
:fileBase64="fileBase64"
@onBase64Transform="onBase64Transform">
</form-compontent>
</div>
</template>
<script>
import formCompontent from "@c/form.vue";
import axios from "axios";
import request from "@/api/interface/dictionaryCode.js";
// import {
// insertUserNew,
// getUserXxByxxzjbh,
// updateUserXx
// } from "@/api/userAuth/addUser.js";
// import { queryXzTreeData } from "@/api/userAuth/role.js";
// import { sm4encrypt } from "@/utils/sm4Util.js";
export default {
name: "addUser",
components: {
formCompontent,
},
data () {
return {
title: "设备注册",
propFormField: [
//基本信息
{
title: "设备注册",
id: 1,
objStr: "",
index: 0,
data: [
{
name: "IP地址:",
id: "ip",
type: "text",
prop: "checkEmpty",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "MAC地址:",
id: "mac",
type: "text",
prop: "checkEmpty",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "设备品牌:",
id: "sbpp",
type: "text",
prop: "checkEmpty",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "设备名称:",
id: "sbmc",
type: "text",
prop: "checkEmpty",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "设备型号:",
id: "sbxh",
type: "text",
prop: "checkEmpty",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "绑定用户身份证:",
id: "bdidcard",
type: "text",
prop: "checkEmpty",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "绑定姓名:",
id: "bdxm",
type: "text",
prop: "checkEmpty",
value: "",
placeholder: "请输入",
col: "2",
},
{
name: "是否开启:",
id: "sbzt",
type: "radio",
prop: "checkEmpty",
value: "1",
placeholder: "请输入",
col: "2",
radioData: [
{ name: "开启", value: "0" },
{ name: "关闭", value: "1" },
],
},
{
name: "备注:",
id: "bz",
type: "text",
prop: "checkEmpty",
value: "",
placeholder: "请输入",
col: "2",
},
],
},
],
fileBase64: {},
formLabelAlign: {
'ip': '',
'mac': '',
'sbpp': '',
'sbmc': '',
'sbxh': '',
'bdidcard': '',
'bdxm': '',
'sbzt': '1',
'bz': '',
},
Loading: null,
unitname: "",
userInfo: {},
fdId: "",
};
},
methods: {
onBase64Transform (p) {
this.fileBase64 = p;
},
removePhoto (item) {
let loading = this.$loading({
lock: true,
text: "正在删除...",
spinner: "el-icon-loading",
background: "rgba(255, 255, 255, 0.7)",
});
let id = item.id;
this.$set(this.formLabelAlign, id, "");
loading.close();
},
getDialogSeletesd (label) {
debugger;
this.unitname = label;
},
submit (params) {
clearTimeout(this.fdId);
let self = this;
let loading = this.$loading({
lock: true,
text: "正在保存...",
spinner: "el-icon-loading",
background: "rgba(255, 255, 255, 0.7)",
});
self.fdId = setTimeout(() => {
if (!self.xxzjbh) {
self.addSubmit(params, loading);
} else {
self.editSubmit(params, loading);
}
}, 500);
},
addSubmit (params, loading) {
params.set('bdidcard', this.formLabelAlign.bdidcard || '')
request.insertYdjw(params).then((res) => {
if (res.success && res.code == 200) {
this.$alert("保存成功!", "提示", {
confirmButtonText: "确定",
type: "success",
callback: () => {
window.opener.postMessage("userReloadData", location.origin);
loading.close();
window.close()
window.opener.location.reload();
},
});
} else {
this.$message.error(res.message);
loading.close();
}
});
},
editSubmit (params, loading) {
params.append("xxzjbh", this.xxzjbh);
request.updateYdjw(params).then((res) => {
if (res.success && res.code == 200) {
this.$alert("保存成功!", "提示", {
confirmButtonText: "确定",
type: "success",
callback: () => {
loading.close();
window.close()
window.opener.location.reload();
},
});
} else {
this.$message.error(res.message);
loading.close();
}
});
},
getshuju () {
var self = this;
request.queryByIdJw({
xxzjbh: this.xxzjbh,
}).then((res) => {
if (res.success && res.code == 200) {
var result = res.data.rows;
self.propFormField.forEach((fieldItem) => {
if (fieldItem.data && fieldItem.data.length > 0) {
fieldItem.data.forEach((i) => {
this.$set(this.formLabelAlign, i.id, result[i.id]);
});
}
this.$forceUpdate();
});
self.$forceUpdate();
}
setTimeout(() => {
self.Loading.close();
}, 500);
});
},
handleChildren (data, dwdm) {
let arr = [];
data.forEach((item) => {
if (item.id == dwdm) {
arr.push(item);
debugger;
} else {
this.handleChildren(item.children, dwdm);
}
});
return arr;
},
},
created () {
this.$store.commit("user/SET_Breadcrumb", this.breadcrumbList);
this.userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
if (this.$route.query.xxzjbh) {
this.Loading = this.$loading({
lock: true,
text: "正在获取数据...",
spinner: "el-icon-loading",
background: "rgba(255, 255, 255, 0.7)",
});
this.title = "设备修改";
this.xxzjbh = this.$route.query.xxzjbh;
this.getshuju();
}
},
mounted () {
let self = this;
let radioData0 = [
{ name: "地市级", value: "D" },
{ name: "县级", value: "X" },
];
let radioData1 = [{ name: "县级", value: "X" }];
if (this.userInfo.grade == "D") {
self.$set(self.propFormField[0].data[7], "radioData", radioData0);
} else if (this.userInfo.grade == "X") {
self.$set(self.propFormField[0].data[7], "radioData", radioData1);
}
// let parm = {
// type: "CODE_UNIT",
// id: JSON.parse(sessionStorage.getItem("userInfo")).unitcode,
// };
// queryXzTreeData(parm).then((res) => {
// self.$set(self.propFormField[0].data[0], "codeOptions", res.rows);
// });
},
};
</script>
<style scoped lang="scss">
</style>
\ No newline at end of file
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