insatller fee

This commit is contained in:
morteza-mortezai
2025-11-26 09:37:16 +03:30
parent 1a98067f1a
commit 7b501107cf
11 changed files with 224 additions and 63 deletions
+106
View File
@@ -0,0 +1,106 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0"> تنظیم هزینه نصب </CBreadcrumb>
</CustomSubHeader>
<CRow>
<CCol xl="6">
<CCard>
<CCardHeader>
<slot name="header">
<i class="fas fa-filter"></i>
<b>فیلتر ها</b>
</slot>
</CCardHeader>
<CCardBody>
<CRow>
<CCol sm="12">
</CCol>
<CCol sm="12">
<el-divider></el-divider>
</CCol>
<CCol sm="12">
<el-form :model="form" :rules="rules" ref="form">
<el-form-item label="مبلغ نصب" prop="amount">
<el-input v-model="form.amount" placeholder="مبلغ"></el-input>
<span v-if="form.amount">{{ formatCurrency(form.amount) }}</span>
</el-form-item>
<el-form-item >
<el-button type="primary" @click="setFee">ثبت</el-button>
</el-form-item>
</el-form>
</CCol>
</CRow>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
export default {
name: 'AdminGpsWithdrawList',
layout: 'admin',
data() {
return {
form: {
amount: 0
},
rules: {
amount: [{ required: true, message: 'لطفا مبلغ را وارد کنید', trigger: 'blur' }]
}
}
},
methods: {
async setFee() {
try {
await this.$axios.post('/api/admin/gps/install-fee', this.form)
.then(res => {
this.$message({
type: 'success',
message: 'هزینه نصب با موفقیت ثبت شد'
})
this.$nuxt.refresh()
})
} catch (error) {
console.log(error)
}
},
async getFee() {
try {
await this.$axios.get('/api/admin/gps/install-fee')
.then(res => {
this.form.amount = res.data.amount
})
} catch (error) {
console.log(error)
}
},
formatCurrency(amount) {
const formatted= new Intl.NumberFormat('fa-IR').format(amount);
return `${formatted} تومان`;
}
},
mounted() {
this.getFee()
}
}
</script>
<style>
.unreadMsgInCv {
background: rgba(orange, 0.1) !important;
}
</style>
+3 -2
View File
@@ -65,6 +65,7 @@
<el-table-column label="مدل" width="150px">
<template slot-scope="scope">
{{ scope?.row?.deviceId?.model }}
{{ scope?.row?.deviceType }}
</template>
</el-table-column>
<el-table-column prop="IMEI" label=" IMEI" width="150px"> </el-table-column>
@@ -106,7 +107,7 @@
</el-table-column>
<el-table-column label="تایید" width="110" align="center">
<template slot-scope="scope">
<CButton
<!-- <CButton
v-if="scope?.row?.status == 0 || scope?.row?.status == 2"
:key="scope?.row?._id"
color="success"
@@ -114,7 +115,7 @@
@click="post(scope?.row?._id, 'accept')"
>
<i class="fa fa-check-square"></i>
</CButton>
</CButton> -->
<CButton
v-if="scope?.row?.status == 0 || scope?.row?.status == 1"
:key="scope?.row?._id"
+5
View File
@@ -143,6 +143,11 @@
<el-tag v-if="scope.row.status == 0" type="warning"> درانتظار</el-tag>
</template>
</el-table-column>
<el-table-column label="تاریخ درخواست" width="">
<template slot-scope="scope">
{{new Date(scope.row.created_at).toLocaleString('fa-IR') }}
</template>
</el-table-column>
<el-table-column label="بررسی" width="110" align="center">
<template slot-scope="scope">
<CButton :key="scope.row._id" color="info" variant="outline" @click="showDialog(scope.row)">