feat(oa): 添加项目进度步骤批量延期功能
- 在服务层接口添加批量延期方法定义 - 实现批量延期业务逻辑,支持按天或小时延期 - 添加数据库批量延期SQL映射 - 控制器增加批量延期API端点 - 前端组件添加批量延期按钮和对话框 - 集成前端批量延期API调用逻辑 - 添加批量延期数据传输对象定义
This commit is contained in:
@@ -67,3 +67,12 @@ export function listMyPage (query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 批量延期步骤结束时间
|
||||
export function batchDelayStep (data) {
|
||||
return request({
|
||||
url: '/oa/projectScheduleStep/batch-delay',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -4,12 +4,15 @@
|
||||
<el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="addInnerData">新增</el-button>
|
||||
<el-button type="warning" plain icon="el-icon-time" size="mini" @click="handleBatchDelay" :disabled="selectedRows.length === 0">批量延期</el-button>
|
||||
<slot name="extra-buttons"></slot>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<vxe-table size="mini" height="500" ref="tableRef" border show-overflow :edit-config="editConfig" :data="innerData"
|
||||
:row-config="{ 'isCurrent': true }" :column-config="{ 'isCurrent': true }" :sort-config="sortConfig">
|
||||
:row-config="{ 'isCurrent': true, 'isHover': true }" :column-config="{ 'isCurrent': true }" :sort-config="sortConfig"
|
||||
@checkbox-change="handleCheckboxChange" @checkbox-all="handleCheckboxAll">
|
||||
<vxe-column type="checkbox" width="50"></vxe-column>
|
||||
<vxe-column field="sortNum" title="顺序" :edit-render="{ name: 'input' }" width="70" sortable></vxe-column>
|
||||
<vxe-column field="secondLevelNode" title="步骤名称" :edit-render="{ name: 'input' }"></vxe-column>
|
||||
<vxe-column field="tabNode" title="进度类别" :edit-render="{ name: 'input' }"></vxe-column>
|
||||
@@ -166,6 +169,25 @@
|
||||
<el-button type="primary" @click="submitApplyDelay">确认申请</el-button>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 批量延期对话框 -->
|
||||
<el-dialog :visible.sync="dialogBatchDelayVisible" title="批量延期" append-to-body width="400px">
|
||||
<el-form :model="dialogBatchDelayForm" label-width="100px">
|
||||
<el-form-item label="延期数值">
|
||||
<el-input-number v-model="dialogBatchDelayForm.delayValue" :min="1" :max="365" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="延期单位">
|
||||
<el-radio-group v-model="dialogBatchDelayForm.delayUnit">
|
||||
<el-radio label="day">天</el-radio>
|
||||
<el-radio label="hour">小时</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="dialogBatchDelayVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitBatchDelay">确认延期</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="addDialogVisible" title="新增进度" append-to-body>
|
||||
<el-form :model="dialogAddForm" ref="formRef" label-width="120px">
|
||||
<el-form-item label="进度类别" prop="tabNode">
|
||||
@@ -229,7 +251,7 @@
|
||||
<script>
|
||||
import { addFileOperationRecord } from '@/api/oa/fileOperationRecord';
|
||||
import { applyProjectScheduleDelay } from "@/api/oa/projectScheduleDelay";
|
||||
import { updateProjectScheduleStep } from "@/api/oa/projectScheduleStep";
|
||||
import { updateProjectScheduleStep, batchDelayStep } from "@/api/oa/projectScheduleStep";
|
||||
import { listSupplier } from "@/api/oa/supplier";
|
||||
import { listUser } from "@/api/system/user";
|
||||
|
||||
@@ -280,6 +302,13 @@ export default {
|
||||
delayTo: '',
|
||||
applyReason: '',
|
||||
},
|
||||
// 批量延期对话框控制
|
||||
dialogBatchDelayVisible: false,
|
||||
dialogBatchDelayForm: {
|
||||
delayValue: 1,
|
||||
delayUnit: 'day',
|
||||
},
|
||||
selectedRows: [],
|
||||
dialogMoreVisible: false,
|
||||
// 新增对话框控制
|
||||
addDialogVisible: false,
|
||||
@@ -699,6 +728,44 @@ export default {
|
||||
handleDelete (row) {
|
||||
this.$emit('delete', row.trackId);
|
||||
},
|
||||
handleCheckboxChange ({ records }) {
|
||||
this.selectedRows = records;
|
||||
},
|
||||
handleCheckboxAll ({ records }) {
|
||||
this.selectedRows = records;
|
||||
},
|
||||
handleBatchDelay () {
|
||||
if (this.selectedRows.length === 0) {
|
||||
this.$modal.msgWarning("请先选择要延期的步骤");
|
||||
return;
|
||||
}
|
||||
this.dialogBatchDelayForm = {
|
||||
delayValue: 1,
|
||||
delayUnit: 'day',
|
||||
};
|
||||
this.dialogBatchDelayVisible = true;
|
||||
},
|
||||
submitBatchDelay () {
|
||||
const trackIds = this.selectedRows.map(row => row.trackId).filter(id => id);
|
||||
if (trackIds.length === 0) {
|
||||
this.$modal.msgWarning("请选择有效的步骤");
|
||||
return;
|
||||
}
|
||||
this.buttonLoading = true;
|
||||
batchDelayStep({
|
||||
trackIds: trackIds,
|
||||
delayValue: this.dialogBatchDelayForm.delayValue,
|
||||
delayUnit: this.dialogBatchDelayForm.delayUnit,
|
||||
}).then(res => {
|
||||
this.$modal.msgSuccess("批量延期成功");
|
||||
this.dialogBatchDelayVisible = false;
|
||||
this.$emit("refresh", this.innerData);
|
||||
}).catch(() => {
|
||||
this.$modal.msgError("批量延期失败");
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user