|
|
@@ -20,6 +20,7 @@ const state = reactive({
|
|
|
stationType: "1",
|
|
|
parkingFee: "",
|
|
|
parkingQrCode: "",
|
|
|
+ parkingCouponMinAmount: 6.0,
|
|
|
remark: "",
|
|
|
pictures: [] as string[],
|
|
|
stationLng: "",
|
|
|
@@ -41,6 +42,7 @@ const resetForm = () => {
|
|
|
stationType: "1",
|
|
|
parkingFee: "",
|
|
|
parkingQrCode: "",
|
|
|
+ parkingCouponMinAmount: 6.0,
|
|
|
remark: "",
|
|
|
pictures: [],
|
|
|
stationLng: "",
|
|
|
@@ -58,6 +60,7 @@ const open = async (type: "add" | "edit" | "view", row?: any) => {
|
|
|
try {
|
|
|
const res = await getStationDetail(row.id);
|
|
|
Object.assign(state.ruleForm, res);
|
|
|
+ state.ruleForm.parkingCouponMinAmount = (res.parkingCouponMinAmount || 600) / 100;
|
|
|
} catch (e) {
|
|
|
ElMessage.error("加载站点详情失败");
|
|
|
} finally {
|
|
|
@@ -79,11 +82,15 @@ const handleSubmit = async () => {
|
|
|
|
|
|
loading.value = true;
|
|
|
try {
|
|
|
+ const payload = {
|
|
|
+ ...state.ruleForm,
|
|
|
+ parkingCouponMinAmount: Math.round(state.ruleForm.parkingCouponMinAmount * 100)
|
|
|
+ };
|
|
|
if (dialogType.value === "add") {
|
|
|
- await addStation(state.ruleForm);
|
|
|
+ await addStation(payload);
|
|
|
ElMessage.success("新增成功");
|
|
|
} else {
|
|
|
- await modifyStation(state.ruleForm);
|
|
|
+ await modifyStation(payload);
|
|
|
ElMessage.success("修改成功");
|
|
|
}
|
|
|
handleClose();
|
|
|
@@ -135,6 +142,9 @@ defineExpose({ open });
|
|
|
<el-form-item label="站点类型" prop="stationType">
|
|
|
<ext-d-select v-model="state.ruleForm.stationType" type="Station.type" placeholder="请选择站点类型" />
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="停车券最低消费金额(元)" prop="parkingCouponMinAmount">
|
|
|
+ <el-input-number v-model="state.ruleForm.parkingCouponMinAmount" :min="0" :precision="2" placeholder="默认6元" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="停车减免规则" prop="parkingFee">
|
|
|
<el-input
|
|
|
v-model="state.ruleForm.parkingFee"
|