解决无法启动以及启动时报错问题

This commit is contained in:
BianLzhaoMin 2025-05-30 09:42:34 +08:00
parent 293da5a635
commit d2f9a8c965
8 changed files with 14967 additions and 15134 deletions

3877
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,7 @@
"pinia": "^2.2.2",
"pinia-plugin-persistedstate": "^3.2.3",
"sass": "^1.32.13",
"sass-loader": "^16.0.3",
"sass-loader": "^10.1.1",
"vue": "^3.5.13",
"vue-i18n": "^9.14.1"
},

View File

@ -2,12 +2,7 @@
<view class="accept page-common">
<div class="card">
<h2 style="padding: 4rpx 0; font-weight: bold">转出方信息</h2>
<uni-forms
:model="formDataOut"
ref="formOut"
label-width="200rpx"
:rule="rulesOut.value"
>
<uni-forms :model="formDataOut" ref="formOut" label-width="200rpx" :rule="rulesOut.value">
<uni-forms-item label="转出单位:" name="unitId" required>
<eselect
style="width: 100%; height: 90rpx"
@ -82,11 +77,7 @@
/>
</uni-forms-item>
<uni-forms-item label="联系电话:" name="phoneIn" required>
<uni-easyinput
v-model="formDataIn.phoneIn"
maxlength="11"
placeholder="请输入联系电话"
/>
<uni-easyinput v-model="formDataIn.phoneIn" maxlength="11" placeholder="请输入联系电话" />
</uni-forms-item>
</uni-forms>
</div>
@ -97,18 +88,9 @@
<!-- 上传按钮仅当上传图片数量少于 3 张时显示 -->
<div class="upload" @click="uploadImg" v-if="bmFileInfos.length < 3">+</div>
<!-- 动态展示已上传的图片 -->
<div
class="upload"
@click="uploadImg"
v-for="(img, index) in bmFileInfos"
:key="index"
>
<div class="upload" @click="uploadImg" v-for="(img, index) in bmFileInfos" :key="index">
<div class="image-container">
<image
:src="img.urlTemp"
style="width: 160rpx; height: 160rpx"
mode=""
></image>
<image :src="img.urlTemp" style="width: 160rpx; height: 160rpx" mode=""></image>
<!-- 删除 logo这里用一个 span 模拟可替换为实际的 logo 图片 -->
<span class="delete-logo" @click.stop="deleteImg(index)">&times;</span>
</div>
@ -136,7 +118,7 @@ import {
getAgreementInfoById,
getListsByConfigId,
getTypeDataList,
leaseTask,
// leaseTask,
} from '../../services/back.js'
import { getDirectRotationDetail } from '@/services/integratedQuery'
@ -295,7 +277,7 @@ const getUnitOut = () => {
}
getUnitList(obj)
.then((res) => {
console.log("xxxxxxxxxx",res)
console.log('xxxxxxxxxx', res)
unitListOut.value = res.data
// getAgreement()
if (formDataOut.value.unitId && formDataOut.value.projectId) {
@ -487,7 +469,7 @@ onReady((opt) => {
console.log('🚀 ~ opt:', opt)
onLoad((options) => {
console.log("uuuuuuuuuuuuu",options)
console.log('uuuuuuuuuuuuu', options)
if (options && options.params) {
opt = JSON.parse(options.params)
}

View File

@ -248,7 +248,7 @@ import {
insertApp,
getAgreementInfoById,
getTypeDataList,
leaseTask,
// leaseTask,
discountSubmit,
} from '../../services/back.js'
import {

View File

@ -1,11 +1,20 @@
<template>
<view class="accept page-common">
<div class="card">
<uni-forms :model="formData" ref="form" label-width="200rpx" :rule="rules.value" :border="true" >
<uni-forms
:model="formData"
ref="form"
label-width="200rpx"
:rule="rules.value"
:border="true"
>
<uni-forms-item label="领用班组" name="teamId" required>
<uni-data-select v-model="formData.teamId"
<uni-data-select
v-model="formData.teamId"
placeholder="请选择领用班组"
:localdata="unitList" @change="getUnit" >
:localdata="unitList"
@change="getUnit"
>
</uni-data-select>
<!-- <eselect
style="width: 100%; height: 90rpx"
@ -46,13 +55,13 @@
></eselect>
</uni-forms-item>
<uni-forms-item label="附件" label-width="100rpx" v-if="flagFile">
<div class="upload-wrapper" style="display: flex; flex-wrap: wrap;">
<div class="upload-wrapper" style="display: flex; flex-wrap: wrap">
<!-- 上传按钮仅当上传图片数量少于 3 张时显示 -->
<div class="upload" @click="uploadImg" v-if="bmFileInfos.length < 3">+</div>
<!-- 动态展示已上传的图片 -->
<div class="upload" @click="uploadImg" v-for="(img, index) in bmFileInfos" :key="index">
<div class="image-container">
<image :src="img.urlTemp" style="width: 160rpx;height: 160rpx;" mode=""></image>
<image :src="img.urlTemp" style="width: 160rpx; height: 160rpx" mode=""></image>
<!-- 删除 logo这里用一个 span 模拟可替换为实际的 logo 图片 -->
<span class="delete-logo" @click.stop="deleteImg(index)">&times;</span>
</div>
@ -66,17 +75,23 @@
<uni-row :gutter="24" style="display: flex; align-items: center">
<uni-col :span="10">
<view>
<uni-data-select v-model="typeId"
<uni-data-select
v-model="typeId"
placeholder="请选择物资类型"
:localdata="maTypeSelectList" @change="getMaCode" >
:localdata="maTypeSelectList"
@change="getMaCode"
>
</uni-data-select>
</view>
</uni-col>
<uni-col :span="10">
<view>
<uni-data-select v-model="typeCode"
<uni-data-select
v-model="typeCode"
placeholder="请选择规格型号"
:localdata="maCodeSelectList" @change="selectMaCode" >
:localdata="maCodeSelectList"
@change="selectMaCode"
>
</uni-data-select>
</view>
</uni-col>
@ -86,19 +101,19 @@
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr>
<uni-th width="100px" style="font-size: 24rpx;" align="center">类型名称</uni-th>
<uni-th width="100px" style="font-size: 24rpx;" align="center">规格型号</uni-th>
<uni-th width="90px" style="font-size: 24rpx;" align="center">计量单位</uni-th>
<uni-th width="90px" style="font-size: 24rpx;" align="center">预领数量</uni-th>
<uni-th width="90px" style="font-size: 24rpx;" align="center">备注</uni-th>
<uni-th width="70px" style="font-size: 24rpx;" align="center">操作</uni-th>
<uni-th width="100px" style="font-size: 24rpx" align="center">类型名称</uni-th>
<uni-th width="100px" style="font-size: 24rpx" align="center">规格型号</uni-th>
<uni-th width="90px" style="font-size: 24rpx" align="center">计量单位</uni-th>
<uni-th width="90px" style="font-size: 24rpx" align="center">预领数量</uni-th>
<uni-th width="90px" style="font-size: 24rpx" align="center">备注</uni-th>
<uni-th width="70px" style="font-size: 24rpx" align="center">操作</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item, index) in typeList" :key="item.id">
<uni-td style="font-size: 24rpx;text-align: center;">{{item.maTypeName}}</uni-td>
<uni-td style="font-size: 24rpx;text-align: center;">{{item.typeName}}</uni-td>
<uni-td style="font-size: 24rpx;text-align: center;">{{item.unitName}}</uni-td>
<uni-td style="font-size: 24rpx;text-align: center;">
<uni-td style="font-size: 24rpx; text-align: center">{{ item.maTypeName }}</uni-td>
<uni-td style="font-size: 24rpx; text-align: center">{{ item.typeName }}</uni-td>
<uni-td style="font-size: 24rpx; text-align: center">{{ item.unitName }}</uni-td>
<uni-td style="font-size: 24rpx; text-align: center">
<uni-easyinput
placeholder="预领数量"
v-model="item.preNum"
@ -108,7 +123,7 @@
:styles="{ width: '100rpx' }"
/>
</uni-td>
<uni-td style="font-size: 24rpx;text-align: center;">
<uni-td style="font-size: 24rpx; text-align: center">
<uni-easyinput
placeholder="备注"
v-model="item.remark"
@ -116,13 +131,13 @@
:styles="{ width: '100rpx' }"
/>
</uni-td>
<uni-td style="font-size: 24rpx;text-align: center;">
<uni-td style="font-size: 24rpx; text-align: center">
<view class="uni-group">
<!-- <view class="action-btn" @click="uploadImg(item)">
<uni-icons type="camera" size="20" style="color: #3784fb;"/>
</view> -->
<view class="action-btn delete" @click="delRow(index)">
<uni-icons type="trash-filled" size="20" style="color: red;margin-left:10px;"/>
<uni-icons type="trash-filled" size="20" style="color: red; margin-left: 10px" />
</view>
</view>
</uni-td>
@ -141,7 +156,18 @@
import { ref, reactive } from 'vue'
import eselect from '@/components/tree-select/eselect.vue'
import { onLoad, onReady } from '@dcloudio/uni-app'
import { getBmTeamList,getProjectList,getConfigList,getLevelThreeType,insertApp,getAgreementInfoById,getListsByConfigId,getTypeDataList,leaseTask } from '@/services/back.js';
import {
getBmTeamList,
getProjectList,
getConfigList,
getLevelThreeType,
insertApp,
getAgreementInfoById,
getListsByConfigId,
getTypeDataList,
// leaseTask,
addLeaseTask,
} from '@/services/back.js'
const taskInfo = ref({})
const treeSelect = ref(null)
const treeSelect2 = ref(null)
@ -153,8 +179,7 @@ const formData = ref({
phone: '',
configId: '',
applyCode: '',
}
},
})
const unitList = ref([])
@ -166,16 +191,15 @@ const configId = ref('')
const agreementId = ref('')
const maTypeSelectList = ref([])
const typeId = ref("")//
const typeId = ref('') //
const maCodeSelectList = ref([])
const typeCode = ref("")//
const typeCode = ref('') //
const typeList = ref([])
const bmFileInfos = ref([]) //
// form
const form = ref(null)
const flagFile = ref(false)
//
const rules = ref({
unitId: {
@ -183,54 +207,53 @@ const rules = ref({
{
required: true,
errorMessage: '领用单位为必填项',
trigger: 'change'
}
]
trigger: 'change',
},
],
},
proId: {
rules: [
{
required: true,
errorMessage: '领用工程为必填项',
trigger: 'change'
}
]
trigger: 'change',
},
],
},
applyCode: {
rules: [
{
required: true,
errorMessage: '采购申请编号为必填项',
trigger: 'blur'
}
]
trigger: 'blur',
},
],
},
leasePerson: {
rules: [
{
required: true,
errorMessage: '领料人为必填项',
trigger: 'blur'
}
]
trigger: 'blur',
},
],
},
phone: {
rules: [
{
required: true,
errorMessage: '联系电话为必填项',
trigger: 'blur'
trigger: 'blur',
},
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
errorMessage: '请输入正确的手机号码',
trigger: 'blur'
}
]
trigger: 'blur',
},
],
},
})
//
const getUnit = () => {
// proId.value=e.id;
@ -242,7 +265,7 @@ const getUnit = () => {
console.log('🚀 ~ .班组 ~ res:', res)
// unitList.value = res.data
if (res.data.rows.length > 0) {
unitList.value = res.data.rows.map(option => {
unitList.value = res.data.rows.map((option) => {
return {
value: option.id,
text: option.teamName,
@ -275,17 +298,17 @@ const getProject = async () => {
// // "isApp":true
// }
try {
const res = await getProjectList({});
proList.value = res.data;
const res = await getProjectList({})
proList.value = res.data
// proId.value=""
// treeSelect2.value.clearInput();
agreementId.value = '';
agreementId.value = ''
if (unitId.value && proId.value) {
await getAgreement();
await getAgreement()
// getMaType();
}
} catch (error) {
console.log(error);
console.log(error)
}
}
@ -314,7 +337,7 @@ const getConfigChange = (e) => {
.then((res) => {
console.log(res)
if (res.code == 200 && res.data.length > 0) {
res.data.forEach(item => {
res.data.forEach((item) => {
let param = {
typeId: item.typeId,
typeName: item.typeName,
@ -324,9 +347,9 @@ const getConfigChange = (e) => {
preNum: item.num,
}
// typeList typeId
const exists = typeList.value.some(existingItem => existingItem.typeId === param.typeId);
const exists = typeList.value.some((existingItem) => existingItem.typeId === param.typeId)
if (!exists) {
typeList.value.push(param);
typeList.value.push(param)
}
})
}
@ -370,36 +393,40 @@ const getAgreement = async () => {
const getMaType = () => {
console.log('sdadasda', agreementId.value)
let obj = {
"level":3,
level: 3,
}
getLevelThreeType(obj).then(res => {
getLevelThreeType(obj)
.then((res) => {
console.log(res)
maTypeSelectList.value = res.data.map(option => {
maTypeSelectList.value = res.data.map((option) => {
return {
value: option.typeId,
text: option.name,
}
});
}).catch(error => {
})
})
.catch((error) => {
console.log(error)
})
}
//
const getMaCode = () => {
let obj = {
"typeId":typeId.value
typeId: typeId.value,
}
getTypeDataList(obj).then(res => {
getTypeDataList(obj)
.then((res) => {
console.log(res)
maCodeSelectList.value = res.data.map(option => {
maCodeSelectList.value = res.data.map((option) => {
let obj = {
...option,
value: option.typeId,
text: option.typeName,
}
return obj
});
}).catch(error => {
})
})
.catch((error) => {
console.log(error)
})
}
@ -407,10 +434,10 @@ const getMaCode = () => {
const selectMaCode = (e) => {
console.log(e)
// typeList typeId
const exists = typeList.value.some(existingItem => existingItem.typeId === e);
const exists = typeList.value.some((existingItem) => existingItem.typeId === e)
if (exists) {
let name = ''
maCodeSelectList.value.forEach(item => {
maCodeSelectList.value.forEach((item) => {
if (item.typeId === e) {
name = item.typeName
}
@ -418,11 +445,11 @@ const selectMaCode = (e) => {
uni.showToast({
title: `${name} 已添加到列表中`,
icon: 'none',
duration: 1000
duration: 1000,
})
return
}
maCodeSelectList.value.forEach(item=>{
maCodeSelectList.value.forEach((item) => {
console.log(item)
if (item.typeId == e) {
let param = {
@ -440,7 +467,6 @@ const selectMaCode = (e) => {
}
//
const submitNum = async () => {
console.log(typeList.value)
// 使
form.value.validate(async (valid) => {
@ -450,7 +476,7 @@ const submitNum = async() => {
await uni.showToast({
title: '请上传附件',
icon: 'none',
duration: 1000
duration: 1000,
})
return
}
@ -460,7 +486,7 @@ const submitNum = async() => {
await uni.showToast({
title: '请添加申请数据',
icon: 'none',
duration: 1000
duration: 1000,
})
return
}
@ -475,53 +501,53 @@ const submitNum = async() => {
// }
// }
let obj = {
"leaseApplyInfo":{
"unitId":unitId.value,
"teamId":formData.value.teamId,
"projectId":proId.value,
"agreementId":agreementId.value,
"leasePerson":formData.value.leasePerson,
"phone":formData.value.phone,
"standardConfigId":configId.value,
"applyCode":formData.value.applyCode,
"bmFileInfos": bmFileInfos.value,
leaseApplyInfo: {
unitId: unitId.value,
teamId: formData.value.teamId,
projectId: proId.value,
agreementId: agreementId.value,
leasePerson: formData.value.leasePerson,
phone: formData.value.phone,
standardConfigId: configId.value,
applyCode: formData.value.applyCode,
bmFileInfos: bmFileInfos.value,
},
"leaseApplyDetailsList":typeList.value
leaseApplyDetailsList: typeList.value,
}
console.log(obj)
leaseTask(obj).then( res => {
addLeaseTask(obj)
.then((res) => {
console.log(res)
if (res.code == 200) {
console.log('xxxxxxxxxxxxxxxx')
uni.showToast({ title: '申请成功', icon: 'none',duration: 1000
})
uni.showToast({ title: '申请成功', icon: 'none', duration: 1000 })
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 1000);
delta: 1,
})
}, 1000)
} else {
console.log('yyyyyyyyyyyyy')
uni.showToast({ title: res.msg, icon: 'none', duration: 1000 })
}
}).catch(error => {
})
.catch((error) => {
console.log(error)
})
} else {
return;
return
}
})
}
onReady(() => {
if (form.value) {
//
form.value.setRules(rules.value);
form.value.setRules(rules.value)
} else {
console.error('表单引用未正确初始化');
console.error('表单引用未正确初始化')
}
});
})
onLoad((options) => {
getUnit()
@ -542,8 +568,8 @@ const uploadImg = (item) => {
uni.chooseImage({
count: 3 - bmFileInfos.value.length, //
sizeType: ['original', 'compressed'], //original compressed
sourceType: ['album', 'camera',], //album camera 使
success: res => {
sourceType: ['album', 'camera'], //album camera 使
success: (res) => {
console.log(res)
let imgFiles = res.tempFilePaths //
imgFiles.forEach((filePath) => {
@ -557,38 +583,38 @@ const uploadImg = (item) => {
bmFileInfos.value.forEach((item, index) => {
uni.uploadFile({
// url: baseURL+"/file/upload",//app
url: "/file/upload",//h5
url: '/file/upload', //h5
filePath: item.urlTemp,
name: 'file',
success: (res) => {
res = JSON.parse(res.data)
console.log('上传成功', res.code);
console.log('上传成功', res.data);
console.log('上传成功', res.code)
console.log('上传成功', res.data)
if (res.code && res.code == 200) {
bmFileInfos.value[index] = {
...bmFileInfos.value[index],
name: res.data.name,
url: res.data.url
};
url: res.data.url,
}
uni.showToast({ title: '上传成功', icon: 'none' })
} else {
uni.showToast({ title: '上传失败', icon: 'none' })
}
},
fail: (err) => {
console.error('上传失败', err);
}
});
});
console.error('上传失败', err)
},
})
})
// this.$refs.vForm.clearValidate()
}
},
})
}
const deleteImg = (index) => {
bmFileInfos.value.splice(index, 1);
bmFileInfos.value.splice(index, 1)
// bmFileInfosTemp.value.splice(index, 1);
};
}
//
const delRow = (index) => {
console.log(index)
@ -661,7 +687,6 @@ const clearConfig = () => {
configId.value = ''
getConfig()
}
</script>
<style lang="scss">

View File

@ -210,9 +210,7 @@ function uploadUnNotice(arr) {
}
//
onShow(() => {
})
onShow(() => {})
//
onNavigationBarButtonTap((e) => {
@ -235,7 +233,7 @@ onNavigationBarButtonTap((e) => {
<style lang="scss" scoped>
.page-bg {
background: url('/src/static/bgd.png');
background: url('../../static/bgd.png');
background-repeat: no-repeat;
background-size: 100% 100%;
min-height: 100vh;
@ -355,22 +353,22 @@ onNavigationBarButtonTap((e) => {
}
}
.llsp {
background: url('/src/static/llsp.png');
background: url('../../static/llsp.png');
background-repeat: no-repeat;
background-size: 100% 100%;
}
.tlsp {
background: url('/src/static/tlsp.png');
background: url('../../static/tlsp.png');
background-repeat: no-repeat;
background-size: 100% 100%;
}
.bfsh {
background: url('/src/static/bfsh.png');
background: url('../../static/bfsh.png');
background-repeat: no-repeat;
background-size: 100% 100%;
}
.sysh {
background: url('/src/static/sysh.png');
background: url('../../static/sysh.png');
background-repeat: no-repeat;
background-size: 100% 100%;
}

View File

@ -1,5 +1,9 @@
<template>
<!-- 登录页面 -->
<!-- 如果是h5时则显示登录页面 -->
/*#ifdef H5 */
<view class="login" v-if="origin.indexOf('ticket') == -1">
<uni-forms :modelValue="loginForm" label-position="top" class="login-form">
<h1>用户登录</h1>
@ -7,16 +11,30 @@
<uni-easyinput v-model="loginForm.username" placeholder="请输入用户名" />
</uni-forms-item>
<uni-forms-item required label="密码">
<uni-easyinput
type="password"
placeholder="请输入密码"
v-model="loginForm.password"
/>
<uni-easyinput type="password" placeholder="请输入密码" v-model="loginForm.password" />
</uni-forms-item>
<view class="login-btn" @tap="onHandleLogin">登录</view>
</uni-forms>
</view>
/* #endif */
<!-- 如果是app时则显示登录页面 -->
/* #ifdef APP-PLUS */
<view class="login">
<uni-forms :modelValue="loginForm" label-position="top" class="login-form">
<h1>用户登录</h1>
<uni-forms-item required label="用户名">
<uni-easyinput v-model="loginForm.username" placeholder="请输入用户名" />
</uni-forms-item>
<uni-forms-item required label="密码">
<uni-easyinput type="password" placeholder="请输入密码" v-model="loginForm.password" />
</uni-forms-item>
<view class="login-btn" @tap="onHandleLogin">登录</view>
</uni-forms>
</view>
/* #endif */
</template>
<script setup>
@ -24,7 +42,11 @@ import { onMounted, reactive, ref } from 'vue'
import { appLoginAPI, getUserInfoAPI, iwsLoginAPI } from '@/services/index.js'
import { useMemberStore } from '@/stores'
const memberStore = useMemberStore()
// h5origin
/* #ifdef H5 */
const origin = window.location.href
/* #endif */
//
const loginForm = reactive({
@ -38,12 +60,15 @@ const loginForm = reactive({
})
onMounted(async () => {
console.log('🚀 ~ onMounted ~ origin:', origin)
// uni.showToast({
// title: origin,
// icon: 'none',
// duration: 5000,
// })
// h5origin
/* #ifdef H5 */
console.log('🚀 ~ onMounted ~ origin:', origin)
if (origin.indexOf('ticket') != -1) {
try {
uni.showLoading({ title: '登录中' })
@ -73,6 +98,7 @@ onMounted(async () => {
showToast('登录失败')
}
}
/* #endif */
})
//

View File

@ -106,11 +106,10 @@ export function getMachineApi(data) {
return http({
url: '/material/back_apply_info/getMachine',
method: 'GET',
params: data
params: data,
})
}
// 获取已退料编码列表-查看
export const getMaCodeList = (data) => {
return http({
@ -154,7 +153,6 @@ export const backApplyRemove = (data) => {
})
}
// 二维码扫码获取编码信息
export const getMachineByQrCodeApi = (data) => {
return http({
@ -164,7 +162,6 @@ export const getMachineByQrCodeApi = (data) => {
})
}
// 获取退料明细(退料人退料时间)
export const getDetailsByIdApi = (data) => {
return http({