|
@@ -82,19 +82,57 @@
|
|
</div>
|
|
</div>
|
|
<kNoData v-else></kNoData>
|
|
<kNoData v-else></kNoData>
|
|
<!-- </div> -->
|
|
<!-- </div> -->
|
|
- <!-- 机器销售额 -->
|
|
|
|
- <div class="outer9 flex-col justify-center">
|
|
|
|
- <div class="main24 flex-col justify-between">
|
|
|
|
- <div class="ImageText10 flex-col">
|
|
|
|
- <div class="wrap2 flex-row justify-between">
|
|
|
|
- <div class="outer10 flex-col"></div>
|
|
|
|
- <div class="TextGroup13 flex-col">
|
|
|
|
- <span class="txt13">{{ $t("home.machineSales") }}</span>
|
|
|
|
|
|
+
|
|
|
|
+ <div v-if="user.ifForeign === '1'">
|
|
|
|
+ <!-- 机器销售额 -->
|
|
|
|
+ <div class="outer9 flex-col justify-center">
|
|
|
|
+ <div class="main24 flex-col justify-between">
|
|
|
|
+ <div class="ImageText10 flex-col">
|
|
|
|
+ <div class="wrap2 flex-row justify-between">
|
|
|
|
+ <div class="outer10 flex-col"></div>
|
|
|
|
+ <div class="TextGroup13 flex-col">
|
|
|
|
+ <span class="txt13">{{ $t("home.machineSales") }}</span>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 各支付方式总额 -->
|
|
|
|
+ <van-list offset="100" :immediate-check="false">
|
|
|
|
+ <div v-for="item in combinedList" :key="item" class="o-pb-20">
|
|
|
|
+ <div>
|
|
|
|
+ <van-cell-group inset class="machineSaleBox">
|
|
|
|
+ <!-- 设备名称 -->
|
|
|
|
+ <div class="contentWord kBordBott">{{ item.machineName }}
|
|
|
|
+ </div>
|
|
|
|
+ <!-- <van-row class="layer5" justify="space-between">
|
|
|
|
+ <van-col span="12">总销售额: {{ item.totalSales }}</van-col>
|
|
|
|
+ <van-col span="12">总现金: {{ item.totalCash }}</van-col>
|
|
|
|
+ </van-row> -->
|
|
|
|
+ <van-row class="layer5" justify="space-between">
|
|
|
|
+ <!-- 硬币 -->
|
|
|
|
+ <van-col span="8">{{ $t("home.coins") }}: {{ item.coins }}</van-col>
|
|
|
|
+ <!-- 纸币 -->
|
|
|
|
+ <van-col span="8">{{ $t("home.bills") }}: {{ item.bills }}</van-col>
|
|
|
|
+ <!-- 硬币+纸币 -->
|
|
|
|
+ <van-col span="8">{{ $t("home.coinsBills") }}: {{ item.coinsBills }}</van-col>
|
|
|
|
+ <!-- 信用卡 -->
|
|
|
|
+ <van-col span="8">{{ $t("home.creditCard") }}: {{ item.creditCard }}</van-col>
|
|
|
|
+ <!-- 电子支付 -->
|
|
|
|
+ <van-col span="8">{{ $t("home.electronicPayment") }}: {{ item.electronicPayment }}</van-col>
|
|
|
|
+ </van-row>
|
|
|
|
+ </van-cell-group>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </van-list>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-else style="text-align: center;">
|
|
|
|
+ <div><br><br></div>
|
|
|
|
+ {{ $t("home.migrationInstructions") }}
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<!-- 通知弹窗 -->
|
|
<!-- 通知弹窗 -->
|
|
@@ -146,7 +184,6 @@ import kNoData from "../../components/commom/kNoData/index.vue";
|
|
import kDialog from "../../components/commom/kDialog/index.vue";
|
|
import kDialog from "../../components/commom/kDialog/index.vue";
|
|
import { onMounted, ref, nextTick } from "vue";
|
|
import { onMounted, ref, nextTick } from "vue";
|
|
import sHeader from "../../components/SimpleHeader";
|
|
import sHeader from "../../components/SimpleHeader";
|
|
-// import navBar from "../../components/NavBar";
|
|
|
|
import dateSelectList from "../../components/dateSelectList";
|
|
import dateSelectList from "../../components/dateSelectList";
|
|
import typeSelectList from "../../components/typeSelectList";
|
|
import typeSelectList from "../../components/typeSelectList";
|
|
import { getLoginUser, $M_Menus, Format_time, styleUrl } from "../../common/js/utils";
|
|
import { getLoginUser, $M_Menus, Format_time, styleUrl } from "../../common/js/utils";
|
|
@@ -157,10 +194,11 @@ import {
|
|
Api_postMachineNum,
|
|
Api_postMachineNum,
|
|
Api_getUpdateNotice,
|
|
Api_getUpdateNotice,
|
|
getIsAlarm,
|
|
getIsAlarm,
|
|
|
|
+ Api_getEquipmentPageStatistics,
|
|
} from "../../service/home";
|
|
} from "../../service/home";
|
|
import dateUtil from "../../utils/dateUtil";
|
|
import dateUtil from "../../utils/dateUtil";
|
|
import { useI18n } from "vue-i18n";
|
|
import { useI18n } from "vue-i18n";
|
|
-import { showToast } from "vant";
|
|
|
|
|
|
+import { showFailToast, showToast } from "vant";
|
|
import RobotIcon from '@/assets/home/robot.png';
|
|
import RobotIcon from '@/assets/home/robot.png';
|
|
import { getLocal, setLocal, navigatorLanguage } from "@/common/js/utils";
|
|
import { getLocal, setLocal, navigatorLanguage } from "@/common/js/utils";
|
|
|
|
|
|
@@ -243,11 +281,13 @@ export default {
|
|
const update = (uDate) => {
|
|
const update = (uDate) => {
|
|
dateSelect.value = uDate;
|
|
dateSelect.value = uDate;
|
|
getStatisticsFun();
|
|
getStatisticsFun();
|
|
|
|
+ getMachineNameListFunc()
|
|
};
|
|
};
|
|
let typeSelectData = {};
|
|
let typeSelectData = {};
|
|
const upselectdata = (uSData) => {
|
|
const upselectdata = (uSData) => {
|
|
typeSelectData = uSData;
|
|
typeSelectData = uSData;
|
|
getStatisticsFun();
|
|
getStatisticsFun();
|
|
|
|
+ getMachineNameListFunc()
|
|
};
|
|
};
|
|
const salesVolume = ref(0);
|
|
const salesVolume = ref(0);
|
|
const salesNumber = ref(0);
|
|
const salesNumber = ref(0);
|
|
@@ -461,8 +501,89 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
getTitleFunc();
|
|
getTitleFunc();
|
|
|
|
+
|
|
|
|
+ if (user) {
|
|
|
|
+ getMachineNameListFunc();
|
|
|
|
+ }
|
|
|
|
+
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ const finished = ref(false);
|
|
|
|
+ const loading = ref(true);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 设备销售数据
|
|
|
|
+ const combinedList = ref([]); // 设备销额集合
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const getMachineNameListFunc = async () => {
|
|
|
|
+
|
|
|
|
+ combinedList.value = [];
|
|
|
|
+ const searchParams = {
|
|
|
|
+ adminId: user.id,
|
|
|
|
+ ...dateSelect.value,
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ const { data } = await Api_getEquipmentPageStatistics(Object.assign({}, searchParams));
|
|
|
|
+ if (data.code === "00000" && data.data) {
|
|
|
|
+
|
|
|
|
+ for (let i = 0; i < data.data.categories.length; i++) {
|
|
|
|
+ const machineNameVal = data.data.categories[i]; // 设备名称
|
|
|
|
+ const coinsVal = data.data.series[0].data[i]; // 硬币销额
|
|
|
|
+ const billsVal = data.data.series[1].data[i]; // 纸币销额
|
|
|
|
+ const coinsBillsVal = data.data.series[2].data[i]; // 硬币+纸币销额
|
|
|
|
+ const creditCardVal = data.data.series[3].data[i]; // 信用卡销额
|
|
|
|
+ const electronicPaymentVal = data.data.series[4].data[i]; // 电子支付销额
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const machineSalesData = {
|
|
|
|
+ // totalSales: totalSalesVal,
|
|
|
|
+ // totalCash: totalCashVal,
|
|
|
|
+ machineName: machineNameVal,
|
|
|
|
+ coins: coinsVal,
|
|
|
|
+ bills: billsVal,
|
|
|
|
+ coinsBills: coinsBillsVal,
|
|
|
|
+ creditCard: creditCardVal,
|
|
|
|
+ electronicPayment: electronicPaymentVal
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ combinedList.value.push(machineSalesData);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // data.data.categories.forEach((item) => {
|
|
|
|
+ // machineName.value = item.value
|
|
|
|
+ // })
|
|
|
|
+ // coins.value = 0;
|
|
|
|
+ // bills.value = 0;
|
|
|
|
+ // coinsBills.value = 0;
|
|
|
|
+ // creditCard.value = 0;
|
|
|
|
+ // electronicPayment.value = 0;
|
|
|
|
+ // data.data.series[0].data.forEach((item) => {
|
|
|
|
+ // coins.value = parseInt(coins.value + item);
|
|
|
|
+ // });
|
|
|
|
+ // console.log("coins.value >>>", coins.value);
|
|
|
|
+ // data.data.series[1].data.forEach((item) => {
|
|
|
|
+ // bills.value = parseInt(bills.value + item);
|
|
|
|
+ // });
|
|
|
|
+ // data.data.series[2].data.forEach((item) => {
|
|
|
|
+ // coinsBills.value = parseInt(coinsBills.value + item);
|
|
|
|
+ // });
|
|
|
|
+ // data.data.series[3].data.forEach((item) => {
|
|
|
|
+ // creditCard.value = parseInt(creditCard.value + item);
|
|
|
|
+ // });
|
|
|
|
+ // data.data.series[4].data.forEach((item) => {
|
|
|
|
+ // electronicPayment.value = parseInt(electronicPayment.value + item);
|
|
|
|
+ // });
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ showFailToast(data.message);
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error("Error", error)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
const getTitleFunc = async () => {
|
|
const getTitleFunc = async () => {
|
|
const currentDomain = window.location.href;
|
|
const currentDomain = window.location.href;
|
|
// const currentDomain = window.location.hostname;
|
|
// const currentDomain = window.location.hostname;
|
|
@@ -686,6 +807,7 @@ export default {
|
|
// };
|
|
// };
|
|
|
|
|
|
return {
|
|
return {
|
|
|
|
+ user,
|
|
userName,
|
|
userName,
|
|
update,
|
|
update,
|
|
upselectdata,
|
|
upselectdata,
|
|
@@ -724,6 +846,15 @@ export default {
|
|
offset,
|
|
offset,
|
|
isShowRobot,
|
|
isShowRobot,
|
|
sysTitle,
|
|
sysTitle,
|
|
|
|
+ finished,
|
|
|
|
+ loading,
|
|
|
|
+ // machineName,
|
|
|
|
+ // coins,
|
|
|
|
+ // bills,
|
|
|
|
+ // coinsBills,
|
|
|
|
+ // creditCard,
|
|
|
|
+ // electronicPayment,
|
|
|
|
+ combinedList
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
|