fix bug
This commit is contained in:
@@ -52,7 +52,9 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<a-form-item label="实付款金额" name="payPrice">
|
<a-form-item label="实付款金额" name="payPrice">
|
||||||
<span class="ele-text-warning">¥{{ formatNumber(data.payPrice) }}</span>
|
<span class="ele-text-warning"
|
||||||
|
>¥{{ formatNumber(data.payPrice) }}</span
|
||||||
|
>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col
|
<a-col
|
||||||
@@ -63,7 +65,7 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<a-form-item label="支付方式" name="payMethod">
|
<a-form-item label="支付方式" name="payMethod">
|
||||||
<Tag dict-code="payMethod" v-model:value="data.payMethod"/>
|
<Tag dict-code="payMethod" v-model:value="data.payMethod" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col
|
<a-col
|
||||||
@@ -74,7 +76,7 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<a-form-item label="配送方式" name="deliveryType">
|
<a-form-item label="配送方式" name="deliveryType">
|
||||||
<Tag dict-code="deliveryType" v-model:value="data.deliveryType"/>
|
<Tag dict-code="deliveryType" v-model:value="data.deliveryType" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col
|
<a-col
|
||||||
@@ -96,7 +98,7 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<a-form-item label="订单状态" name="orderStatus">
|
<a-form-item label="订单状态" name="orderStatus">
|
||||||
<Tag dict-code="orderStatus" v-model:value="data.orderStatus"/>
|
<Tag dict-code="orderStatus" v-model:value="data.orderStatus" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col
|
<a-col
|
||||||
@@ -213,22 +215,18 @@
|
|||||||
v-if="Number(record.equipmentCategory) === 10"
|
v-if="Number(record.equipmentCategory) === 10"
|
||||||
color="success"
|
color="success"
|
||||||
>销售
|
>销售
|
||||||
</a-tag
|
</a-tag>
|
||||||
>
|
|
||||||
<a-tag v-if="Number(record.equipmentCategory) === 20" color="red"
|
<a-tag v-if="Number(record.equipmentCategory) === 20" color="red"
|
||||||
>分期
|
>分期
|
||||||
</a-tag
|
</a-tag>
|
||||||
>
|
|
||||||
<a-tag
|
<a-tag
|
||||||
v-if="Number(record.equipmentCategory) === 30"
|
v-if="Number(record.equipmentCategory) === 30"
|
||||||
color="orange"
|
color="orange"
|
||||||
>以租代购
|
>以租代购
|
||||||
</a-tag
|
</a-tag>
|
||||||
>
|
|
||||||
<a-tag v-if="Number(record.equipmentCategory) === 40" color="blue"
|
<a-tag v-if="Number(record.equipmentCategory) === 40" color="blue"
|
||||||
>租赁
|
>租赁
|
||||||
</a-tag
|
</a-tag>
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'more'">
|
<template v-if="column.key === 'more'">
|
||||||
<div v-if="record.periodsType > 0">
|
<div v-if="record.periodsType > 0">
|
||||||
@@ -258,13 +256,11 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
<a-card title="换电记录" class="order-card">
|
<a-card title="换电记录" class="order-card">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
|
|
||||||
<a-table
|
<a-table
|
||||||
:data-source="EquipmentRecordList"
|
:data-source="EquipmentRecordList"
|
||||||
:columns="columns3"
|
:columns="columns3"
|
||||||
:pagination="true"
|
:pagination="true"
|
||||||
>
|
>
|
||||||
|
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'batteryModel'">
|
<template v-if="column.key === 'batteryModel'">
|
||||||
<div>电池租金:¥{{ record.batteryRent }}</div>
|
<div>电池租金:¥{{ record.batteryRent }}</div>
|
||||||
@@ -276,9 +272,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.key === 'duration'">
|
<template v-if="column.key === 'duration'">
|
||||||
<span class="ele-text-danger">{{ countDuration (record)}}</span>
|
<span class="ele-text-danger">{{ countDuration(record) }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
@@ -292,10 +287,15 @@
|
|||||||
:pagination="true"
|
:pagination="true"
|
||||||
>
|
>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'orderNo'">
|
||||||
|
<span :class="[record.isAdminRenew === 1 ? 'ele-text-primary' : '']">{{ record.orderNo }}</span>
|
||||||
|
</template>
|
||||||
<template v-if="column.key === 'batteryModel'">
|
<template v-if="column.key === 'batteryModel'">
|
||||||
|
<div :class="[record.isAdminRenew === 1 ? 'ele-text-primary' : '']">
|
||||||
<div>电池租金:¥{{ record.batteryRent }}</div>
|
<div>电池租金:¥{{ record.batteryRent }}</div>
|
||||||
<div>电池押金:¥{{ record.batteryDeposit }}</div>
|
<div>电池押金:¥{{ record.batteryDeposit }}</div>
|
||||||
<div>电池保险:¥{{ record.batteryInsurance }}</div>
|
<div>电池保险:¥{{ record.batteryInsurance }}</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'expirationTime'">
|
<template v-if="column.key === 'expirationTime'">
|
||||||
<div>{{ record.startTime }}</div>
|
<div>{{ record.startTime }}</div>
|
||||||
@@ -306,28 +306,28 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
|
<view>
|
||||||
<view >
|
<a-button @click="openOrderOnline(record)"
|
||||||
<a-button
|
>续费该设备
|
||||||
@click="openOrderOnline(record)"
|
</a-button>
|
||||||
>续费该设备</a-button>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.key === 'currPeriods'">
|
<template v-if="column.key === 'currPeriods'">
|
||||||
<view v-if="record.orderSource === 10" >
|
<view v-if="record.orderSource === 10">
|
||||||
<span>一次性购买</span>
|
<span>一次性购买</span>
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view
|
||||||
|
v-else
|
||||||
|
:class="[record.isAdminRenew === 1 ? 'ele-text-primary' : '']"
|
||||||
|
>
|
||||||
<span>第{{ record.currPeriods }}期</span>
|
<span>第{{ record.currPeriods }}期</span>
|
||||||
<view v-if="record.isAdminRenew === 1">
|
<view v-if="record.isAdminRenew === 1">
|
||||||
<span> (后台续费)</span>
|
<span> (后台续费)</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</a-table>
|
</a-table>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</a-card>
|
</a-card>
|
||||||
@@ -388,7 +388,6 @@
|
|||||||
<span>{{ data.address }}</span>
|
<span>{{ data.address }}</span>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col
|
<a-col
|
||||||
@@ -431,63 +430,65 @@
|
|||||||
:data="current"
|
:data="current"
|
||||||
@done="getRenewOrder"
|
@done="getRenewOrder"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</ele-modal>
|
</ele-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {ref, reactive, watch} from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import {Form} from 'ant-design-vue';
|
import { Form } from 'ant-design-vue';
|
||||||
import {assignObject, EleProTable, timeAgo} from 'ele-admin-pro';
|
import { assignObject, EleProTable, timeAgo } from 'ele-admin-pro';
|
||||||
import {useThemeStore} from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import {formatNumber} from 'ele-admin-pro/es';
|
import { formatNumber } from 'ele-admin-pro/es';
|
||||||
import {storeToRefs} from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import {copyText} from '@/utils/common';
|
import { copyText } from '@/utils/common';
|
||||||
import {Order} from '@/api/order/model';
|
import { Order } from '@/api/order/model';
|
||||||
import OrderXufei from '../components/order-xufei.vue';
|
import OrderXufei from '../components/order-xufei.vue';
|
||||||
import {listEquipmentOrderGoods} from '@/api/apps/equipment/order/goods';
|
import { listEquipmentOrderGoods } from '@/api/apps/equipment/order/goods';
|
||||||
import {EquipmentOrderGoods} from '@/api/apps/equipment/order/goods/model';
|
import { EquipmentOrderGoods } from '@/api/apps/equipment/order/goods/model';
|
||||||
import * as EquipmentApi from '@/api/apps/equipment';
|
import * as EquipmentApi from '@/api/apps/equipment';
|
||||||
import * as EquipmentRecordApi from '@/api/apps/equipment/record';
|
import * as EquipmentRecordApi from '@/api/apps/equipment/record';
|
||||||
import {ColumnItem, DatasourceFunction} from 'ele-admin-pro/es/ele-pro-table/types';
|
import {
|
||||||
import {listOrder, listOrderPay} from '@/api/order';
|
ColumnItem,
|
||||||
import {CopyOutlined} from '@ant-design/icons-vue';
|
DatasourceFunction
|
||||||
import {EquipmentRecord} from '@/api/apps/equipment/record/model';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import { listOrder, listOrderPay } from '@/api/order';
|
||||||
|
import { CopyOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { EquipmentRecord } from '@/api/apps/equipment/record/model';
|
||||||
|
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
// 是否开启响应式布局
|
// 是否开启响应式布局
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
const {styleResponsive} = storeToRefs(themeStore);
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
const showOrderXufei = ref(false);
|
const showOrderXufei = ref(false);
|
||||||
// 当前编辑数据
|
// 当前编辑数据
|
||||||
const current = ref<Order | null>(null);
|
const current = ref<Order | null>(null);
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
// 弹窗是否打开
|
// 弹窗是否打开
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
// 修改回显的数据
|
// 修改回显的数据
|
||||||
data?: Order | null;
|
data?: Order | null;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
export interface step {
|
export interface step {
|
||||||
title?: String | undefined;
|
title?: String | undefined;
|
||||||
subTitle?: String | undefined;
|
subTitle?: String | undefined;
|
||||||
description?: String | undefined;
|
description?: String | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
// 是否显示最大化切换按钮
|
// 是否显示最大化切换按钮
|
||||||
const maxAble = ref(true);
|
const maxAble = ref(true);
|
||||||
const EquipmentOrderGoodsList = ref<EquipmentOrderGoods[]>([]);
|
const EquipmentOrderGoodsList = ref<EquipmentOrderGoods[]>([]);
|
||||||
const renewOrderList = ref<Order[]>([]);
|
const renewOrderList = ref<Order[]>([]);
|
||||||
const EquipmentRecordList = ref<EquipmentRecord[]>([]);
|
const EquipmentRecordList = ref<EquipmentRecord[]>([]);
|
||||||
const bindEquipmentCode = ref<string>();
|
const bindEquipmentCode = ref<string>();
|
||||||
|
|
||||||
const files = ref<any[]>();
|
const files = ref<any[]>();
|
||||||
|
|
||||||
// 步骤条
|
// 步骤条
|
||||||
const steps = ref<step[]>([
|
const steps = ref<step[]>([
|
||||||
{
|
{
|
||||||
title: '下单',
|
title: '下单',
|
||||||
description: undefined
|
description: undefined
|
||||||
@@ -508,33 +509,33 @@ const steps = ref<step[]>([
|
|||||||
title: '完成',
|
title: '完成',
|
||||||
description: undefined
|
description: undefined
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
const active = ref(2);
|
const active = ref(2);
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'done'): void;
|
(e: 'done'): void;
|
||||||
(e: 'update:visible', visible: boolean): void;
|
(e: 'update:visible', visible: boolean): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// 订单信息
|
// 订单信息
|
||||||
const order = reactive<Order>({
|
const order = reactive<Order>({
|
||||||
orderId: undefined,
|
orderId: undefined,
|
||||||
orderNo: '',
|
orderNo: '',
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
orderSourceData: ''
|
orderSourceData: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
// 请求状态
|
// 请求状态
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
|
||||||
const {resetFields} = useForm(order);
|
const { resetFields } = useForm(order);
|
||||||
|
|
||||||
/* 更新visible */
|
/* 更新visible */
|
||||||
const updateVisible = (value: boolean) => {
|
const updateVisible = (value: boolean) => {
|
||||||
emit('update:visible', value);
|
emit('update:visible', value);
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns = ref<ColumnItem[]>([
|
const columns = ref<ColumnItem[]>([
|
||||||
// {
|
// {
|
||||||
// title: '商品ID',
|
// title: '商品ID',
|
||||||
// dataIndex: 'goodsId'
|
// dataIndex: 'goodsId'
|
||||||
@@ -558,13 +559,13 @@ const columns = ref<ColumnItem[]>([
|
|||||||
title: '电池价格',
|
title: '电池价格',
|
||||||
dataIndex: 'batteryPrice',
|
dataIndex: 'batteryPrice',
|
||||||
key: 'batteryPrice',
|
key: 'batteryPrice',
|
||||||
customRender: ({text}) => '¥' + text
|
customRender: ({ text }) => '¥' + text
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '电池租金',
|
title: '电池租金',
|
||||||
dataIndex: 'batteryRent',
|
dataIndex: 'batteryRent',
|
||||||
key: 'batteryRent',
|
key: 'batteryRent',
|
||||||
customRender: ({text}) => '¥' + text
|
customRender: ({ text }) => '¥' + text
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '分期方案',
|
title: '分期方案',
|
||||||
@@ -577,11 +578,11 @@ const columns = ref<ColumnItem[]>([
|
|||||||
key: 'num',
|
key: 'num',
|
||||||
customRender: ({}) => 1
|
customRender: ({}) => 1
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef2 = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef2 = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
const columns2 = ref<ColumnItem[]>([
|
const columns2 = ref<ColumnItem[]>([
|
||||||
{
|
{
|
||||||
title: '当前期数',
|
title: '当前期数',
|
||||||
dataIndex: 'currPeriods',
|
dataIndex: 'currPeriods',
|
||||||
@@ -612,7 +613,7 @@ const columns2 = ref<ColumnItem[]>([
|
|||||||
title: '订单金额',
|
title: '订单金额',
|
||||||
dataIndex: 'orderPrice',
|
dataIndex: 'orderPrice',
|
||||||
key: 'orderPrice',
|
key: 'orderPrice',
|
||||||
customRender: ({text}) => '¥' + text
|
customRender: ({ text }) => '¥' + text
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '设备租金',
|
title: '设备租金',
|
||||||
@@ -641,9 +642,9 @@ const columns2 = ref<ColumnItem[]>([
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
hideInSetting: true
|
hideInSetting: true
|
||||||
},
|
}
|
||||||
]);
|
]);
|
||||||
const columns3 = ref<ColumnItem[]>([
|
const columns3 = ref<ColumnItem[]>([
|
||||||
{
|
{
|
||||||
title: '设备编号',
|
title: '设备编号',
|
||||||
dataIndex: 'equipmentCode',
|
dataIndex: 'equipmentCode',
|
||||||
@@ -662,7 +663,7 @@ const columns3 = ref<ColumnItem[]>([
|
|||||||
{
|
{
|
||||||
title: '使用电池',
|
title: '使用电池',
|
||||||
dataIndex: 'duration',
|
dataIndex: 'duration',
|
||||||
key:'duration'
|
key: 'duration'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作人',
|
title: '操作人',
|
||||||
@@ -674,10 +675,10 @@ const columns3 = ref<ColumnItem[]>([
|
|||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
key: 'createTime'
|
key: 'createTime'
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/* 制作步骤条 */
|
/* 制作步骤条 */
|
||||||
const loadSteps = (order) => {
|
const loadSteps = (order) => {
|
||||||
steps.value = [];
|
steps.value = [];
|
||||||
steps.value.push({
|
steps.value.push({
|
||||||
title: '下单'
|
title: '下单'
|
||||||
@@ -733,32 +734,31 @@ const loadSteps = (order) => {
|
|||||||
if (order.orderStatus == 20) {
|
if (order.orderStatus == 20) {
|
||||||
active.value = 4;
|
active.value = 4;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getEquipmentOrderGoods = () => {
|
const getEquipmentOrderGoods = () => {
|
||||||
const orderId = props.data?.orderId;
|
const orderId = props.data?.orderId;
|
||||||
const goodsId = props.data?.goodsId;
|
const goodsId = props.data?.goodsId;
|
||||||
listEquipmentOrderGoods({orderId, goodsId}).then((data) => {
|
listEquipmentOrderGoods({ orderId, goodsId }).then((data) => {
|
||||||
EquipmentOrderGoodsList.value = data;
|
EquipmentOrderGoodsList.value = data;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* 线下缴费 */
|
||||||
/* 线下缴费 */
|
const openOrderOnline = (row?: Order) => {
|
||||||
const openOrderOnline = (row?: Order) => {
|
|
||||||
current.value = row ?? null;
|
current.value = row ?? null;
|
||||||
showOrderXufei.value = true;
|
showOrderXufei.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getEquipment = () => {
|
const getEquipment = () => {
|
||||||
EquipmentApi.listEquipment({orderId: order.orderId}).then((data) => {
|
EquipmentApi.listEquipment({ orderId: order.orderId }).then((data) => {
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
bindEquipmentCode.value = data[0].equipmentCode;
|
bindEquipmentCode.value = data[0].equipmentCode;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getRenewOrder = () => {
|
const getRenewOrder = () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
console.log(order);
|
console.log(order);
|
||||||
if (order.orderId > 28798) {
|
if (order.orderId > 28798) {
|
||||||
@@ -780,64 +780,64 @@ const getRenewOrder = () => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
};
|
const getEquipmentRecordList = () => {
|
||||||
|
|
||||||
const getEquipmentRecordList = () => {
|
|
||||||
EquipmentRecordApi.pageEquipmentRecord({
|
EquipmentRecordApi.pageEquipmentRecord({
|
||||||
orderId: order.orderId,
|
orderId: order.orderId,
|
||||||
userId: order.userId
|
userId: order.userId
|
||||||
}).then((data) => {
|
}).then((data) => {
|
||||||
EquipmentRecordList.value = data.list;
|
EquipmentRecordList.value = data.list;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
// const datasource3: DatasourceFunction = ({
|
// const datasource3: DatasourceFunction = ({
|
||||||
// page,
|
// page,
|
||||||
// limit,
|
// limit,
|
||||||
// where,
|
// where,
|
||||||
// orders
|
// orders
|
||||||
// }) => {
|
// }) => {
|
||||||
// where.orderId = order.orderId
|
// where.orderId = order.orderId
|
||||||
// where.userId = order.userId
|
// where.userId = order.userId
|
||||||
// return EquipmentRecordApi.pageEquipmentRecord({
|
// return EquipmentRecordApi.pageEquipmentRecord({
|
||||||
// ...where,
|
// ...where,
|
||||||
// ...orders,
|
// ...orders,
|
||||||
// page,
|
// page,
|
||||||
// limit
|
// limit
|
||||||
// });
|
// });
|
||||||
// };
|
// };
|
||||||
|
|
||||||
const expirationDay = (order) => {
|
const expirationDay = (order) => {
|
||||||
const setTime = new Date(order.expirationTime);
|
const setTime = new Date(order.expirationTime);
|
||||||
const nowTime = new Date();
|
const nowTime = new Date();
|
||||||
const restSec = setTime.getTime() - nowTime.getTime();
|
const restSec = setTime.getTime() - nowTime.getTime();
|
||||||
console.log("计算剩余天数");
|
console.log('计算剩余天数');
|
||||||
console.log(restSec);
|
console.log(restSec);
|
||||||
// 剩余天数
|
// 剩余天数
|
||||||
const day = parseInt(String(restSec / (60 * 60 * 24 * 1000)));
|
const day = parseInt(String(restSec / (60 * 60 * 24 * 1000)));
|
||||||
if (day < 0) {
|
if (day < 0) {
|
||||||
return '逾期' + Math.abs(day) + '天';
|
return '逾期' + Math.abs(day) + '天';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const countDuration = (equipmentRecord) =>{//计算使用时间
|
const countDuration = (equipmentRecord) => {
|
||||||
if (equipmentRecord.eventType ==="电池解绑"){
|
//计算使用时间
|
||||||
if (equipmentRecord.duration !== null){
|
if (equipmentRecord.eventType === '电池解绑') {
|
||||||
return equipmentRecord.duration+'天'
|
if (equipmentRecord.duration !== null) {
|
||||||
|
return equipmentRecord.duration + '天';
|
||||||
}
|
}
|
||||||
return '0天'
|
return '0天';
|
||||||
|
} else {
|
||||||
|
if (equipmentRecord.duration !== null) {
|
||||||
|
return equipmentRecord.duration + '天';
|
||||||
} else {
|
} else {
|
||||||
if (equipmentRecord.duration !== null){
|
|
||||||
return equipmentRecord.duration+'天';
|
|
||||||
}else {
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
const getFiles = () => {
|
const getFiles = () => {
|
||||||
if (order.orderSourceData != '') {
|
if (order.orderSourceData != '') {
|
||||||
const array = JSON.parse(<string>order.orderSourceData);
|
const array = JSON.parse(<string>order.orderSourceData);
|
||||||
files.value = array.map((url, id) => {
|
files.value = array.map((url, id) => {
|
||||||
@@ -848,13 +848,12 @@ const getFiles = () => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 保存编辑 */
|
/* 保存编辑 */
|
||||||
const save = () => {
|
const save = () => {};
|
||||||
};
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
(visible) => {
|
(visible) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
@@ -872,14 +871,14 @@ watch(
|
|||||||
resetFields();
|
resetFields();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.order-card {
|
.order-card {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-form-item {
|
.ant-form-item {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user