南大三十年教职工疗休养
This commit is contained in:
+122
-2
@@ -92,9 +92,10 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分配时间" prop="assignedAt" width="170" sortable="custom" align="center" header-align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="操作" width="470" align="center" header-align="center" fixed="right">
|
||||
<el-table-column label="操作" width="540" align="center" header-align="center" fixed="right">
|
||||
<template slot-scope="{row}">
|
||||
<el-button v-if="!row.matterId && row.personType !== 'BACKUP' && $auth.hasPermission('thirtyTeachTour.branchUserAssignment.selectMatter')" size="mini" type="primary" @click="openSelectMatter(row)">选择路线</el-button>
|
||||
<el-button v-if="!row.matterId && row.personType !== 'BACKUP' && $auth.hasPermission('thirtyTeachTour.branchUserAssignment.selectMatter')" size="mini" type="primary" @click="openSelectMatter(row)">选择批次</el-button>
|
||||
<el-button v-if="$auth.hasPermission('thirtyTeachTour.branchUserAssignment.assign')" size="mini" type="primary" @click="openBoardingPlace(row)">乘车地点</el-button>
|
||||
<el-button v-if="$auth.hasPermission('thirtyTeachTour.branchUserAssignment.assign')" size="mini" type="primary" @click="openListPhotoUpload(row)">{{ photoFileCount(row) > 0 ? "已上传" : "上传图片" }}</el-button>
|
||||
<el-button v-if="$auth.hasPermission('thirtyTeachTour.branchUserAssignment.switchPersonType')" size="mini" type="primary" :loading="personTypeSwitching === row.id" @click="switchPersonType(row, row.personType === 'BACKUP' ? 'FORMAL' : 'BACKUP')">{{ row.personType === 'BACKUP' ? '转为正式' : '转为替补' }}</el-button>
|
||||
<el-button v-if="isCancelled(row) && $auth.hasPermission('thirtyTeachTour.branchUserAssignment.cancelRestore')" size="mini" type="warning" @click="restoreCancel(row)">取消退出</el-button>
|
||||
@@ -333,6 +334,28 @@ layout("/layouts/platform.html"){
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="乘车地点"
|
||||
:visible.sync="boardingPlaceDialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
width="480px"
|
||||
@closed="resetBoardingPlaceDialog">
|
||||
<el-form :model="boardingPlaceForm" :rules="boardingPlaceRules" ref="boardingPlaceFormRef" label-width="100px">
|
||||
<el-form-item label="人员">
|
||||
<el-input v-model="boardingPlaceForm.userName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="乘车地点" prop="boardingPlace">
|
||||
<el-select v-model="boardingPlaceForm.boardingPlace" clearable filterable placeholder="请选择乘车地点" style="width: 100%">
|
||||
<el-option v-for="item in boardingPlaceOptions" :key="item" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="boardingPlaceDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="boardingPlaceSubmitting" @click="saveBoardingPlace">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="选择分配批次"
|
||||
:visible.sync="selectMatterDialogVisible"
|
||||
@@ -515,6 +538,15 @@ layout("/layouts/platform.html"){
|
||||
photoFiles: "",
|
||||
currentPeriodPhotoFiles: ""
|
||||
},
|
||||
boardingPlaceDialogVisible: false,
|
||||
boardingPlaceSubmitting: false,
|
||||
boardingPlaceOptions: [],
|
||||
boardingPlaceForm: {
|
||||
id: "",
|
||||
settingId: "",
|
||||
userName: "",
|
||||
boardingPlace: ""
|
||||
},
|
||||
personTypeSwitching: "",
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
@@ -558,6 +590,9 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
selectMatterRules: {
|
||||
matterId: [{required: true, message: "请选择分配批次", trigger: ["change", "blur"]}]
|
||||
},
|
||||
boardingPlaceRules: {
|
||||
boardingPlace: [{required: true, message: "请选择乘车地点", trigger: ["change", "blur"]}]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1035,6 +1070,71 @@ layout("/layouts/platform.html"){
|
||||
this.listPhotoSubmitting = false
|
||||
})
|
||||
},
|
||||
openBoardingPlace(row) {
|
||||
this.boardingPlaceForm = {
|
||||
id: row.id || "",
|
||||
settingId: row.settingId || "",
|
||||
userName: row.userName || "",
|
||||
boardingPlace: row.boardingPlace || ""
|
||||
}
|
||||
this.boardingPlaceOptions = []
|
||||
this.boardingPlaceDialogVisible = true
|
||||
this.loadBoardingPlaceOptions(row)
|
||||
},
|
||||
resetBoardingPlaceDialog() {
|
||||
this.boardingPlaceSubmitting = false
|
||||
this.boardingPlaceOptions = []
|
||||
this.boardingPlaceForm = {
|
||||
id: "",
|
||||
settingId: "",
|
||||
userName: "",
|
||||
boardingPlace: ""
|
||||
}
|
||||
},
|
||||
loadBoardingPlaceOptions(row) {
|
||||
const settingId = row && row.settingId ? row.settingId : this.boardingPlaceForm.settingId
|
||||
if (!settingId) {
|
||||
return
|
||||
}
|
||||
// 乘车地点必须按当前行人员分配记录所属配置读取,避免受页面筛选配置或其它弹窗缓存影响。
|
||||
this.$axios.post(loc() + "/boardingPlaceOptions", {settingId: settingId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.applyBoardingPlaceOptions(res.data || [], row)
|
||||
} else {
|
||||
this.$message.warning(res.msg || "乘车地点加载失败")
|
||||
}
|
||||
})
|
||||
},
|
||||
applyBoardingPlaceOptions(value, row) {
|
||||
this.boardingPlaceOptions = this.parseBoardingPlaceOptions(value)
|
||||
const defaultPlace = row && row.boardingPlace ? row.boardingPlace : ""
|
||||
if (defaultPlace && this.boardingPlaceOptions.indexOf(defaultPlace) < 0) {
|
||||
this.boardingPlaceOptions.unshift(defaultPlace)
|
||||
}
|
||||
if (!this.boardingPlaceForm.boardingPlace && this.boardingPlaceOptions.length === 1) {
|
||||
this.boardingPlaceForm.boardingPlace = this.boardingPlaceOptions[0]
|
||||
}
|
||||
},
|
||||
saveBoardingPlace() {
|
||||
this.$refs.boardingPlaceFormRef.validate((valid) => {
|
||||
if (!valid) return
|
||||
this.boardingPlaceSubmitting = true
|
||||
this.$axios.post(loc() + "/updateBoardingPlace", {
|
||||
id: this.boardingPlaceForm.id,
|
||||
boardingPlace: this.boardingPlaceForm.boardingPlace
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("乘车地点保存成功")
|
||||
this.boardingPlaceDialogVisible = false
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$message.warning(res.msg || "乘车地点保存失败")
|
||||
}
|
||||
}).finally(() => {
|
||||
this.boardingPlaceSubmitting = false
|
||||
})
|
||||
})
|
||||
},
|
||||
clearCandidateSelection() {
|
||||
this.selectedCandidates = []
|
||||
if (this.$refs.candidateTable) {
|
||||
@@ -1215,6 +1315,26 @@ layout("/layouts/platform.html"){
|
||||
// 分配批次选项按业务事项展示,线路名称仅作为历史数据缺失事项名称时的兜底。
|
||||
matterOptionLabel(item) {
|
||||
return item.matterName || item.lineName || ""
|
||||
},
|
||||
parseBoardingPlaceOptions(value) {
|
||||
if (!value) return []
|
||||
if (Array.isArray(value)) {
|
||||
return value.map((item) => String(item || "").trim()).filter((item) => item)
|
||||
}
|
||||
try {
|
||||
const list = JSON.parse(value)
|
||||
if (Array.isArray(list)) {
|
||||
return list.map((item) => {
|
||||
if (item && typeof item === "object") {
|
||||
return item.route || item.name || item.value || ""
|
||||
}
|
||||
return item || ""
|
||||
}).map((item) => String(item).trim()).filter((item) => item)
|
||||
}
|
||||
} catch (e) {
|
||||
return String(value).split(",").map((item) => item.trim()).filter((item) => item)
|
||||
}
|
||||
return []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
Reference in New Issue
Block a user