Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
2026-07-08 13:43:52 +08:00
21 changed files with 165 additions and 37 deletions

View File

@@ -0,0 +1,7 @@
-- ========================================
-- 电子请购单 — 增量变更 1增加审批意见字段
-- ========================================
ALTER TABLE `erp_purchase_requisition`
ADD COLUMN `first_approval_opinion` VARCHAR(500) DEFAULT NULL COMMENT '一审审批意见' AFTER `remark`,
ADD COLUMN `second_approval_opinion` VARCHAR(500) DEFAULT NULL COMMENT '二审审批意见' AFTER `first_approval_opinion`;

View File

@@ -94,14 +94,16 @@ public class ErpPurchaseRequisitionController extends BaseController {
/** 审批通过(审批中 → 已通过) */
@Log(title = "请购及采购单", businessType = BusinessType.UPDATE)
@PutMapping("/{reqId}/approve")
public R<Void> approve(@NotNull(message = "主键不能为空") @PathVariable Long reqId) {
return toAjax(iErpPurchaseRequisitionService.approve(reqId));
public R<Void> approve(@NotNull(message = "主键不能为空") @PathVariable Long reqId,
@RequestParam(required = false) String approvalOpinion) {
return toAjax(iErpPurchaseRequisitionService.approve(reqId, approvalOpinion));
}
/** 驳回(审批中 → 已驳回) */
@Log(title = "请购及采购单", businessType = BusinessType.UPDATE)
@PutMapping("/{reqId}/reject")
public R<Void> reject(@NotNull(message = "主键不能为空") @PathVariable Long reqId) {
return toAjax(iErpPurchaseRequisitionService.reject(reqId));
public R<Void> reject(@NotNull(message = "主键不能为空") @PathVariable Long reqId,
@RequestParam(required = false) String approvalOpinion) {
return toAjax(iErpPurchaseRequisitionService.reject(reqId, approvalOpinion));
}
}

View File

@@ -106,6 +106,12 @@ public class ErpPurchaseRequisition extends BaseEntity {
@TableLogic
private String delFlag;
/** 一审审批意见 */
private String firstApprovalOpinion;
/** 二审审批意见 */
private String secondApprovalOpinion;
/** 备注 */
private String remark;
}

View File

@@ -100,6 +100,12 @@ public class ErpPurchaseRequisitionBo extends BaseEntity {
/** 状态 */
private String formStatus;
/** 一审审批意见 */
private String firstApprovalOpinion;
/** 二审审批意见 */
private String secondApprovalOpinion;
/** 备注 */
private String remark;

View File

@@ -100,6 +100,12 @@ public class ErpPurchaseRequisitionVo implements Serializable {
@ExcelProperty(value = "状态")
private String formStatus;
@ExcelProperty(value = "一审审批意见")
private String firstApprovalOpinion;
@ExcelProperty(value = "二审审批意见")
private String secondApprovalOpinion;
@ExcelProperty(value = "备注")
private String remark;

View File

@@ -38,8 +38,8 @@ public interface IErpPurchaseRequisitionService {
Boolean submitApproval(Long reqId, Long firstApproverId, String firstApproverName);
/** 审批通过(审批中 → 已通过) */
Boolean approve(Long reqId);
Boolean approve(Long reqId, String approvalOpinion);
/** 驳回(审批中 → 已驳回) */
Boolean reject(Long reqId);
Boolean reject(Long reqId, String approvalOpinion);
}

View File

@@ -149,7 +149,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean approve(Long reqId) {
public Boolean approve(Long reqId, String approvalOpinion) {
ErpPurchaseRequisition entity = baseMapper.selectById(reqId);
if (entity == null) return false;
String currentNickName = LoginHelper.getNickName();
@@ -161,6 +161,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
throw new RuntimeException("您不是该请购单指定的审批人");
}
entity.setFormStatus("6");
entity.setFirstApprovalOpinion(approvalOpinion);
return baseMapper.updateById(entity) > 0;
} else if ("6".equals(entity.getFormStatus())) {
@@ -170,6 +171,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
}
entity.setFormStatus("2");
entity.setSignRequestGm("陈清鑫");
entity.setSecondApprovalOpinion(approvalOpinion);
return baseMapper.updateById(entity) > 0;
} else {
@@ -179,7 +181,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean reject(Long reqId) {
public Boolean reject(Long reqId, String approvalOpinion) {
ErpPurchaseRequisition entity = baseMapper.selectById(reqId);
if (entity == null) return false;
String currentNickName = LoginHelper.getNickName();
@@ -191,6 +193,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
throw new RuntimeException("您不是该请购单指定的审批人");
}
entity.setFormStatus("5");
entity.setFirstApprovalOpinion(approvalOpinion);
return baseMapper.updateById(entity) > 0;
} else if ("6".equals(entity.getFormStatus())) {
@@ -199,6 +202,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
throw new RuntimeException("二审仅限指定审批人操作");
}
entity.setFormStatus("5");
entity.setSecondApprovalOpinion(approvalOpinion);
return baseMapper.updateById(entity) > 0;
} else {

View File

@@ -59,6 +59,8 @@ public class EqpMaintenancePlanDetail extends BaseEntity {
private String equipmentExecutor;
private String plannedCompleteTime;
private String actualCompleteTime;
private String plannedStartTime;
private String actualStartTime;
private String totalHours;
private String acceptanceUser;
/**

View File

@@ -66,6 +66,8 @@ public class EqpMaintenancePlanDetailBo extends BaseEntity {
private String equipmentExecutor;
private String plannedCompleteTime;
private String actualCompleteTime;
private String plannedStartTime;
private String actualStartTime;
private String totalHours;
private String acceptanceUser;

View File

@@ -76,10 +76,16 @@ public class EqpMaintenancePlanDetailVo {
@ExcelProperty(value = "设备执行人员")
private String equipmentExecutor;
@ExcelProperty(value = "预计完成时间")
@ExcelProperty(value = "预计开始时间")
private String plannedStartTime;
@ExcelProperty(value = "预计结束时间")
private String plannedCompleteTime;
@ExcelProperty(value = "实际完成时间")
@ExcelProperty(value = "实际开始时间")
private String actualStartTime;
@ExcelProperty(value = "实际结束时间")
private String actualCompleteTime;
@ExcelProperty(value = "总耗时h")

View File

@@ -17,6 +17,8 @@
<result property="equipmentExecutor" column="equipment_executor"/>
<result property="plannedCompleteTime" column="planned_complete_time"/>
<result property="actualCompleteTime" column="actual_complete_time"/>
<result property="plannedStartTime" column="planned_start_time"/>
<result property="actualStartTime" column="actual_start_time"/>
<result property="totalHours" column="total_hours"/>
<result property="acceptanceUser" column="acceptance_user"/>
<result property="repairUser" column="repair_user"/>

View File

@@ -45,18 +45,20 @@ export function submitApproval(reqId, firstApproverId, firstApproverName) {
}
// 审批通过
export function approvePurchase(reqId) {
export function approvePurchase(reqId, approvalOpinion) {
return request({
url: '/erp/purchaseRequisition/' + reqId + '/approve',
method: 'put'
method: 'put',
params: { approvalOpinion }
})
}
// 驳回
export function rejectPurchase(reqId) {
export function rejectPurchase(reqId, approvalOpinion) {
return request({
url: '/erp/purchaseRequisition/' + reqId + '/reject',
method: 'put'
method: 'put',
params: { approvalOpinion }
})
}

View File

@@ -64,6 +64,10 @@ export default {
type: Number,
default: 6,
validator: (value) => value > 0
},
inputFormatter: {
type: Function,
default: null
}
},
data() {
@@ -132,10 +136,11 @@ export default {
* @param {object} item - 选中的项 {value: 'xxx'}
*/
handleSelect(item) {
this.cacheInputValue(item.value);
this.inputValue = item.value;
const v = this.formatValue(item.value);
this.cacheInputValue(v);
this.inputValue = v;
// 触发自定义事件,通知父组件选中结果
this.$emit('input', item.value);
this.$emit('input', v);
},
/**
@@ -144,13 +149,22 @@ export default {
*/
handleInputChange(value) {
if (value && value.trim() !== '') {
this.cacheInputValue(value.trim());
const v = this.formatValue(value.trim());
this.cacheInputValue(v);
// 触发自定义事件,通知父组件输入结果
this.$emit('input', value.trim());
this.$emit('input', v);
} else {
this.$emit('input', '');
}
},
formatValue(value) {
const v = value === null || value === undefined ? '' : String(value);
if (!v.trim()) return '';
if (typeof this.inputFormatter === 'function') {
return this.inputFormatter(v);
}
return v.trim();
},
/**
* 缓存输入值到localStorage

View File

@@ -19,6 +19,8 @@ export const MemoInputStorageKey = {
maintenanceEquipmentExecutor: 'maintenanceEquipmentExecutor', // 维修明细-设备执行人员
maintenancePlannedCompleteTime: 'maintenancePlannedCompleteTime', // 维修明细-预计完成时间
maintenanceActualCompleteTime: 'maintenanceActualCompleteTime', // 维修明细-实际完成时间
maintenancePlannedStartTime: 'maintenancePlannedStartTime', // 维修明细-预计开始时间
maintenanceActualStartTime: 'maintenanceActualStartTime', // 维修明细-实际开始时间
maintenanceTotalHours: 'maintenanceTotalHours', // 维修明细-总耗时
maintenanceAcceptanceUser: 'maintenanceAcceptanceUser', // 维修明细-验收人
maintenanceRemark: 'maintenanceRemark', // 维修明细-备注

View File

@@ -363,9 +363,15 @@
<!-- 审批进度 -->
<div class="pv-section-title" style="margin-top:14px">审批进度</div>
<div style="display:flex;gap:24px;padding:8px 0;font-size:13px">
<div style="padding:8px 0;font-size:13px">
<div style="margin-bottom:10px">
<div><label style="color:#909399">一审人</label><span>{{ viewForm.signPurchaseHandler || '待审批' }}</span></div>
<div v-if="viewForm.firstApprovalOpinion" style="margin:4px 0 0 62px;color:#606266;font-size:12px;padding:4px 10px;background:#f5f7fa;border-radius:3px;display:inline-block">意见{{ viewForm.firstApprovalOpinion }}</div>
</div>
<div>
<div><label style="color:#909399">二审人陈清鑫</label><span>{{ viewForm.signRequestGm || '待审批' }}</span></div>
<div v-if="viewForm.secondApprovalOpinion" style="margin:4px 0 0 124px;color:#606266;font-size:12px;padding:4px 10px;background:#f5f7fa;border-radius:3px;display:inline-block">意见{{ viewForm.secondApprovalOpinion }}</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
@@ -766,7 +772,7 @@ export default {
// 审批通过
doApprove() {
this.approvalLoading = true
approvePurchase(this.approvalReq.reqId).then(() => {
approvePurchase(this.approvalReq.reqId, this.approvalRemark).then(() => {
this.$modal.msgSuccess('审批通过')
this.approvalOpen = false
this.getList()
@@ -775,7 +781,7 @@ export default {
// 驳回
doReject() {
this.approvalLoading = true
rejectPurchase(this.approvalReq.reqId).then(() => {
rejectPurchase(this.approvalReq.reqId, this.approvalRemark).then(() => {
this.$modal.msgSuccess('已驳回')
this.approvalOpen = false
this.getList()

View File

@@ -497,7 +497,11 @@ export default {
loadDialogData() {
if (!this.currentWarehouse) return;
this.dialogLoading = true;
const baseParams = { warehouseId: this.currentWarehouse.warehouseId, dataType: 1, status: 0 };
const baseParams = {
warehouseId: this.currentWarehouse.warehouseId,
qualityStatusCsv: this.queryParams.qualityStatusCsv || '',
dataType: 1, status: 0,
};
Promise.all([
listLightCoil({ ...baseParams, pageSize: 99999, pageNum: 1 }),
listMaterialCoil({ ...baseParams, pageNum: this.dialogPageNum, pageSize: this.dialogPageSize }),

View File

@@ -112,8 +112,10 @@
<el-table-column label="具体工作内容" align="center" prop="repairContent" min-width="220" show-overflow-tooltip />
<el-table-column label="产线执行人员" align="center" prop="lineExecutor" min-width="150" show-overflow-tooltip />
<el-table-column label="设备执行人员" align="center" prop="equipmentExecutor" min-width="150" show-overflow-tooltip />
<el-table-column label="预计完成时间" align="center" prop="plannedCompleteTime" min-width="140" show-overflow-tooltip />
<el-table-column label="实际完成时间" align="center" prop="actualCompleteTime" min-width="140" show-overflow-tooltip />
<el-table-column label="预计开始时间" align="center" prop="plannedStartTime" min-width="120" show-overflow-tooltip />
<el-table-column label="预计结束时间" align="center" prop="plannedCompleteTime" min-width="120" show-overflow-tooltip />
<el-table-column label="实际开始时间" align="center" prop="actualStartTime" min-width="120" show-overflow-tooltip />
<el-table-column label="实际结束时间" align="center" prop="actualCompleteTime" min-width="120" show-overflow-tooltip />
<el-table-column label="总耗时h" align="center" prop="totalHours" min-width="110" show-overflow-tooltip />
<el-table-column label="验收人" align="center" prop="acceptanceUser" min-width="110" show-overflow-tooltip />
<el-table-column label="是否完成" align="center" width="100">

View File

@@ -101,8 +101,10 @@
<el-table-column label="具体工作内容" align="center" prop="repairContent" min-width="200" show-overflow-tooltip />
<el-table-column label="产线执行人员" align="center" prop="lineExecutor" min-width="130" show-overflow-tooltip />
<el-table-column label="设备执行人员" align="center" prop="equipmentExecutor" min-width="130" show-overflow-tooltip />
<el-table-column label="预计完成时间" align="center" prop="plannedCompleteTime" min-width="120" show-overflow-tooltip />
<el-table-column label="实际完成时间" align="center" prop="actualCompleteTime" min-width="120" show-overflow-tooltip />
<el-table-column label="预计开始时间" align="center" prop="plannedStartTime" min-width="120" show-overflow-tooltip />
<el-table-column label="预计结束时间" align="center" prop="plannedCompleteTime" min-width="120" show-overflow-tooltip />
<el-table-column label="实际开始时间" align="center" prop="actualStartTime" min-width="120" show-overflow-tooltip />
<el-table-column label="实际结束时间" align="center" prop="actualCompleteTime" min-width="120" show-overflow-tooltip />
<el-table-column label="总耗时h" align="center" prop="totalHours" min-width="100" show-overflow-tooltip />
<el-table-column label="验收人" align="center" prop="acceptanceUser" min-width="100" show-overflow-tooltip />
<el-table-column label="进度" align="center" width="160">

View File

@@ -165,7 +165,20 @@
<div v-else class="cell-pre-wrap">{{ scope.row.equipmentExecutor || '-' }}</div>
</template>
</el-table-column>
<el-table-column label="预计完成时间" align="center" min-width="140">
<el-table-column label="预计开始时间" align="center" min-width="120">
<template slot-scope="scope">
<MemoInput
v-if="scope.row._editing"
v-model="scope.row.plannedStartTime"
storageKey="maintenancePlannedStartTime"
matchRule="contain"
triggerMode="focus"
:inputFormatter="normalizeHm"
placeholder="如 07:00" />
<span v-else>{{ scope.row.plannedStartTime || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="预计结束时间" align="center" min-width="120">
<template slot-scope="scope">
<MemoInput
v-if="scope.row._editing"
@@ -173,11 +186,25 @@
storageKey="maintenancePlannedCompleteTime"
matchRule="contain"
triggerMode="focus"
placeholder="如 7:00-18:30" />
:inputFormatter="normalizeHm"
placeholder="如 18:30" />
<span v-else>{{ scope.row.plannedCompleteTime || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="实际完成时间" align="center" min-width="140">
<el-table-column label="实际开始时间" align="center" min-width="120">
<template slot-scope="scope">
<MemoInput
v-if="scope.row._editing"
v-model="scope.row.actualStartTime"
storageKey="maintenanceActualStartTime"
matchRule="contain"
triggerMode="focus"
:inputFormatter="normalizeHm"
placeholder="如 07:00" />
<span v-else>{{ scope.row.actualStartTime || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="实际结束时间" align="center" min-width="120">
<template slot-scope="scope">
<MemoInput
v-if="scope.row._editing"
@@ -185,7 +212,8 @@
storageKey="maintenanceActualCompleteTime"
matchRule="contain"
triggerMode="focus"
placeholder="如 7:00-18:30" />
:inputFormatter="normalizeHm"
placeholder="如 18:30" />
<span v-else>{{ scope.row.actualCompleteTime || '-' }}</span>
</template>
</el-table-column>
@@ -362,6 +390,17 @@ export default {
},
methods: {
parseTime,
normalizeHm(value) {
if (value === null || value === undefined) return '';
var s = String(value).trim();
if (!s) return '';
var m = s.match(/^(\d{1,2})(?::(\d{1,2}))?$/);
if (!m) return s;
var hh = parseInt(m[1], 10);
var mm = m[2] === undefined ? 0 : parseInt(m[2], 10);
if (isNaN(hh) || isNaN(mm) || hh < 0 || hh > 23 || mm < 0 || mm > 59) return s;
return String(hh).padStart(2, '0') + ':' + String(mm).padStart(2, '0');
},
async loadLineList() {
try {
const res = await listProductionLine({ pageSize: 999 });
@@ -456,7 +495,9 @@ export default {
repairContent: rec.abnormalDesc || '',
lineExecutor: rec.inspector || '',
equipmentExecutor: '',
plannedStartTime: '',
plannedCompleteTime: '',
actualStartTime: '',
actualCompleteTime: '',
totalHours: '',
acceptanceUser: '',
@@ -578,7 +619,9 @@ export default {
repairContent: row.repairContent,
lineExecutor: row.lineExecutor,
equipmentExecutor: row.equipmentExecutor,
plannedStartTime: row.plannedStartTime,
plannedCompleteTime: row.plannedCompleteTime,
actualStartTime: row.actualStartTime,
actualCompleteTime: row.actualCompleteTime,
totalHours: row.totalHours,
acceptanceUser: row.acceptanceUser,
@@ -598,7 +641,9 @@ export default {
row.repairContent = row._origin.repairContent;
row.lineExecutor = row._origin.lineExecutor;
row.equipmentExecutor = row._origin.equipmentExecutor;
row.plannedStartTime = row._origin.plannedStartTime;
row.plannedCompleteTime = row._origin.plannedCompleteTime;
row.actualStartTime = row._origin.actualStartTime;
row.actualCompleteTime = row._origin.actualCompleteTime;
row.totalHours = row._origin.totalHours;
row.acceptanceUser = row._origin.acceptanceUser;
@@ -644,7 +689,9 @@ export default {
repairContent: '',
lineExecutor: '',
equipmentExecutor: '',
plannedStartTime: '',
plannedCompleteTime: '',
actualStartTime: '',
actualCompleteTime: '',
totalHours: '',
acceptanceUser: '',
@@ -663,7 +710,9 @@ export default {
repairContent: row.repairContent,
lineExecutor: row.lineExecutor,
equipmentExecutor: row.equipmentExecutor,
plannedStartTime: row.plannedStartTime,
plannedCompleteTime: row.plannedCompleteTime,
actualStartTime: row.actualStartTime,
actualCompleteTime: row.actualCompleteTime,
totalHours: row.totalHours,
acceptanceUser: row.acceptanceUser,

View File

@@ -98,7 +98,7 @@ export default {
const newSet = new Set(nv)
const oldSet = ov ? new Set(ov) : new Set()
this.orderedColumns = this.orderedColumns.filter(f => newSet.has(f))
const added = nv.filter(f => !oldSet.has(f))
const added = nv.filter(f => !oldSet.has(f) && !this.orderedColumns.includes(f))
if (added.length) {
this.orderedColumns.push(...added)
}
@@ -114,8 +114,9 @@ export default {
try {
const arr = JSON.parse(cached)
if (Array.isArray(arr) && arr.length) {
this.selectedColumns = [...arr]
this.orderedColumns = [...arr]
const uniqueArr = [...new Set(arr)]
this.selectedColumns = uniqueArr
this.orderedColumns = uniqueArr
this.$emit('update:visible', true)
return
}

View File

@@ -0,0 +1,3 @@
ALTER TABLE eqp_maintenance_plan_detail
ADD COLUMN planned_start_time varchar(16) NULL,
ADD COLUMN actual_start_time varchar(16) NULL;