需求优化
This commit is contained in:
parent
237fc8dd2f
commit
42fa793d30
|
|
@ -14,9 +14,14 @@ export default {
|
|||
},
|
||||
{
|
||||
prop: 'unitPrice',
|
||||
label: '单价',
|
||||
label: '绩效单价',
|
||||
slot: 'unitPrice',
|
||||
},
|
||||
{
|
||||
prop: 'settlementUnitPrice',
|
||||
label: '结算单价',
|
||||
slot: 'settlementUnitPrice',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
|
|
|
|||
|
|
@ -16,10 +16,14 @@
|
|||
新建工作量类别
|
||||
</ComButton>
|
||||
</template>
|
||||
<!-- 单价列插槽 -->
|
||||
<!-- 绩效单价列插槽 -->
|
||||
<template #unitPrice="{ row }">
|
||||
<span>¥{{ fenToYuan(row.unitPrice) }}</span>
|
||||
</template>
|
||||
<!-- 结算单价列插槽 -->
|
||||
<template #settlementUnitPrice="{ row }">
|
||||
<span>¥{{ fenToYuan(row.settlementUnitPrice) }}</span>
|
||||
</template>
|
||||
</ComTable>
|
||||
|
||||
<ComDialog :dialog-config="dialogConfig" @closeDialogOuter="onCloseDialogOuter">
|
||||
|
|
@ -40,7 +44,7 @@
|
|||
v-model.trim="addAndEditForm.workloadCategoryName"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单价" prop="unitPrice">
|
||||
<el-form-item label="绩效单价" prop="unitPrice">
|
||||
<el-input-number
|
||||
style="width: 100%"
|
||||
:min="0.1"
|
||||
|
|
@ -54,6 +58,21 @@
|
|||
</template>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="结算单价" prop="settlementUnitPrice">
|
||||
<el-input-number
|
||||
style="width: 100%"
|
||||
:min="0.1"
|
||||
:max="10000"
|
||||
:precision="2"
|
||||
:step="10"
|
||||
v-model="addAndEditForm.settlementUnitPrice"
|
||||
>
|
||||
<template #prefix>
|
||||
<span>¥</span>
|
||||
</template>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
type="textarea"
|
||||
|
|
@ -101,6 +120,7 @@ const editId = ref(null)
|
|||
const getInitFormData = () => ({
|
||||
workloadCategoryName: '',
|
||||
unitPrice: 0.1,
|
||||
settlementUnitPrice: 0.1,
|
||||
remark: '',
|
||||
})
|
||||
|
||||
|
|
@ -108,7 +128,8 @@ const addAndEditForm = ref(getInitFormData())
|
|||
|
||||
const addAndEditRules = ref({
|
||||
workloadCategoryName: [{ required: true, message: '请输入工作量类别名称', trigger: 'blur' }],
|
||||
unitPrice: [{ required: true, message: '请输入单价', trigger: 'blur' }],
|
||||
unitPrice: [{ required: true, message: '请输入绩效单价', trigger: 'blur' }],
|
||||
settlementUnitPrice: [{ required: true, message: '请输入结算单价', trigger: 'blur' }],
|
||||
})
|
||||
|
||||
const actionColumns = [
|
||||
|
|
@ -117,7 +138,13 @@ const actionColumns = [
|
|||
type: 'primary',
|
||||
link: true,
|
||||
handler: (row) => {
|
||||
const { workloadCategoryId, workloadCategoryName, remark, unitPrice } = row
|
||||
const {
|
||||
remark,
|
||||
unitPrice,
|
||||
workloadCategoryId,
|
||||
workloadCategoryName,
|
||||
settlementUnitPrice,
|
||||
} = row
|
||||
editId.value = workloadCategoryId
|
||||
dialogConfig.outerTitle = '编辑工作量类别'
|
||||
dialogConfig.outerVisible = true
|
||||
|
|
@ -125,6 +152,7 @@ const actionColumns = [
|
|||
nextTick(() => {
|
||||
addAndEditForm.value.workloadCategoryName = workloadCategoryName
|
||||
addAndEditForm.value.unitPrice = fenToYuan(unitPrice) // 分转元回显
|
||||
addAndEditForm.value.settlementUnitPrice = fenToYuan(settlementUnitPrice) // 分转元回显
|
||||
addAndEditForm.value.remark = remark
|
||||
})
|
||||
},
|
||||
|
|
@ -174,6 +202,7 @@ const onHandleSave = async () => {
|
|||
const API = editId.value ? updateWorkloadCategoryAPI : addWorkloadCategoryAPI
|
||||
const params = JSON.parse(JSON.stringify(addAndEditForm.value))
|
||||
params.unitPrice = yuanToFen(params.unitPrice) // 元转分提交
|
||||
params.settlementUnitPrice = yuanToFen(params.settlementUnitPrice) // 元转分提交
|
||||
editId.value ? (params.workloadCategoryId = editId.value) : null
|
||||
|
||||
const result = await API(params)
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
placeholder="请选择年份"
|
||||
format="YYYY"
|
||||
value-format="YYYY"
|
||||
:disabled-date="disabledYearDate"
|
||||
@change="onYearChange"
|
||||
style="width: 100%"
|
||||
/>
|
||||
|
|
@ -86,21 +87,44 @@ const selectedMonth = ref('')
|
|||
const loading = ref(false)
|
||||
const docxFile = ref(null)
|
||||
|
||||
// 生成月份选项
|
||||
// 获取当前年月
|
||||
const currentYear = new Date().getFullYear()
|
||||
const currentMonth = new Date().getMonth() + 1
|
||||
|
||||
// 生成月份选项(升序排列)
|
||||
const monthOptions = computed(() => {
|
||||
if (!selectedYear.value) {
|
||||
return []
|
||||
}
|
||||
const year = parseInt(selectedYear.value)
|
||||
const months = []
|
||||
for (let i = 1; i <= 12; i++) {
|
||||
months.push({
|
||||
label: `${selectedYear.value}-${String(i).padStart(2, '0')}`,
|
||||
value: `${selectedYear.value}-${String(i).padStart(2, '0')}`,
|
||||
})
|
||||
|
||||
// 如果选择的是当前年份,只显示已过完的月份和当月
|
||||
if (year === currentYear) {
|
||||
for (let i = 1; i <= currentMonth; i++) {
|
||||
months.push({
|
||||
label: `${selectedYear.value}-${String(i).padStart(2, '0')}`,
|
||||
value: `${selectedYear.value}-${String(i).padStart(2, '0')}`,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// 如果选择的是过去的年份,显示所有12个月
|
||||
for (let i = 1; i <= 12; i++) {
|
||||
months.push({
|
||||
label: `${selectedYear.value}-${String(i).padStart(2, '0')}`,
|
||||
value: `${selectedYear.value}-${String(i).padStart(2, '0')}`,
|
||||
})
|
||||
}
|
||||
}
|
||||
return months.reverse()
|
||||
return months // 升序排列
|
||||
})
|
||||
|
||||
// 年份选择器禁用日期(禁用未来年份)
|
||||
const disabledYearDate = (date) => {
|
||||
const year = date.getFullYear()
|
||||
return year > currentYear
|
||||
}
|
||||
|
||||
// 报告标题
|
||||
const reportTitle = computed(() => {
|
||||
if (selectedMonth.value) {
|
||||
|
|
|
|||
|
|
@ -298,6 +298,7 @@ const getRepairFormData = () => ({
|
|||
workloadCategoryId: '',
|
||||
workloadCategoryName: '',
|
||||
unitPrice: '',
|
||||
settlementUnitPrice: '',
|
||||
workloadNum: '',
|
||||
},
|
||||
], // 实际完成工作内容(动态列表)
|
||||
|
|
@ -716,6 +717,7 @@ const getDetail = async () => {
|
|||
workloadCategoryId: item.workloadCategoryId || '',
|
||||
workloadCategoryName: item.workloadCategoryName || '',
|
||||
unitPrice: item.unitPrice || '',
|
||||
settlementUnitPrice: item.settlementUnitPrice || '',
|
||||
workloadNum: item.workloadNum || '',
|
||||
}))
|
||||
: [
|
||||
|
|
@ -723,6 +725,7 @@ const getDetail = async () => {
|
|||
workloadCategoryId: '',
|
||||
workloadCategoryName: '',
|
||||
unitPrice: '',
|
||||
settlementUnitPrice: '',
|
||||
workloadNum: '',
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -852,6 +852,7 @@ const onAddWorkLoad = () => {
|
|||
workloadCategoryName: '',
|
||||
unitPrice: '',
|
||||
workloadNum: '',
|
||||
settlementUnitPrice: '',
|
||||
})
|
||||
updateField('actualWorkloadList', newWorkloadList)
|
||||
}
|
||||
|
|
@ -886,6 +887,7 @@ const onChangeWorkLoadCategory = (workloadCategoryId, index) => {
|
|||
workloadCategoryId: workloadCategory.workloadCategoryId,
|
||||
workloadCategoryName: workloadCategory.workloadCategoryName,
|
||||
unitPrice: workloadCategory.unitPrice || '',
|
||||
settlementUnitPrice: workloadCategory.settlementUnitPrice || '',
|
||||
}
|
||||
updateField('actualWorkloadList', newWorkloadList)
|
||||
} else {
|
||||
|
|
@ -895,6 +897,7 @@ const onChangeWorkLoadCategory = (workloadCategoryId, index) => {
|
|||
workloadCategoryId: '',
|
||||
workloadCategoryName: '',
|
||||
unitPrice: '',
|
||||
settlementUnitPrice: '',
|
||||
}
|
||||
updateField('actualWorkloadList', newWorkloadList)
|
||||
}
|
||||
|
|
@ -923,6 +926,7 @@ const onCancelActualCompletion = () => {
|
|||
workloadCategoryId: '',
|
||||
workloadCategoryName: '',
|
||||
unitPrice: '',
|
||||
settlementUnitPrice: '',
|
||||
workloadNum: '',
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ export const buildFormColumns = (
|
|||
type: 'month',
|
||||
prop: 'monthlyPlan',
|
||||
placeholder: '请选择月份',
|
||||
defaultValue: dayjs().format('YYYY-MM'), // 默认当前月份
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
|
|
|
|||
|
|
@ -689,6 +689,7 @@ const getInitFormData = () => ({
|
|||
workloadCategoryName: '', // 工作量类别名称
|
||||
unitPrice: '', // 单价
|
||||
workloadNum: '', // 工作量
|
||||
settlementUnitPrice: '', // 结算单价
|
||||
},
|
||||
],
|
||||
personnelArrangementList: [], // 人员排班模板 [{day: '', personnelNames: ''}]
|
||||
|
|
@ -814,6 +815,7 @@ const onAddWorkLoad = () => {
|
|||
workloadCategoryName: '',
|
||||
unitPrice: '',
|
||||
workloadNum: '',
|
||||
settlementUnitPrice: '',
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -979,6 +981,8 @@ const onChangeWorkLoadCategory = (event, index) => {
|
|||
)
|
||||
if (workloadCategory) {
|
||||
formData.value.workloadList[index].unitPrice = workloadCategory.unitPrice
|
||||
formData.value.workloadList[index].settlementUnitPrice =
|
||||
workloadCategory.settlementUnitPrice
|
||||
formData.value.workloadList[index].workloadCategoryName =
|
||||
workloadCategory.workloadCategoryName
|
||||
}
|
||||
|
|
@ -1044,6 +1048,7 @@ const getDetail = async () => {
|
|||
workloadCategoryId: item.workloadCategoryId || '',
|
||||
workloadCategoryName: item.workloadCategoryName || '',
|
||||
unitPrice: item.unitPrice || '',
|
||||
settlementUnitPrice: item.settlementUnitPrice || '',
|
||||
workloadNum: item.workloadNum || '',
|
||||
}))
|
||||
} else {
|
||||
|
|
@ -1053,6 +1058,7 @@ const getDetail = async () => {
|
|||
workloadCategoryId: '',
|
||||
workloadCategoryName: '',
|
||||
unitPrice: '',
|
||||
settlementUnitPrice: '',
|
||||
workloadNum: '',
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ import ComTable from '@/components/ComTable/index.vue'
|
|||
import ComButton from '@/components/ComButton/index.vue'
|
||||
import ComDialog from '@/components/ComDialog/index.vue'
|
||||
import AddForm from './addForm.vue'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const dictStore = useDictStore()
|
||||
|
|
|
|||
|
|
@ -212,7 +212,8 @@
|
|||
active-value="0"
|
||||
inactive-value="1"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
></el-switch>
|
||||
>
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
|
|
|||
Loading…
Reference in New Issue