From e6847080408955a099979e25cddd4ed1744a5858 Mon Sep 17 00:00:00 2001
From: 周宾 <2802492122@qq.com>
Date: 星期一, 22 十二月 2025 15:43:26 +0800
Subject: [PATCH] 海川开心-本地推送
---
src/pages/index.vue | 2252 ++++++++++++++++++++++---------------------
src/api/login.js | 9
src/pages.json | 4
src/pages/inspectionUpload/index.vue | 728 ++++++-------
src/manifest.json | 17
5 files changed, 1,546 insertions(+), 1,464 deletions(-)
diff --git a/src/api/login.js b/src/api/login.js
index acf6978..12d9518 100644
--- a/src/api/login.js
+++ b/src/api/login.js
@@ -40,4 +40,13 @@
method: 'get',
params: params
})
+}
+
+// 鑾峰彇鏈繃鏈熷叕鍛婃暟閲�
+export function noticesCount(params) {
+ return request({
+ url: '/home/noticesCount',
+ method: 'get',
+ params: params
+ })
}
\ No newline at end of file
diff --git a/src/manifest.json b/src/manifest.json
index c412774..e75dcee 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -1,6 +1,6 @@
{
"name" : "淇℃伅绠$悊",
- "appid" : "__UNI__D950DA4",
+ "appid" : "__UNI__E1C100D",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@@ -19,7 +19,8 @@
/* 妯″潡閰嶇疆 */
"modules" : {
"Camera" : {},
- "Barcode" : {}
+ "Barcode" : {},
+ "Push" : {}
},
/* 搴旂敤鍙戝竷淇℃伅 */
"distribute" : {
@@ -48,7 +49,17 @@
"dSYMs" : false
},
/* SDK閰嶇疆 */
- "sdkConfigs" : {},
+ "sdkConfigs" : {
+ "push" : {
+ "unipush" : {
+ "icons" : {
+ "small" : {
+ "ldpi" : "D:/xindao/wenjian/img/logo/app.png"
+ }
+ }
+ }
+ }
+ },
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
diff --git a/src/pages.json b/src/pages.json
index 68210cf..7df8341 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -411,7 +411,9 @@
"path": "pages/inspectionUpload/index",
"style": {
"navigationBarTitleText": "宸℃涓婁紶",
- "navigationStyle": "custom"
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": true, // 寮�鍚笅鎷夊埛鏂�
+ "backgroundColor": "#f8f8f8" // 涓嬫媺鍒锋柊鏃剁殑鑳屾櫙鑹�
}
},
{
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 9fc49a0..8f96f6f 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -2,12 +2,12 @@
<view class="content">
<view class="header-section">
<view class="currentFactory">
- <up-text type="primary" :text="userStore.currentFactoryName" @click="show = true" size="18"
- class="factoryName" suffixIcon="arrow-right" :iconStyle="iconStyle"></up-text>
+ <up-text type="primary" :text="userStore.currentFactoryName" @click="show = true" size="18" class="factoryName"
+ suffixIcon="arrow-right" :iconStyle="iconStyle"></up-text>
</view>
<up-picker :show="show" :columns="factoryList" @confirm="changeFactory" @cancel="show = false"></up-picker>
</view>
-
+
<view class="hero-section">
<view class="bg-img">
<view class="hero-content">
@@ -16,7 +16,7 @@
<view class="hero-wave"></view>
</view>
</view>
-
+
<!-- <view class="notice-section">-->
<!-- <view class="notice">-->
<!-- <view class="notice-content">-->
@@ -31,7 +31,7 @@
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
-
+
<!-- 钀ラ攢绠$悊妯″潡 -->
<view class="common-module marketing-module">
<view class="module-header">
@@ -40,28 +40,17 @@
</view>
</view>
<view class="module-content">
- <up-grid
- :border="false"
- col="4"
- >
- <up-grid-item
- v-for="(item, index) in marketingItems"
- :key="index"
- @click="handleCommonItemClick(item)"
- >
+ <up-grid :border="false" col="4">
+ <up-grid-item v-for="(item, index) in marketingItems" :key="index" @click="handleCommonItemClick(item)">
<view class="icon-container" :style="{ background: item.bgColor }">
- <up-icon
- :name="item.icon"
- :size="58"
- color="#ffffff"
- ></up-icon>
+ <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
</up-grid>
</view>
</view>
-
+
<!-- 閲囪喘绠$悊妯″潡 -->
<view class="common-module purchase-module">
<view class="module-header">
@@ -70,28 +59,17 @@
</view>
</view>
<view class="module-content">
- <up-grid
- :border="false"
- col="4"
- >
- <up-grid-item
- v-for="(item, index) in purchaseItems"
- :key="index"
- @click="handleCommonItemClick(item)"
- >
+ <up-grid :border="false" col="4">
+ <up-grid-item v-for="(item, index) in purchaseItems" :key="index" @click="handleCommonItemClick(item)">
<view class="icon-container" :style="{ background: item.bgColor }">
- <up-icon
- :name="item.icon"
- :size="58"
- color="#ffffff"
- ></up-icon>
+ <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
</up-grid>
</view>
</view>
-
+
<!-- 鍗忓悓鍔炲叕妯″潡 -->
<view class="common-module collaboration-module">
<view class="module-header">
@@ -100,21 +78,10 @@
</view>
</view>
<view class="module-content">
- <up-grid
- :border="false"
- col="4"
- >
- <up-grid-item
- v-for="(item, index) in collaborationItems"
- :key="index"
- @click="handleCommonItemClick(item)"
- >
+ <up-grid :border="false" col="4">
+ <up-grid-item v-for="(item, index) in collaborationItems" :key="index" @click="handleCommonItemClick(item)">
<view class="icon-container" :style="{ background: item.bgColor }">
- <up-icon
- :name="item.icon"
- :size="58"
- color="#ffffff"
- ></up-icon>
+ <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
@@ -129,28 +96,17 @@
</view>
</view>
<view class="module-content">
- <up-grid
- :border="false"
- col="4"
- >
- <up-grid-item
- v-for="(item, index) in inventoryManagement"
- :key="index"
- @click="handleCommonItemClick(item)"
- >
+ <up-grid :border="false" col="4">
+ <up-grid-item v-for="(item, index) in inventoryManagement" :key="index" @click="handleCommonItemClick(item)">
<view class="icon-container" :style="{ background: item.bgColor }">
- <up-icon
- :name="item.icon"
- :size="58"
- color="#ffffff"
- ></up-icon>
+ <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
</up-grid>
</view>
</view>
-
+
<!-- 鐢熶骇绠℃帶妯″潡 -->
<view class="common-module production-module">
<view class="module-header">
@@ -159,28 +115,17 @@
</view>
</view>
<view class="module-content">
- <up-grid
- :border="false"
- col="4"
- >
- <up-grid-item
- v-for="(item, index) in productionItems"
- :key="index"
- @click="handleCommonItemClick(item)"
- >
+ <up-grid :border="false" col="4">
+ <up-grid-item v-for="(item, index) in productionItems" :key="index" @click="handleCommonItemClick(item)">
<view class="icon-container" :style="{ background: item.bgColor }">
- <up-icon
- :name="item.icon"
- :size="58"
- color="#ffffff"
- ></up-icon>
+ <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
</up-grid>
</view>
</view>
-
+
<!-- 璁惧绠$悊妯″潡 -->
<view class="common-module equipment-module">
<view class="module-header">
@@ -189,21 +134,10 @@
</view>
</view>
<view class="module-content">
- <up-grid
- :border="false"
- col="4"
- >
- <up-grid-item
- v-for="(item, index) in equipmentItems"
- :key="index"
- @click="handleCommonItemClick(item)"
- >
+ <up-grid :border="false" col="4">
+ <up-grid-item v-for="(item, index) in equipmentItems" :key="index" @click="handleCommonItemClick(item)">
<view class="icon-container" :style="{ background: item.bgColor }">
- <up-icon
- :name="item.icon"
- :size="58"
- color="#ffffff"
- ></up-icon>
+ <up-icon :name="item.icon" :size="58" color="#ffffff"></up-icon>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
@@ -214,1037 +148,1191 @@
</template>
<script setup>
-import {ref, onMounted, nextTick, reactive} from 'vue';
-import {userLoginFacotryList} from "@/api/login";
-import modal from "@/plugins/modal";
-import useUserStore from "@/store/modules/user";
+ import {
+ ref,
+ onMounted,
+ nextTick,
+ reactive
+ } from 'vue';
+ import {
+ userLoginFacotryList,
+ noticesCount
+ } from "@/api/login";
+ import modal from "@/plugins/modal";
+ import useUserStore from "@/store/modules/user";
+ import { onShow } from '@dcloudio/uni-app'
-const userStore = useUserStore()
-const factoryId = ref('');
-const show = ref(false);
-const factoryList = ref([]);
-const factoryListTem = ref([]);
-const iconStyle = {
- fontSize: '1.125rem',
- color: '#2979ff'
-}
-
-// 閫氱煡鐘舵�佸垏鎹�
-const statusList = ['閿�鍞�', '閲囪喘']
-let statusIndex = 0
-const currentStatus = ref(statusList[0])
-const number = ref(7643)
-
-// 瀹氭椂鍣ㄥ垏鎹㈤�氱煡鐘舵��
-const startStatusTimer = () => {
- setInterval(() => {
- statusIndex = (statusIndex + 1) % statusList.length
- currentStatus.value = statusList[statusIndex]
- }, 3000)
-}
-
-// 钀ラ攢绠$悊鍔熻兘鏁版嵁
-const marketingItems = reactive([
- {
- icon: '/static/images/icon/xiaoshoutaizhang@2x.png',
- label: '閿�鍞彴璐�',
- },
- {
- icon: '/static/images/icon/kaipiaodengji@2x.png',
- label: '寮�绁ㄧ櫥璁�',
- },
- {
- icon: '/static/images/icon/kaipiaotaizhang@2x.png',
- label: '寮�绁ㄥ彴璐�',
- },
- {
- icon: '/static/images/icon/huikuandengji@2x.png',
- label: '鍥炴鐧昏',
- },
- {
- icon: '/static/images/icon/huikuanliushui@2x.png',
- label: '鍥炴娴佹按',
- },
- {
- icon: '/static/images/icon/kehuwanglai@2x.png',
- label: '瀹㈡埛寰�鏉�',
+ const userStore = useUserStore()
+ const factoryId = ref('');
+ const show = ref(false);
+ const factoryList = ref([]);
+ const factoryListTem = ref([]);
+ const iconStyle = {
+ fontSize: '1.125rem',
+ color: '#2979ff'
}
-]);
-// 閲囪喘绠$悊鍔熻兘鏁版嵁
-const purchaseItems = reactive([
- {
- icon: '/static/images/icon/caigoutaizhang@2x.png',
- label: '閲囪喘鍙拌处',
- },
- {
- icon: '/static/images/icon/laipiaodengji@2x.png',
- label: '鏉ョエ鐧昏',
- },
- {
- icon: '/static/images/icon/laipiaotaizhang@2x.png',
- label: '鏉ョエ鍙拌处',
- },
- {
- icon: '/static/images/icon/fukuanjingji@2x.png',
- label: '浠樻鐧昏',
- },
- {
- icon: '/static/images/icon/fukuanliushui@2x.png',
- label: '浠樻娴佹按',
- },
- {
- icon: '/static/images/icon/gongyingshangwanglai@2x.png',
- label: '渚涘簲鍟嗗線鏉�',
- },
-]);
+ // 閫氱煡鐘舵�佸垏鎹�
+ const statusList = ['閿�鍞�', '閲囪喘']
+ let statusIndex = 0
+ const currentStatus = ref(statusList[0])
+ const number = ref(7643)
-// 鍗忓悓鍔炲叕鍔熻兘鏁版嵁
-const collaborationItems = reactive([
- {
- icon: '/static/images/icon/gongchuguanli@2x.png',
- label: '鍏嚭绠$悊',
- },
- {
- icon: '/static/images/icon/qingjiaguanli@2x.png',
- label: '璇峰亣绠$悊',
- },
- {
- icon: '/static/images/icon/chuchaiguanli@2x.png',
- label: '鍑哄樊绠$悊',
- },
- {
- icon: '/static/images/icon/xietongshenpi@2x.png',
- label: '鍗忓悓瀹℃壒',
- },
- {
- icon: '/static/images/icon/kehubaifang@2x.png',
- label: '瀹㈡埛鎷滆',
+ // 瀹氭椂鍣ㄥ垏鎹㈤�氱煡鐘舵��
+ const startStatusTimer = () => {
+ setInterval(() => {
+ statusIndex = (statusIndex + 1) % statusList.length
+ currentStatus.value = statusList[statusIndex]
+ }, 3000)
}
-]);
-// 鍗忓悓鍔炲叕鍔熻兘鏁版嵁inventoryManagement/receiptManagement
-const inventoryManagement = reactive([
- {
- icon: '/static/images/icon/rukuguanli@2x.png',
- label: '鑷畾涔夊叆搴�',
- },
- {
- icon: '/static/images/icon/zidingyichuku.png',
- label: '鑷畾涔夊嚭搴�',
- },
-]);
-// 鐢熶骇绠℃帶鍔熻兘鏁版嵁
-const productionItems = reactive([
- {
- icon: '/static/images/icon/shengchandingdan@2x.png',
- label: '鐢熶骇璁㈠崟',
- bgColor: '#FF9800'
- },
- {
- icon: '/static/images/icon/shengchanpaigong@2x.png',
- label: '鐢熶骇娲惧伐',
- bgColor: '#FF6B35'
- },
- {
- icon: '/static/images/icon/shengchanpaichan@2x.png',
- label: '宸ュ簭鎺掍骇',
- bgColor: '#E91E63'
- },
- {
- icon: '/static/images/icon/shengchanbaogong@2x.png',
- label: '鐢熶骇鎶ュ伐',
- bgColor: '#673AB7'
- },
- {
- icon: '/static/images/icon/shengchanhesuan@2x.png',
- label: '鐢熶骇鏍哥畻',
- bgColor: '#3F51B5'
- }
-]);
-
-// 璁惧绠$悊鍔熻兘鏁版嵁
-const equipmentItems = reactive([
- {
- icon: '/static/images/icon/shebeitaizhang@2x.png',
- label: '璁惧鍙拌处',
- },
- {
- icon: '/static/images/icon/shbeibaoxiu@2x.png',
- label: '璁惧鎶ヤ慨',
- },
- {
- icon: '/static/images/icon/shbeibaoyang@2x.png',
- label: '璁惧淇濆吇',
- },
- {
- icon: '/static/images/icon/xunjianshangchuan@2x.png',
- label: '宸℃涓婁紶',
- },
- // {
- // icon: '/static/images/icon/guzhangfenxi@2x.png',
- // label: '鍒嗘瀽杩芥函',
- // bgColor: '#ff9800'
- // },
- // {
- // icon: '/static/images/icon/zhinengpaidan@2x.png',
- // label: '鏅鸿兘娲惧崟',
- // bgColor: '#ff6b35'
- // },
- // {
- // icon: '/static/images/icon/zuoyezhidao@2x.png',
- // label: '浣滀笟鎸囧',
- // bgColor: '#4caf50'
- // },
- // {
- // icon: '/static/images/icon/jieguoyanzheng@2x.png',
- // label: '缁撴灉楠岃瘉',
- // bgColor: '#9c27b0'
- // }
-]);
-
-// 澶勭悊甯哥敤鍔熻兘鐐瑰嚮
-const handleCommonItemClick = (item) => {
- // 鏍规嵁涓嶅悓鐨勫姛鑳介」杩涜璺宠浆
- switch (item.label) {
- case '閿�鍞彴璐�':
- uni.navigateTo({
- url: '/pages/sales/salesAccount/index'
- });
- break;
- case '寮�绁ㄧ櫥璁�':
- uni.navigateTo({
- url: '/pages/sales/invoicingRegistration/index'
- });
- break;
- case '寮�绁ㄥ彴璐�':
- uni.navigateTo({
- url: '/pages/sales/invoiceLedger/index'
- });
- break;
- case '鍥炴鐧昏':
- uni.navigateTo({
- url: '/pages/sales/receiptPayment/index'
- });
- break;
- case '鍥炴娴佹按':
- uni.navigateTo({
- url: '/pages/sales/receiptPaymentHistory/index'
- });
- break;
- case '瀹㈡埛寰�鏉�':
- uni.navigateTo({
- url: '/pages/sales/receiptPaymentLedger/index'
- });
- break;
- case '閲囪喘鍙拌处':
- uni.navigateTo({
- url: '/pages/procurementManagement/procurementLedger/index'
- });
- break;
- case '鏉ョエ鐧昏':
- uni.navigateTo({
- url: '/pages/procurementManagement/invoiceEntry/index'
- });
- break;
- case '鏉ョエ鍙拌处':
- uni.navigateTo({
- url: '/pages/procurementManagement/procurementInvoiceLedger/index'
- });
- break;
- case '浠樻鐧昏':
- uni.navigateTo({
- url: '/pages/procurementManagement/paymentEntry/index'
- });
- break;
- case '浠樻娴佹按':
- uni.navigateTo({
- url: '/pages/procurementManagement/receiptPaymentHistory/index'
- });
- break;
- case '渚涘簲鍟嗗線鏉�':
- uni.navigateTo({
- url: '/pages/procurementManagement/paymentLedger/index'
- });
- break;
- case '鍏嚭绠$悊':
- uni.navigateTo({
- url: '/pages/cooperativeOffice/collaborativeApproval/index1'
- });
- break;
- case '璇峰亣绠$悊':
- uni.navigateTo({
- url: '/pages/cooperativeOffice/collaborativeApproval/index2'
- });
- break;
- case '鍑哄樊绠$悊':
- uni.navigateTo({
- url: '/pages/cooperativeOffice/collaborativeApproval/index3'
- });
- break;
- case '鍗忓悓瀹℃壒':
- uni.navigateTo({
- url: '/pages/cooperativeOffice/collaborativeApproval/index'
- });
- break;
- case '瀹㈡埛鎷滆':
- uni.navigateTo({
- url: '/pages/cooperativeOffice/clientVisit/index'
- });
- break;
- case '鑷畾涔夊叆搴�':
- uni.navigateTo({
- url: '/pages/inventoryManagement/receiptManagement/index'
- });
- break;
- case '鑷畾涔夊嚭搴�':
- uni.navigateTo({
- url: '/pages/inventoryManagement/issueManagement/index'
- });
- break;
- case '鐢熶骇璁㈠崟':
- uni.navigateTo({
- url: '/pages/productionManagement/productionOrder/index'
- });
- break;
- case '鐢熶骇娲惧伐':
- uni.navigateTo({
- url: '/pages/productionManagement/productionDispatching/index'
- });
- break;
- case '宸ュ簭鎺掍骇':
- uni.navigateTo({
- url: '/pages/productionManagement/operationScheduling/index'
- });
- break;
- case '鐢熶骇鎶ュ伐':
- uni.navigateTo({
- url: '/pages/productionManagement/productionReporting/index'
- });
- break;
- case '鐢熶骇鏍哥畻':
- uni.navigateTo({
- url: '/pages/productionManagement/productionCosting/index'
- });
- break;
- case '璁惧鍙拌处':
- uni.navigateTo({
- url: '/pages/equipmentManagement/ledger/index'
- });
- break;
- case '璁惧鎶ヤ慨':
- uni.navigateTo({
- url: '/pages/equipmentManagement/repair/index'
- });
- break;
- case '璁惧淇濆吇':
- uni.navigateTo({
- url: '/pages/equipmentManagement/upkeep/index'
- });
- break;
- case '宸℃涓婁紶':
- uni.navigateTo({
- url: '/pages/inspectionUpload/index'
- });
- break;
- case '鍒嗘瀽杩芥函':
- uni.navigateTo({
- url: '/pages/equipmentManagement/faultAnalysis/index'
- });
- break;
- case '鏅鸿兘娲惧崟':
- uni.navigateTo({
- url: '/pages/equipmentManagement/smartDispatch/index'
- });
- break;
- case '浣滀笟鎸囧':
- uni.navigateTo({
- url: '/pages/equipmentManagement/sop/index'
- });
- break;
- case '缁撴灉楠岃瘉':
- uni.navigateTo({
- url: '/pages/equipmentManagement/verification/index'
- });
- break;
- default:
- uni.showToast({
- title: `鐐瑰嚮浜�${item.label}`,
- icon: 'none'
- });
- }
-};
-
-// 鍒涘缓瀵瑰瓙缁勪欢鐨勫紩鐢�
-const uToastRef = ref(null);
-
-function getUserLoginFacotryList() {
- userLoginFacotryList({userName: userStore.nickName}).then(res => {
- // 妫�鏌es.data鏄惁涓烘暟缁�
- factoryList.value[0] = []
- if (res.data && Array.isArray(res.data)) {
- factoryListTem.value = res.data
- res.data.forEach(item => {
- factoryList.value[0].push(item.deptName)
- })
- factoryId.value = userStore.currentDeptId
- } else {
- // 濡傛灉res.data涓嶆槸鏁扮粍锛岃缃负绌烘暟缁�
- factoryList.value = []
+ // 钀ラ攢绠$悊鍔熻兘鏁版嵁
+ const marketingItems = reactive([{
+ icon: '/static/images/icon/xiaoshoutaizhang@2x.png',
+ label: '閿�鍞彴璐�',
+ },
+ {
+ icon: '/static/images/icon/kaipiaodengji@2x.png',
+ label: '寮�绁ㄧ櫥璁�',
+ },
+ {
+ icon: '/static/images/icon/kaipiaotaizhang@2x.png',
+ label: '寮�绁ㄥ彴璐�',
+ },
+ {
+ icon: '/static/images/icon/huikuandengji@2x.png',
+ label: '鍥炴鐧昏',
+ },
+ {
+ icon: '/static/images/icon/huikuanliushui@2x.png',
+ label: '鍥炴娴佹按',
+ },
+ {
+ icon: '/static/images/icon/kehuwanglai@2x.png',
+ label: '瀹㈡埛寰�鏉�',
}
- }).catch(error => {
- modal.msgError('鑾峰彇鍏徃鍒楄〃澶辫触:', error)
- factoryList.value = []
- })
-}
-const changeFactory = async (arr) => {
- show.value = false;
- const factoryId = factoryListTem.value[arr.indexs[0]].deptId
- const loginForm = {
- username: userStore.name,
- password: uni.getStorageSync('remembered_password'),
- factoryId: factoryId,
+ ]);
+
+ // 閲囪喘绠$悊鍔熻兘鏁版嵁
+ const purchaseItems = reactive([{
+ icon: '/static/images/icon/caigoutaizhang@2x.png',
+ label: '閲囪喘鍙拌处',
+ },
+ {
+ icon: '/static/images/icon/laipiaodengji@2x.png',
+ label: '鏉ョエ鐧昏',
+ },
+ {
+ icon: '/static/images/icon/laipiaotaizhang@2x.png',
+ label: '鏉ョエ鍙拌处',
+ },
+ {
+ icon: '/static/images/icon/fukuanjingji@2x.png',
+ label: '浠樻鐧昏',
+ },
+ {
+ icon: '/static/images/icon/fukuanliushui@2x.png',
+ label: '浠樻娴佹按',
+ },
+ {
+ icon: '/static/images/icon/gongyingshangwanglai@2x.png',
+ label: '渚涘簲鍟嗗線鏉�',
+ },
+ ]);
+
+ // 鍗忓悓鍔炲叕鍔熻兘鏁版嵁
+ const collaborationItems = reactive([{
+ icon: '/static/images/icon/gongchuguanli@2x.png',
+ label: '鍏嚭绠$悊',
+ },
+ {
+ icon: '/static/images/icon/qingjiaguanli@2x.png',
+ label: '璇峰亣绠$悊',
+ },
+ {
+ icon: '/static/images/icon/chuchaiguanli@2x.png',
+ label: '鍑哄樊绠$悊',
+ },
+ {
+ icon: '/static/images/icon/xietongshenpi@2x.png',
+ label: '鍗忓悓瀹℃壒',
+ },
+ {
+ icon: '/static/images/icon/kehubaifang@2x.png',
+ label: '瀹㈡埛鎷滆',
+ }
+ ]);
+ // 鍗忓悓鍔炲叕鍔熻兘鏁版嵁inventoryManagement/receiptManagement
+ const inventoryManagement = reactive([{
+ icon: '/static/images/icon/rukuguanli@2x.png',
+ label: '鑷畾涔夊叆搴�',
+ },
+ {
+ icon: '/static/images/icon/zidingyichuku.png',
+ label: '鑷畾涔夊嚭搴�',
+ },
+ ]);
+
+ // 鐢熶骇绠℃帶鍔熻兘鏁版嵁
+ const productionItems = reactive([{
+ icon: '/static/images/icon/shengchandingdan@2x.png',
+ label: '鐢熶骇璁㈠崟',
+ bgColor: '#FF9800'
+ },
+ {
+ icon: '/static/images/icon/shengchanpaigong@2x.png',
+ label: '鐢熶骇娲惧伐',
+ bgColor: '#FF6B35'
+ },
+ {
+ icon: '/static/images/icon/shengchanpaichan@2x.png',
+ label: '宸ュ簭鎺掍骇',
+ bgColor: '#E91E63'
+ },
+ {
+ icon: '/static/images/icon/shengchanbaogong@2x.png',
+ label: '鐢熶骇鎶ュ伐',
+ bgColor: '#673AB7'
+ },
+ {
+ icon: '/static/images/icon/shengchanhesuan@2x.png',
+ label: '鐢熶骇鏍哥畻',
+ bgColor: '#3F51B5'
+ }
+ ]);
+
+ // 璁惧绠$悊鍔熻兘鏁版嵁
+ const equipmentItems = reactive([{
+ icon: '/static/images/icon/shebeitaizhang@2x.png',
+ label: '璁惧鍙拌处',
+ },
+ {
+ icon: '/static/images/icon/shbeibaoxiu@2x.png',
+ label: '璁惧鎶ヤ慨',
+ },
+ {
+ icon: '/static/images/icon/shbeibaoyang@2x.png',
+ label: '璁惧淇濆吇',
+ },
+ {
+ icon: '/static/images/icon/xunjianshangchuan@2x.png',
+ label: '宸℃涓婁紶',
+ },
+ // {
+ // icon: '/static/images/icon/guzhangfenxi@2x.png',
+ // label: '鍒嗘瀽杩芥函',
+ // bgColor: '#ff9800'
+ // },
+ // {
+ // icon: '/static/images/icon/zhinengpaidan@2x.png',
+ // label: '鏅鸿兘娲惧崟',
+ // bgColor: '#ff6b35'
+ // },
+ // {
+ // icon: '/static/images/icon/zuoyezhidao@2x.png',
+ // label: '浣滀笟鎸囧',
+ // bgColor: '#4caf50'
+ // },
+ // {
+ // icon: '/static/images/icon/jieguoyanzheng@2x.png',
+ // label: '缁撴灉楠岃瘉',
+ // bgColor: '#9c27b0'
+ // }
+ ]);
+
+ // 澶勭悊甯哥敤鍔熻兘鐐瑰嚮
+ const handleCommonItemClick = (item) => {
+ // 鏍规嵁涓嶅悓鐨勫姛鑳介」杩涜璺宠浆
+ switch (item.label) {
+ case '閿�鍞彴璐�':
+ uni.navigateTo({
+ url: '/pages/sales/salesAccount/index'
+ });
+ break;
+ case '寮�绁ㄧ櫥璁�':
+ uni.navigateTo({
+ url: '/pages/sales/invoicingRegistration/index'
+ });
+ break;
+ case '寮�绁ㄥ彴璐�':
+ uni.navigateTo({
+ url: '/pages/sales/invoiceLedger/index'
+ });
+ break;
+ case '鍥炴鐧昏':
+ uni.navigateTo({
+ url: '/pages/sales/receiptPayment/index'
+ });
+ break;
+ case '鍥炴娴佹按':
+ uni.navigateTo({
+ url: '/pages/sales/receiptPaymentHistory/index'
+ });
+ break;
+ case '瀹㈡埛寰�鏉�':
+ uni.navigateTo({
+ url: '/pages/sales/receiptPaymentLedger/index'
+ });
+ break;
+ case '閲囪喘鍙拌处':
+ uni.navigateTo({
+ url: '/pages/procurementManagement/procurementLedger/index'
+ });
+ break;
+ case '鏉ョエ鐧昏':
+ uni.navigateTo({
+ url: '/pages/procurementManagement/invoiceEntry/index'
+ });
+ break;
+ case '鏉ョエ鍙拌处':
+ uni.navigateTo({
+ url: '/pages/procurementManagement/procurementInvoiceLedger/index'
+ });
+ break;
+ case '浠樻鐧昏':
+ uni.navigateTo({
+ url: '/pages/procurementManagement/paymentEntry/index'
+ });
+ break;
+ case '浠樻娴佹按':
+ uni.navigateTo({
+ url: '/pages/procurementManagement/receiptPaymentHistory/index'
+ });
+ break;
+ case '渚涘簲鍟嗗線鏉�':
+ uni.navigateTo({
+ url: '/pages/procurementManagement/paymentLedger/index'
+ });
+ break;
+ case '鍏嚭绠$悊':
+ uni.navigateTo({
+ url: '/pages/cooperativeOffice/collaborativeApproval/index1'
+ });
+ break;
+ case '璇峰亣绠$悊':
+ uni.navigateTo({
+ url: '/pages/cooperativeOffice/collaborativeApproval/index2'
+ });
+ break;
+ case '鍑哄樊绠$悊':
+ uni.navigateTo({
+ url: '/pages/cooperativeOffice/collaborativeApproval/index3'
+ });
+ break;
+ case '鍗忓悓瀹℃壒':
+ uni.navigateTo({
+ url: '/pages/cooperativeOffice/collaborativeApproval/index'
+ });
+ break;
+ case '瀹㈡埛鎷滆':
+ uni.navigateTo({
+ url: '/pages/cooperativeOffice/clientVisit/index'
+ });
+ break;
+ case '鑷畾涔夊叆搴�':
+ uni.navigateTo({
+ url: '/pages/inventoryManagement/receiptManagement/index'
+ });
+ break;
+ case '鑷畾涔夊嚭搴�':
+ uni.navigateTo({
+ url: '/pages/inventoryManagement/issueManagement/index'
+ });
+ break;
+ case '鐢熶骇璁㈠崟':
+ uni.navigateTo({
+ url: '/pages/productionManagement/productionOrder/index'
+ });
+ break;
+ case '鐢熶骇娲惧伐':
+ uni.navigateTo({
+ url: '/pages/productionManagement/productionDispatching/index'
+ });
+ break;
+ case '宸ュ簭鎺掍骇':
+ uni.navigateTo({
+ url: '/pages/productionManagement/operationScheduling/index'
+ });
+ break;
+ case '鐢熶骇鎶ュ伐':
+ uni.navigateTo({
+ url: '/pages/productionManagement/productionReporting/index'
+ });
+ break;
+ case '鐢熶骇鏍哥畻':
+ uni.navigateTo({
+ url: '/pages/productionManagement/productionCosting/index'
+ });
+ break;
+ case '璁惧鍙拌处':
+ uni.navigateTo({
+ url: '/pages/equipmentManagement/ledger/index'
+ });
+ break;
+ case '璁惧鎶ヤ慨':
+ uni.navigateTo({
+ url: '/pages/equipmentManagement/repair/index'
+ });
+ break;
+ case '璁惧淇濆吇':
+ uni.navigateTo({
+ url: '/pages/equipmentManagement/upkeep/index'
+ });
+ break;
+ case '宸℃涓婁紶':
+ uni.navigateTo({
+ url: '/pages/inspectionUpload/index'
+ });
+ break;
+ case '鍒嗘瀽杩芥函':
+ uni.navigateTo({
+ url: '/pages/equipmentManagement/faultAnalysis/index'
+ });
+ break;
+ case '鏅鸿兘娲惧崟':
+ uni.navigateTo({
+ url: '/pages/equipmentManagement/smartDispatch/index'
+ });
+ break;
+ case '浣滀笟鎸囧':
+ uni.navigateTo({
+ url: '/pages/equipmentManagement/sop/index'
+ });
+ break;
+ case '缁撴灉楠岃瘉':
+ uni.navigateTo({
+ url: '/pages/equipmentManagement/verification/index'
+ });
+ break;
+ default:
+ uni.showToast({
+ title: `鐐瑰嚮浜�${item.label}`,
+ icon: 'none'
+ });
+ }
+ };
+
+ // 鍒涘缓瀵瑰瓙缁勪欢鐨勫紩鐢�
+ const uToastRef = ref(null);
+
+ function getUserLoginFacotryList() {
+ userLoginFacotryList({
+ userName: userStore.nickName
+ }).then(res => {
+ // 妫�鏌es.data鏄惁涓烘暟缁�
+ factoryList.value[0] = []
+ if (res.data && Array.isArray(res.data)) {
+ factoryListTem.value = res.data
+ res.data.forEach(item => {
+ factoryList.value[0].push(item.deptName)
+ })
+ factoryId.value = userStore.currentDeptId
+ } else {
+ // 濡傛灉res.data涓嶆槸鏁扮粍锛岃缃负绌烘暟缁�
+ factoryList.value = []
+ }
+ }).catch(error => {
+ modal.msgError('鑾峰彇鍏徃鍒楄〃澶辫触:', error)
+ factoryList.value = []
+ })
}
- modal.loading("鍒锋柊涓紝璇疯�愬績绛夊緟...")
- userStore.loginCheckFactory(loginForm).then(() => {
- modal.closeLoading()
- nextTick(() => {
- loginSuccess()
+ const changeFactory = async (arr) => {
+ show.value = false;
+ const factoryId = factoryListTem.value[arr.indexs[0]].deptId
+ const loginForm = {
+ username: userStore.name,
+ password: uni.getStorageSync('remembered_password'),
+ factoryId: factoryId,
+ }
+ modal.loading("鍒锋柊涓紝璇疯�愬績绛夊緟...")
+ userStore.loginCheckFactory(loginForm).then(() => {
+ modal.closeLoading()
+ nextTick(() => {
+ loginSuccess()
+ });
+ }).catch(() => {
+ modal.closeLoading()
+ })
+ }
+
+ function loginSuccess(result) {
+ uni.reLaunch({
+ url: '/pages/index'
});
- }).catch(() => {
- modal.closeLoading()
- })
-}
-function loginSuccess(result) {
- uni.reLaunch({
- url: '/pages/index'
- });
-}
-
-// 瀹氫箟鏂规硶
-const click = (name) => {
- if (uToastRef.value) {
- uToastRef.value.success(`鐐瑰嚮浜嗙${name + 1}涓猔); // 娉ㄦ剰锛氳繖閲屽姞1鏄洜涓洪�氬父鎴戜滑鏄粠绗�1涓紑濮嬭鏁扮殑
}
-};
-onMounted(() => {
- // 璁剧疆鐢ㄦ埛淇℃伅
- userStore.getInfo()
- getUserLoginFacotryList()
- // 鍚姩閫氱煡鐘舵�佸畾鏃跺櫒
- startStatusTimer()
-});
+ // 瀹氫箟鏂规硶
+ const click = (name) => {
+ if (uToastRef.value) {
+ uToastRef.value.success(`鐐瑰嚮浜嗙${name + 1}涓猔); // 娉ㄦ剰锛氳繖閲屽姞1鏄洜涓洪�氬父鎴戜滑鏄粠绗�1涓紑濮嬭鏁扮殑
+ }
+ };
+ const isShowNoticesCount = ref(true)
+ // 鑾峰彇鍏憡鏁伴噺
+ const getNoticesCount = () => {
+ if(!isShowNoticesCount.value){
+ return
+ }
+ noticesCount({}).then(resp => {
+ if (resp.code != 200 || !resp.data) {
+ return
+ }
+ const res = uni.getAppAuthorizeSetting();
+ if (res.notificationAuthorized == 'denied') {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '璇峰湪璁剧疆涓紑鍚�氱煡鏉冮檺',
+ success: (res) => {
+ if (res.confirm) {
+ uni.openAppAuthorizeSetting({
+ success: (res) => {
+ console.log('openAppAuthorizeSetting',res)
+ // if (res.authSetting['scope.push']) {
+ // createPushMessage(resp.data)
+ // }
+ }
+ });
+ }else{
+ isShowNoticesCount.value = false
+ }
+ }
+ });
+ return
+ }
+ createPushMessage(resp.data)
+ }).catch(error => {
+ modal.msgError('鑾峰彇鍏憡鏁伴噺:', error)
+ console.log('鑾峰彇鍏憡鏁伴噺:', error)
+ })
+ }
+
+ const createPushMessage = (_noticesCount) => {
+ uni.createPushMessage({
+ title: '鍏憡閫氱煡',
+ content: `褰撳墠鏈�${_noticesCount}鏉″叕鍛婇�氱煡锛屾敞鎰忔煡鐪媊,
+ success: (resp) => {
+ console.log('success', resp)
+ isShowNoticesCount.value = false
+ },
+ fail: (resp) => {
+ console.log('fail', resp)
+ }
+ })
+ }
+
+ onMounted(() => {
+ // 璁剧疆鐢ㄦ埛淇℃伅
+ userStore.getInfo()
+ getUserLoginFacotryList()
+ // 鍚姩閫氱煡鐘舵�佸畾鏃跺櫒
+ startStatusTimer()
+ // getNoticesCount()
+ });
+ onShow(()=>{
+ getNoticesCount()
+ })
</script>
<style scoped lang="scss">
-.content {
- background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
- min-height: 100vh;
- padding: 1.25rem;
- /* 涓烘墍鏈夎澶囪缃熀纭�padding-top */
- padding-top: 40px;
- position: relative;
-
- /* iOS璁惧浣跨敤env()鍑芥暟澶勭悊瀹夊叏鍖哄煙 */
- padding-top: env(safe-area-inset-top);
-
- /* 涓哄畨鍗撹澶囪缃洿澶х殑椤堕儴鍐呰竟璺� */
- /* #ifdef APP-PLUS && !MP && !H5 */
- padding-top: 45px;
- /* #endif */
-
- /* H5鍜屽皬绋嬪簭骞冲彴鐨勯�氱敤鏍峰紡 */
- /* #ifdef H5 || MP */
- padding-top: 30px;
- /* #endif */
-
- &::before {
- content: '';
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(41, 121, 255, 0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
- pointer-events: none;
- z-index: -1;
- }
-
- &::after {
- content: '';
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: radial-gradient(circle at 20% 80%, rgba(41, 121, 255, 0.02) 0%, transparent 50%),
- radial-gradient(circle at 80% 20%, rgba(156, 39, 176, 0.02) 0%, transparent 50%);
- pointer-events: none;
- z-index: -1;
- }
-}
+ .content {
+ background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
+ min-height: 100vh;
+ padding: 1.25rem;
+ /* 涓烘墍鏈夎澶囪缃熀纭�padding-top */
+ padding-top: 40px;
+ position: relative;
-.header-section {
- margin-bottom: 1rem;
- animation: fadeInDown 0.6s ease-out;
- /* 涓哄畨鍗撹澶囬澶栬皟鏁村ご閮ㄤ綅缃� */
- /* #ifdef APP-PLUS && !MP && !H5 */
- margin-top: 10px;
- /* #endif */
-}
+ /* iOS璁惧浣跨敤env()鍑芥暟澶勭悊瀹夊叏鍖哄煙 */
+ padding-top: env(safe-area-inset-top);
-.currentFactory {
- margin-top: 0.5rem;
- margin-left: 0.25rem;
- font-weight: 500;
- display: flex;
-}
+ /* 涓哄畨鍗撹澶囪缃洿澶х殑椤堕儴鍐呰竟璺� */
+ /* #ifdef APP-PLUS && !MP && !H5 */
+ padding-top: 45px;
+ /* #endif */
-.factoryName {
- width: auto;
-}
+ /* H5鍜屽皬绋嬪簭骞冲彴鐨勯�氱敤鏍峰紡 */
+ /* #ifdef H5 || MP */
+ padding-top: 30px;
+ /* #endif */
-:deep(.u-text) {
- align-items: center;
-}
+ &::before {
+ content: '';
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(41, 121, 255, 0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
+ pointer-events: none;
+ z-index: -1;
+ }
-.hero-section {
- margin-bottom: 1rem;
- animation: fadeInUp 0.6s ease-out 0.1s both;
-}
-
-.bg-img {
- width: 100%;
- height: 8.75rem;
- background-image: url("../static/images/banner/backview.png");
- background-size: cover;
- border-radius: 0.75rem;
- position: relative;
- overflow: hidden;
- box-shadow: 0 0.25rem 1.25rem rgba(41, 121, 255, 0.15);
-
- &::before {
- content: '';
- position: absolute;
- top: -50%;
- left: -50%;
- width: 200%;
- height: 200%;
- background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.1), transparent, rgba(255,255,255,0.05), transparent);
- animation: rotate 20s linear infinite;
- }
-
- &::after {
- content: '';
- position: absolute;
- top: 0;
- right: 0;
- width: 7.5rem;
- height: 7.5rem;
- background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
- border-radius: 50%;
- transform: translate(2.5rem, -2.5rem);
- }
-}
-
-.hero-content {
- position: relative;
- z-index: 1;
- padding: 1.25rem 1.25rem 1.6rem 1.25rem;
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- justify-content: flex-start;
-}
-
-.hero-title {
- color: #ffffff;
- font-size: 1.625rem;
- font-weight: 700;
- letter-spacing: 0.03125rem;
- text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5);
-}
-.hero-subtitle { font-size: 0.8125rem; margin-top: 0.375rem; }
-.hero-wave { height: 2.75rem; }
-
-.hero-subtitle {
- color: rgba(255, 255, 255, 0.9);
- font-size: 0.8125rem;
- margin-top: 0.375rem;
- font-weight: 400;
- text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
-}
-
-.hero-wave {
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- height: 2.75rem;
- background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'><path fill='%23ffffff' fill-opacity='0.2' d='M0,224L48,218.7C96,213,192,203,288,197.3C384,192,480,192,576,176C672,160,768,128,864,122.7C960,117,1056,139,1152,144C1248,149,1344,139,1392,133.3L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'></path></svg>") no-repeat bottom center/cover;
- pointer-events: none;
-}
-
-
-.notice-section {
- margin-bottom: 1rem;
- animation: fadeInUp 0.6s ease-out 0.2s both;
-}
-
-.notice {
- width: 100%;
- background: linear-gradient(135deg, #EAF2FF 0%, #BBDEFB 100%);
- border: 0.0625rem solid #e3f2fd;
- border-radius: 0.75rem;
- padding: 1rem;
- box-shadow: 0 0.25rem 1.25rem rgba(41, 121, 255, 0.08);
- position: relative;
- overflow: hidden;
-
- &::before {
- content: '';
- position: absolute;
- top: -50%;
- left: -50%;
- width: 200%;
- height: 200%;
- background: linear-gradient(45deg, transparent, rgba(255,255,255,0.6), transparent);
- animation: shine 4s infinite;
- }
-
- &::after {
- content: '';
- position: absolute;
- top: 0;
- right: 0;
- width: 5rem;
- height: 5rem;
- background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
- border-radius: 50%;
- transform: translate(1.875rem, -1.875rem);
- }
-
- &:hover {
- transform: translateY(-0.125rem);
- box-shadow: 0 0.5rem 1.875rem rgba(0, 0, 0, 0.1);
- }
-}
-
-
-
-@keyframes shine {
- 0% {
- transform: translateX(-100%) translateY(-100%) rotate(45deg);
- }
- 100% {
- transform: translateX(100%) translateY(100%) rotate(45deg);
- }
-}
-
-@keyframes fadeInDown {
- from {
- opacity: 0;
- transform: translateY(-1.25rem);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
-@keyframes fadeInUp {
- from {
- opacity: 0;
- transform: translateY(1.25rem);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
-@keyframes fadeInScale {
- 0% { opacity: 0; transform: translateY(0.5rem) scale(0.96); }
- 100% { opacity: 1; transform: translateY(0) scale(1); }
-}
-
-.notice-content {
- display: flex;
- align-items: center;
- height: 100%;
- position: relative;
- z-index: 1;
-}
-
-.notice-left {
- margin-right: 1rem;
-}
-
-.notice-status {
- font-weight: 600;
- font-size: 1rem;
- color: #1976d2;
-}
-
-.notice-separator {
- width: 0.0625rem;
- height: 1.5rem;
- background: #e0e0e0;
- margin-right: 1rem;
-}
-
-.notice-right {
- display: flex;
- align-items: center;
- justify-content: space-between;
- flex: 1;
-}
-
-.notice-label {
- color: #333;
- font-size: 0.875rem;
- font-weight: 500;
- margin-right: 0.75rem;
-}
-
-.notice-text {
- font-weight: 400;
- font-size: 0.875rem;
- color: #666666;
-}
-
-.notice-number {
- font-weight: 600;
- font-size: 1rem;
- color: #1976d2;
- margin-left: 0.25rem;
-}
-
-.notice-unit {
- color: #666666;
- font-size: 0.875rem;
- margin-left: 0.125rem;
-}
-
-/* 鍔熻兘妯″潡鏍峰紡 */
-.common-module {
- margin-bottom: 1.5rem;
- background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
- border-radius: 1rem;
- padding: 1rem;
- box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.06);
- border: none;
- position: relative;
- overflow: hidden;
- transition: all 0.3s ease;
-
- &::after {
- content: '';
- position: absolute;
- top: 0;
- right: 0;
- width: 3.75rem;
- height: 3.75rem;
- background: radial-gradient(circle, rgba(0,0,0,0.02) 0%, transparent 70%);
- border-radius: 50%;
- transform: translate(1.875rem, -1.875rem);
- }
-}
-
-.marketing-module {
- --module-color: #2979ff;
-}
-
-.purchase-module {
- --module-color: #1976d2;
-}
-
-.collaboration-module {
- --module-color: #4caf50;
-}
-
-.production-module {
- --module-color: #FF9800;
-}
-
-.equipment-module {
- --module-color: #9c27b0;
-}
-
-.module-header {
- margin-bottom: 1.5rem;
- display: flex;
- align-items: center;
- justify-content: space-between;
-}
-
-.module-title-container {
- display: flex;
- align-items: center;
-}
-
-.module-title {
- color: #333333;
- font-size: 1.125rem;
- font-weight: 600;
- position: relative;
-}
-
-.module-subtitle {
- color: #666666;
- font-size: 0.75rem;
- font-weight: 400;
- margin-left: 0.5rem;
-}
-
-.module-content {
- width: 100%;
- display: grid;
- gap: 1rem;
-}
-
-.icon-container {
- width: 3.25rem;
- height: 3.25rem;
- border-radius: 0.75rem;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 0.375rem;
- box-shadow: 0 0.1875rem 0.75rem rgba(0, 0, 0, 0.12);
- transition: all 0.2s ease;
- position: relative;
- overflow: hidden;
- animation: fadeInScale 0.5s ease both;
-
- &::before {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
- opacity: 0;
- transition: opacity 0.3s ease;
- }
-
- &::after {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- border-radius: 0.75rem;
- background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
- opacity: 0;
- transition: opacity 0.3s ease;
- }
-
- &:hover {
- transform: translateY(-0.1875rem) scale(1.02);
- box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.18);
-
- &::before,
&::after {
- opacity: 1;
+ content: '';
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: radial-gradient(circle at 20% 80%, rgba(41, 121, 255, 0.02) 0%, transparent 50%),
+ radial-gradient(circle at 80% 20%, rgba(156, 39, 176, 0.02) 0%, transparent 50%);
+ pointer-events: none;
+ z-index: -1;
}
}
-
- &:active {
- transform: scale(0.97);
- box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.18);
- }
-}
-.item-label {
- font-size: 0.8125rem;
- color: #555555;
- text-align: center;
- display: block;
- line-height: 1.4;
- font-weight: 500;
- margin-top: 0.25rem;
- margin-bottom: 0.625rem;
-}
+ .header-section {
+ margin-bottom: 1rem;
+ animation: fadeInDown 0.6s ease-out;
+ /* 涓哄畨鍗撹澶囬澶栬皟鏁村ご閮ㄤ綅缃� */
+ /* #ifdef APP-PLUS && !MP && !H5 */
+ margin-top: 10px;
+ /* #endif */
+ }
-.grid-text {
- font-size: 0.875rem;
- color: #909399;
- padding: 0.625rem 0 1.25rem 0;
- /* #ifndef APP-PLUS */
- box-sizing: border-box;
- /* #endif */
-}
+ .currentFactory {
+ margin-top: 0.5rem;
+ margin-left: 0.25rem;
+ font-weight: 500;
+ display: flex;
+ }
-/* 鏆楄壊妯″紡閫傞厤 */
-@media (prefers-color-scheme: dark) {
- .content {
- background: linear-gradient(135deg, #121317 0%, #161a20 100%);
+ .factoryName {
+ width: auto;
}
- .content::before {
- background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255, 255, 255, 0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
+
+ :deep(.u-text) {
+ align-items: center;
}
- .common-module {
- background: linear-gradient(135deg, #1e1f24 0%, #23252b 100%);
- box-shadow: 0 0.375rem 1.5rem rgba(0,0,0,0.35);
+
+ .hero-section {
+ margin-bottom: 1rem;
+ animation: fadeInUp 0.6s ease-out 0.1s both;
}
- .module-title {
- color: #e9edf3;
- }
- .module-subtitle, .item-label, .notice-text, .notice-unit, .notice-label {
- color: #c7cbd3;
- }
- .notice {
- background: linear-gradient(135deg, #1b2330 0%, #1a2432 100%);
- border-color: rgba(255,255,255,0.06);
- box-shadow: 0 0.375rem 1.25rem rgba(0,0,0,0.4);
- }
- .notice-status, .notice-number {
- color: #8ab4ff;
- }
+
.bg-img {
- background: linear-gradient(135deg, #1f4fb9 0%, #0e3a8a 100%);
+ width: 100%;
+ height: 8.75rem;
+ background-image: url("../static/images/banner/backview.png");
+ background-size: cover;
+ border-radius: 0.75rem;
+ position: relative;
+ overflow: hidden;
+ box-shadow: 0 0.25rem 1.25rem rgba(41, 121, 255, 0.15);
+
+ &::before {
+ content: '';
+ position: absolute;
+ top: -50%;
+ left: -50%;
+ width: 200%;
+ height: 200%;
+ background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent, rgba(255, 255, 255, 0.05), transparent);
+ animation: rotate 20s linear infinite;
+ }
+
+ &::after {
+ content: '';
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 7.5rem;
+ height: 7.5rem;
+ background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
+ border-radius: 50%;
+ transform: translate(2.5rem, -2.5rem);
+ }
}
-}
-@keyframes rotate {
- from { transform: rotate(0deg); }
- to { transform: rotate(360deg); }
-}
+ .hero-content {
+ position: relative;
+ z-index: 1;
+ padding: 1.25rem 1.25rem 1.6rem 1.25rem;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ justify-content: flex-start;
+ }
-@keyframes fadeInDown {
- from { opacity: 0; transform: translateY(-1.25rem); }
- to { opacity: 1; transform: translateY(0); }
-}
+ .hero-title {
+ color: #ffffff;
+ font-size: 1.625rem;
+ font-weight: 700;
+ letter-spacing: 0.03125rem;
+ text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5);
+ }
-@keyframes fadeInUp {
- from { opacity: 0; transform: translateY(1.25rem); }
- to { opacity: 1; transform: translateY(0); }
-}
+ .hero-subtitle {
+ font-size: 0.8125rem;
+ margin-top: 0.375rem;
+ }
-@keyframes fadeInScale {
- 0% { opacity: 0; transform: translateY(0.5rem) scale(0.96); }
- 100% { opacity: 1; transform: translateY(0) scale(1); }
-}
+ .hero-wave {
+ height: 2.75rem;
+ }
-.notice-left { margin-right: 1rem; }
-.notice-status { font-size: 1rem; }
-.notice-separator { width: 0.0625rem; height: 1.5rem; margin-right: 1rem; }
-.notice-label { font-size: 0.875rem; margin-right: 0.75rem; }
-.notice-text { font-size: 0.875rem; }
-.notice-number { font-size: 1rem; margin-left: 0.25rem; }
-.notice-unit { font-size: 0.875rem; margin-left: 0.125rem; }
+ .hero-subtitle {
+ color: rgba(255, 255, 255, 0.9);
+ font-size: 0.8125rem;
+ margin-top: 0.375rem;
+ font-weight: 400;
+ text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
+ }
-.common-module {
- margin-bottom: 1.5rem;
- background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
- border-radius: 1rem;
- padding: 1rem;
- box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.06);
- border: none;
- position: relative;
- overflow: hidden;
- transition: all 0.3s ease;
-
- &::after {
- content: '';
+ .hero-wave {
position: absolute;
- top: 0;
+ left: 0;
right: 0;
- width: 3.75rem;
- height: 3.75rem;
- background: radial-gradient(circle, rgba(0,0,0,0.02) 0%, transparent 70%);
- border-radius: 50%;
- transform: translate(1.875rem, -1.875rem);
+ bottom: 0;
+ height: 2.75rem;
+ background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'><path fill='%23ffffff' fill-opacity='0.2' d='M0,224L48,218.7C96,213,192,203,288,197.3C384,192,480,192,576,176C672,160,768,128,864,122.7C960,117,1056,139,1152,144C1248,149,1344,139,1392,133.3L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'></path></svg>") no-repeat bottom center/cover;
+ pointer-events: none;
}
-}
-.marketing-module {
- --module-color: #2979ff;
-}
-.purchase-module {
- --module-color: #1976d2;
-}
-
-.collaboration-module {
- --module-color: #4caf50;
-}
-
-.production-module {
- --module-color: #FF9800;
-}
-
-.equipment-module {
- --module-color: #9c27b0;
-}
-
-.module-header {
- margin-bottom: 1.5rem;
- display: flex;
- align-items: center;
- justify-content: space-between;
-}
-
-.module-title-container {
- display: flex;
- align-items: center;
-}
-
-.module-title {
- color: #333333;
- font-size: 1.125rem;
- font-weight: 600;
- position: relative;
-}
-
-.module-subtitle {
- color: #666666;
- font-size: 0.75rem;
- font-weight: 400;
- margin-left: 0.5rem;
-}
-
-.module-content {
- width: 100%;
- display: grid;
- gap: 1rem;
-}
-
-.icon-container {
- width: 3.25rem;
- height: 3.25rem;
- border-radius: 0.75rem;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 0.375rem;
- box-shadow: 0 0.1875rem 0.75rem rgba(0, 0, 0, 0.12);
- transition: all 0.2s ease;
- position: relative;
- overflow: hidden;
- animation: fadeInScale 0.5s ease both;
-
- &:hover {
- transform: translateY(-0.1875rem) scale(1.02);
- box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.18);
+ .notice-section {
+ margin-bottom: 1rem;
+ animation: fadeInUp 0.6s ease-out 0.2s both;
}
-
- &:active {
- transform: scale(0.97);
- box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.18);
+
+ .notice {
+ width: 100%;
+ background: linear-gradient(135deg, #EAF2FF 0%, #BBDEFB 100%);
+ border: 0.0625rem solid #e3f2fd;
+ border-radius: 0.75rem;
+ padding: 1rem;
+ box-shadow: 0 0.25rem 1.25rem rgba(41, 121, 255, 0.08);
+ position: relative;
+ overflow: hidden;
+
+ &::before {
+ content: '';
+ position: absolute;
+ top: -50%;
+ left: -50%;
+ width: 200%;
+ height: 200%;
+ background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.6), transparent);
+ animation: shine 4s infinite;
+ }
+
+ &::after {
+ content: '';
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 5rem;
+ height: 5rem;
+ background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
+ border-radius: 50%;
+ transform: translate(1.875rem, -1.875rem);
+ }
+
+ &:hover {
+ transform: translateY(-0.125rem);
+ box-shadow: 0 0.5rem 1.875rem rgba(0, 0, 0, 0.1);
+ }
}
-}
-.item-label { font-size: 0.8125rem; margin-top: 0.25rem; margin-bottom: 0.625rem; }
-.grid-text { font-size: 0.875rem; }
-@media (prefers-color-scheme: dark) {
- .common-module { box-shadow: 0 0.375rem 1.5rem rgba(0,0,0,0.35); }
- .notice { box-shadow: 0 0.375rem 1.25rem rgba(0,0,0,0.4); }
-}
-</style>
+
+ @keyframes shine {
+ 0% {
+ transform: translateX(-100%) translateY(-100%) rotate(45deg);
+ }
+
+ 100% {
+ transform: translateX(100%) translateY(100%) rotate(45deg);
+ }
+ }
+
+ @keyframes fadeInDown {
+ from {
+ opacity: 0;
+ transform: translateY(-1.25rem);
+ }
+
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ }
+
+ @keyframes fadeInUp {
+ from {
+ opacity: 0;
+ transform: translateY(1.25rem);
+ }
+
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ }
+
+ @keyframes fadeInScale {
+ 0% {
+ opacity: 0;
+ transform: translateY(0.5rem) scale(0.96);
+ }
+
+ 100% {
+ opacity: 1;
+ transform: translateY(0) scale(1);
+ }
+ }
+
+ .notice-content {
+ display: flex;
+ align-items: center;
+ height: 100%;
+ position: relative;
+ z-index: 1;
+ }
+
+ .notice-left {
+ margin-right: 1rem;
+ }
+
+ .notice-status {
+ font-weight: 600;
+ font-size: 1rem;
+ color: #1976d2;
+ }
+
+ .notice-separator {
+ width: 0.0625rem;
+ height: 1.5rem;
+ background: #e0e0e0;
+ margin-right: 1rem;
+ }
+
+ .notice-right {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ flex: 1;
+ }
+
+ .notice-label {
+ color: #333;
+ font-size: 0.875rem;
+ font-weight: 500;
+ margin-right: 0.75rem;
+ }
+
+ .notice-text {
+ font-weight: 400;
+ font-size: 0.875rem;
+ color: #666666;
+ }
+
+ .notice-number {
+ font-weight: 600;
+ font-size: 1rem;
+ color: #1976d2;
+ margin-left: 0.25rem;
+ }
+
+ .notice-unit {
+ color: #666666;
+ font-size: 0.875rem;
+ margin-left: 0.125rem;
+ }
+
+ /* 鍔熻兘妯″潡鏍峰紡 */
+ .common-module {
+ margin-bottom: 1.5rem;
+ background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
+ border-radius: 1rem;
+ padding: 1rem;
+ box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.06);
+ border: none;
+ position: relative;
+ overflow: hidden;
+ transition: all 0.3s ease;
+
+ &::after {
+ content: '';
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 3.75rem;
+ height: 3.75rem;
+ background: radial-gradient(circle, rgba(0, 0, 0, 0.02) 0%, transparent 70%);
+ border-radius: 50%;
+ transform: translate(1.875rem, -1.875rem);
+ }
+ }
+
+ .marketing-module {
+ --module-color: #2979ff;
+ }
+
+ .purchase-module {
+ --module-color: #1976d2;
+ }
+
+ .collaboration-module {
+ --module-color: #4caf50;
+ }
+
+ .production-module {
+ --module-color: #FF9800;
+ }
+
+ .equipment-module {
+ --module-color: #9c27b0;
+ }
+
+ .module-header {
+ margin-bottom: 1.5rem;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ }
+
+ .module-title-container {
+ display: flex;
+ align-items: center;
+ }
+
+ .module-title {
+ color: #333333;
+ font-size: 1.125rem;
+ font-weight: 600;
+ position: relative;
+ }
+
+ .module-subtitle {
+ color: #666666;
+ font-size: 0.75rem;
+ font-weight: 400;
+ margin-left: 0.5rem;
+ }
+
+ .module-content {
+ width: 100%;
+ display: grid;
+ gap: 1rem;
+ }
+
+ .icon-container {
+ width: 3.25rem;
+ height: 3.25rem;
+ border-radius: 0.75rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-bottom: 0.375rem;
+ box-shadow: 0 0.1875rem 0.75rem rgba(0, 0, 0, 0.12);
+ transition: all 0.2s ease;
+ position: relative;
+ overflow: hidden;
+ animation: fadeInScale 0.5s ease both;
+
+ &::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
+ opacity: 0;
+ transition: opacity 0.3s ease;
+ }
+
+ &::after {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ border-radius: 0.75rem;
+ background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
+ opacity: 0;
+ transition: opacity 0.3s ease;
+ }
+
+ &:hover {
+ transform: translateY(-0.1875rem) scale(1.02);
+ box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.18);
+
+ &::before,
+ &::after {
+ opacity: 1;
+ }
+ }
+
+ &:active {
+ transform: scale(0.97);
+ box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.18);
+ }
+ }
+
+ .item-label {
+ font-size: 0.8125rem;
+ color: #555555;
+ text-align: center;
+ display: block;
+ line-height: 1.4;
+ font-weight: 500;
+ margin-top: 0.25rem;
+ margin-bottom: 0.625rem;
+ }
+
+ .grid-text {
+ font-size: 0.875rem;
+ color: #909399;
+ padding: 0.625rem 0 1.25rem 0;
+ /* #ifndef APP-PLUS */
+ box-sizing: border-box;
+ /* #endif */
+ }
+
+ /* 鏆楄壊妯″紡閫傞厤 */
+ @media (prefers-color-scheme: dark) {
+ .content {
+ background: linear-gradient(135deg, #121317 0%, #161a20 100%);
+ }
+
+ .content::before {
+ background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255, 255, 255, 0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
+ }
+
+ .common-module {
+ background: linear-gradient(135deg, #1e1f24 0%, #23252b 100%);
+ box-shadow: 0 0.375rem 1.5rem rgba(0, 0, 0, 0.35);
+ }
+
+ .module-title {
+ color: #e9edf3;
+ }
+
+ .module-subtitle,
+ .item-label,
+ .notice-text,
+ .notice-unit,
+ .notice-label {
+ color: #c7cbd3;
+ }
+
+ .notice {
+ background: linear-gradient(135deg, #1b2330 0%, #1a2432 100%);
+ border-color: rgba(255, 255, 255, 0.06);
+ box-shadow: 0 0.375rem 1.25rem rgba(0, 0, 0, 0.4);
+ }
+
+ .notice-status,
+ .notice-number {
+ color: #8ab4ff;
+ }
+
+ .bg-img {
+ background: linear-gradient(135deg, #1f4fb9 0%, #0e3a8a 100%);
+ }
+ }
+
+ @keyframes rotate {
+ from {
+ transform: rotate(0deg);
+ }
+
+ to {
+ transform: rotate(360deg);
+ }
+ }
+
+ @keyframes fadeInDown {
+ from {
+ opacity: 0;
+ transform: translateY(-1.25rem);
+ }
+
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ }
+
+ @keyframes fadeInUp {
+ from {
+ opacity: 0;
+ transform: translateY(1.25rem);
+ }
+
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+ }
+
+ @keyframes fadeInScale {
+ 0% {
+ opacity: 0;
+ transform: translateY(0.5rem) scale(0.96);
+ }
+
+ 100% {
+ opacity: 1;
+ transform: translateY(0) scale(1);
+ }
+ }
+
+ .notice-left {
+ margin-right: 1rem;
+ }
+
+ .notice-status {
+ font-size: 1rem;
+ }
+
+ .notice-separator {
+ width: 0.0625rem;
+ height: 1.5rem;
+ margin-right: 1rem;
+ }
+
+ .notice-label {
+ font-size: 0.875rem;
+ margin-right: 0.75rem;
+ }
+
+ .notice-text {
+ font-size: 0.875rem;
+ }
+
+ .notice-number {
+ font-size: 1rem;
+ margin-left: 0.25rem;
+ }
+
+ .notice-unit {
+ font-size: 0.875rem;
+ margin-left: 0.125rem;
+ }
+
+ .common-module {
+ margin-bottom: 1.5rem;
+ background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
+ border-radius: 1rem;
+ padding: 1rem;
+ box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.06);
+ border: none;
+ position: relative;
+ overflow: hidden;
+ transition: all 0.3s ease;
+
+ &::after {
+ content: '';
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 3.75rem;
+ height: 3.75rem;
+ background: radial-gradient(circle, rgba(0, 0, 0, 0.02) 0%, transparent 70%);
+ border-radius: 50%;
+ transform: translate(1.875rem, -1.875rem);
+ }
+ }
+
+ .marketing-module {
+ --module-color: #2979ff;
+ }
+
+ .purchase-module {
+ --module-color: #1976d2;
+ }
+
+ .collaboration-module {
+ --module-color: #4caf50;
+ }
+
+ .production-module {
+ --module-color: #FF9800;
+ }
+
+ .equipment-module {
+ --module-color: #9c27b0;
+ }
+
+ .module-header {
+ margin-bottom: 1.5rem;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ }
+
+ .module-title-container {
+ display: flex;
+ align-items: center;
+ }
+
+ .module-title {
+ color: #333333;
+ font-size: 1.125rem;
+ font-weight: 600;
+ position: relative;
+ }
+
+ .module-subtitle {
+ color: #666666;
+ font-size: 0.75rem;
+ font-weight: 400;
+ margin-left: 0.5rem;
+ }
+
+ .module-content {
+ width: 100%;
+ display: grid;
+ gap: 1rem;
+ }
+
+ .icon-container {
+ width: 3.25rem;
+ height: 3.25rem;
+ border-radius: 0.75rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-bottom: 0.375rem;
+ box-shadow: 0 0.1875rem 0.75rem rgba(0, 0, 0, 0.12);
+ transition: all 0.2s ease;
+ position: relative;
+ overflow: hidden;
+ animation: fadeInScale 0.5s ease both;
+
+ &:hover {
+ transform: translateY(-0.1875rem) scale(1.02);
+ box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.18);
+ }
+
+ &:active {
+ transform: scale(0.97);
+ box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.18);
+ }
+ }
+
+ .item-label {
+ font-size: 0.8125rem;
+ margin-top: 0.25rem;
+ margin-bottom: 0.625rem;
+ }
+
+ .grid-text {
+ font-size: 0.875rem;
+ }
+
+ @media (prefers-color-scheme: dark) {
+ .common-module {
+ box-shadow: 0 0.375rem 1.5rem rgba(0, 0, 0, 0.35);
+ }
+
+ .notice {
+ box-shadow: 0 0.375rem 1.25rem rgba(0, 0, 0, 0.4);
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/src/pages/inspectionUpload/index.vue b/src/pages/inspectionUpload/index.vue
index 4320a6e..e18f93b 100644
--- a/src/pages/inspectionUpload/index.vue
+++ b/src/pages/inspectionUpload/index.vue
@@ -1,46 +1,32 @@
<template>
<view class="inspection-upload-page">
<!-- 椤甸潰澶撮儴 -->
- <PageHeader title="宸℃涓婁紶" @back="goBack"/>
-
+ <PageHeader title="宸℃涓婁紶" @back="goBack" />
+
<!-- 鏁版嵁鍒楄〃 -->
<view class="table-section">
<!-- 鐢熶骇宸℃鍒楄〃 -->
<view class="task-list">
- <view
- v-for="(item, index) in taskTableData"
- :key="index"
- class="task-item"
- >
+ <view v-for="(item, index) in taskTableData" :key="index" class="task-item">
<view class="task-header">
<view class="task-info">
<text class="task-name">{{ item.taskName }}</text>
<text class="task-location">{{ item.inspectionLocation }}</text>
</view>
<view class="task-actions">
- <u-button
- type="primary"
- size="small"
- @click.stop="startScanForTask(item)"
- :customStyle="{
- borderRadius: '15px',
- height: '30px',
- fontSize: '12px',
- marginRight: '8px'
- }"
- >
+ <u-button type="primary" size="small" @click.stop="startScanForTask(item)" :customStyle="{
+ borderRadius: '15px',
+ height: '30px',
+ fontSize: '12px',
+ marginRight: '8px'
+ }">
鎵爜涓婁紶
</u-button>
- <u-button
- type="success"
- size="small"
- @click.stop="viewAttachments(item)"
- :customStyle="{
- borderRadius: '15px',
- height: '30px',
- fontSize: '12px'
- }"
- >
+ <u-button type="success" size="small" @click.stop="viewAttachments(item)" :customStyle="{
+ borderRadius: '15px',
+ height: '30px',
+ fontSize: '12px'
+ }">
鏌ョ湅闄勪欢
</u-button>
</view>
@@ -58,64 +44,56 @@
<text class="detail-label">鎵ц浜�</text>
<text class="detail-value">{{ item.inspector }}</text>
</view>
- <view class="detail-item">
- <text class="detail-label">浠诲姟涓嬪彂鏃ユ湡</text>
- <text class="detail-value">{{ item.dateStr }}</text>
- </view>
+ <view class="detail-item">
+ <text class="detail-label">浠诲姟涓嬪彂鏃ユ湡</text>
+ <text class="detail-value">{{ item.dateStr }}</text>
+ </view>
+ <view class="detail-item">
+ <text class="detail-label">宸℃鐘舵��</text>
+ <view class="detail-value">
+ <uni-tag v-if="item.fileStatus==2" text="宸插畬鎴�" size="small" type="success" inverted></uni-tag>
+ <uni-tag v-else-if="item.fileStatus==1" text="宸℃涓�" size="small" type="primary" inverted></uni-tag>
+ <uni-tag v-else="" text="鏈贰妫�" size="small" type="warning" inverted></uni-tag>
+ </view>
+ </view>
</view>
</view>
+ <uni-load-more :status="loadMoreStatus"></uni-load-more>
</view>
-
+
<!-- 绌虹姸鎬� -->
- <view v-if="taskTableData.length === 0" class="no-data">
+ <view v-if="taskTableData?.length === 0" class="no-data">
<text>鏆傛棤鏁版嵁</text>
</view>
-
+
</view>
-
+
<!-- 鎵爜鍖哄煙 - 鍏ㄥ眬寮圭獥 -->
<view v-if="isScanning" class="qr-scan-overlay">
<view class="qr-scan-container">
<view class="scan-header">
<text class="scan-title">鎵弿浜岀淮鐮�</text>
- <u-button
- type="error"
- size="small"
- @click.stop="stopScan"
- :customStyle="{
- borderRadius: '15px',
- height: '30px',
- fontSize: '12px'
- }"
- >
+ <u-button type="error" size="small" @click.stop="stopScan" :customStyle="{
+ borderRadius: '15px',
+ height: '30px',
+ fontSize: '12px'
+ }">
鍏抽棴
</u-button>
</view>
- <camera
- class="qr-camera"
- device-position="back"
- flash="off"
- @scancode="handleScanCode"
- @error="handleCameraError"
- ></camera>
+ <camera class="qr-camera" device-position="back" flash="off" @scancode="handleScanCode"
+ @error="handleCameraError"></camera>
<view class="scan-frame-wrapper">
<view class="scan-frame"></view>
<view class="scan-tip">璇峰皢浜岀淮鐮佹斁鍏ユ鍐�</view>
</view>
- <u-alert
- v-if="cameraError"
- :title="cameraError"
- type="error"
- :showIcon="true"
- :closable="true"
- @close="cameraError = ''"
- :customStyle="{
+ <u-alert v-if="cameraError" :title="cameraError" type="error" :showIcon="true" :closable="true"
+ @close="cameraError = ''" :customStyle="{
margin: '10px 0'
- }"
- ></u-alert>
+ }"></u-alert>
</view>
</view>
-
+
<!-- 鍥剧墖涓婁紶寮圭獥 - 鍘熺敓瀹炵幇 -->
<view v-if="showUploadDialog" class="custom-modal-overlay" @click="closeUploadDialog">
<view class="custom-modal-container" @click.stop>
@@ -123,145 +101,109 @@
<view class="upload-popup-header">
<text class="upload-popup-title">涓婁紶宸℃璁板綍</text>
</view>
-
- <view class="upload-popup-body">
- <!-- 鍒嗙被鏍囩椤� -->
- <view class="upload-tabs">
- <view
- class="tab-item"
- :class="{ active: currentUploadType === 'before' }"
- @click="switchUploadType('before')"
- >
- 鐢熶骇鍓�
- </view>
- <view
- class="tab-item"
- :class="{ active: currentUploadType === 'after' }"
- @click="switchUploadType('after')"
- >
- 鐢熶骇涓�
- </view>
- <view
- class="tab-item"
- :class="{ active: currentUploadType === 'issue' }"
- @click="switchUploadType('issue')"
- >
- 鐢熶骇鍚�
- </view>
+
+ <view class="upload-popup-body">
+ <!-- 鍒嗙被鏍囩椤� -->
+ <view class="upload-tabs">
+ <view class="tab-item" :class="{ active: currentUploadType === 'before' }"
+ @click="switchUploadType('before')">
+ 鐢熶骇鍓�
</view>
-
- <!-- 寮傚父鐘舵�侀�夋嫨 -->
- <view class="exception-section">
- <text class="section-title">鏄惁瀛樺湪寮傚父锛�</text>
- <view class="exception-options">
- <view
- class="exception-option"
- :class="{ active: hasException === false }"
- @click="setExceptionStatus(false)"
- >
- <u-icon name="checkmark-circle" size="20" color="#52c41a"></u-icon>
- <text>姝e父</text>
- </view>
- <view
- class="exception-option"
- :class="{ active: hasException === true }"
- @click="setExceptionStatus(true)"
- >
- <u-icon name="close-circle" size="20" color="#ff4d4f"></u-icon>
- <text>瀛樺湪寮傚父</text>
- </view>
- </view>
+ <view class="tab-item" :class="{ active: currentUploadType === 'after' }"
+ @click="switchUploadType('after')">
+ 鐢熶骇涓�
</view>
-
- <!-- 褰撳墠鍒嗙被鐨勪笂浼犲尯鍩� -->
- <view class="simple-upload-area">
- <view class="upload-buttons">
- <u-button
- type="primary"
- @click="chooseMedia('image')"
- :loading="uploading"
- :disabled="getCurrentFiles().length >= uploadConfig.limit"
- :customStyle="{ marginRight: '10px', flex: 1 }"
- >
- <u-icon name="camera" size="18" color="#fff" style="margin-right: 5px;"></u-icon>
- {{ uploading ? '涓婁紶涓�...' : '鎷嶇収' }}
- </u-button>
- <u-button
- type="success"
- @click="chooseMedia('video')"
- :loading="uploading"
- :disabled="getCurrentFiles().length >= uploadConfig.limit"
- :customStyle="{ flex: 1 }"
- >
- <uni-icons type="videocam" name="videocam" size="18" color="#fff" style="margin-right: 5px;"></uni-icons>
- {{ uploading ? '涓婁紶涓�...' : '鎷嶈棰�' }}
- </u-button>
+ <view class="tab-item" :class="{ active: currentUploadType === 'issue' }"
+ @click="switchUploadType('issue')">
+ 鐢熶骇鍚�
+ </view>
+ </view>
+
+ <!-- 寮傚父鐘舵�侀�夋嫨 -->
+ <view class="exception-section">
+ <text class="section-title">鏄惁瀛樺湪寮傚父锛�</text>
+ <view class="exception-options">
+ <view class="exception-option" :class="{ active: hasException === false }"
+ @click="setExceptionStatus(false)">
+ <u-icon name="checkmark-circle" size="20" color="#52c41a"></u-icon>
+ <text>姝e父</text>
</view>
-
- <!-- 涓婁紶杩涘害 -->
- <view v-if="uploading" class="upload-progress">
- <u-line-progress
- :percentage="uploadProgress"
- :showText="true"
- activeColor="#409eff"
- ></u-line-progress>
- </view>
-
- <!-- 褰撳墠鍒嗙被鐨勬枃浠跺垪琛� -->
- <view v-if="getCurrentFiles().length > 0" class="file-list">
- <view
- v-for="(file, index) in getCurrentFiles()"
- :key="index"
- class="file-item"
- >
- <view class="file-preview-container">
- <image
- v-if="file?.path?.fileType === 'image'"
- :src="file?.url || file?.tempFilePath?.tempFilePath || file?.path?.tempFilePath"
- class="file-preview"
- mode="aspectFill"
- />
- <view v-else class="video-preview">
- <uni-icons type="videocam" name="videocam" size="18" color="#fff" style="margin-right: 5px;"></uni-icons>
- <text class="video-text">瑙嗛</text>
- </view>
-
- <!-- 鍒犻櫎鎸夐挳 -->
- <view class="delete-btn" @click="removeFile(index)">
- <u-icon name="close" size="12" color="#fff"></u-icon>
- </view>
- </view>
-
- <view class="file-info">
- <text class="file-name">{{ file.bucketFilename || file.name || (file.type === 'image' ? '鍥剧墖' : '瑙嗛') }}</text>
- <text class="file-size">{{ formatFileSize(file.size) }}</text>
- </view>
- </view>
- </view>
-
- <view v-if="getCurrentFiles().length === 0" class="empty-state">
- <text>璇烽�夋嫨瑕佷笂浼犵殑{{ getUploadTypeText() }}鍥剧墖鎴栬棰�</text>
- </view>
-
- <!-- 缁熻淇℃伅 -->
- <view class="upload-summary">
- <text class="summary-text">
- 鐢熶骇鍓�: {{ beforeModelValue.length }}涓枃浠� |
- 鐢熶骇涓�: {{ afterModelValue.length }}涓枃浠� |
- 鐢熶骇鍚�: {{ issueModelValue.length }}涓枃浠�
- </text>
+ <view class="exception-option" :class="{ active: hasException === true }"
+ @click="setExceptionStatus(true)">
+ <u-icon name="close-circle" size="20" color="#ff4d4f"></u-icon>
+ <text>瀛樺湪寮傚父</text>
</view>
</view>
</view>
-
+
+ <!-- 褰撳墠鍒嗙被鐨勪笂浼犲尯鍩� -->
+ <view class="simple-upload-area">
+ <view class="upload-buttons">
+ <u-button type="primary" @click="chooseMedia('image')" :loading="uploading"
+ :disabled="getCurrentFiles().length >= uploadConfig.limit"
+ :customStyle="{ marginRight: '10px', flex: 1 }">
+ <u-icon name="camera" size="18" color="#fff" style="margin-right: 5px;"></u-icon>
+ {{ uploading ? '涓婁紶涓�...' : '鎷嶇収' }}
+ </u-button>
+ <u-button type="success" @click="chooseMedia('video')" :loading="uploading"
+ :disabled="getCurrentFiles().length >= uploadConfig.limit" :customStyle="{ flex: 1 }">
+ <uni-icons type="videocam" name="videocam" size="18" color="#fff"
+ style="margin-right: 5px;"></uni-icons>
+ {{ uploading ? '涓婁紶涓�...' : '鎷嶈棰�' }}
+ </u-button>
+ </view>
+
+ <!-- 涓婁紶杩涘害 -->
+ <view v-if="uploading" class="upload-progress">
+ <u-line-progress :percentage="uploadProgress" :showText="true" activeColor="#409eff"></u-line-progress>
+ </view>
+
+ <!-- 褰撳墠鍒嗙被鐨勬枃浠跺垪琛� -->
+ <view v-if="getCurrentFiles().length > 0" class="file-list">
+ <view v-for="(file, index) in getCurrentFiles()" :key="index" class="file-item">
+ <view class="file-preview-container">
+ <image v-if="file?.path?.fileType === 'image'"
+ :src="file?.url || file?.tempFilePath?.tempFilePath || file?.path?.tempFilePath"
+ class="file-preview" mode="aspectFill" />
+ <view v-else class="video-preview">
+ <uni-icons type="videocam" name="videocam" size="18" color="#fff"
+ style="margin-right: 5px;"></uni-icons>
+ <text class="video-text">瑙嗛</text>
+ </view>
+
+ <!-- 鍒犻櫎鎸夐挳 -->
+ <view class="delete-btn" @click="removeFile(index)">
+ <u-icon name="close" size="12" color="#fff"></u-icon>
+ </view>
+ </view>
+
+ <view class="file-info">
+ <text class="file-name">{{ file.bucketFilename || file.name || (file.type === 'image' ? '鍥剧墖' : '瑙嗛')
+ }}</text>
+ <text class="file-size">{{ formatFileSize(file.size) }}</text>
+ </view>
+ </view>
+ </view>
+
+ <view v-if="getCurrentFiles().length === 0" class="empty-state">
+ <text>璇烽�夋嫨瑕佷笂浼犵殑{{ getUploadTypeText() }}鍥剧墖鎴栬棰�</text>
+ </view>
+
+ <!-- 缁熻淇℃伅 -->
+ <view class="upload-summary">
+ <text class="summary-text">
+ 鐢熶骇鍓�: {{ beforeModelValue.length }}涓枃浠� |
+ 鐢熶骇涓�: {{ afterModelValue.length }}涓枃浠� |
+ 鐢熶骇鍚�: {{ issueModelValue.length }}涓枃浠�
+ </text>
+ </view>
+ </view>
+ </view>
+
<view class="upload-popup-footer">
<u-button @click="closeUploadDialog" :customStyle="{ marginRight: '10px' }">鍙栨秷</u-button>
- <u-button
- v-if="hasException === true"
- type="warning"
- @click="goToRepair"
- :customStyle="{ marginRight: '10px' }"
- >
+ <u-button v-if="hasException === true" type="warning" @click="goToRepair"
+ :customStyle="{ marginRight: '10px' }">
鏂板鎶ヤ慨
</u-button>
<u-button type="primary" @click="submitUpload">鎻愪氦</u-button>
@@ -269,7 +211,7 @@
</view>
</view>
</view>
-
+
<!-- 鏌ョ湅闄勪欢寮圭獥 -->
<view v-if="showAttachmentDialog" class="custom-modal-overlay" @click="closeAttachmentDialog">
<view class="custom-modal-container" @click.stop>
@@ -280,62 +222,44 @@
<u-icon name="close" size="16" color="#666"></u-icon>
</view>
</view>
-
+
<view class="attachment-popup-body">
<!-- 鍒嗙被鏍囩椤� -->
<view class="attachment-tabs">
- <view
- class="tab-item"
- :class="{ active: currentViewType === 'before' }"
- @click="switchViewType('before')"
- >
+ <view class="tab-item" :class="{ active: currentViewType === 'before' }"
+ @click="switchViewType('before')">
鐢熶骇鍓� ({{ getAttachmentsByType(0).length }})
</view>
- <view
- class="tab-item"
- :class="{ active: currentViewType === 'after' }"
- @click="switchViewType('after')"
- >
+ <view class="tab-item" :class="{ active: currentViewType === 'after' }" @click="switchViewType('after')">
鐢熶骇涓� ({{ getAttachmentsByType(1).length }})
</view>
- <view
- class="tab-item"
- :class="{ active: currentViewType === 'issue' }"
- @click="switchViewType('issue')"
- >
+ <view class="tab-item" :class="{ active: currentViewType === 'issue' }" @click="switchViewType('issue')">
鐢熶骇鍚� ({{ getAttachmentsByType(2).length }})
</view>
</view>
-
+
<!-- 褰撳墠鍒嗙被鐨勯檮浠跺垪琛� -->
<view class="attachment-content">
<view v-if="getCurrentViewAttachments().length > 0" class="attachment-list">
- <view
- v-for="(file, index) in getCurrentViewAttachments()"
- :key="index"
- class="attachment-item"
- @click="previewAttachment(file)"
- >
+ <view v-for="(file, index) in getCurrentViewAttachments()" :key="index" class="attachment-item"
+ @click="previewAttachment(file)">
<view class="attachment-preview-container">
- <image
- v-if="file.type === 'image' || isImageFile(file)"
- :src="file.url || file.downloadUrl"
- class="attachment-preview"
- mode="aspectFill"
- />
+ <image v-if="file.type === 'image' || isImageFile(file)" :src="file.url || file.downloadUrl"
+ class="attachment-preview" mode="aspectFill" />
<view v-else class="attachment-video-preview">
<u-icon name="video" size="24" color="#409eff"></u-icon>
<text class="video-text">瑙嗛</text>
</view>
</view>
-
+
<view class="attachment-info">
- <text class="attachment-name">{{ file.originalFilename || file.bucketFilename || file.name || '闄勪欢' }}</text>
+ <text class="attachment-name">{{ file.originalFilename || file.bucketFilename || file.name || '闄勪欢'
+ }}</text>
<text class="attachment-size">{{ formatFileSize(file.byteSize || file.size) }}</text>
</view>
</view>
</view>
-
+
<view v-else class="attachment-empty">
<text>璇ュ垎绫绘殏鏃犻檮浠�</text>
</view>
@@ -344,7 +268,7 @@
</view>
</view>
</view>
-
+
<!-- 瑙嗛棰勮寮圭獥 -->
<view v-if="showVideoDialog" class="video-modal-overlay" @click="closeVideoPreview">
<view class="video-modal-container" @click.stop>
@@ -355,14 +279,8 @@
</view>
</view>
<view class="video-modal-body">
- <video
- v-if="currentVideoFile"
- :src="currentVideoFile.url || currentVideoFile.downloadUrl"
- class="video-player"
- controls
- autoplay
- @error="handleVideoError"
- ></video>
+ <video v-if="currentVideoFile" :src="currentVideoFile.url || currentVideoFile.downloadUrl"
+ class="video-player" controls autoplay @error="handleVideoError"></video>
</view>
</view>
</view>
@@ -370,11 +288,11 @@
</template>
<script setup>
-import { onMounted, onUnmounted, ref, nextTick, computed } from 'vue'
-import { onShow } from '@dcloudio/uni-app'
+import { onMounted, onUnmounted, ref, nextTick, computed, reactive } from 'vue'
+import { onShow, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import PageHeader from '@/components/PageHeader.vue'
import { getLedgerById } from '@/api/equipmentManagement/ledger.js'
-import {inspectionTaskList, uploadInspectionTask} from "@/api/inspectionManagement";
+import { inspectionTaskList, uploadInspectionTask } from "@/api/inspectionManagement";
import { getToken } from "@/utils/auth";
// 缁勪欢寮曠敤宸茬Щ闄�
@@ -439,7 +357,7 @@
// 璁$畻涓婁紶URL
const uploadFileUrl = computed(() => {
let baseUrl = '';
-
+
if (process.env.VUE_APP_BASE_API) {
baseUrl = process.env.VUE_APP_BASE_API;
} else if (process.env.NODE_ENV === 'development') {
@@ -447,7 +365,7 @@
} else {
baseUrl = 'http://114.132.189.42:9068';
}
-
+
return baseUrl + uploadConfig.action;
})
@@ -464,29 +382,68 @@
const isScanning = ref(false)
const cameraError = ref('')
+const pagesPames = reactive({
+ size: 10,
+ current:1
+})
+
+const loadMoreStatus = computed(()=>{
+ if(loading.value){
+ return 'loading'
+ }
+ if(noMore.value){
+ return 'noMore'
+ }
+ return 'more'
+})
+const totalSize = ref(0)
+const noMore = computed(()=>{
+ return taskTableData.value.length>=totalSize.value
+})
+const loading = ref(false)
+
+const reloadPage = ()=>{
+ pagesPames.current = 1
+ taskTableData.value = []
+ getList()
+}
+const loadPage = ()=>{
+ if(noMore.value||loading.value)return;
+ pagesPames.current += 1
+ getList()
+}
+
// 鐢熷懡鍛ㄦ湡
onMounted(() => {
// 寤惰繜鍒濆鍖栵紝纭繚DOM宸叉覆鏌�
- nextTick(() => {
- getList()
- })
+ // nextTick(() => {
+ // getList()
+ // })
+})
+
+onReachBottom(() => {
+ loadPage()
+})
+onPullDownRefresh(() => {
+ reloadPage()
+ uni.stopPullDownRefresh()
})
onShow(() => {
// 椤甸潰鏄剧ず鏃跺埛鏂版暟鎹�
- getList()
+ reloadPage()
})
// 缁勪欢閿�姣佹椂鐨勬竻鐞�
onUnmounted(() => {
// 璁剧疆鍙栨秷鏍囧織锛岄樆姝㈠悗缁殑寮傛鎿嶄綔
isRequestCancelled = true
-
+
// 鍋滄鎵爜
if (isScanning.value) {
isScanning.value = false
}
-
+
// 鍏抽棴涓婁紶寮圭獥
if (showUploadDialog.value) {
showUploadDialog.value = false
@@ -498,26 +455,23 @@
uni.navigateBack()
}
-// 鏌ヨ鏁版嵁
-const handleQuery = () => {
- getList()
-}
// 鑾峰彇鍒楄〃鏁版嵁
const getList = () => {
// 鏄剧ず鍔犺浇鎻愮ず
- showLoadingToast('鍔犺浇涓�...')
-
+ // showLoadingToast('鍔犺浇涓�...')
+
// 璁剧疆鍙栨秷鏍囧織
isRequestCancelled = false
-
- inspectionTaskList({}).then(res => {
+ loading.value = true
+ inspectionTaskList({...pagesPames}).then(res => {
// 妫�鏌ョ粍浠舵槸鍚﹁繕瀛樺湪涓旇姹傛湭琚彇娑�
if (!isRequestCancelled) {
// 澶勭悊涓嶅悓鐨勬暟鎹粨鏋�
let records = [];
if (res && res.data) {
// 灏濊瘯澶氱鍙兘鐨勬暟鎹粨鏋�
+ totalSize.value = res.data.total
if (Array.isArray(res.data.records)) {
records = res.data.records;
} else if (Array.isArray(res.data.rows)) {
@@ -528,9 +482,12 @@
records = res.data.list;
}
}
-
+
if (records.length > 0) {
- taskTableData.value = records;
+ taskTableData.value = [...taskTableData.value,...records.map((record)=>{
+ record.fileStatus = getFileStatus(record)
+ return record
+ })];
} else {
taskTableData.value = [];
uni.showToast({
@@ -539,8 +496,9 @@
});
}
}
+ loading.value =false
// 鍏抽棴鍔犺浇鎻愮ず
- closeToast()
+ // closeToast()
}).catch(err => {
// 妫�鏌ョ粍浠舵槸鍚﹁繕瀛樺湪涓旇姹傛湭琚彇娑�
if (!isRequestCancelled) {
@@ -551,9 +509,23 @@
icon: 'error'
})
}
+ loading.value =false
// 鍏抽棴鍔犺浇鎻愮ず
- closeToast()
+ // closeToast()
})
+}
+
+const getFileStatus = (record)=>{
+ let _beforeProduction = record.beforeProduction&&record.beforeProduction.length
+ let _afterProduction = record.afterProduction&&record.afterProduction.length
+ let _productionIssues = record.productionIssues&&record.productionIssues.length
+ if(_beforeProduction&&_afterProduction&&_productionIssues){
+ return 2
+ }else if(_beforeProduction||_afterProduction||_productionIssues){
+ return 1
+ }else{
+ return 0
+ }
}
// 涓烘寚瀹氫换鍔″紑濮嬫壂鐮�
@@ -561,10 +533,10 @@
try {
// 璁板綍褰撳墠鎵弿鐨勪换鍔�
currentScanningTask.value = task
-
+
// 鏄剧ず鎵弿鐣岄潰
isScanning.value = true
-
+
// 浣跨敤uniapp鐨勬壂鐮丄PI
uni.scanCode({
success: (res) => {
@@ -599,7 +571,7 @@
try {
// 瑙f瀽浜岀淮鐮佹暟鎹紝鎻愬彇deviceId
let deviceId = ''
-
+
// 妫�鏌ユ槸鍚︽槸URL鏍煎紡
if (result.result.includes('deviceId=')) {
// 浠嶶RL涓彁鍙杁eviceId
@@ -618,7 +590,7 @@
deviceId = result.result
}
}
-
+
if (!deviceId) {
uni.showToast({
title: '鏈瘑鍒埌璁惧ID',
@@ -627,20 +599,20 @@
isScanning.value = false
return
}
-
+
// 鑾峰彇褰撳墠浠诲姟鐨則askId
const currentTaskId = currentScanningTask.value?.taskId || currentScanningTask.value?.id
-
+
// 瀵规瘮deviceId鍜宼askId
if (deviceId === currentTaskId.toString()) {
uni.showToast({
title: '璇嗗埆鎴愬姛',
icon: 'success'
})
-
+
// 鍏堝叧闂壂鎻忕晫闈�
isScanning.value = false
-
+
// 寤惰繜鎵撳紑涓婁紶寮圭獥锛岀‘淇濇壂鎻忕晫闈㈠畬鍏ㄥ叧闂�
setTimeout(() => {
openUploadDialog(currentScanningTask.value)
@@ -650,11 +622,11 @@
title: '璇锋壂鎻忔纭殑璁惧',
icon: 'error'
})
-
+
// 鍏抽棴鎵弿鐣岄潰
isScanning.value = false
}
-
+
} catch (error) {
uni.showToast({
title: error.message || '鏁版嵁瑙f瀽澶辫触',
@@ -675,13 +647,13 @@
storageBlobDTO: [] // 鍒濆鍖栨枃浠跺垪琛�
};
}
-
+
// 璁剧疆涓婁紶鐘舵�佺被鍨嬶紙鍙互鏍规嵁浠诲姟绫诲瀷璁剧疆涓嶅悓鐨勭姸鎬侊級
uploadStatusType.value = 0 // 榛樿鐘舵��
-
+
// 娓呯┖涔嬪墠鐨勬枃浠�
uploadFiles.value = []
-
+
// 鏄剧ず涓婁紶寮圭獥
showUploadDialog.value = true
}
@@ -708,11 +680,11 @@
const getCurrentFiles = () => {
switch (currentUploadType.value) {
case 'before':
- return beforeModelValue.value
+ return beforeModelValue.value||[]
case 'after':
- return afterModelValue.value
+ return afterModelValue.value||[]
case 'issue':
- return issueModelValue.value
+ return issueModelValue.value||[]
default:
return []
}
@@ -758,17 +730,17 @@
issue: issueModelValue.value
}
}
-
+
uni.setStorageSync('repairTaskInfo', JSON.stringify(taskInfo))
-
+
// 璺宠浆鍒版柊澧炴姤淇〉闈�
uni.navigateTo({
url: '/pages/equipmentManagement/repair/add'
})
-
+
// 鍏抽棴涓婁紶寮圭獥
closeUploadDialog()
-
+
} catch (error) {
console.error('璺宠浆鎶ヤ慨椤甸潰澶辫触:', error)
uni.showToast({
@@ -789,7 +761,7 @@
})
return
}
-
+
// 妫�鏌ユ槸鍚︽湁浠讳綍鏂囦欢涓婁紶
const totalFiles = beforeModelValue.value.length + afterModelValue.value.length + issueModelValue.value.length;
if (totalFiles === 0) {
@@ -814,31 +786,31 @@
if (issueModelValue.value.length > 0) {
arr.push(...issueModelValue.value);
}
-
+
// 鎻愪氦鏁版嵁
infoData.value.storageBlobDTO = arr;
// 娣诲姞寮傚父鐘舵�佷俊鎭�
infoData.value.hasException = hasException.value;
- const result = await uploadInspectionTask({...infoData.value});
-
+ const result = await uploadInspectionTask({ ...infoData.value });
+
// 妫�鏌ユ彁浜ょ粨鏋�
if (result && (result.code === 200 || result.success)) {
// 鎻愪氦鎴愬姛
closeToast(); // 鍏抽棴鍔犺浇鎻愮ず
-
+
uni.showToast({
title: '鎻愪氦鎴愬姛',
icon: 'success'
})
-
+
// 鍏抽棴寮圭獥
closeUploadDialog()
-
+
// 鍒锋柊鍒楄〃
setTimeout(() => {
- getList()
+ reloadPage()
}, 500)
-
+
} else {
// 鎻愪氦澶辫触
closeToast();
@@ -847,11 +819,11 @@
icon: 'error'
})
}
-
+
} catch (error) {
console.error('鎻愪氦涓婁紶澶辫触:', error)
closeToast(); // 鍏抽棴鍔犺浇鎻愮ず
-
+
let errorMessage = '鎻愪氦澶辫触';
if (error.message) {
errorMessage = error.message;
@@ -860,7 +832,7 @@
} else if (typeof error === 'string') {
errorMessage = error;
}
-
+
uni.showToast({
title: errorMessage,
icon: 'error'
@@ -883,10 +855,10 @@
try {
currentViewTask.value = task
currentViewType.value = 'before'
-
+
// 瑙f瀽鏂扮殑鏁版嵁缁撴瀯
attachmentList.value = []
-
+
// 鐢熶骇鍓嶉檮浠� (type=0)
if (task.beforeProduction && Array.isArray(task.beforeProduction)) {
const beforeFiles = task.beforeProduction.map(file => ({
@@ -895,7 +867,7 @@
}))
attachmentList.value.push(...beforeFiles)
}
-
+
// 鐢熶骇涓檮浠� (type=1)
if (task.afterProduction && Array.isArray(task.afterProduction)) {
const afterFiles = task.afterProduction.map(file => ({
@@ -904,7 +876,7 @@
}))
attachmentList.value.push(...afterFiles)
}
-
+
// 鐢熶骇鍚庨檮浠� (type=2)
if (task.productionIssues && Array.isArray(task.productionIssues)) {
const issueFiles = task.productionIssues.map(file => ({
@@ -913,9 +885,9 @@
}))
attachmentList.value.push(...issueFiles)
}
-
+
showAttachmentDialog.value = true
-
+
} catch (error) {
uni.showToast({
title: '鑾峰彇闄勪欢澶辫触',
@@ -943,16 +915,16 @@
}
// 鑾峰彇type鍊�
const getTabType = () => {
- switch (currentUploadType.value) {
- case 'before':
- return 0
- case 'after':
- return 1
- case 'issue':
- return 2
- default:
- return 0
- }
+ switch (currentUploadType.value) {
+ case 'before':
+ return 0
+ case 'after':
+ return 1
+ case 'issue':
+ return 2
+ default:
+ return 0
+ }
}
// 鑾峰彇褰撳墠鏌ョ湅绫诲瀷鐨勯檮浠�
const getCurrentViewAttachments = () => {
@@ -974,10 +946,10 @@
if (file.contentType && file.contentType.startsWith('image/')) {
return true
}
-
+
// 妫�鏌ュ師鏈夌殑type瀛楁
if (file.type === 'image') return true
-
+
// 妫�鏌ユ枃浠舵墿灞曞悕
const name = file.bucketFilename || file.originalFilename || file.name || ''
const ext = name.split('.').pop()?.toLowerCase()
@@ -991,7 +963,7 @@
const imageUrls = getCurrentViewAttachments()
.filter(f => isImageFile(f))
.map(f => f.url || f.downloadUrl)
-
+
uni.previewImage({
urls: imageUrls,
current: file.url || file.downloadUrl
@@ -1024,50 +996,50 @@
// 浣跨敤鐩告満
const chooseMedia = (type) => {
- let mediaPamaes={
- count: 1,
- mediaType:[type||'image'],
- sizeType: ['compressed', 'original'],
- sourceType: ['camera'],
- }
- uni.chooseMedia({
- ...mediaPamaes,
- success: (res) => {
- try {
- if (!res.tempFiles || res.tempFiles.length === 0) {
- throw new Error('鏈幏鍙栧埌鍥剧墖鏂囦欢');
- }
-
- const tempFilePath = res.tempFiles[0];
- const tempFile = res.tempFiles && res.tempFiles[0] ? res.tempFiles[0] : {};
-
- const file = {
- tempFilePath: tempFilePath,
- path: tempFilePath, // 淇濇寔鍏煎鎬�
- type: 'image',
- name: `photo_${Date.now()}.jpg`,
- size: tempFile.size || 0,
- createTime: new Date().getTime(),
- uid: Date.now() + Math.random()
- };
-
- handleBeforeUpload(file);
- } catch (error) {
- console.error('澶勭悊鎷嶇収缁撴灉澶辫触:', error);
- uni.showToast({
- title: '澶勭悊鍥剧墖澶辫触',
- icon: 'error'
- });
- }
- },
- fail: (err) => {
- console.error('鎷嶇収澶辫触:', err);
- uni.showToast({
- title: '鎷嶇収澶辫触: ' + (err.errMsg || '鏈煡閿欒'),
- icon: 'error'
- });
- }
- })
+ let mediaPamaes = {
+ count: 1,
+ mediaType: [type || 'image'],
+ sizeType: ['compressed', 'original'],
+ sourceType: ['camera'],
+ }
+ uni.chooseMedia({
+ ...mediaPamaes,
+ success: (res) => {
+ try {
+ if (!res.tempFiles || res.tempFiles.length === 0) {
+ throw new Error('鏈幏鍙栧埌鍥剧墖鏂囦欢');
+ }
+
+ const tempFilePath = res.tempFiles[0];
+ const tempFile = res.tempFiles && res.tempFiles[0] ? res.tempFiles[0] : {};
+
+ const file = {
+ tempFilePath: tempFilePath,
+ path: tempFilePath, // 淇濇寔鍏煎鎬�
+ type: 'image',
+ name: `photo_${Date.now()}.jpg`,
+ size: tempFile.size || 0,
+ createTime: new Date().getTime(),
+ uid: Date.now() + Math.random()
+ };
+
+ handleBeforeUpload(file);
+ } catch (error) {
+ console.error('澶勭悊鎷嶇収缁撴灉澶辫触:', error);
+ uni.showToast({
+ title: '澶勭悊鍥剧墖澶辫触',
+ icon: 'error'
+ });
+ }
+ },
+ fail: (err) => {
+ console.error('鎷嶇収澶辫触:', err);
+ uni.showToast({
+ title: '鎷嶇収澶辫触: ' + (err.errMsg || '鏈煡閿欒'),
+ icon: 'error'
+ });
+ }
+ })
}
// 鎷嶇収
@@ -1079,10 +1051,10 @@
});
return;
}
-
+
uni.chooseMedia({
count: 1,
- mediaType:['image', 'video'],
+ mediaType: ['image', 'video'],
sizeType: ['compressed', 'original'],
sourceType: ['camera'],
success: (res) => {
@@ -1090,10 +1062,10 @@
if (!res.tempFiles || res.tempFiles.length === 0) {
throw new Error('鏈幏鍙栧埌鍥剧墖鏂囦欢');
}
-
+
const tempFilePath = res.tempFiles[0];
const tempFile = res.tempFiles && res.tempFiles[0] ? res.tempFiles[0] : {};
-
+
const file = {
tempFilePath: tempFilePath,
path: tempFilePath, // 淇濇寔鍏煎鎬�
@@ -1103,7 +1075,7 @@
createTime: new Date().getTime(),
uid: Date.now() + Math.random()
};
-
+
handleBeforeUpload(file);
} catch (error) {
console.error('澶勭悊鎷嶇収缁撴灉澶辫触:', error);
@@ -1132,7 +1104,7 @@
});
return;
}
-
+
uni.chooseVideo({
sourceType: ['camera'],
maxDuration: uploadConfig.maxVideoDuration,
@@ -1142,7 +1114,7 @@
if (!res.tempFilePath) {
throw new Error('鏈幏鍙栧埌瑙嗛鏂囦欢');
}
-
+
const file = {
tempFilePath: res.tempFilePath,
path: res.tempFilePath, // 淇濇寔鍏煎鎬�
@@ -1153,7 +1125,7 @@
createTime: new Date().getTime(),
uid: Date.now() + Math.random()
};
-
+
handleBeforeUpload(file);
} catch (error) {
console.error('澶勭悊鎷嶈棰戠粨鏋滃け璐�:', error);
@@ -1256,7 +1228,7 @@
if (uploadConfig.fileType && Array.isArray(uploadConfig.fileType) && uploadConfig.fileType.length > 0) {
const fileName = file.name || '';
const fileExtension = fileName ? fileName.split('.').pop().toLowerCase() : '';
-
+
// 鏍规嵁鏂囦欢绫诲瀷纭畾鏈熸湜鐨勬墿灞曞悕
let expectedTypes = [];
if (file.type === 'image') {
@@ -1264,13 +1236,13 @@
} else if (file.type === 'video') {
expectedTypes = ['mp4', 'mov', 'avi', 'wmv'];
}
-
+
// 妫�鏌ユ枃浠舵墿灞曞悕鏄惁鍦ㄥ厑璁哥殑绫诲瀷涓�
if (fileExtension && expectedTypes.length > 0) {
- const isAllowed = expectedTypes.some(type =>
+ const isAllowed = expectedTypes.some(type =>
uploadConfig.fileType.includes(type) && type === fileExtension
);
-
+
if (!isAllowed) {
uni.showToast({
title: `鏂囦欢鏍煎紡涓嶆敮鎸侊紝璇锋媿鎽� ${expectedTypes.join('/')} 鏍煎紡鐨勬枃浠禶,
@@ -1291,21 +1263,21 @@
uploading.value = true;
uploadProgress.value = 0;
number.value++; // 澧炲姞涓婁紶璁℃暟
-
+
// 纭繚鏂囦欢璺緞姝g‘
- const filePath = file.tempFilePath?.tempFilePath || file.path?.tempFilePath||'';
+ const filePath = file.tempFilePath?.tempFilePath || file.path?.tempFilePath || '';
if (!filePath) {
handleUploadError('鏂囦欢璺緞涓嶅瓨鍦�');
return;
}
-
+
// 纭繚token瀛樺湪
const token = getToken();
if (!token) {
handleUploadError('鐢ㄦ埛鏈櫥褰�');
return;
}
-
+
// 鍑嗗涓婁紶鍙傛暟
const uploadParams = {
url: uploadFileUrl.value,
@@ -1345,7 +1317,7 @@
fail: (err) => {
console.error('涓婁紶澶辫触:', err.errMsg || err);
number.value--; // 涓婁紶澶辫触鏃跺噺灏戣鏁�
-
+
let errorMessage = '涓婁紶澶辫触';
if (err.errMsg) {
if (err.errMsg.includes('statusCode: null')) {
@@ -1358,7 +1330,7 @@
errorMessage = err.errMsg;
}
}
-
+
handleUploadError(errorMessage);
},
complete: () => {
@@ -1366,7 +1338,7 @@
uploadProgress.value = 0;
}
});
-
+
// 鐩戝惉涓婁紶杩涘害
if (uploadTask && uploadTask.onProgressUpdate) {
uploadTask.onProgressUpdate((res) => {
@@ -1399,7 +1371,7 @@
const handleUploadSuccess = (res, file) => {
if (res.code === 200 && res.data && Array.isArray(res.data) && res.data.length > 0) {
const uploadedFile = res.data[0];
-
+
// 鏍规嵁褰撳墠涓婁紶绫诲瀷璁剧疆type瀛楁
let typeValue = 0; // 榛樿涓虹敓浜у墠
switch (currentUploadType.value) {
@@ -1413,7 +1385,7 @@
typeValue = 2;
break;
}
-
+
// 纭繚涓婁紶鐨勬枃浠舵暟鎹畬鏁达紝鍖呭惈id鍜宼ype
const fileData = {
...file,
@@ -1425,7 +1397,7 @@
createTime: uploadedFile.createTime || new Date().getTime(),
type: typeValue // 娣诲姞绫诲瀷瀛楁锛�0=鐢熶骇鍓�, 1=鐢熶骇涓�, 2=鐢熶骇鍚�
};
-
+
uploadList.value.push(fileData);
uploadedSuccessfully();
} else {
@@ -1449,7 +1421,7 @@
issueModelValue.value = [...issueModelValue.value, ...uploadList.value];
break;
}
-
+
// 閲嶇疆鐘舵��
uploadList.value = [];
number.value = 0;
--
Gitblit v1.9.3