This commit is contained in:
parent
5ecde86836
commit
6c13392998
|
|
@ -934,11 +934,21 @@ watch(
|
|||
{ immediate: true },
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
if (route.query.id) {
|
||||
getDetail()
|
||||
}
|
||||
})
|
||||
watch(
|
||||
() => route.query.id,
|
||||
(newId) => {
|
||||
if (newId) {
|
||||
getDetail()
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
// onMounted(() => {
|
||||
// if (route.query.id) {
|
||||
// getDetail()
|
||||
// }
|
||||
// })
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
|
|||
|
|
@ -8,51 +8,51 @@ export const buildFormColumns = (
|
|||
businessTypeOptions,
|
||||
riskLevelOptions,
|
||||
) => [
|
||||
{
|
||||
type: 'month',
|
||||
prop: 'monthlyPlan',
|
||||
placeholder: '请选择月份',
|
||||
defaultValue: dayjs().format('YYYY-MM'), // 默认当前月份
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
prop: 'inspectionStationId',
|
||||
placeholder: '请选择运检站',
|
||||
options: inspectionStationOptions.map((item) => ({
|
||||
label: item.value,
|
||||
value: item.id,
|
||||
})),
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
prop: 'keyWord',
|
||||
placeholder: '请输入关键字',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
prop: 'planMajorId',
|
||||
placeholder: '请选择专业',
|
||||
options: majorOptions.map((item) => ({
|
||||
label: item.planMajorName,
|
||||
value: item.planMajorId,
|
||||
})),
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
prop: 'businessTypeId',
|
||||
placeholder: '请选择业务类型',
|
||||
options: businessTypeOptions.map((item) => ({
|
||||
label: item.planMajorName,
|
||||
value: item.planMajorId,
|
||||
})),
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
prop: 'riskLevel',
|
||||
placeholder: '请选择风险等级',
|
||||
options: riskLevelOptions,
|
||||
},
|
||||
]
|
||||
{
|
||||
type: 'month',
|
||||
prop: 'monthlyPlan',
|
||||
placeholder: '请选择月份',
|
||||
defaultValue: dayjs().format('YYYY-MM'), // 默认当前月份
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
prop: 'inspectionStationId',
|
||||
placeholder: '请选择运检站',
|
||||
options: inspectionStationOptions.map((item) => ({
|
||||
label: item.value,
|
||||
value: item.id,
|
||||
})),
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
prop: 'keyWord',
|
||||
placeholder: '请输入关键字',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
prop: 'planMajorId',
|
||||
placeholder: '请选择专业',
|
||||
options: majorOptions.map((item) => ({
|
||||
label: item.planMajorName,
|
||||
value: item.planMajorId,
|
||||
})),
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
prop: 'businessTypeId',
|
||||
placeholder: '请选择业务类型',
|
||||
options: businessTypeOptions.map((item) => ({
|
||||
label: item.planMajorName,
|
||||
value: item.planMajorId,
|
||||
})),
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
prop: 'riskLevel',
|
||||
placeholder: '请选择风险等级',
|
||||
options: riskLevelOptions,
|
||||
},
|
||||
]
|
||||
|
||||
// 月计划列表表格列
|
||||
export const tableColumns = [
|
||||
|
|
@ -71,7 +71,7 @@ export const tableColumns = [
|
|||
prop: 'planPersonnel',
|
||||
label: '计划投入管理人员数量',
|
||||
formatter: (row) => {
|
||||
return row.personneltList?.length || ''
|
||||
return row.personneltList?.length || 0
|
||||
},
|
||||
},
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ export const tableColumns = [
|
|||
formatter: (row) => {
|
||||
return (
|
||||
(dayjs(row.plannedEndTime).diff(dayjs(row.plannedStartTime), 'day') + 1) *
|
||||
row.planSkilledWorkerDay || ''
|
||||
row.planSkilledWorkerDay || 0
|
||||
)
|
||||
},
|
||||
},
|
||||
|
|
@ -96,7 +96,7 @@ export const tableColumns = [
|
|||
formatter: (row) => {
|
||||
return (
|
||||
(dayjs(row.plannedEndTime).diff(dayjs(row.plannedStartTime), 'day') + 1) *
|
||||
row.planAuxiliaryWorkerDay || ''
|
||||
row.planAuxiliaryWorkerDay || 0
|
||||
)
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1035,14 +1035,14 @@ const getDetail = async () => {
|
|||
formData.value.planMajorId = data.planMajorId
|
||||
formData.value.businessTypeId = data.businessTypeId
|
||||
formData.value.planCategoryId = data.planCategoryId
|
||||
formData.value.towerBaseNumber = data.towerBaseNumber || ''
|
||||
formData.value.planCarNum = data.planCarNum || ''
|
||||
formData.value.planSkilledWorkerNum = data.planSkilledWorkerNum || ''
|
||||
formData.value.planAuxiliaryWorkerNum = data.planAuxiliaryWorkerNum || ''
|
||||
formData.value.planAuxiliaryWorkerDay = data.planAuxiliaryWorkerDay || ''
|
||||
formData.value.planSkilledWorkerDay = data.planSkilledWorkerDay || ''
|
||||
formData.value.planSubCarNum = data.planSubCarNum || ''
|
||||
formData.value.actualWorkingDay = data.actualWorkingDay || ''
|
||||
formData.value.towerBaseNumber = data.towerBaseNumber
|
||||
formData.value.planCarNum = data.planCarNum
|
||||
formData.value.planSkilledWorkerNum = data.planSkilledWorkerNum
|
||||
formData.value.planAuxiliaryWorkerNum = data.planAuxiliaryWorkerNum
|
||||
formData.value.planAuxiliaryWorkerDay = data.planAuxiliaryWorkerDay
|
||||
formData.value.planSkilledWorkerDay = data.planSkilledWorkerDay
|
||||
formData.value.planSubCarNum = data.planSubCarNum
|
||||
formData.value.actualWorkingDay = data.actualWorkingDay
|
||||
formData.value.riskLevel = data.riskLevel
|
||||
|
||||
// 2. 从后端返回的数据更新路由参数字段(如果后端返回了这些字段)
|
||||
|
|
|
|||
Loading…
Reference in New Issue