仪器管理 选项切换,数据重置

master
382696293@qq.com 2 years ago
parent 45a1cd5ed1
commit 83b3448e36

@ -73,6 +73,9 @@ public class WxInstrumentController extends BaseController {
|| wxInstrumentSaveReq.getExtraClockTimeRange().size() != 2) { || wxInstrumentSaveReq.getExtraClockTimeRange().size() != 2) {
throw new ServiceException("请输入额外打卡奖励或者选择额外打卡时间"); throw new ServiceException("请输入额外打卡奖励或者选择额外打卡时间");
} }
} else {
wxInstrumentSaveReq.setExtraClockCredit(null);
wxInstrumentSaveReq.setExtraClockTimeRange(null);
} }
// 仪器类型:IOT仪器 // 仪器类型:IOT仪器
@ -80,6 +83,8 @@ public class WxInstrumentController extends BaseController {
if (StringUtils.isBlank(wxInstrumentSaveReq.getModel())) { if (StringUtils.isBlank(wxInstrumentSaveReq.getModel())) {
throw new ServiceException("请选择仪器类型"); throw new ServiceException("请选择仪器类型");
} }
} else {
wxInstrumentSaveReq.setModel(null);
} }
// 支持购买 // 支持购买
@ -88,6 +93,9 @@ public class WxInstrumentController extends BaseController {
|| StringUtils.isBlank(wxInstrumentSaveReq.getShoppingPath())) { || StringUtils.isBlank(wxInstrumentSaveReq.getShoppingPath())) {
throw new ServiceException("请输入购买商城APPID和商城PATH"); throw new ServiceException("请输入购买商城APPID和商城PATH");
} }
} else {
wxInstrumentSaveReq.setShoppingAppid(null);
wxInstrumentSaveReq.setShoppingPath(null);
} }
WxInstrument wxInstrument = new WxInstrument(); WxInstrument wxInstrument = new WxInstrument();
BeanUtils.copyProperties(wxInstrumentSaveReq, wxInstrument); BeanUtils.copyProperties(wxInstrumentSaveReq, wxInstrument);

@ -295,7 +295,7 @@
</el-form-item> </el-form-item>
<el-form-item label="开启额外打卡奖励" prop="dailyClockCredit"> <el-form-item label="开启额外打卡奖励" prop="dailyClockCredit">
<el-switch v-model="form.isExtraClock" :active-value="1" :inactive-value="0" active-color="#13ce66" <el-switch v-model="form.isExtraClock" :active-value="1" :inactive-value="0" active-color="#13ce66"
inactive-color="#DCDCDC"> inactive-color="#DCDCDC" @change="isExtraClockChange">
</el-switch> </el-switch>
</el-form-item> </el-form-item>
<el-form-item v-if="form.isExtraClock == 1" label="额外打卡奖励积分" prop="extraClockCredit"> <el-form-item v-if="form.isExtraClock == 1" label="额外打卡奖励积分" prop="extraClockCredit">
@ -313,7 +313,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="仪器类型" prop="type"> <el-form-item label="仪器类型" prop="type">
<el-select v-model="form.type" style="width: 50%"> <el-select v-model="form.type" style="width: 50%" @change="typeChange">
<el-option label="非IOT仪器" :value="1"></el-option> <el-option label="非IOT仪器" :value="1"></el-option>
<el-option label="IOT仪器" :value="2"></el-option> <el-option label="IOT仪器" :value="2"></el-option>
</el-select> </el-select>
@ -363,7 +363,7 @@
</el-switch> </el-switch>
</el-form-item> </el-form-item>
<el-form-item label="是否支持购买" prop="isPurchase"> <el-form-item label="是否支持购买" prop="isPurchase">
<el-select v-model="form.isPurchase" style="width: 50%"> <el-select v-model="form.isPurchase" style="width: 50%" @change="isPurchaseChang">
<el-option label="是" :value="1"></el-option> <el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option> <el-option label="否" :value="0"></el-option>
</el-select> </el-select>
@ -900,6 +900,25 @@ export default {
this.$message.error('图片插入失败') this.$message.error('图片插入失败')
} }
}, },
/* 是否开启额外打卡奖励 */
isExtraClockChange() {
if (this.form.isExtraClock == 0) {
this.form.extraClockCredit = 0;
this.form.extraClockTimeRange = [];
}
},
/* 仪器类型切换 */
typeChange() {
if (this.form.type == 1) {
this.form.model = "WL200";
}
},
isPurchaseChang() {
if (this.form.isPurchase == 0) {
this.form.shoppingAppid = null;
this.form.shoppingPath = null;
}
}
} }
}; };
</script> </script>

Loading…
Cancel
Save