This commit is contained in:
2026-06-11 17:26:11 +08:00
parent ec1d9f1aa1
commit 67bf620d01
9 changed files with 227 additions and 19 deletions
@@ -633,9 +633,12 @@ layout("/layouts/platform.html"){
})
}).catch(() => {})
},
// 分配路线选项展示线路管理中的线路类型,便于同名线路按类型区分。
matterOptionLabel(item) {
const lineName = item.lineName || ""
return lineName || item.matterName || ""
const lineType = item.lineType || ""
const label = lineName || item.matterName || ""
return label && lineType ? label + "" + lineType + "" : label
}
},
mounted() {
@@ -33,7 +33,7 @@ layout("/layouts/platform.html"){
@keyup.enter.native="doSearch">
</el-input>
</search-item>
<search-item label="所属工会">
<search-item label="所属工会" v-if="canSelectUnion()">
<el-select v-model="pageForm.unionId" clearable filterable placeholder="请选择所属工会" style="width: 100%">
<el-option v-for="item in unionOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
@@ -367,6 +367,7 @@ layout("/layouts/platform.html"){
showImportDialog: false,
multipleSelection: [],
filterOptionsTimer: null,
currentUnionId: "",
pageForm: {
pageNumber: 1,
pageSize: 10,
@@ -398,6 +399,17 @@ layout("/layouts/platform.html"){
handleSelectionChange(val) {
this.multipleSelection = val || []
},
canSelectUnion() {
return this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
},
isBranchUnionChairmanOnly() {
return !this.canSelectUnion() && this.$auth.hasRole("BRANCH_UNION_CHAIRMAN")
},
applyUnionScope() {
if (this.isBranchUnionChairmanOnly() && this.currentUnionId) {
this.pageForm.unionId = this.currentUnionId
}
},
clearTableSelection() {
this.multipleSelection = []
if (this.$refs.tableRef) {
@@ -501,7 +513,7 @@ layout("/layouts/platform.html"){
this.pageForm.startYear = moment().format("YYYY")
this.pageForm.endYear = moment().format("YYYY")
this.pageForm.keyword = ""
this.pageForm.unionId = ""
this.pageForm.unionId = this.isBranchUnionChairmanOnly() ? this.currentUnionId : ""
this.pageForm.lineId = ""
this.pageForm.travelPeriod = ""
this.pageForm.lineType = ""
@@ -556,6 +568,10 @@ layout("/layouts/platform.html"){
this.$axios.post(loc() + "/unionOptions").then((res) => {
if (res.code === 0) {
this.unionOptions = res.data || []
if (this.isBranchUnionChairmanOnly()) {
this.currentUnionId = this.unionOptions.length ? this.unionOptions[0].id : ""
this.applyUnionScope()
}
}
})
},
@@ -611,6 +627,7 @@ layout("/layouts/platform.html"){
})
},
doSearch() {
this.applyUnionScope()
this.tableKey = new Date().getTime()
this.pageForm.pageNumber = 1
this.clearTableSelection()
@@ -686,9 +686,12 @@ layout("/layouts/platform.html"){
})
}).catch(() => {})
},
// 分配线路选项展示线路管理中的线路类型,便于同名线路按类型区分。
matterOptionLabel(item) {
const lineName = item.lineName || ""
return lineName || item.matterName || ""
const lineType = item.lineType || ""
const label = lineName || item.matterName || ""
return label && lineType ? label + "" + lineType + "" : label
}
},
mounted() {
@@ -29,8 +29,8 @@ const basicForm = {
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="排序号" prop="serialNumber">
<el-input maxlength="50" v-model="formData.serialNumber" placeholder="请输入排序号"></el-input>
<el-form-item label="线路编码" prop="serialNumber">
<el-input maxlength="50" v-model="formData.serialNumber" placeholder="请输入线路编码"></el-input>
</el-form-item>
</el-col>
</el-row>
@@ -240,7 +240,7 @@ const basicForm = {
isDisabled: true
},
formRules: {
serialNumber: [{required: true, message: '请输入排序号', trigger: ['change', 'blur']}],
serialNumber: [{required: true, message: '请输入线路编码', trigger: ['change', 'blur']}],
lineName: [{required: true, message: '请输入线路名称', trigger: ['change', 'blur']}],
travelAgencyId: [{required: true, message: '请选择旅行社', trigger: ['change', 'blur']}],
regionalNature: [{required: true, message: '请选择区域性质', trigger: ['change', 'blur']}],
@@ -297,6 +297,9 @@ const basicForm = {
this.formData = {...data}
})
} else {
this.formData = {
isDisabled: true
}
await this.getNumber()
const createMode = await this.getCreateMode()
this.$set(this.formData, 'createMode', createMode)
@@ -333,8 +336,15 @@ const basicForm = {
return resp.data
},
async getNumber() {
const resp = await this.$axios.post(loc() + '/getNo')
this.$set(this.formData, 'serialNumber', resp.data)
return this.$axios.post(loc() + '/getNo').then((resp) => {
if (resp.code === 0) {
this.$set(this.formData, 'serialNumber', resp.data)
} else {
this.$message.warning(resp.msg || '线路编码生成失败')
}
}).catch(() => {
this.$message.warning('线路编码生成失败')
})
},
},
async created() {