同步6/16
This commit is contained in:
@@ -19,17 +19,26 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="计算公式" prop="formula">
|
||||
<el-select v-model="form.formula">
|
||||
<el-select
|
||||
@change="
|
||||
(val) => {
|
||||
if (val === '2') {
|
||||
form.unit = null;
|
||||
}
|
||||
}
|
||||
"
|
||||
v-model="form.formula"
|
||||
>
|
||||
<el-option v-for="(item, index) in com_charge_item_formula" :key="index" :value="item.value" :label="item.label"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="计量单位" prop="unit">
|
||||
<el-form-item label="计量单位" prop="unit" v-if="form.formula !== '2'">
|
||||
<el-select v-model="form.unit">
|
||||
<el-option v-for="(item, index) in com_charge_item_unit" :key="index" :value="item.value" :label="item.label"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="费用单价" prop="fixedPrice">
|
||||
<el-input v-model.trim="form.fixedPrice" placeholder="请输入费用单价" />
|
||||
<el-input v-model.trim="form.fixedPrice" :placeholder="placeHolderFun(form.typeId)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计算精度" prop="accuracy">
|
||||
<el-select v-model="form.accuracy">
|
||||
@@ -41,16 +50,15 @@
|
||||
<el-option v-for="(item, index) in com_charge_item_carry_method" :key="index" :value="item.value" :label="item.label"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用/停用" prop="status">
|
||||
<!-- <el-form-item label="启用/停用" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio value="0" label="启用"></el-radio>
|
||||
<el-radio value="1" label="停用"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" :rows="5" v-model.trim="form.remark" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item style="margin-top: 30px">
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
<el-button @click="cancelForm">返回</el-button>
|
||||
@@ -119,6 +127,9 @@ if (route.query.id) {
|
||||
// !== 提交 =============================================================================
|
||||
// 提交
|
||||
const submitForm = () => {
|
||||
if (form.value.formula === '2') {
|
||||
form.value.unit = null;
|
||||
}
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (userid.value) {
|
||||
@@ -139,6 +150,12 @@ const submitForm = () => {
|
||||
const cancelForm = () => {
|
||||
router.back();
|
||||
};
|
||||
|
||||
// 车位费 物业费
|
||||
const typeNamelist = ref(['2049026520314445826']);
|
||||
function placeHolderFun(typeId: string) {
|
||||
return typeNamelist.value.includes(typeId) ? '请输入每日费用单价' : '请输入费用单价';
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -36,38 +36,39 @@
|
||||
<el-table v-loading="loading" border :data="chargeItemList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目名称" align="center" prop="itemName" />
|
||||
<el-table-column label="计费方式" align="center" prop="billingType">
|
||||
<el-table-column label="计费方式" width="100" align="center" prop="billingType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_charge_item_method" :value="scope.row.billingType"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计算公式" align="center" prop="formula">
|
||||
<el-table-column label="计算公式" width="100" align="center" prop="formula">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_charge_item_formula" :value="scope.row.formula"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" align="center" prop="fixedPrice">
|
||||
<el-table-column label="单价" width="100" align="center" prop="fixedPrice">
|
||||
<template #default="scope">
|
||||
{{ scope.row.price }}
|
||||
<dict-tag :options="com_charge_item_unit" :value="scope.row.fixedPrice"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计量单位" align="center" prop="unit">
|
||||
<el-table-column label="计量单位" width="100" align="center" prop="unit">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_charge_item_unit" :value="scope.row.unit"></dict-tag>
|
||||
<dict-tag v-if="scope.row.unit" :options="com_charge_item_unit" :value="scope.row.unit"></dict-tag>
|
||||
<span v-else>---</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计算精度" align="center" prop="accuracy">
|
||||
<el-table-column label="计算精度" width="120" align="center" prop="accuracy">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_charge_item_precision" :value="scope.row.accuracy"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进位方式" align="center" prop="carryMethod">
|
||||
<el-table-column label="进位方式" width="100" align="center" prop="carryMethod">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_charge_item_carry_method" :value="scope.row.carryMethod"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<el-table-column label="状态" width="100" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
@change="(val: string) => handleSwitch(val, scope.row)"
|
||||
@@ -77,6 +78,7 @@
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" show-overflow-tooltip align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['chargeItem:chargeItem:edit']">编辑</el-button>
|
||||
@@ -138,10 +140,14 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询收费项目管理列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listChargeItem(queryParams.value);
|
||||
chargeItemList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
listChargeItem(queryParams.value)
|
||||
.then((res) => {
|
||||
chargeItemList.value = res.rows;
|
||||
total.value = res.total;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
@@ -185,10 +191,11 @@ const handleAdd = () => {
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: ChargeItemVO) => {
|
||||
const _ids = row?.id || ids.value[0];
|
||||
router.push({
|
||||
path: '/sdb/editchargeItem',
|
||||
query: {
|
||||
id: row.id
|
||||
id: _ids
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user