增强办公,新增审批,缺少电子签章功能

This commit is contained in:
2026-04-20 15:56:29 +08:00
parent a026ef7a54
commit cd71a3a457
18 changed files with 1791 additions and 537 deletions

View File

@@ -5,7 +5,7 @@
<text class="sheet-title">选择时间</text>
<text class="sheet-close" @tap="close">关闭</text>
</view>
<picker-view ref="picker" class="wheel" @change="onChange">
<picker-view ref="picker" class="wheel" :value="pickerValue" indicator-style="height: 88rpx;" @change="onChange">
<picker-view-column>
<view v-for="(d, i) in dateOptions" :key="d" class="wheel-item"><text>{{ d }}</text></view>
</picker-view-column>
@@ -30,31 +30,41 @@ export default {
dateOptions() { const res = []; const base = new Date(); base.setHours(0,0,0,0); for (let i = 0; i < this.days; i++) { const d = new Date(base); d.setDate(d.getDate() + i); res.push(this.formatYMD(d)) } return res },
hourOptions() { return Array.from({ length: 24 }, (_, i) => `${i < 10 ? '0' : ''}${i}`) }
},
watch: {
visible(v) { if (v) setTimeout(() => this.initValue(), 100) }
watch: {
visible(v) {
if (v) {
this.$nextTick(() => {
setTimeout(() => this.initValue(), 50)
})
}
}
},
methods: {
initValue() {
if (this.value) {
const v = String(this.value).replace('T', ' ')
const parts = v.split(' ')
const ymd = parts[0].split('-')
const hm = parts[1]?.split(':') || [0, 0]
const hour = parseInt(hm[0]) || 0
const dateIndex = this.dateOptions.indexOf(ymd.join('-'))
const ymd = (parts[0] || '').split('-')
const hm = (parts[1] || '00:00:00').split(':')
const hour = Math.max(0, Math.min(23, parseInt(hm[0], 10) || 0))
const dateKey = ymd.length === 3 ? ymd.join('-') : this.dateOptions[0]
const dateIndex = this.dateOptions.indexOf(dateKey)
this.pickerValue = [dateIndex >= 0 ? dateIndex : 0, hour]
} else {
this.pickerValue = [0, 0]
}
this.$nextTick(() => {
const pv = this.$refs.picker
if (pv) pv.setValue(this.pickerValue)
if (pv && pv.setValue) pv.setValue(this.pickerValue)
})
},
onChange(e) { this.pickerValue = e.detail.value },
onChange(e) {
const val = e.detail.value || [0, 0]
this.pickerValue = [Number(val[0]) || 0, Number(val[1]) || 0]
},
confirm() {
const date = this.dateOptions[this.pickerValue[0]] || this.dateOptions[0]
let hour = this.pickerValue[1] || 0
let hour = Number(this.pickerValue[1]) || 0
if (hour >= 24) hour = 23
this.$emit('change', `${date}T${hour < 10 ? '0' : ''}${hour}:00:00.000+08:00`)
this.close()