902890b673c06bf7d145dab94532d7d0c6b82530..27c416bf9742574411401fb67203ee9669e57c8a
2025-11-26 spring
fix: 绞线报工的盘具领用和芯线领用的厂家字段使用字典维护做下拉框
27c416 对比 | 目录
2025-11-26 spring
fix: 添加版本可见
5422df 对比 | 目录
已修改8个文件
464 ■■■■ 文件已修改
.env.development 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/manifest.json 222 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/login/index.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/mine/index.vue 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/receive/plate/form.vue 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/receive/plate/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/receive/steelCore/form.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/report/draw.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -7,13 +7,13 @@
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' #
src/manifest.json
@@ -1,116 +1,116 @@
{
  "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"
}
src/pages/login/index.vue
@@ -75,6 +75,11 @@
          <text class="text">和</text>
          <text class="link" @click="navigateToPrivacy">《隐私政策》</text>
        </view>
        <!-- 版本号 -->
        <view class="version">
          <text class="version-text">版本号:{{ versionName }}</text>
        </view>
      </view>
    </view>
@@ -87,12 +92,41 @@
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>({
@@ -384,4 +418,16 @@
.agreement .link {
  color: #165dff;
}
.version {
  display: flex;
  justify-content: center;
  margin-top: 20rpx;
  margin-bottom: 20rpx;
}
.version-text {
  font-size: 22rpx;
  color: #9ca3af;
}
</style>
src/pages/mine/index.vue
@@ -7,7 +7,7 @@
        <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">
@@ -16,7 +16,7 @@
        </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>
@@ -215,6 +215,11 @@
      <wd-button class="logout-btn" @click="handleLogout">退出登录</wd-button>
    </view>
    <!-- 版本号 -->
    <view class="version">
      <text class="version-text">版本号:{{ versionName }}</text>
    </view>
    <wd-toast />
  </view>
</template>
@@ -223,7 +228,7 @@
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();
@@ -231,6 +236,35 @@
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 = () => {
@@ -661,4 +695,17 @@
    }
  }
}
// 版本号
.version {
  display: flex;
  justify-content: center;
  margin-top: 20rpx;
  margin-bottom: 40rpx;
}
.version-text {
  font-size: 22rpx;
  color: #9ca3af;
}
</style>
src/pages/production/twist/receive/plate/form.vue
@@ -27,13 +27,25 @@
        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 />
@@ -41,6 +53,7 @@
</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";
@@ -64,6 +77,7 @@
  diskMaterial: undefined, // 盘具类型
  model: undefined, // 尺寸
  amount: undefined, // 数量
  unit: "只", // 单位,默认值为"只"
  supplier: undefined,
  type: "盘具",
});
@@ -75,6 +89,12 @@
// 盘具类型字典数据
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 () => {
@@ -91,9 +111,56 @@
  }
};
// 加载单位字典数据
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 变化,同步选择器显示
@@ -139,6 +206,7 @@
        diskMaterial: model.diskMaterial,
        model: model.model,
        amount: model.amount,
        unit: model.unit,
        supplier: model.supplier,
        type: model.type,
      };
@@ -175,6 +243,7 @@
    model.diskMaterial = currentItem.diskMaterial;
    model.model = currentItem.model;
    model.amount = currentItem.amount;
    model.unit = currentItem.unit || "只";
    model.supplier = currentItem.supplier;
    model.type = currentItem.type || "盘具";
    // 设置盘具类型的回显值
@@ -188,6 +257,8 @@
onMounted(async () => {
  await loadDiskMaterialDict();
  await loadUnitDict();
  await loadSupplierDict();
});
// 监听编辑数据变化,自动回显
@@ -198,6 +269,7 @@
      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 || "";
@@ -211,6 +283,7 @@
  model.diskMaterial = undefined;
  model.model = undefined;
  model.amount = undefined;
  model.unit = "只";
  model.supplier = undefined;
  model.type = "盘具";
  diskMaterialValue.value = "";
src/pages/production/twist/receive/plate/index.vue
@@ -85,6 +85,10 @@
    prop: "amount",
  },
  {
    label: "单位",
    prop: "unit",
  },
  {
    label: "厂家",
    prop: "supplier",
    span: 14,
src/pages/production/twist/receive/steelCore/form.vue
@@ -43,19 +43,22 @@
        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";
@@ -95,6 +98,9 @@
const diskMaterialOptions = ref<Array<{ label: string; value: string }>>([]);
const diskMaterialValue = ref("");
// 厂家字典数据
const supplierOptions = ref<Array<{ label: string; value: string }>>([]);
// 加载芯线类型字典数据
const loadDiskMaterialDict = async () => {
  try {
@@ -110,9 +116,29 @@
  }
};
// 加载厂家字典数据
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 变化,同步选择器显示
@@ -256,6 +282,7 @@
onMounted(async () => {
  await loadDiskMaterialDict();
  await loadSupplierDict();
});
defineExpose({
src/pages/production/twist/report/draw.vue
@@ -161,11 +161,14 @@
                ></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
@@ -199,7 +202,7 @@
</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";
@@ -246,6 +249,12 @@
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 {