|
@@ -71,7 +71,7 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="form-item selectBox" v-if="repType==3&&deviceType">
|
|
|
- <view class="title"><text class="necessary">*</text>设备编号:</view>
|
|
|
+ <view class="title"><text class="necessary">*</text>报备设备:</view>
|
|
|
<select name="" id="" placeholder=""clearable v-model="deviceNo">
|
|
|
<option value="">请选择</option>
|
|
|
<option value="1">编号1</option>
|
|
@@ -109,6 +109,7 @@
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
+ id:'',
|
|
|
|
|
|
repType:'',
|
|
|
deviceType:'',
|
|
@@ -123,6 +124,8 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad: function(option) {
|
|
|
+
|
|
|
+ this.id=option.id;
|
|
|
this.getSiteList();
|
|
|
|
|
|
uni.setNavigationBarTitle({
|
|
@@ -144,208 +147,121 @@
|
|
|
methods: {
|
|
|
|
|
|
async submit() {
|
|
|
+
|
|
|
//提交验证
|
|
|
|
|
|
- if (!this.device_code) {
|
|
|
- uni.showToast({
|
|
|
- title: "请输入设备编号",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }else{
|
|
|
- var reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{2,10}$/;
|
|
|
- if(!reg.test(this.device_code)){
|
|
|
- uni.showToast({
|
|
|
- title: "请输入字母和数字结合的设备编号",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (!this.device_name.replace(/^\s*/g,'')) {
|
|
|
- uni.showToast({
|
|
|
- title: "请输入设备名称",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.unitinfo.replace(/^\s*/g,'')) {
|
|
|
- uni.showToast({
|
|
|
- title: "请输入单元地址",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.louyu) {
|
|
|
- uni.showToast({
|
|
|
- title: "请选择所属楼层",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.sim.replace(/^\s*/g,'')) {
|
|
|
- uni.showToast({
|
|
|
- title: "请输入物联网卡号",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.company_code) {
|
|
|
- uni.showToast({
|
|
|
- title: "请选择所在单位",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.type) {
|
|
|
- uni.showToast({
|
|
|
- title: "请选择设备类型",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.transfer_type) {
|
|
|
+ if (!this.repType) {
|
|
|
uni.showToast({
|
|
|
- title: "请选择传输方式",
|
|
|
+ title: "请输入报备类型",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- if(this.type==1&&this.transfer_type=="4G"){
|
|
|
- if (this.owner_xh_a=='z') {
|
|
|
+ if(this.repType==1){
|
|
|
+ if (!this.startTime.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
- title: "请选择第一个解析方法",
|
|
|
+ title: "请选择开始时间",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (this.owner_xh_b=='z') {
|
|
|
+ if (!this.endTime.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
- title: "请选择第二个解析方法",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.owner_xh_c=='z') {
|
|
|
- uni.showToast({
|
|
|
- title: "请选择第三个解析方法",
|
|
|
+ title: "请选择结束时间",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if(this.transfer_type=='NB'&&(this.type==2||this.type==5)){
|
|
|
+ if(this.repType==2||this.repType==3){
|
|
|
if (!this.deviceType) {
|
|
|
uni.showToast({
|
|
|
- title: "请选择水表NB设备类型",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.manufacturerName) {
|
|
|
- uni.showToast({
|
|
|
- title: "请选择水表NB厂商名称",
|
|
|
+ title: "请选择设备类型",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.model) {
|
|
|
+ if (!this.startTime.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
- title: "请选择水表NB设备型号",
|
|
|
+ title: "请输入开始时间",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.manufacturerId) {
|
|
|
+ if (!this.endTime.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
- title: "请选择水表NB厂商ID",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.location.replace(/^\s*/g,'')) {
|
|
|
- uni.showToast({
|
|
|
- title: "请输入水表NB地址",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.protocolType.replace(/^\s*/g,'')) {
|
|
|
- uni.showToast({
|
|
|
- title: "请输入水表NB协议",
|
|
|
+ title: "请输入结束时间",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- if(this.type==7&&this.transfer_type=='4G'){
|
|
|
- if (!this.max_level) {
|
|
|
- uni.showToast({
|
|
|
- title: "请选择最高层",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.min_level) {
|
|
|
- uni.showToast({
|
|
|
- title: "请选择最低层",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
+ if(this.repType==3&&this.deviceType){
|
|
|
|
|
|
-
|
|
|
- if (!this.owner_bl.replace(/^\s*/g,'')) {
|
|
|
+ if (this.deviceType==6) {
|
|
|
+ if (!this.portId.replace(/^\s*/g,'')) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请输入端口号",
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.portType) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请选择端口类型",
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.deviceNo) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请选择报备设备",
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!this.deviceNo) {
|
|
|
uni.showToast({
|
|
|
- title: "请输入倍率",
|
|
|
+ title: "请选择报备设备",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- let queryParam = {};
|
|
|
- queryParam.device_code = this.device_code;
|
|
|
- queryParam.device_name = this.device_name;
|
|
|
- queryParam.unitinfo = this.unitinfo;
|
|
|
- queryParam.louyu = this.louyu;
|
|
|
- queryParam.sim = this.sim;
|
|
|
|
|
|
- queryParam.company_code = this.company_code;
|
|
|
- queryParam.type = this.type;
|
|
|
- queryParam.transfer_type = this.transfer_type;
|
|
|
- queryParam.is_top = this.radioOne;
|
|
|
+
|
|
|
+ let queryParam = {};
|
|
|
+ if(this.id){
|
|
|
+ queryParam.id=this.id
|
|
|
+ }
|
|
|
+ queryParam.repType = this.repType;
|
|
|
+ queryParam.companyCode='10012';
|
|
|
+ queryParam.remark = this.remark;
|
|
|
+ queryParam.startTime = this.startTime;
|
|
|
+ queryParam.endTime = this.endTime;
|
|
|
|
|
|
- if (this.type==1&&this.transfer_type=="4G") {
|
|
|
- queryParam.owner_xh_a = this.owner_xh_a;
|
|
|
- queryParam.owner_xh_b = this.owner_xh_b;
|
|
|
- queryParam.owner_xh_c = this.owner_xh_c;
|
|
|
+ if (this.repType==1) {
|
|
|
this.addDevice(queryParam)
|
|
|
return;
|
|
|
}
|
|
|
- if (this.transfer_type=='NB'&&(this.type==2||this.type==5)) {
|
|
|
+ if (this.repType==2) {
|
|
|
queryParam.deviceType = this.deviceType;
|
|
|
- queryParam.manufacturerName = this.manufacturerName;
|
|
|
- queryParam.model = this.model;
|
|
|
- queryParam.location = this.location;
|
|
|
- queryParam.protocolType = this.protocolType;
|
|
|
- queryParam.manufacturerId = this.manufacturerId;
|
|
|
this.addDevice(queryParam)
|
|
|
return;
|
|
|
}
|
|
|
- if (this.type==7&&this.transfer_type=='4G') {
|
|
|
- queryParam.max_level = this.max_level;
|
|
|
- queryParam.min_level = this.min_level;
|
|
|
- queryParam.owner_bl = this.owner_bl;
|
|
|
+ if (this.repType==3) {
|
|
|
+ queryParam.deviceType = this.deviceType;
|
|
|
+ if(this.deviceType==6){
|
|
|
+ queryParam.portType = this.portType;
|
|
|
+ queryParam.portId = this.portId;
|
|
|
+ }
|
|
|
+ queryParam.deviceNo = this.deviceNo;
|
|
|
this.addDevice(queryParam)
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
this.addDevice(queryParam)
|
|
|
|
|
|
},
|