| | |
| | | VITE_APP_PORT = 4096 |
| | | |
| | | # API 基础路径,开发环境下的请求前缀 |
| | | #VITE_APP_BASE_API = 'http://114.132.189.42:7002/mes' |
| | | # VITE_APP_BASE_API = 'http://114.132.189.42:7002/mes' |
| | | VITE_APP_BASE_API = 'http://192.168.10.119:7002/mes' # 邹裕 |
| | | # VITE_APP_BASE_API = 'http://192.168.100.131:7002/mes' # |
| | | # VITE_APP_BASE_API = 'http://114.132.189.42:7002/mes' |
| | | # VITE_APP_BASE_API = 'http://192.168.10.119:7002/mes' # 邹裕 |
| | | VITE_APP_BASE_API = 'http://192.168.100.131:7002/mes' # |
| | | |
| | | # API 服务器的 URL |
| | | #VITE_APP_API_URL = 'http://114.132.189.42:7002/mes' |
| | | VITE_APP_API_URL = 'http://192.168.10.119:7002/mes' |
| | | # VITE_APP_API_URL = 'http://192.168.100.131:7002/mes' # |
| | | # VITE_APP_API_URL = 'http://114.132.189.42:7002/mes' |
| | | # VITE_APP_API_URL = 'http://192.168.10.119:7002/mes' |
| | | VITE_APP_API_URL = 'http://192.168.100.131:7002/mes' # |
| | | |
| | |
| | | { |
| | | "name": "线缆上报", |
| | | "appid": "__UNI__F64E0A4", |
| | | "description": "", |
| | | "versionName": "1.0.15", |
| | | "versionCode": "100", |
| | | "transformPx": false, |
| | | /* 5+App特有相关 */ |
| | | "app-plus": { |
| | | "usingComponents": true, |
| | | "nvueStyleCompiler": "uni-app", |
| | | "compilerVersion": 3, |
| | | "compatible": { |
| | | "ignoreVersion": true // true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持 |
| | | }, |
| | | "splashscreen": { |
| | | "alwaysShowBeforeRender": true, |
| | | "waiting": true, |
| | | "autoclose": true, |
| | | "delay": 0 |
| | | }, |
| | | /* 模块配置 */ |
| | | "modules": { |
| | | "Camera": {}, |
| | | "Gallery": {} |
| | | }, |
| | | /* 应用发布信息 */ |
| | | "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.READ_EXTERNAL_STORAGE\"/>", |
| | | "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_MEDIA_IMAGES\"/>", |
| | | "<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.RECEIVE_BOOT_COMPLETED\"/>" |
| | | ] |
| | | }, |
| | | /* ios打包配置 */ |
| | | "ios": { |
| | | "dSYMs": false |
| | | }, |
| | | /* SDK配置 */ |
| | | "sdkConfigs": {}, |
| | | "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" |
| | | "name" : "线缆上报", |
| | | "appid" : "__UNI__F64E0A4", |
| | | "description" : "", |
| | | "versionName" : "1.0.20", |
| | | "versionCode" : "100", |
| | | "transformPx" : false, |
| | | /* 5+App特有相关 */ |
| | | "app-plus" : { |
| | | "usingComponents" : true, |
| | | "nvueStyleCompiler" : "uni-app", |
| | | "compilerVersion" : 3, |
| | | "compatible" : { |
| | | "ignoreVersion" : true // true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持 |
| | | }, |
| | | "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" |
| | | } |
| | | "splashscreen" : { |
| | | "alwaysShowBeforeRender" : true, |
| | | "waiting" : true, |
| | | "autoclose" : true, |
| | | "delay" : 0 |
| | | }, |
| | | /* 模块配置 */ |
| | | "modules" : { |
| | | "Camera" : {}, |
| | | "Gallery" : {} |
| | | }, |
| | | /* 应用发布信息 */ |
| | | "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.READ_EXTERNAL_STORAGE\"/>", |
| | | "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_MEDIA_IMAGES\"/>", |
| | | "<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.RECEIVE_BOOT_COMPLETED\"/>" |
| | | ] |
| | | }, |
| | | /* ios打包配置 */ |
| | | "ios" : { |
| | | "dSYMs" : false |
| | | }, |
| | | /* SDK配置 */ |
| | | "sdkConfigs" : {}, |
| | | "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 |
| | | }, |
| | | "usingComponents": true |
| | | }, |
| | | "mp-alipay": { |
| | | "usingComponents": true |
| | | }, |
| | | "mp-baidu": { |
| | | "usingComponents": true |
| | | }, |
| | | "mp-toutiao": { |
| | | "usingComponents": true |
| | | }, |
| | | "uniStatistics": { |
| | | "enable": false |
| | | }, |
| | | "vueVersion": "3" |
| | | /* 快应用特有相关 */ |
| | | "quickapp" : {}, |
| | | /* 小程序特有相关 */ |
| | | "mp-weixin" : { |
| | | "appid" : "", |
| | | "setting" : { |
| | | "urlCheck" : false |
| | | }, |
| | | "usingComponents" : true |
| | | }, |
| | | "mp-alipay" : { |
| | | "usingComponents" : true |
| | | }, |
| | | "mp-baidu" : { |
| | | "usingComponents" : true |
| | | }, |
| | | "mp-toutiao" : { |
| | | "usingComponents" : true |
| | | }, |
| | | "uniStatistics" : { |
| | | "enable" : false |
| | | }, |
| | | "vueVersion" : "3" |
| | | } |
| | |
| | | <text class="text">和</text> |
| | | <text class="link" @click="navigateToPrivacy">《隐私政策》</text> |
| | | </view> |
| | | |
| | | <!-- 版本号 --> |
| | | <view class="version"> |
| | | <text class="version-text">版本号:{{ versionName }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | import { type LoginFormData } from "@/api/auth"; |
| | | import { useUserStore } from "@/store/modules/user"; |
| | | import { useToast } from "wot-design-uni"; |
| | | import { ref } from "vue"; |
| | | import { ref, onMounted } from "vue"; |
| | | |
| | | const loginFormRef = ref(); |
| | | const toast = useToast(); |
| | | const loading = ref(false); |
| | | const userStore = useUserStore(); |
| | | |
| | | // 版本号 |
| | | const versionName = ref("1.0.16"); |
| | | |
| | | // 获取版本号 |
| | | onMounted(() => { |
| | | // #ifdef MP-WEIXIN |
| | | try { |
| | | const accountInfo = uni.getAccountInfoSync(); |
| | | if (accountInfo?.miniProgram?.version) { |
| | | versionName.value = accountInfo.miniProgram.version; |
| | | } |
| | | } catch (e) { |
| | | // 获取失败时使用默认值 |
| | | } |
| | | // #endif |
| | | |
| | | // #ifdef APP-PLUS |
| | | try { |
| | | // @ts-ignore |
| | | if (plus?.runtime?.version) { |
| | | // @ts-ignore |
| | | versionName.value = plus.runtime.version; |
| | | } |
| | | } catch (e) { |
| | | // 获取失败时使用默认值 |
| | | } |
| | | // #endif |
| | | }); |
| | | |
| | | // 登录表单数据 |
| | | const loginFormData = ref<LoginFormData>({ |
| | |
| | | .agreement .link { |
| | | color: #165dff; |
| | | } |
| | | |
| | | .version { |
| | | display: flex; |
| | | justify-content: center; |
| | | margin-top: 20rpx; |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | .version-text { |
| | | font-size: 22rpx; |
| | | color: #9ca3af; |
| | | } |
| | | </style> |
| | |
| | | <view class="avatar-container" @click="navigateToProfile"> |
| | | <image |
| | | class="avatar" |
| | | :src="isLogin ? userInfo!.avatar : defaultAvatar" |
| | | :src="isLogin ? userInfo?.avatar : defaultAvatar" |
| | | mode="aspectFill" |
| | | /> |
| | | <view v-if="isLogin" class="avatar-edit"> |
| | |
| | | </view> |
| | | <view class="user-details"> |
| | | <block v-if="isLogin"> |
| | | <view class="nickname">{{ userInfo!.nickname || "匿名用户" }}</view> |
| | | <view class="nickname">{{ userInfo?.nickname || "匿名用户" }}</view> |
| | | <view class="user-id">ID: {{ userInfo?.username || "0000000" }}</view> |
| | | </block> |
| | | <block v-else> |
| | |
| | | <wd-button class="logout-btn" @click="handleLogout">退出登录</wd-button> |
| | | </view> |
| | | |
| | | <!-- 版本号 --> |
| | | <view class="version"> |
| | | <text class="version-text">版本号:{{ versionName }}</text> |
| | | </view> |
| | | |
| | | <wd-toast /> |
| | | </view> |
| | | </template> |
| | |
| | | import { useToast } from "wot-design-uni"; |
| | | import { useUserStore } from "@/store/modules/user"; |
| | | import { useThemeStore } from "@/store/modules/theme"; |
| | | import { computed } from "vue"; |
| | | import { computed, ref, onMounted } from "vue"; |
| | | |
| | | const toast = useToast(); |
| | | const userStore = useUserStore(); |
| | |
| | | const userInfo = computed(() => userStore.userInfo); |
| | | const isLogin = computed(() => !!userInfo.value); |
| | | const defaultAvatar = "/static/images/default-avatar.png"; |
| | | |
| | | // 版本号 |
| | | const versionName = ref("1.0.16"); |
| | | |
| | | // 获取版本号 |
| | | onMounted(() => { |
| | | // #ifdef MP-WEIXIN |
| | | try { |
| | | const accountInfo = uni.getAccountInfoSync(); |
| | | if (accountInfo?.miniProgram?.version) { |
| | | versionName.value = accountInfo.miniProgram.version; |
| | | } |
| | | } catch (e) { |
| | | // 获取失败时使用默认值 |
| | | } |
| | | // #endif |
| | | |
| | | // #ifdef APP-PLUS |
| | | try { |
| | | // @ts-ignore |
| | | if (plus?.runtime?.version) { |
| | | // @ts-ignore |
| | | versionName.value = plus.runtime.version; |
| | | } |
| | | } catch (e) { |
| | | // 获取失败时使用默认值 |
| | | } |
| | | // #endif |
| | | }); |
| | | |
| | | // 登录 |
| | | const navigateToLoginPage = () => { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 版本号 |
| | | .version { |
| | | display: flex; |
| | | justify-content: center; |
| | | margin-top: 20rpx; |
| | | margin-bottom: 40rpx; |
| | | } |
| | | |
| | | .version-text { |
| | | font-size: 22rpx; |
| | | color: #9ca3af; |
| | | } |
| | | </style> |
| | |
| | | clearable |
| | | placeholder="请输入数量" |
| | | /> |
| | | <wd-input |
| | | <wd-picker |
| | | v-model="model.unit" |
| | | :columns="unitOptions" |
| | | label="单位" |
| | | label-width="100px" |
| | | prop="unit" |
| | | placeholder="请选择单位" |
| | | clearable |
| | | @confirm="handleUnitChange" |
| | | /> |
| | | <wd-picker |
| | | v-model="model.supplier" |
| | | :columns="supplierOptions" |
| | | label="厂家" |
| | | label-width="100px" |
| | | prop="supplier" |
| | | placeholder="请选择厂家" |
| | | clearable |
| | | placeholder="请输入厂家" |
| | | @confirm="handleSupplierChange" |
| | | /> |
| | | </wd-cell-group> |
| | | <wd-toast /> |
| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { onMounted, watch } from "vue"; |
| | | import useFormData from "@/hooks/useFormData"; |
| | | import TwistApi from "@/api/product/twist"; |
| | | import ManageApi from "@/api/product/manage"; |
| | |
| | | diskMaterial: undefined, // 盘具类型 |
| | | model: undefined, // 尺寸 |
| | | amount: undefined, // 数量 |
| | | unit: "只", // 单位,默认值为"只" |
| | | supplier: undefined, |
| | | type: "盘具", |
| | | }); |
| | |
| | | // 盘具类型字典数据 |
| | | const diskMaterialOptions = ref<Array<{ label: string; value: string }>>([]); |
| | | const diskMaterialValue = ref(""); |
| | | |
| | | // 单位字典数据 |
| | | const unitOptions = ref<Array<{ label: string; value: string }>>([]); |
| | | |
| | | // 厂家字典数据 |
| | | const supplierOptions = ref<Array<{ label: string; value: string }>>([]); |
| | | |
| | | // 加载盘具类型字典数据 |
| | | const loadDiskMaterialDict = async () => { |
| | |
| | | } |
| | | }; |
| | | |
| | | // 加载单位字典数据 |
| | | const loadUnitDict = async () => { |
| | | try { |
| | | const res = await ManageApi.dictAPI("technical_weight_unit"); |
| | | if (res.data && Array.isArray(res.data)) { |
| | | unitOptions.value = res.data.map((item: any) => ({ |
| | | label: item.dictLabel || "", |
| | | value: item.dictValue || "", |
| | | })); |
| | | // 设置默认值为"只",如果字典中有"只"选项 |
| | | const defaultOption = unitOptions.value.find( |
| | | (item) => item.label === "只" || item.value === "只" |
| | | ); |
| | | if (defaultOption && !model.unit) { |
| | | model.unit = defaultOption.value; |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 加载字典失败,静默处理 |
| | | } |
| | | }; |
| | | |
| | | // 加载厂家字典数据 |
| | | const loadSupplierDict = async () => { |
| | | try { |
| | | const res = await ManageApi.dictAPI("factory"); |
| | | if (res.data && Array.isArray(res.data)) { |
| | | supplierOptions.value = res.data.map((item: any) => ({ |
| | | label: item.dictLabel || "", |
| | | value: item.dictValue || "", |
| | | })); |
| | | } |
| | | } catch (error) { |
| | | // 加载字典失败,静默处理 |
| | | } |
| | | }; |
| | | |
| | | // 处理盘具类型选择 |
| | | const handleDiskMaterialChange = (val: any) => { |
| | | model.diskMaterial = val.value; |
| | | }; |
| | | |
| | | // 处理单位选择 |
| | | const handleUnitChange = (val: any) => { |
| | | model.unit = val.value; |
| | | }; |
| | | |
| | | // 处理厂家选择 |
| | | const handleSupplierChange = (val: any) => { |
| | | model.supplier = val.value; |
| | | }; |
| | | |
| | | // 监听 model.diskMaterial 变化,同步选择器显示 |
| | |
| | | diskMaterial: model.diskMaterial, |
| | | model: model.model, |
| | | amount: model.amount, |
| | | unit: model.unit, |
| | | supplier: model.supplier, |
| | | type: model.type, |
| | | }; |
| | |
| | | model.diskMaterial = currentItem.diskMaterial; |
| | | model.model = currentItem.model; |
| | | model.amount = currentItem.amount; |
| | | model.unit = currentItem.unit || "只"; |
| | | model.supplier = currentItem.supplier; |
| | | model.type = currentItem.type || "盘具"; |
| | | // 设置盘具类型的回显值 |
| | |
| | | |
| | | onMounted(async () => { |
| | | await loadDiskMaterialDict(); |
| | | await loadUnitDict(); |
| | | await loadSupplierDict(); |
| | | }); |
| | | |
| | | // 监听编辑数据变化,自动回显 |
| | |
| | | model.diskMaterial = newData.diskMaterial || ""; |
| | | model.model = newData.model || ""; |
| | | model.amount = newData.amount || ""; |
| | | model.unit = newData.unit || "只"; |
| | | model.supplier = newData.supplier || ""; |
| | | model.type = newData.type || "盘具"; |
| | | diskMaterialValue.value = newData.diskMaterial || ""; |
| | |
| | | model.diskMaterial = undefined; |
| | | model.model = undefined; |
| | | model.amount = undefined; |
| | | model.unit = "只"; |
| | | model.supplier = undefined; |
| | | model.type = "盘具"; |
| | | diskMaterialValue.value = ""; |
| | |
| | | prop: "amount", |
| | | }, |
| | | { |
| | | label: "单位", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "厂家", |
| | | prop: "supplier", |
| | | span: 14, |
| | |
| | | clearable |
| | | placeholder="请输入重量" |
| | | /> |
| | | <wd-input |
| | | <wd-picker |
| | | v-model="model.supplier" |
| | | :columns="supplierOptions" |
| | | label="厂家" |
| | | label-width="100px" |
| | | prop="supplier" |
| | | placeholder="请选择厂家" |
| | | clearable |
| | | placeholder="请输入厂家" |
| | | @confirm="handleSupplierChange" |
| | | /> |
| | | </wd-cell-group> |
| | | </wd-form> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { onMounted, watch } from "vue"; |
| | | import useFormData from "@/hooks/useFormData"; |
| | | import TwistApi from "@/api/product/twist"; |
| | | import ManageApi from "@/api/product/manage"; |
| | |
| | | const diskMaterialOptions = ref<Array<{ label: string; value: string }>>([]); |
| | | const diskMaterialValue = ref(""); |
| | | |
| | | // 厂家字典数据 |
| | | const supplierOptions = ref<Array<{ label: string; value: string }>>([]); |
| | | |
| | | // 加载芯线类型字典数据 |
| | | const loadDiskMaterialDict = async () => { |
| | | try { |
| | |
| | | } |
| | | }; |
| | | |
| | | // 加载厂家字典数据 |
| | | const loadSupplierDict = async () => { |
| | | try { |
| | | const res = await ManageApi.dictAPI("factory"); |
| | | if (res.data && Array.isArray(res.data)) { |
| | | supplierOptions.value = res.data.map((item: any) => ({ |
| | | label: item.dictLabel || "", |
| | | value: item.dictValue || "", |
| | | })); |
| | | } |
| | | } catch (error) { |
| | | // 加载字典失败,静默处理 |
| | | } |
| | | }; |
| | | |
| | | // 处理芯线类型选择 |
| | | const handleDiskMaterialChange = (val: any) => { |
| | | model.diskMaterial = val.value; |
| | | }; |
| | | |
| | | // 处理厂家选择 |
| | | const handleSupplierChange = (val: any) => { |
| | | model.supplier = val.value; |
| | | }; |
| | | |
| | | // 监听 model.diskMaterial 变化,同步选择器显示 |
| | |
| | | |
| | | onMounted(async () => { |
| | | await loadDiskMaterialDict(); |
| | | await loadSupplierDict(); |
| | | }); |
| | | |
| | | defineExpose({ |
| | |
| | | ></wd-input> |
| | | </wd-form-item> |
| | | <wd-form-item label="绞向" prop="twistedDirection" required> |
| | | <wd-input |
| | | <wd-select-picker |
| | | v-model="localSteelData.twistedDirection" |
| | | :columns="twistDirectionColumns" |
| | | type="radio" |
| | | placeholder="请选择绞向" |
| | | :clearable="false" |
| | | :disabled="false" |
| | | placeholder="请输入" |
| | | ></wd-input> |
| | | /> |
| | | </wd-form-item> |
| | | <wd-form-item label="外径" prop="outerDiameter" required> |
| | | <wd-input |
| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref, watch, nextTick } from "vue"; |
| | | import { ref, watch, nextTick, onMounted } from "vue"; |
| | | import { useToast } from "wot-design-uni"; |
| | | import TwistApi from "@/api/product/twist"; |
| | | import ManageApi from "@/api/product/manage"; |
| | |
| | | const paintQualityOptions = ref<Array<{ label: string; value: string | number }>>([]); |
| | | const weldQualityOptions = ref<Array<{ label: string; value: string | number }>>([]); |
| | | |
| | | // 绞向选项 |
| | | const twistDirectionColumns = [ |
| | | { label: "左向", value: "左向" }, |
| | | { label: "右向", value: "右向" }, |
| | | ]; |
| | | |
| | | // 从数据字典中加载数据 |
| | | const loadDictData = async () => { |
| | | try { |