fix: 支持按照工单进行输入报工信息报工。也可以扫码报工
| | |
| | | { |
| | | "name" : "ä¿¡æ¯ç®¡ç", |
| | | "appid" : "__UNI__099A590", |
| | | "description" : "", |
| | | "versionName" : "1.1.5", |
| | | "versionCode" : 100, |
| | | "transformPx" : false, |
| | | /* 5+Appç¹æç¸å
³ */ |
| | | "app-plus" : { |
| | | "compatible" : { |
| | | "usingComponents" : true, |
| | | "ignoreVersion" : true |
| | | }, |
| | | "usingComponents" : true, |
| | | "nvueStyleCompiler" : "uni-app", |
| | | "compilerVersion" : 3, |
| | | "splashscreen" : { |
| | | "alwaysShowBeforeRender" : true, |
| | | "waiting" : true, |
| | | "autoclose" : true, |
| | | "delay" : 0 |
| | | }, |
| | | /* 模åé
ç½® */ |
| | | "modules" : { |
| | | "Camera" : {}, |
| | | "Barcode" : {}, |
| | | "Push" : {}, |
| | | "Maps" : {} |
| | | }, |
| | | /* åºç¨åå¸ä¿¡æ¯ */ |
| | | "distribute" : { |
| | | /* androidæå
é
ç½® */ |
| | | "android" : { |
| | | "permissions" : [ |
| | | "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
| | | "<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
| | | "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CAMERA\"/>", |
| | | "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
| | | "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
| | | "<uses-feature android:name=\"android.hardware.camera\"/>", |
| | | "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>", |
| | | "<uses-feature android:name=\"android.hardware.location\"/>", |
| | | "<uses-feature android:name=\"android.hardware.location.gps\"/>", |
| | | "<uses-feature android:name=\"android.hardware.location.network\"/>" |
| | | ] |
| | | }, |
| | | /* iosæå
é
ç½® */ |
| | | "ios" : { |
| | | "dSYMs" : false, |
| | | "plist" : { |
| | | "NSLocationWhenInUseUsageDescription" : "éè¦è·åæ¨çä½ç½®ä¿¡æ¯æ¥è®°å½å®¢æ·æè®¿å°ç¹", |
| | | "NSLocationAlwaysAndWhenInUseUsageDescription" : "éè¦è·åæ¨çä½ç½®ä¿¡æ¯æ¥è®°å½å®¢æ·æè®¿å°ç¹" |
| | | } |
| | | }, |
| | | /* SDKé
ç½® */ |
| | | "sdkConfigs" : { |
| | | "push" : { |
| | | "unipush" : { |
| | | "icons" : { |
| | | "small" : { |
| | | "ldpi" : "D:/xindao/wenjian/img/logo/app.png" |
| | | } |
| | | }, |
| | | "offline" : false |
| | | } |
| | | }, |
| | | "maps" : { |
| | | "amap" : { |
| | | "name" : "amap_18330707920ae9zOwCD", |
| | | "appkey_ios" : "c2b4e3889ab4cb9468e9c8ae4f3ab53f", |
| | | "appkey_android" : "c2b4e3889ab4cb9468e9c8ae4f3ab53f" |
| | | } |
| | | } |
| | | }, |
| | | "icons" : { |
| | | "android" : { |
| | | "hdpi" : "unpackage/res/icons/72x72.png", |
| | | "xhdpi" : "unpackage/res/icons/96x96.png", |
| | | "xxhdpi" : "unpackage/res/icons/144x144.png", |
| | | "xxxhdpi" : "unpackage/res/icons/192x192.png" |
| | | }, |
| | | "ios" : { |
| | | "appstore" : "unpackage/res/icons/1024x1024.png", |
| | | "ipad" : { |
| | | "app" : "unpackage/res/icons/76x76.png", |
| | | "app@2x" : "unpackage/res/icons/152x152.png", |
| | | "notification" : "unpackage/res/icons/20x20.png", |
| | | "notification@2x" : "unpackage/res/icons/40x40.png", |
| | | "proapp@2x" : "unpackage/res/icons/167x167.png", |
| | | "settings" : "unpackage/res/icons/29x29.png", |
| | | "settings@2x" : "unpackage/res/icons/58x58.png", |
| | | "spotlight" : "unpackage/res/icons/40x40.png", |
| | | "spotlight@2x" : "unpackage/res/icons/80x80.png" |
| | | }, |
| | | "iphone" : { |
| | | "app@2x" : "unpackage/res/icons/120x120.png", |
| | | "app@3x" : "unpackage/res/icons/180x180.png", |
| | | "notification@2x" : "unpackage/res/icons/40x40.png", |
| | | "notification@3x" : "unpackage/res/icons/60x60.png", |
| | | "settings@2x" : "unpackage/res/icons/58x58.png", |
| | | "settings@3x" : "unpackage/res/icons/87x87.png", |
| | | "spotlight@2x" : "unpackage/res/icons/80x80.png", |
| | | "spotlight@3x" : "unpackage/res/icons/120x120.png" |
| | | } |
| | | } |
| | | } |
| | | "name": "éé绿è¡", |
| | | "appid": "__UNI__099A590", |
| | | "description": "", |
| | | "versionName": "1.1.5", |
| | | "versionCode": 100, |
| | | "transformPx": false, |
| | | /* 5+Appç¹æç¸å
³ */ |
| | | "app-plus": { |
| | | "compatible": { |
| | | "usingComponents": true, |
| | | "ignoreVersion": true |
| | | }, |
| | | "usingComponents": true, |
| | | "nvueStyleCompiler": "uni-app", |
| | | "compilerVersion": 3, |
| | | "splashscreen": { |
| | | "alwaysShowBeforeRender": true, |
| | | "waiting": true, |
| | | "autoclose": true, |
| | | "delay": 0 |
| | | }, |
| | | /* 模åé
ç½® */ |
| | | "modules": { |
| | | "Camera": {}, |
| | | "Barcode": {}, |
| | | "Push": {}, |
| | | "Maps": {} |
| | | }, |
| | | /* åºç¨åå¸ä¿¡æ¯ */ |
| | | "distribute": { |
| | | /* androidæå
é
ç½® */ |
| | | "android": { |
| | | "permissions": [ |
| | | "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
| | | "<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
| | | "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CAMERA\"/>", |
| | | "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
| | | "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
| | | "<uses-feature android:name=\"android.hardware.camera\"/>", |
| | | "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>", |
| | | "<uses-feature android:name=\"android.hardware.location\"/>", |
| | | "<uses-feature android:name=\"android.hardware.location.gps\"/>", |
| | | "<uses-feature android:name=\"android.hardware.location.network\"/>" |
| | | ] |
| | | }, |
| | | /* iosæå
é
ç½® */ |
| | | "ios": { |
| | | "dSYMs": false, |
| | | "plist": { |
| | | "NSLocationWhenInUseUsageDescription": "éè¦è·åæ¨çä½ç½®ä¿¡æ¯æ¥è®°å½å®¢æ·æè®¿å°ç¹", |
| | | "NSLocationAlwaysAndWhenInUseUsageDescription": "éè¦è·åæ¨çä½ç½®ä¿¡æ¯æ¥è®°å½å®¢æ·æè®¿å°ç¹" |
| | | } |
| | | }, |
| | | /* å¿«åºç¨ç¹æç¸å
³ */ |
| | | "quickapp" : {}, |
| | | /* å°ç¨åºç¹æç¸å
³ */ |
| | | "mp-weixin" : { |
| | | "appid" : "", |
| | | "setting" : { |
| | | "urlCheck" : false |
| | | }, |
| | | /* SDKé
ç½® */ |
| | | "sdkConfigs": { |
| | | "push": { |
| | | "unipush": { |
| | | "icons": { |
| | | "small": { |
| | | "ldpi": "D:/xindao/wenjian/img/logo/app.png" |
| | | } |
| | | }, |
| | | "offline": false |
| | | } |
| | | }, |
| | | "usingComponents" : true |
| | | "maps": { |
| | | "amap": { |
| | | "name": "amap_18330707920ae9zOwCD", |
| | | "appkey_ios": "c2b4e3889ab4cb9468e9c8ae4f3ab53f", |
| | | "appkey_android": "c2b4e3889ab4cb9468e9c8ae4f3ab53f" |
| | | } |
| | | } |
| | | }, |
| | | "icons": { |
| | | "android": { |
| | | "hdpi": "unpackage/res/icons/72x72.png", |
| | | "xhdpi": "unpackage/res/icons/96x96.png", |
| | | "xxhdpi": "unpackage/res/icons/144x144.png", |
| | | "xxxhdpi": "unpackage/res/icons/192x192.png" |
| | | }, |
| | | "ios": { |
| | | "appstore": "unpackage/res/icons/1024x1024.png", |
| | | "ipad": { |
| | | "app": "unpackage/res/icons/76x76.png", |
| | | "app@2x": "unpackage/res/icons/152x152.png", |
| | | "notification": "unpackage/res/icons/20x20.png", |
| | | "notification@2x": "unpackage/res/icons/40x40.png", |
| | | "proapp@2x": "unpackage/res/icons/167x167.png", |
| | | "settings": "unpackage/res/icons/29x29.png", |
| | | "settings@2x": "unpackage/res/icons/58x58.png", |
| | | "spotlight": "unpackage/res/icons/40x40.png", |
| | | "spotlight@2x": "unpackage/res/icons/80x80.png" |
| | | }, |
| | | "iphone": { |
| | | "app@2x": "unpackage/res/icons/120x120.png", |
| | | "app@3x": "unpackage/res/icons/180x180.png", |
| | | "notification@2x": "unpackage/res/icons/40x40.png", |
| | | "notification@3x": "unpackage/res/icons/60x60.png", |
| | | "settings@2x": "unpackage/res/icons/58x58.png", |
| | | "settings@3x": "unpackage/res/icons/87x87.png", |
| | | "spotlight@2x": "unpackage/res/icons/80x80.png", |
| | | "spotlight@3x": "unpackage/res/icons/120x120.png" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | /* å¿«åºç¨ç¹æç¸å
³ */ |
| | | "quickapp": {}, |
| | | /* å°ç¨åºç¹æç¸å
³ */ |
| | | "mp-weixin": { |
| | | "appid": "", |
| | | "setting": { |
| | | "urlCheck": false |
| | | }, |
| | | "mp-alipay" : { |
| | | "usingComponents" : true |
| | | }, |
| | | "mp-baidu" : { |
| | | "usingComponents" : true |
| | | }, |
| | | "mp-toutiao" : { |
| | | "usingComponents" : true |
| | | }, |
| | | "uniStatistics" : { |
| | | "enable" : false |
| | | }, |
| | | "vueVersion" : "3" |
| | | "usingComponents": true |
| | | }, |
| | | "mp-alipay": { |
| | | "usingComponents": true |
| | | }, |
| | | "mp-baidu": { |
| | | "usingComponents": true |
| | | }, |
| | | "mp-toutiao": { |
| | | "usingComponents": true |
| | | }, |
| | | "uniStatistics": { |
| | | "enable": false |
| | | }, |
| | | "vueVersion": "3" |
| | | } |
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/productionManagement/productionReport/workOrderList", |
| | | "style": { |
| | | "navigationBarTitleText": "ç产æ¥å·¥", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/productionManagement/productionReporting/ledger", |
| | | "style": { |
| | | "navigationBarTitleText": "æ¥å·¥å°è´¦", |
| | |
| | | { |
| | | label: "ç产æ¥å·¥", |
| | | icon: "/static/images/icon/shengchanbaogong.svg", |
| | | action: "scan", |
| | | route: "/pages/productionManagement/productionReport/workOrderList", |
| | | }, |
| | | { |
| | | label: "设å¤å·¡æ£", |
| | |
| | | } |
| | | |
| | | function handleQuickTool(item) { |
| | | if (item?.action === "scan") { |
| | | // ç产æ¥å·¥ - è°ç¨æ«ç |
| | | uni.scanCode({ |
| | | success: (res) => { |
| | | console.log("æ«ç ç»æ:", res); |
| | | // è§£ææ«ç ç»æå¹¶è·³è½¬å°ç产æ¥å·¥é¡µé¢ |
| | | try { |
| | | const scanResult = JSON.parse(res.result); |
| | | uni.navigateTo({ |
| | | url: `/pages/productionManagement/productionReport/index?orderRow=${encodeURIComponent(JSON.stringify(scanResult))}` |
| | | }); |
| | | } catch (e) { |
| | | console.error("æ«ç ç»æè§£æå¤±è´¥:", e); |
| | | uni.showToast({ title: "æ æçäºç»´ç ", icon: "none" }); |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | console.error("æ«ç 失败:", err); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | if (!item?.route) return; |
| | | uni.navigateTo({ url: item.route }); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="report-entry-page"> |
| | | <PageHeader title="ç产æ¥å·¥" |
| | | @back="goBack" /> |
| | | |
| | | <view class="scan-section"> |
| | | <view class="scan-card" |
| | | @click="startScan"> |
| | | <up-icon name="scan" |
| | | size="28" |
| | | color="#2979ff" /> |
| | | <view class="scan-text-wrap"> |
| | | <text class="scan-title">æ«ç æ¥å·¥</text> |
| | | </view> |
| | | <up-icon name="arrow-right" |
| | | size="18" |
| | | color="#c0c4cc" /> |
| | | </view> |
| | | </view> |
| | | |
| | | <scroll-view v-if="tableData.length > 0" |
| | | scroll-y |
| | | class="list-body" |
| | | @scrolltolower="loadMore"> |
| | | <view v-for="(item, index) in tableData" |
| | | :key="item.id || index" |
| | | class="ledger-item" |
| | | @click="onCardClick(item)"> |
| | | <view class="item-header"> |
| | | <view class="item-left"> |
| | | <view class="document-icon"> |
| | | <up-icon name="file-text" |
| | | size="16" |
| | | color="#ffffff" /> |
| | | </view> |
| | | <text class="item-id">{{ item.workOrderNo || "-" }}</text> |
| | | </view> |
| | | <view class="item-right operation-header-right"> |
| | | <view class="operation-pill"> |
| | | <text class="operation-pill-text">{{ operationNameOf(item) }}</text> |
| | | </view> |
| | | <view v-if="item.endOrder" |
| | | class="end-pill"> |
| | | <text class="end-pill-text">å·²ç»æ</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <up-divider /> |
| | | <view class="item-details"> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">ç产订åå·</text> |
| | | <text class="detail-value">{{ item.npsNo || "-" }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">产ååç§°</text> |
| | | <text class="detail-value">{{ item.productName || "-" }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">è§æ ¼</text> |
| | | <text class="detail-value">{{ item.model || "-" }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">åä½</text> |
| | | <text class="detail-value">{{ item.unit || "-" }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">éæ±æ°é</text> |
| | | <text class="detail-value">{{ item.planQuantity ?? "-" }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">宿æ°é</text> |
| | | <text class="detail-value">{{ item.completeQuantity ?? "-" }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <up-loadmore :status="loadStatus" /> |
| | | </scroll-view> |
| | | |
| | | <view v-else-if="!loading" |
| | | class="no-data"> |
| | | <up-empty mode="data" |
| | | text="ææ å·¥åæ°æ®" /> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive } from "vue"; |
| | | import { onShow } from "@dcloudio/uni-app"; |
| | | import PageHeader from "@/components/PageHeader.vue"; |
| | | import { productWorkOrderPage } from "@/api/productionManagement/workOrder.js"; |
| | | import { getProductWorkOrderById } from "@/api/productionManagement/productionReporting"; |
| | | import modal from "@/plugins/modal"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | |
| | | const userStore = useUserStore(); |
| | | |
| | | const loading = ref(false); |
| | | const tableData = ref([]); |
| | | const loadStatus = ref("loadmore"); |
| | | |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | total: 0, |
| | | }); |
| | | |
| | | const goBack = () => { |
| | | uni.navigateBack(); |
| | | }; |
| | | |
| | | const operationNameOf = item => |
| | | item?.operationName || item?.processName || "-"; |
| | | |
| | | const reportPermissionMessage = row => { |
| | | if (row.endOrder) return "该订åå·²ç»æï¼æ æ³æ¥å·¥"; |
| | | const pq = Number(row.planQuantity); |
| | | if (Number.isFinite(pq) && pq <= 0) return "å¾
ç产æ°é为0ï¼æ æ³æ¥å·¥"; |
| | | // if (row.userIds) { |
| | | // try { |
| | | // const userIds = |
| | | // typeof row.userIds === "string" ? JSON.parse(row.userIds) : row.userIds; |
| | | // if ( |
| | | // Array.isArray(userIds) && |
| | | // userIds.length > 0 && |
| | | // !userIds.some(id => String(id) === String(userStore.id)) |
| | | // ) { |
| | | // return "æ¨ä¸å¨è¯¥å·¥åçæå®æ¥å·¥äººèå´å
"; |
| | | // } |
| | | // } catch { |
| | | // return "工忥工æéæ ¡éªå¤±è´¥"; |
| | | // } |
| | | // } |
| | | return ""; |
| | | }; |
| | | |
| | | const navigateToReport = orderRowStr => { |
| | | uni.navigateTo({ |
| | | url: `/pages/productionManagement/productionReport/index?orderRow=${encodeURIComponent(orderRowStr)}`, |
| | | }); |
| | | }; |
| | | |
| | | const onCardClick = row => { |
| | | const msg = reportPermissionMessage(row); |
| | | if (msg) { |
| | | uni.showToast({ title: msg, icon: "none" }); |
| | | return; |
| | | } |
| | | navigateToReport(JSON.stringify(row)); |
| | | }; |
| | | |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | tableData.value = []; |
| | | getList(); |
| | | }; |
| | | |
| | | const getList = () => { |
| | | if (loading.value) return; |
| | | loading.value = true; |
| | | const params = { ...page }; |
| | | productWorkOrderPage(params) |
| | | .then(res => { |
| | | loading.value = false; |
| | | const records = res.data?.records || []; |
| | | tableData.value = |
| | | page.current === 1 ? records : [...tableData.value, ...records]; |
| | | page.total = res.data?.total ?? 0; |
| | | loadStatus.value = |
| | | tableData.value.length >= page.total ? "nomore" : "loadmore"; |
| | | }) |
| | | .catch(() => { |
| | | loading.value = false; |
| | | uni.showToast({ title: "å 载失败", icon: "none" }); |
| | | }); |
| | | }; |
| | | |
| | | const loadMore = () => { |
| | | if (loadStatus.value === "nomore" || loading.value) return; |
| | | page.current++; |
| | | getList(); |
| | | }; |
| | | |
| | | const startScan = () => { |
| | | uni.scanCode({ |
| | | success: async res => { |
| | | const scanResult = res.result; |
| | | let orderRow = ""; |
| | | |
| | | const isNumericId = /^\d+$/.test(String(scanResult).trim()); |
| | | |
| | | if (isNumericId) { |
| | | const workOrderId = String(scanResult).trim(); |
| | | modal.loading("æ£å¨è·åå·¥åä¿¡æ¯..."); |
| | | try { |
| | | const workRes = await getProductWorkOrderById({ id: workOrderId }); |
| | | modal.closeLoading(); |
| | | if (workRes.code === 200 && workRes.data) { |
| | | const workData = workRes.data; |
| | | if (workData.endOrder === true) { |
| | | modal.msgError("该订åå·²ç»æï¼æ æ³æ¥å·¥"); |
| | | return; |
| | | } |
| | | orderRow = JSON.stringify(workData); |
| | | } else { |
| | | modal.msgError("æªæ¾å°å¯¹åºçå·¥åä¿¡æ¯"); |
| | | return; |
| | | } |
| | | } catch (error) { |
| | | modal.closeLoading(); |
| | | modal.msgError( |
| | | "è·åå·¥åä¿¡æ¯å¤±è´¥: " + (error?.message || "æªç¥é误") |
| | | ); |
| | | return; |
| | | } |
| | | } else { |
| | | try { |
| | | const orderRowStart = scanResult.indexOf("orderRow={"); |
| | | if (orderRowStart !== -1) { |
| | | orderRow = scanResult.substring(orderRowStart + 9); |
| | | } else { |
| | | orderRow = scanResult; |
| | | } |
| | | JSON.parse(orderRow); |
| | | } catch { |
| | | try { |
| | | const parsed = JSON.parse(scanResult); |
| | | orderRow = JSON.stringify(parsed); |
| | | } catch { |
| | | modal.msgError("订åè§£æå¤±è´¥ï¼è¯·æ£æ¥äºç»´ç æ ¼å¼"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | navigateToReport(orderRow); |
| | | }, |
| | | fail: () => { |
| | | uni.showToast({ title: "æ«ç 失败", icon: "none" }); |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | onShow(() => { |
| | | handleQuery(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import "@/styles/sales-common.scss"; |
| | | |
| | | .report-entry-page { |
| | | min-height: 100vh; |
| | | background: #f8f9fa; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .scan-section { |
| | | padding: 12px 16px 8px; |
| | | } |
| | | |
| | | .scan-card { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 12px; |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | padding: 16px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | .scan-text-wrap { |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 4px; |
| | | } |
| | | |
| | | .scan-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | } |
| | | |
| | | .scan-desc { |
| | | font-size: 12px; |
| | | color: #909399; |
| | | } |
| | | |
| | | .list-body { |
| | | flex: 1; |
| | | height: 0; |
| | | padding: 12px 16px 20px; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .operation-header-right { |
| | | flex: 1; |
| | | min-width: 0; |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | gap: 8px; |
| | | } |
| | | |
| | | .operation-pill { |
| | | max-width: 58%; |
| | | min-width: 0; |
| | | padding: 5px 12px; |
| | | border-radius: 20px; |
| | | background: #e8f1ff; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .operation-pill-text { |
| | | font-size: 12px; |
| | | line-height: 1.35; |
| | | color: #2979ff; |
| | | font-weight: 500; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | display: block; |
| | | } |
| | | |
| | | .end-pill { |
| | | padding: 5px 10px; |
| | | border-radius: 20px; |
| | | background: #fef0f0; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .end-pill-text { |
| | | font-size: 12px; |
| | | line-height: 1.35; |
| | | color: #f56c6c; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .no-data { |
| | | flex: 1; |
| | | padding-top: 80px; |
| | | } |
| | | </style> |
| | |
| | | <script setup> |
| | | import { ref, onMounted, nextTick, reactive, computed } from "vue"; |
| | | import { userLoginFacotryList } from "@/api/login"; |
| | | import { getProductWorkOrderById } from "@/api/productionManagement/productionReporting"; |
| | | import DownloadProgressMask from "@/components/DownloadProgressMask.vue"; |
| | | import modal from "@/plugins/modal"; |
| | | import useUserStore from "@/store/modules/user"; |
| | |
| | | }); |
| | | break; |
| | | case "ç产æ¥å·¥": |
| | | getcode(); |
| | | uni.navigateTo({ |
| | | url: "/pages/productionManagement/productionReport/workOrderList", |
| | | }); |
| | | break; |
| | | case "æ¥å·¥å°è´¦": |
| | | uni.navigateTo({ |
| | |
| | | factoryList.value = []; |
| | | }); |
| | | } |
| | | const getcode = async () => { |
| | | uni.scanCode({ |
| | | success: async res => { |
| | | // è§£æäºç»´ç å
容 |
| | | const scanResult = res.result; |
| | | let orderRow = ""; |
| | | |
| | | // å¤ææ«æç»ææ¯å¦ä¸ºçº¯æ°åï¼idï¼ |
| | | const isNumericId = /^\d+$/.test(scanResult.trim()); |
| | | |
| | | if (isNumericId) { |
| | | // 妿æ¯çº¯æ°åï¼æ ¹æ® id è·åå·¥åæ°æ® |
| | | const workOrderId = scanResult.trim(); |
| | | modal.loading("æ£å¨è·åå·¥åä¿¡æ¯..."); |
| | | try { |
| | | const workRes = await getProductWorkOrderById({ id: workOrderId }); |
| | | modal.closeLoading(); |
| | | |
| | | console.log("å·¥åæ¥è¯¢ç»æ:", workRes); |
| | | |
| | | if (workRes.code === 200 && workRes.data) { |
| | | // æ°æ¥å£è¿åçæ¯å个对象ï¼ä¸æ¯æ°ç» |
| | | const workData = workRes.data; |
| | | console.log("工忰æ®:", workData); |
| | | |
| | | if (workData.endOrder === true) { |
| | | modal.msgError("该订åå·²ç»æï¼æ æ³æ¥å·¥"); |
| | | return; |
| | | } |
| | | |
| | | orderRow = JSON.stringify(workData); |
| | | |
| | | console.log("æé çorderRow:", orderRow); |
| | | } else { |
| | | modal.msgError("æªæ¾å°å¯¹åºçå·¥åä¿¡æ¯"); |
| | | return; |
| | | } |
| | | } catch (error) { |
| | | modal.closeLoading(); |
| | | console.error("è·åå·¥åä¿¡æ¯å¤±è´¥:", error); |
| | | modal.msgError("è·åå·¥åä¿¡æ¯å¤±è´¥: " + (error.message || "æªç¥é误")); |
| | | return; |
| | | } |
| | | } else { |
| | | // 妿䏿¯çº¯æ°åï¼å°è¯ä»æ«ç ç»æä¸æåorderRowåæ° |
| | | try { |
| | | // å¤çæ··åæ ¼å¼: http://...?orderRow={...} |
| | | const orderRowStart = scanResult.indexOf("orderRow={"); |
| | | if (orderRowStart !== -1) { |
| | | // æåä»orderRow={å¼å§çJSONå
容 |
| | | const jsonPart = scanResult.substring(orderRowStart + 9); // 9æ¯"orderRow=".length |
| | | orderRow = jsonPart; |
| | | } else { |
| | | // å¦æç´æ¥æ¯JSONå符串ï¼å°è¯è§£æ |
| | | orderRow = scanResult; |
| | | } |
| | | } catch (e) { |
| | | console.error(e, "è§£æå¤±è´¥====????====="); |
| | | orderRow = ""; |
| | | } |
| | | |
| | | // éªè¯æ¯å¦ä¸ºææçJSON |
| | | try { |
| | | JSON.parse(orderRow); |
| | | } catch (error) { |
| | | modal.msgError("订åè§£æå¤±è´¥ï¼è¯·æ£æ¥äºç»´ç æ ¼å¼"); |
| | | return; |
| | | } |
| | | } |
| | | // æ«ç æåå跳转å°ç产æ¥å·¥é¡µé¢ï¼å¹¶ä¼ éorderRowåæ° |
| | | uni.navigateTo({ |
| | | url: `/pages/productionManagement/productionReport/index?orderRow=${orderRow}`, |
| | | }); |
| | | }, |
| | | fail: err => { |
| | | uni.showToast({ |
| | | title: "æ«ç 失败", |
| | | icon: "none", |
| | | }); |
| | | }, |
| | | }); |
| | | }; |
| | | const changeFactory = async arr => { |
| | | show.value = false; |
| | | const factoryId = factoryListTem.value[arr.indexs[0]].deptId; |