|
|
@@ -52,6 +52,7 @@
|
|
|
type="text"
|
|
|
placeholder="请输入具体文档名"
|
|
|
class="input-field"
|
|
|
+ @input="handleDocumentNameInput"
|
|
|
/>
|
|
|
</view>
|
|
|
<view class="date-picker-wrapper">
|
|
|
@@ -131,15 +132,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- console.log('页面参数:', options)
|
|
|
-
|
|
|
this.projectId = parseInt(options.projectId) || 0
|
|
|
this.projectName = decodeURIComponent(options.projectName || '')
|
|
|
this.projectCode = decodeURIComponent(options.projectCode || '')
|
|
|
-
|
|
|
- console.log('解析后的projectId:', this.projectId)
|
|
|
- console.log('解析后的projectName:', this.projectName)
|
|
|
- console.log('解析后的projectCode:', this.projectCode)
|
|
|
},
|
|
|
onReady() {
|
|
|
// 获取系统信息
|
|
|
@@ -166,16 +161,10 @@ export default {
|
|
|
try {
|
|
|
this.loading = true
|
|
|
|
|
|
- console.log('========== 开始加载文件夹列表 ==========')
|
|
|
- console.log('projectId:', this.projectId)
|
|
|
-
|
|
|
const response = await getFolderList({
|
|
|
projectId: this.projectId
|
|
|
})
|
|
|
|
|
|
- console.log('========== 后端返回的原始数据 ==========')
|
|
|
- console.log('完整响应:', response)
|
|
|
-
|
|
|
// 保存原始数据
|
|
|
this.rawData = response
|
|
|
|
|
|
@@ -186,15 +175,13 @@ export default {
|
|
|
}
|
|
|
|
|
|
} catch (error) {
|
|
|
- console.error('========== 加载失败 ==========')
|
|
|
- console.error('错误信息:', error)
|
|
|
+ console.error('加载失败:', error)
|
|
|
uni.showToast({
|
|
|
title: '加载失败',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
} finally {
|
|
|
this.loading = false
|
|
|
- console.log('========== 加载完成 ==========')
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -210,8 +197,6 @@ export default {
|
|
|
...countries
|
|
|
]
|
|
|
|
|
|
- console.log('解析后的国家列表:', this.countryList)
|
|
|
-
|
|
|
// 初始化时加载第一个国家(NA)的中心列表
|
|
|
if (this.countryList.length > 0) {
|
|
|
this.loadCenterList(0)
|
|
|
@@ -237,8 +222,6 @@ export default {
|
|
|
...allCenters
|
|
|
]
|
|
|
}
|
|
|
-
|
|
|
- console.log('国家:', country.name, '中心列表:', this.centerList)
|
|
|
} else {
|
|
|
this.centerList = [{ id: 'NA', name: 'NA', type: 2, displayName: 'NA' }]
|
|
|
}
|
|
|
@@ -279,8 +262,6 @@ export default {
|
|
|
const column = e.detail.column // 哪一列变化了
|
|
|
const value = e.detail.value // 变化后的值
|
|
|
|
|
|
- console.log('列变化:', column, '值:', value)
|
|
|
-
|
|
|
// 如果是第一列(国家)变化
|
|
|
if (column === 0) {
|
|
|
this.selectedCountryIndex = value
|
|
|
@@ -296,15 +277,6 @@ export default {
|
|
|
const values = e.detail.value
|
|
|
this.selectedCountryIndex = values[0]
|
|
|
this.selectedCenterIndex = values[1]
|
|
|
-
|
|
|
- console.log('选择完成 - 国家索引:', this.selectedCountryIndex, '中心索引:', this.selectedCenterIndex)
|
|
|
-
|
|
|
- if (this.countryList[this.selectedCountryIndex]) {
|
|
|
- console.log('选中国家:', this.countryList[this.selectedCountryIndex].name)
|
|
|
- }
|
|
|
- if (this.centerList[this.selectedCenterIndex]) {
|
|
|
- console.log('选中中心:', this.centerList[this.selectedCenterIndex].name)
|
|
|
- }
|
|
|
},
|
|
|
|
|
|
// 获取显示文本
|
|
|
@@ -324,7 +296,27 @@ export default {
|
|
|
// 日期选择变化
|
|
|
handleDateChange(e) {
|
|
|
this.effectiveDate = e.detail.value
|
|
|
- console.log('选择的生效日期:', this.effectiveDate)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 处理文档名称输入,禁止输入 "-" 字符
|
|
|
+ handleDocumentNameInput(e) {
|
|
|
+ const value = e.detail.value
|
|
|
+
|
|
|
+ // 检测是否包含 "-" 字符
|
|
|
+ if (value.includes('-')) {
|
|
|
+ // 移除所有 "-" 字符
|
|
|
+ const filteredValue = value.replace(/-/g, '')
|
|
|
+ this.documentName = filteredValue
|
|
|
+
|
|
|
+ // 提示用户
|
|
|
+ uni.showToast({
|
|
|
+ title: '文档名称不能包含"-"字符',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 1500
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.documentName = value
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 格式化日期为 YYYYMMDD 格式(用于显示)
|
|
|
@@ -439,10 +431,6 @@ export default {
|
|
|
handleCenterChange(e) {
|
|
|
const index = parseInt(e.detail.value)
|
|
|
this.selectedCenterIndex = index
|
|
|
-
|
|
|
- if (index >= 0 && this.centerList[index]) {
|
|
|
- console.log('选中中心:', this.centerList[index].name)
|
|
|
- }
|
|
|
},
|
|
|
|
|
|
// 提交
|
|
|
@@ -512,15 +500,9 @@ export default {
|
|
|
files: fileBase64List
|
|
|
}
|
|
|
|
|
|
- console.log('========== 提交参数 ==========')
|
|
|
- console.log('params:', params)
|
|
|
-
|
|
|
// 调用上传接口
|
|
|
const response = await uploadScanFile(params)
|
|
|
|
|
|
- console.log('========== 上传响应 ==========')
|
|
|
- console.log('response:', response)
|
|
|
-
|
|
|
uni.hideLoading()
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
@@ -545,8 +527,7 @@ export default {
|
|
|
|
|
|
} catch (error) {
|
|
|
uni.hideLoading()
|
|
|
- console.error('========== 提交失败 ==========')
|
|
|
- console.error('错误信息:', error)
|
|
|
+ console.error('提交失败:', error)
|
|
|
uni.showToast({
|
|
|
title: error.message || '提交失败',
|
|
|
icon: 'none'
|