调整进货申请列表
This commit is contained in:
@@ -59,7 +59,8 @@ export function getLbDepartmentUserTree(params) {
|
||||
return request({
|
||||
url: '/lbDepartmentUser/tree',
|
||||
method: 'get',
|
||||
params
|
||||
params,
|
||||
timeout: 160000
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
<el-card class="table-container" shadow="never">
|
||||
<el-table v-loading="loading" :data="list" border class="assessment-apply-table" style="width: 100%">
|
||||
<el-table-column label="序号" prop="sortedNum" min-width="72" />
|
||||
<el-table-column label="申请人姓名" prop="applicantName" min-width="108" />
|
||||
<el-table-column label="申请人电话" prop="applicantPhone" min-width="126" />
|
||||
<el-table-column label="同事姓名" prop="colleagueName" min-width="108" />
|
||||
@@ -130,6 +131,11 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="序号" prop="sortedNum">
|
||||
<el-input v-model="form.sortedNum" clearable placeholder="请输入序号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申请人" prop="applicantName">
|
||||
<el-input v-model="form.applicantName" placeholder="请输入申请人" />
|
||||
@@ -304,7 +310,6 @@ export default {
|
||||
{ label: '陈晓琴老师', value: '陈晓琴老师' },
|
||||
{ label: '李军A老师', value: '李军A老师' },
|
||||
{ label: '刘伟翔老师', value: '刘伟翔老师' },
|
||||
{ label: '李家让老师', value: '李家让老师' },
|
||||
{ label: '张伟老师', value: '张伟老师' },
|
||||
{ label: '林显竹老师', value: '林显竹老师' },
|
||||
{ label: '袁慧榕老师', value: '袁慧榕老师' }
|
||||
@@ -329,6 +334,7 @@ export default {
|
||||
},
|
||||
form: {
|
||||
id: '',
|
||||
sortedNum: '',
|
||||
applicantName: '',
|
||||
applicantPhone: '',
|
||||
applicantAge: undefined,
|
||||
@@ -393,9 +399,19 @@ export default {
|
||||
const s = String(v).replace('T', ' ')
|
||||
return s.length >= 19 ? s.slice(0, 19) : s
|
||||
},
|
||||
normalizeFormNumber(value) {
|
||||
if (value === undefined || value === null || value === '') return undefined
|
||||
const n = Number(value)
|
||||
return Number.isNaN(n) ? undefined : n
|
||||
},
|
||||
normalizeFormString(value) {
|
||||
if (value === undefined || value === null) return ''
|
||||
return String(value).trim()
|
||||
},
|
||||
applyParsedEntityToForm(entity) {
|
||||
if (!entity || typeof entity !== 'object') return
|
||||
const keys = [
|
||||
'sortedNum',
|
||||
'applicantName',
|
||||
'applicantPhone',
|
||||
'applicantAge',
|
||||
@@ -413,12 +429,11 @@ export default {
|
||||
const v = entity[k]
|
||||
if (v === undefined || v === null) return
|
||||
if (k === 'applicantAge') {
|
||||
if (v === '') {
|
||||
this.form.applicantAge = undefined
|
||||
return
|
||||
}
|
||||
const n = Number(v)
|
||||
this.form.applicantAge = Number.isNaN(n) ? undefined : n
|
||||
this.$set(this.form, k, this.normalizeFormNumber(v))
|
||||
return
|
||||
}
|
||||
if (k === 'sortedNum') {
|
||||
this.form[k] = this.normalizeFormString(v)
|
||||
return
|
||||
}
|
||||
if (k === 'applicationDatetime') {
|
||||
@@ -657,11 +672,12 @@ export default {
|
||||
this.dialogTitle = '编辑评估申请'
|
||||
this.isEdit = true
|
||||
this.assessmentApplyText = ''
|
||||
this.form = {
|
||||
Object.assign(this.form, {
|
||||
id: row.id || '',
|
||||
sortedNum: this.normalizeFormString(row.sortedNum),
|
||||
applicantName: row.applicantName || '',
|
||||
applicantPhone: row.applicantPhone || '',
|
||||
applicantAge: row.applicantAge === null || row.applicantAge === undefined ? undefined : Number(row.applicantAge),
|
||||
applicantAge: this.normalizeFormNumber(row.applicantAge),
|
||||
workExperience: row.workExperience || '',
|
||||
colleagueName: row.colleagueName || '',
|
||||
colleaguePhone: row.colleaguePhone || '',
|
||||
@@ -671,7 +687,7 @@ export default {
|
||||
moderatorName: row.moderatorName || '',
|
||||
assessmentTeacherName: row.assessmentTeacherName || '',
|
||||
meetingNumber: row.meetingNumber || ''
|
||||
}
|
||||
})
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dataForm && this.$refs.dataForm.clearValidate()
|
||||
@@ -711,9 +727,10 @@ export default {
|
||||
},
|
||||
buildPayload() {
|
||||
const payload = {
|
||||
sortedNum: this.normalizeFormString(this.form.sortedNum) || undefined,
|
||||
applicantName: this.form.applicantName,
|
||||
applicantPhone: this.form.applicantPhone,
|
||||
applicantAge: this.form.applicantAge,
|
||||
applicantAge: this.normalizeFormNumber(this.form.applicantAge),
|
||||
workExperience: this.form.workExperience || undefined,
|
||||
colleagueName: this.form.colleagueName || undefined,
|
||||
colleaguePhone: this.form.colleaguePhone || undefined,
|
||||
@@ -726,7 +743,7 @@ export default {
|
||||
}
|
||||
if (this.isEdit) payload.id = this.form.id
|
||||
Object.keys(payload).forEach((key) => {
|
||||
if (payload[key] === undefined || payload[key] === '') delete payload[key]
|
||||
if (payload[key] === undefined || payload[key] === null || payload[key] === '') delete payload[key]
|
||||
})
|
||||
return payload
|
||||
},
|
||||
@@ -738,6 +755,7 @@ export default {
|
||||
this.assessmentApplyText = ''
|
||||
this.form = {
|
||||
id: '',
|
||||
sortedNum: '',
|
||||
applicantName: '',
|
||||
applicantPhone: '',
|
||||
applicantAge: undefined,
|
||||
|
||||
@@ -77,9 +77,7 @@
|
||||
<th>特权开通日期</th>
|
||||
<th>推荐人</th>
|
||||
<th>手机号</th>
|
||||
<th>领导人</th>
|
||||
<th>开通日期</th>
|
||||
<th>系统到期日期</th>
|
||||
<th>组长</th>
|
||||
<th class="col-actions">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -100,8 +98,6 @@
|
||||
<td>{{ row.colleagueName || '-' }}</td>
|
||||
<td>{{ row.colleaguePhone || '-' }}</td>
|
||||
<td>{{ row.teamLeader || '-' }}</td>
|
||||
<td>{{ formatOpenDate(row.applyDate) }}</td>
|
||||
<td>{{ formatApplicantSystemExpireDate(row) }}</td>
|
||||
<td class="col-actions">
|
||||
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
|
||||
<el-button type="text" style="color:#F56C6C;" @click="handleDelete(row)">删除</el-button>
|
||||
@@ -269,7 +265,7 @@
|
||||
</td>
|
||||
<td>{{ row.applyPhone || '-' }}</td>
|
||||
<td>{{ formatTryDate(row.tryDate) }}</td>
|
||||
<td>{{ formatOpenDate(row.applyDate) }}</td>
|
||||
<td>{{ formatApplyOpenDate(row.applyDate) }}</td>
|
||||
<td>{{ formatApplicantSystemExpireDate(row) }}</td>
|
||||
<td>{{ formatLatestTradePayTime(row) }}</td>
|
||||
<td>{{ formatLatestTradeTotalMoney(row) }}</td>
|
||||
@@ -632,7 +628,7 @@
|
||||
<th>特权开通日期</th>
|
||||
<th>推荐人</th>
|
||||
<th>手机号</th>
|
||||
<th>领导人</th>
|
||||
<th>组长</th>
|
||||
<th>开通日期</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -653,7 +649,7 @@
|
||||
<td>{{ row.colleagueName || '-' }}</td>
|
||||
<td>{{ row.colleaguePhone || '-' }}</td>
|
||||
<td>{{ row.teamLeader || '-' }}</td>
|
||||
<td>{{ formatOpenDate(row.applyDate) }}</td>
|
||||
<td>{{ formatApplyOpenDate(row.applyDate) }}</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
@@ -884,6 +880,23 @@ export default {
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
addOneWeekday(dateValue) {
|
||||
const normalized = this.normalizeApplyDateValue(dateValue)
|
||||
if (!normalized) return ''
|
||||
const date = new Date(`${normalized}T12:00:00`)
|
||||
if (Number.isNaN(date.getTime())) return normalized
|
||||
date.setDate(date.getDate() + 1)
|
||||
const dayOfWeek = date.getDay()
|
||||
if (dayOfWeek === 6) {
|
||||
date.setDate(date.getDate() + 2)
|
||||
} else if (dayOfWeek === 0) {
|
||||
date.setDate(date.getDate() + 1)
|
||||
}
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
formatShortMd(dateValue, padMonthDay = true) {
|
||||
const normalized = this.normalizeApplyDateValue(dateValue)
|
||||
if (!normalized) return ''
|
||||
@@ -940,6 +953,11 @@ export default {
|
||||
if (Number.isNaN(month) || Number.isNaN(day)) return normalized
|
||||
return `${year}/${month}/${day}`
|
||||
},
|
||||
formatApplyOpenDate(applyDate) {
|
||||
const shifted = this.addOneWeekday(applyDate)
|
||||
if (!shifted) return '-'
|
||||
return this.formatOpenDate(shifted)
|
||||
},
|
||||
fetchList() {
|
||||
this.loading = true
|
||||
getLbPurchaseApplyList(this.buildListParams())
|
||||
|
||||
Reference in New Issue
Block a user