Compare commits

...

11 Commits

Author SHA1 Message Date
2099a01bc1 设计文档简化状态机 2026-04-23 10:42:05 +08:00
d5c1c1485c 设计文档简化状态机 2026-04-23 10:26:36 +08:00
2aa0ae83c2 设计文档完善状态机 2026-04-23 10:22:08 +08:00
774fe86941 提交sql 2026-04-23 10:15:22 +08:00
朱昊天
d02ef34751 辅材修正,详情页迭代,产品图片加载 2026-04-22 18:33:04 +08:00
朱昊天
2e7a50bf64 月工资计算,产品详情页补充 2026-04-20 18:47:36 +08:00
朱昊天
3ae6403bd3 Merge remote-tracking branch 'origin/master' 2026-04-17 16:59:27 +08:00
朱昊天
855dbbe099 增加辅料字段,辅料页面 2026-04-17 16:58:29 +08:00
f41a17c885 config(application): 配置文件中添加环境变量占位符
- 将application.yml中的active profile配置改为@profiles.active@占位符
- 支持通过外部配置动态设置激活的环境profile
- 便于不同部署环境下的配置管理
2026-04-17 15:52:18 +08:00
朱昊天
6aa1d581e7 用户管理修改回显尝试,薪资管理时间戳修正,工人批量导入(无需模版,且删除后重复数据自动覆盖) 2026-04-16 20:01:21 +08:00
朱昊天
595b9fbd68 用户管理修改回显尝试,薪资管理时间戳修正 2026-04-14 23:24:24 +08:00
164 changed files with 9580 additions and 94 deletions

View File

@@ -32,6 +32,10 @@ public class MatMaterial extends BaseEntity {
* 配料名称
*/
private String materialName;
/**
* 物料类型1=辅料2=原料
*/
private Integer materialType;
/**
* 配料规格
*/

View File

@@ -54,4 +54,9 @@ public class MatProduct extends BaseEntity {
*/
private String remark;
/**
* 产品图片,多个图片以逗号分隔
*/
private String productImages;
}

View File

@@ -32,6 +32,11 @@ public class MatMaterialBo extends BaseEntity {
*/
private String materialName;
/**
* 物料类型1=辅料2=原料
*/
private Integer materialType;
/**
* 配料规格
*/

View File

@@ -52,5 +52,10 @@ public class MatProductBo extends BaseEntity {
*/
private String remark;
/**
* 产品图片,多个图片以逗号分隔
*/
private String productImages;
}

View File

@@ -34,6 +34,12 @@ public class MatMaterialVo {
@ExcelProperty(value = "配料名称")
private String materialName;
/**
* 物料类型1=辅料2=原料
*/
@ExcelProperty(value = "物料类型")
private Integer materialType;
/**
* 配料规格
*/

View File

@@ -58,5 +58,11 @@ public class MatProductVo {
@ExcelProperty(value = "备注")
private String remark;
/**
* 产品图片,多个图片以逗号分隔
*/
@ExcelProperty(value = "产品图片")
private String productImages;
}

View File

@@ -57,6 +57,12 @@ public class MatProductWithMaterialsVo {
@ExcelProperty(value = "备注")
private String remark;
/**
* 产品图片,多个图片以逗号分隔
*/
@ExcelProperty(value = "产品图片")
private String productImages;
/**
* 关联的配料信息列表
*/

View File

@@ -75,6 +75,7 @@ public class MatMaterialServiceImpl implements IMatMaterialService {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<MatMaterial> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(bo.getMaterialName()), MatMaterial::getMaterialName, bo.getMaterialName());
lqw.eq(bo.getMaterialType() != null, MatMaterial::getMaterialType, bo.getMaterialType());
lqw.eq(StringUtils.isNotBlank(bo.getSpec()), MatMaterial::getSpec, bo.getSpec());
lqw.eq(StringUtils.isNotBlank(bo.getModel()), MatMaterial::getModel, bo.getModel());
lqw.eq(StringUtils.isNotBlank(bo.getFactory()), MatMaterial::getFactory, bo.getFactory());

View File

@@ -112,6 +112,7 @@ public class MatProductServiceImpl implements IMatProductService {
productWithMaterialsVo.setModel(productVo.getModel());
productWithMaterialsVo.setUnitPrice(productVo.getUnitPrice());
productWithMaterialsVo.setRemark(productVo.getRemark());
// productWithMaterialsVo.setProductImages(productVo.getProductImages());
// 查询并设置关联的配料信息
List<MatProductMaterialRelationVo> relations = productMaterialRelationService.queryList(

View File

@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="com.gear.mat.domain.MatMaterial" id="MatMaterialResult">
<result property="materialId" column="material_id"/>
<result property="materialName" column="material_name"/>
<result property="materialType" column="material_type"/>
<result property="spec" column="spec"/>
<result property="model" column="model"/>
<result property="factory" column="factory"/>

View File

@@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
<!-- <result property="productImages" column="product_images"/>-->
</resultMap>

View File

@@ -93,4 +93,6 @@ public class GearWorkerController extends BaseController {
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] workerIds) {
return toAjax(iGearWorkerService.deleteWithValidByIds(Arrays.asList(workerIds), true));
}
}

View File

@@ -7,9 +7,6 @@ import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 工人主数据对象 gear_worker
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("gear_worker")
@@ -26,19 +23,16 @@ public class GearWorker extends BaseEntity {
private String phone;
/**
* 默认计费类型1小时工 2计件工 3天工
*/
private String defaultBillingType;
private String defaultWorkTypeName;
/**
* 状态0在职 1离职
*/
private String status;
@TableLogic
/**
* 逻辑删除标记0-未删除2-已删除
*/
@TableLogic(value = "0", delval = "2")
private String delFlag;
private String remark;

View File

@@ -12,6 +12,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
/**
* 工资录入明细业务对象 gear_wage_entry_detail
@@ -71,4 +72,6 @@ public class GearWageEntryDetailBo extends BaseEntity {
private String makeupReason;
private String remark;
// 新增累计金额
private Map<String, BigDecimal> cumulativeAmounts;
}

View File

@@ -77,4 +77,6 @@ public class GearWageEntryDetailVo {
@ExcelProperty(value = "备注")
private String remark;
@ExcelProperty(value = "累计金额")
private BigDecimal cumulativeAmount;
}

View File

@@ -3,9 +3,40 @@ package com.gear.oa.mapper;
import com.gear.common.core.mapper.BaseMapperPlus;
import com.gear.oa.domain.GearWorker;
import com.gear.oa.domain.vo.GearWorkerVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
/**
* 工人主数据Mapper接口
*/
public interface GearWorkerMapper extends BaseMapperPlus<GearWorkerMapper, GearWorker, GearWorkerVo> {
/**
* 根据工号查询所有记录(包括逻辑删除的),绕过 MyBatis-Plus 自动过滤
*
* @param workerNo 工号
* @return 工人记录(可能为 null
*/
@Select("SELECT * FROM gear_worker WHERE worker_no = #{workerNo}")
GearWorker selectByWorkerNoIncludeDeleted(@Param("workerNo") String workerNo);
/**
* 强制恢复并更新已删除的工人记录
* 直接将 del_flag 更新为 0并更新其他字段
*
* @param worker 包含新数据的工人对象(必须包含 workerNo 和需要更新的字段)
* @return 影响行数
*/
@Update("UPDATE gear_worker SET " +
"worker_name = #{workerName}, " +
"phone = #{phone}, " +
"default_billing_type = #{defaultBillingType}, " +
"default_work_type_name = #{defaultWorkTypeName}, " +
"status = #{status}, " +
"del_flag = '0', " +
"remark = #{remark}, " +
"update_by = #{updateBy}, " +
"update_time = NOW() " +
"WHERE worker_no = #{workerNo}")
int recoverByWorkerNo(GearWorker worker);
}

View File

@@ -49,10 +49,23 @@ public class GearWageEntryDetailServiceImpl implements IGearWageEntryDetailServi
return TableDataInfo.build(result);
}
// @Override
// public List<GearWageEntryDetailVo> queryList(GearWageEntryDetailBo bo) {
// LambdaQueryWrapper<GearWageEntryDetail> lqw = buildQueryWrapper(bo);
// return baseMapper.selectVoList(lqw);
//
// }
@Override
public List<GearWageEntryDetailVo> queryList(GearWageEntryDetailBo bo) {
LambdaQueryWrapper<GearWageEntryDetail> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
// 将 selectList 改为 selectVoList
List<GearWageEntryDetailVo> list = baseMapper.selectVoList(buildQueryWrapper(bo));
// 处理累计金额
if (bo.getCumulativeAmounts() != null) {
for (GearWageEntryDetailVo vo : list) {
vo.setCumulativeAmount(bo.getCumulativeAmounts().get(vo.getEmpName()));
}
}
return list;
}
private LambdaQueryWrapper<GearWageEntryDetail> buildQueryWrapper(GearWageEntryDetailBo bo) {

View File

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gear.common.core.domain.PageQuery;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.exception.ServiceException;
import com.gear.common.utils.StringUtils;
import com.gear.oa.domain.GearWorker;
import com.gear.oa.domain.bo.GearWorkerBo;
@@ -14,14 +15,13 @@ import com.gear.oa.domain.vo.GearWorkerVo;
import com.gear.oa.mapper.GearWorkerMapper;
import com.gear.oa.service.IGearWorkerService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
/**
* 工人主数据Service业务层处理
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class GearWorkerServiceImpl implements IGearWorkerService {
@@ -48,6 +48,8 @@ public class GearWorkerServiceImpl implements IGearWorkerService {
private LambdaQueryWrapper<GearWorker> buildQueryWrapper(GearWorkerBo bo) {
LambdaQueryWrapper<GearWorker> lqw = Wrappers.lambdaQuery();
// 只查询未删除的数据del_flag = '0'
lqw.eq(GearWorker::getDelFlag, "0");
lqw.eq(bo.getWorkerId() != null, GearWorker::getWorkerId, bo.getWorkerId());
lqw.eq(StringUtils.isNotBlank(bo.getWorkerNo()), GearWorker::getWorkerNo, bo.getWorkerNo());
lqw.like(StringUtils.isNotBlank(bo.getWorkerName()), GearWorker::getWorkerName, bo.getWorkerName());
@@ -59,17 +61,48 @@ public class GearWorkerServiceImpl implements IGearWorkerService {
@Override
public Boolean insertByBo(GearWorkerBo bo) {
// 使用自定义方法查询所有记录(包括逻辑删除的)
GearWorker existing = baseMapper.selectByWorkerNoIncludeDeleted(bo.getWorkerNo());
if (existing != null) {
// 记录存在
if ("0".equals(existing.getDelFlag())) {
throw new ServiceException("工号 " + bo.getWorkerNo() + " 已存在且未删除,不能重复添加");
} else {
// 已删除,执行强制恢复更新
GearWorker update = BeanUtil.toBean(bo, GearWorker.class);
// 必须设置工号,用于 WHERE 条件
update.setWorkerNo(bo.getWorkerNo());
// 调用自定义恢复方法,直接更新数据库
int rows = baseMapper.recoverByWorkerNo(update);
if (rows > 0) {
bo.setWorkerId(existing.getWorkerId());
log.info("恢复并更新已删除工人成功workerNo={}", bo.getWorkerNo());
return true;
} else {
throw new ServiceException("恢复工人数据失败,请稍后重试");
}
}
}
// 完全新增
log.info("新增工人workerNo={}", bo.getWorkerNo());
GearWorker add = BeanUtil.toBean(bo, GearWorker.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
baseMapper.insert(add);
bo.setWorkerId(add.getWorkerId());
}
return flag;
return true;
}
@Override
public Boolean updateByBo(GearWorkerBo bo) {
GearWorker existing = baseMapper.selectById(bo.getWorkerId());
if (existing == null) {
throw new ServiceException("记录不存在");
}
if (!"0".equals(existing.getDelFlag())) {
throw new ServiceException("该记录已被删除,无法更新");
}
GearWorker update = BeanUtil.toBean(bo, GearWorker.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
@@ -82,10 +115,14 @@ public class GearWorkerServiceImpl implements IGearWorkerService {
if (StringUtils.isBlank(entity.getDefaultBillingType())) {
entity.setDefaultBillingType("1");
}
if (StringUtils.isBlank(entity.getDelFlag())) {
entity.setDelFlag("0");
}
}
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
// 由于 @TableLogic(value="0", delval="2") 配置,此处会执行 UPDATE gear_worker SET del_flag='2'
return baseMapper.deleteBatchIds(ids) > 0;
}
@@ -103,17 +140,16 @@ public class GearWorkerServiceImpl implements IGearWorkerService {
msg.append("[工号/姓名为空]");
continue;
}
GearWorker exist = baseMapper.selectOne(Wrappers.<GearWorker>lambdaQuery()
.eq(GearWorker::getWorkerNo, item.getWorkerNo()));
if (exist == null) {
GearWorker add = BeanUtil.toBean(item, GearWorker.class);
validEntityBeforeSave(add);
baseMapper.insert(add);
success++;
} else if (Boolean.TRUE.equals(updateSupport)) {
// 使用自定义方法查询所有记录(包括逻辑删除的)
GearWorker existing = baseMapper.selectByWorkerNoIncludeDeleted(item.getWorkerNo());
if (existing != null) {
if ("0".equals(existing.getDelFlag())) {
// 未删除,根据 updateSupport 决定
if (Boolean.TRUE.equals(updateSupport)) {
GearWorker update = BeanUtil.toBean(item, GearWorker.class);
update.setWorkerId(exist.getWorkerId());
update.setWorkerId(existing.getWorkerId());
validEntityBeforeSave(update);
baseMapper.updateById(update);
success++;
@@ -121,6 +157,26 @@ public class GearWorkerServiceImpl implements IGearWorkerService {
fail++;
msg.append("[工号重复:").append(item.getWorkerNo()).append("]");
}
} else {
// 已删除,强制恢复
GearWorker recover = BeanUtil.toBean(item, GearWorker.class);
recover.setWorkerNo(item.getWorkerNo());
int rows = baseMapper.recoverByWorkerNo(recover);
if (rows > 0) {
success++;
} else {
fail++;
msg.append("[恢复失败:").append(item.getWorkerNo()).append("]");
}
}
continue;
}
// 完全新增
GearWorker add = BeanUtil.toBean(item, GearWorker.class);
validEntityBeforeSave(add);
baseMapper.insert(add);
success++;
}
return "导入完成,成功" + success + "条,失败" + fail + "" + (msg.length() > 0 ? "" + msg : "");
}

View File

@@ -27,6 +27,7 @@
"element-plus": "2.9.9",
"file-saver": "2.0.5",
"fuse.js": "6.6.2",
"i": "^0.3.7",
"js-beautify": "1.14.11",
"js-cookie": "3.0.5",
"jsencrypt": "3.3.2",
@@ -39,7 +40,8 @@
"vue-cropper": "1.1.1",
"vue-router": "4.5.1",
"vue3-treeselect": "^0.1.10",
"vuedraggable": "4.1.0"
"vuedraggable": "4.1.0",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "5.2.4",

View File

@@ -35,10 +35,26 @@ export function updateWorker(data) {
})
}
// 删除工人
export function delWorker(workerId) {
// // 删除工人
// export function delWorker(workerIds) {
// return request({
// url: '/oa/worker/' + workerId,
// // url: '/oa/worker/' + workerIds.join(','),
// method: 'delete'
// })
// }
// 删除工人(修复后,支持单个+批量删除)
export function delWorker(workerIds) {
let url = ''
if (Array.isArray(workerIds)) {
// 数组 → 拼接成 1,2,3
url = '/oa/worker/' + workerIds.join(',')
} else {
// 单个ID
url = '/oa/worker/' + workerIds
}
return request({
url: '/oa/worker/' + workerId,
url: url,
method: 'delete'
})
}

View File

@@ -1,3 +1,4 @@
@use './mixin.scss';
@use './transition.scss';
@use './element-ui.scss';
@@ -176,4 +177,5 @@ aside {
vertical-align: middle;
margin-bottom: 10px;
}
}

View File

@@ -11,10 +11,32 @@
</div>
<!-- 选择弹窗表格+分页+底部按钮 -->
<el-dialog title="选择配料" v-model="open" width="800px" destroy-on-close>
<el-dialog title="选择配料" v-model="open" width="900px" destroy-on-close>
<!-- 检索功能 -->
<el-form :model="searchForm" :inline="true" class="mb-4">
<el-form-item label="配料名称">
<el-input v-model="searchForm.materialName" placeholder="请输入配料名称" clearable @keyup.enter="fetchMaterialList" />
</el-form-item>
<el-form-item label="物料类型">
<el-select v-model="searchForm.materialType" placeholder="请选择物料类型" clearable @change="fetchMaterialList">
<el-option label="主材" value="2" />
<el-option label="辅料" value="1" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="fetchMaterialList">搜索</el-button>
<el-button @click="resetSearch">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="list" style="width: 100%" border stripe @row-click="handleRowSelect" highlight-current-row
row-key="materialId" :current-row-key="materialId">
<el-table-column prop="materialName" label="配料名称" min-width="120" align="center" />
<el-table-column label="物料类型" width="100" align="center">
<template #default="scope">
{{ scope.row.materialType === 1 ? '辅料' : scope.row.materialType === 2 ? '主材' : '-' }}
</template>
</el-table-column>
<el-table-column prop="spec" label="配料规格" min-width="100" align="center" />
<el-table-column prop="model" label="配料型号" min-width="100" align="center" />
<el-table-column prop="factory" label="生产厂家" min-width="120" align="center" />
@@ -64,6 +86,12 @@ const emit = defineEmits(['change']);
const list = ref([]); // 物料列表
const open = ref(false); // 弹窗显隐
// 搜索表单数据
const searchForm = ref({
materialName: '',
materialType: ''
});
// 分页响应式数据(核心新增)
const pageNum = ref(1); // 当前页码
const pageSize = ref(10); // 每页条数
@@ -77,7 +105,15 @@ onMounted(async () => {
// 加载物料列表(适配分页参数)
async function fetchMaterialList() {
try {
const res = await listMaterial({ pageNum: pageNum.value, pageSize: pageSize.value });
// 构建查询参数,包含分页和搜索条件
const params = {
pageNum: pageNum.value,
pageSize: pageSize.value,
materialName: searchForm.value.materialName,
materialType: searchForm.value.materialType
};
const res = await listMaterial(params);
list.value = res.rows;
total.value = res.total; // 赋值总条数供分页使用
@@ -95,6 +131,16 @@ async function fetchMaterialList() {
}
}
// 重置搜索
function resetSearch() {
searchForm.value = {
materialName: '',
materialType: ''
};
pageNum.value = 1;
fetchMaterialList();
}
// 表格行选择物料
function handleRowSelect(row) {
if (row.materialId === materialId.value) return;

View File

@@ -170,8 +170,8 @@ onMounted(() => {
})
</script>
<style lang="scss">
.topmenu-container.el-menu--horizontal > .el-menu-item {
<style lang="scss" scoped>
:deep(.el-menu > .el-menu-item) {
float: left;
height: 50px !important;
line-height: 50px !important;
@@ -180,13 +180,14 @@ onMounted(() => {
margin: 0 10px !important;
}
.topmenu-container.el-menu--horizontal > .el-menu-item.is-active, .el-menu--horizontal > .el-sub-menu.is-active .el-submenu__title {
:deep(.el-menu > .el-menu-item.is-active), :deep(.el-menu > .el-sub-menu.is-active .el-submenu__title) {
border-bottom: 2px solid #{'var(--theme)'} !important;
color: #303133;
background-color: #f5f7fa !important;
}
/* sub-menu item */
.topmenu-container.el-menu--horizontal > .el-sub-menu .el-sub-menu__title {
:deep(.el-menu > .el-sub-menu .el-sub-menu__title) {
float: left;
height: 50px !important;
line-height: 50px !important;
@@ -196,17 +197,17 @@ onMounted(() => {
}
/* 背景色隐藏 */
.topmenu-container.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus, .topmenu-container.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover, .topmenu-container.el-menu--horizontal>.el-submenu .el-submenu__title:hover {
:deep(.el-menu>.el-menu-item:not(.is-disabled):focus), :deep(.el-menu>.el-menu-item:not(.is-disabled):hover), :deep(.el-menu>.el-sub-menu .el-sub-menu__title:hover) {
background-color: #ffffff;
}
/* 图标右间距 */
.topmenu-container .svg-icon {
:deep(.svg-icon) {
margin-right: 4px;
}
/* topmenu more arrow */
.topmenu-container .el-sub-menu .el-sub-menu__icon-arrow {
:deep(.el-sub-menu .el-sub-menu__icon-arrow) {
position: static;
vertical-align: middle;
margin-left: 8px;

View File

@@ -90,8 +90,9 @@ function isActive(r) {
function activeStyle(tag) {
if (!isActive(tag)) return {}
return {
"background-color": theme.value,
"border-color": theme.value
"background-color": "#f5f7fa",
"border-color": "#f5f7fa",
"color": "#303133"
}
}
@@ -291,13 +292,13 @@ function handleScroll() {
}
&.active {
background-color: #42b983;
color: #fff;
border-color: #42b983;
background-color: #f5f7fa;
color: #303133;
border-color: #f5f7fa;
&::before {
content: '';
background: #fff;
background: #42b983;
display: inline-block;
width: 8px;
height: 8px;

View File

@@ -70,20 +70,7 @@ export const constantRoutes = [
}
]
},
{
path: '/user',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: 'profile/:activeTab?',
component: () => import('@/views/system/user/profile/index'),
name: 'Profile',
meta: { title: '个人中心', icon: 'user' }
}
]
}
{ path: '/user', component: Layout, hidden: true, redirect: 'noredirect', children: [ { path: 'profile/:activeTab?', component: () => import('@/views/system/user/profile/index'), name: 'Profile', meta: { title: '个人中心', icon: 'user' } } ] }, { path: '/mat/product', component: Layout, hidden: true, children: [ { path: 'detail/:id(\\d+)', component: () => import('@/views/mat/product/detail'), name: 'ProductDetail', meta: { title: '产品详情', activeMenu: '/mat/product' } } ] }
]
// 动态路由,基于用户权限动态去加载
@@ -151,7 +138,7 @@ export const dynamicRoutes = [
permissions: ['tool:gen:edit'],
children: [
{
path: 'index/:tableId(\\d+)',
path: 'index/:tableId(\d+)',
component: () => import('@/views/tool/gen/editTable'),
name: 'GenEdit',
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }

View File

@@ -17,7 +17,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分
baseURL: import.meta.env.VITE_APP_BASE_API,
// 超时
timeout: 10000
timeout: 30000
})
// request拦截器

View File

@@ -247,23 +247,23 @@ export default {
}
/* 对话框样式 */
::v-deep .el-dialog__header {
:deep(.el-dialog__header) {
padding: 10px 15px;
}
::v-deep .el-dialog__body {
:deep(.el-dialog__body) {
padding: 10px 15px;
}
::v-deep .el-dialog__footer {
:deep(.el-dialog__footer) {
padding: 8px 15px;
}
::v-deep .el-form-item {
:deep(.el-form-item) {
margin-bottom: 10px;
}
::v-deep .el-input__inner {
:deep(.el-input__inner) {
height: 30px;
line-height: 30px;
font-size: 13px;

View File

@@ -0,0 +1,464 @@
<!-- 辅料管理 -->
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="辅料名称" prop="materialName">
<el-input v-model="queryParams.materialName" placeholder="请输入辅料名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="辅料规格" prop="spec">
<el-input v-model="queryParams.spec" placeholder="请输入辅料规格" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="辅料型号" prop="model">
<el-input v-model="queryParams.model" placeholder="请输入辅料型号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="厂家" prop="factory">
<el-input v-model="queryParams.factory" placeholder="请输入厂家" clearable @keyup.enter="handleQuery" />
</el-form-item>
<!-- <el-form-item label="计量单位 个/公斤/米等" prop="unit">
<el-input v-model="queryParams.unit" placeholder="请输入计量单位 个/公斤/米等" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="现存库存" prop="currentStock">
<el-input v-model="queryParams.currentStock" placeholder="请输入现存库存" clearable @keyup.enter="handleQuery" />
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="materialList" @selection-change="handleSelectionChange" @row-click="handleRowClick">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="辅料ID 主键" align="center" prop="materialId" v-if="true" /> -->
<el-table-column label="辅料名称" align="center" prop="materialName" />
<el-table-column label="物料类型" align="center" prop="materialType">
<template #default="scope">
{{ scope.row.materialType === 1 ? '辅料' : '原料' }}
</template>
</el-table-column>
<el-table-column label="辅料规格" align="center" prop="spec" />
<el-table-column label="辅料型号" align="center" prop="model" />
<el-table-column label="厂家" align="center" prop="factory" />
<el-table-column label="计量单位" align="center" prop="unit" />
<el-table-column label="现存库存" align="center" prop="currentStock">
<template #default="scope">
{{ formatDecimal(scope.row.currentStock) }}
</template>
</el-table-column>
<el-table-column label="在途数量" align="center" prop="inTransitNum">
<template #default="scope">
{{ formatDecimal(scope.row.inTransitNum) }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Plus" @click="handleIn(scope.row)">入库</el-button>
<el-button link type="primary" icon="Minus" @click="handleOut(scope.row)">出库</el-button>
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改辅料基础信息对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="materialRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="辅料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入辅料名称" />
</el-form-item>
<el-form-item label="物料类型" prop="materialType">
<el-select v-model="form.materialType" placeholder="请选择物料类型" disabled>
<el-option label="辅料" value="1" />
</el-select>
</el-form-item>
<el-form-item label="辅料规格" prop="spec">
<el-input v-model="form.spec" placeholder="请输入辅料规格" />
</el-form-item>
<el-form-item label="辅料型号" prop="model">
<el-input v-model="form.model" placeholder="请输入辅料型号" />
</el-form-item>
<el-form-item label="厂家" prop="factory">
<el-input v-model="form.factory" placeholder="请输入厂家" />
</el-form-item>
<el-form-item label="计量单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入计量单位" />
</el-form-item>
<!-- <el-form-item label="现存库存" prop="currentStock">
<el-input v-model="form.currentStock" placeholder="请输入现存库存" />
</el-form-item> -->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
<el-dialog title="入库" v-model="inOpen" width="500px" append-to-body>
<el-form ref="materialInRef" :model="inForm" label-width="80px">
<el-form-item label="辅料" prop="materialId">
<raw-selector ref="rawSelector" v-model="inForm.materialId" placeholder="请选择辅料" />
</el-form-item>
<el-form-item label="入库数量" prop="inNum">
<el-input v-model="inForm.inNum" placeholder="请输入入库数量" />
</el-form-item>
<el-form-item label="入库单价" prop="inPrice">
<el-input v-model="inForm.inPrice" placeholder="请输入入库单价" />
</el-form-item>
<el-form-item label="入库时间" prop="inTime">
<el-date-picker clearable v-model="inForm.inTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择实际入库时间">
</el-date-picker>
</el-form-item>
<el-form-item label="操作人" prop="operator">
<el-input v-model="inForm.operator" placeholder="请输入入库操作人" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="inForm.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitFormIn"> </el-button>
<el-button @click="cancelIn"> </el-button>
</div>
</template>
</el-dialog>
<el-dialog title="出库" v-model="outOpen" width="500px" append-to-body>
<el-form ref="materialOutRef" :model="outForm" label-width="80px">
<el-form-item label="出库单号" prop="outNo">
<el-input v-model="outForm.outNo" placeholder="请输入出库单号" />
</el-form-item>
<el-form-item label="辅料" prop="materialId">
<raw-selector ref="rawSelector" v-model="outForm.materialId" placeholder="请选择辅料" />
</el-form-item>
<el-form-item label="出库数量" prop="outNum">
<el-input v-model="outForm.outNum" placeholder="请输入出库数量" />
</el-form-item>
<el-form-item label="出库原因" prop="outReason">
<el-input v-model="outForm.outReason" placeholder="请输入出库原因" />
</el-form-item>
<el-form-item label="操作人" prop="operator">
<el-input v-model="outForm.operator" placeholder="请输入操作人" />
</el-form-item>
<el-form-item label="出库时间" prop="outTime">
<el-date-picker clearable v-model="outForm.outTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择实际出库时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="outForm.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitFormOut"> </el-button>
<el-button @click="cancelOut"> </el-button>
</div>
</template>
</el-dialog>
<Price :materialId="currentMaterialId" ref="priceRef" />
</div>
</template>
<script setup name="AuxiliaryMaterial">
import { listMaterial, getMaterial, delMaterial, addMaterial, updateMaterial } from "@/api/mat/material";
import { addPurchaseInDetail } from "@/api/mat/purchaseInDetail";
import { addMaterialOut } from "@/api/mat/materialOut";
import Price from "@/views/mat/components/price.vue";
import RawSelector from "@/components/RawSelector/index.vue";
import { formatDecimal } from '@/utils/gear'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
const { proxy } = getCurrentInstance();
const materialList = ref([]);
const open = ref(false);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const inForm = ref({});
const outForm = ref({});
const inOpen = ref(false);
const outOpen = ref(false);
const currentMaterialId = ref(null);
function handleRowClick(row) {
currentMaterialId.value = row.materialId;
}
const priceHistoryList = ref([]);
const nickName = computed(() => userStore.nickName)
const formatterTime = (time) => {
return proxy.parseTime(time, '{y}-{m}-{d}')
}
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
materialName: undefined,
spec: undefined,
model: undefined,
factory: undefined,
unit: undefined,
currentStock: undefined,
materialType: 1, // 固定为辅料
},
rules: {
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询辅料基础信息列表 */
function getList() {
loading.value = true;
listMaterial(queryParams.value).then(response => {
materialList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
// 取消按钮
function cancel() {
open.value = false;
reset();
}
// 表单重置
function reset() {
form.value = {
materialId: null,
materialName: null,
materialType: 1, // 固定为辅料
spec: null,
model: null,
factory: null,
unit: null,
currentStock: null,
delFlag: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
remark: null
};
proxy.resetForm("materialRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
queryParams.value.materialType = 1; // 重置后仍为辅料
handleQuery();
}
// 多选框选中数据
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.materialId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加辅料基础信息";
}
/** 修改按钮操作 */
function handleUpdate(row) {
loading.value = true
reset();
const _materialId = row.materialId || ids.value
getMaterial(_materialId).then(response => {
loading.value = false;
form.value = response.data;
open.value = true;
title.value = "修改辅料基础信息";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["materialRef"].validate(valid => {
if (valid) {
buttonLoading.value = true;
if (form.value.materialId != null) {
updateMaterial(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
}).finally(() => {
buttonLoading.value = false;
});
} else {
addMaterial(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
}).finally(() => {
buttonLoading.value = false;
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _materialIds = row.materialId || ids.value;
proxy.$modal.confirm('是否确认删除辅料基础信息编号为"' + _materialIds + '"的数据项?').then(function () {
loading.value = true;
return delMaterial(_materialIds);
}).then(() => {
loading.value = true;
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
loading.value = false;
});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('mat/material/export', {
...queryParams.value
}, `auxiliary_material_${new Date().getTime()}.xlsx`)
}
function handleIn(row) {
const inTime = proxy.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
inOpen.value = true;
inForm.value = {
detailId: null,
purchaseId: null,
materialId: row.materialId,
inNum: null,
inPrice: null,
inAmount: null,
inTime: inTime,
operator: nickName,
delFlag: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
remark: null
};
proxy.resetForm("materialInRef");
}
function cancelIn() {
inOpen.value = false;
}
const priceRef = ref(null);
function submitFormIn() {
loading.value = true;
buttonLoading.value = true;
addPurchaseInDetail(inForm.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
inOpen.value = false;
getList();
priceRef.value.getListChart();
}).finally(() => {
buttonLoading.value = false;
loading.value = false;
});
}
function handleOut(row) {
const outNo = proxy.parseTime(new Date(), '{y}{m}{d}{hh}{i}{s}')
const outTime = proxy.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
outOpen.value = true;
outForm.value = {
outId: null,
outNo: outNo,
materialId: row.materialId,
outNum: null,
outReason: null,
operator: nickName,
outTime: outTime,
delFlag: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
remark: null
};
proxy.resetForm("materialOutRef");
}
function cancelOut() {
outOpen.value = false;
}
function submitFormOut() {
loading.value = true;
buttonLoading.value = true;
addMaterialOut(outForm.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
outOpen.value = false;
getList();
}).finally(() => {
buttonLoading.value = false;
loading.value = false;
});
}
getList();
</script>

View File

@@ -25,6 +25,11 @@
<raw :data="scope.row" :materialId="scope.row.materialId" />
</template>
</el-table-column>
<el-table-column label="物料类型" width="100" align="center">
<template #default="scope">
{{ scope.row.material?.materialType === 1 ? '辅料' : scope.row.material?.materialType === 2 ? '主材' : '-' }}
</template>
</el-table-column>
<el-table-column label="所需数量" align="center" prop="materialNum">
<template #default="scope">
{{ formatDecimal(scope.row.materialNum) }}
@@ -75,6 +80,7 @@
<script setup name="ProductMaterialRelation">
import { listProductMaterialRelation, getProductMaterialRelation, delProductMaterialRelation, addProductMaterialRelation, updateProductMaterialRelation } from "@/api/mat/productMaterialRelation";
import { getMaterial } from "@/api/mat/material";
import RawSelector from '@/components/RawSelector/index.vue'
import Raw from '@/components/Renderer/Raw.vue'
import { formatDecimal } from '@/utils/gear'
@@ -128,8 +134,21 @@ watch(() => props.productId, (newVal, oldVal) => {
function getList() {
loading.value = true;
listProductMaterialRelation(queryParams.value).then(response => {
productMaterialRelationList.value = response.rows;
total.value = response.total;
const relations = response.rows;
// 为每个配方项获取物料详细信息,包括物料类型
const promises = relations.map(item => {
return getMaterial(item.materialId).then(materialResponse => {
item.material = materialResponse.data;
return item;
});
});
return Promise.all(promises);
}).then(relationsWithMaterial => {
productMaterialRelationList.value = relationsWithMaterial;
total.value = relationsWithMaterial.length;
loading.value = false;
}).catch(error => {
console.error('获取数据失败:', error);
loading.value = false;
});
}

View File

@@ -0,0 +1,360 @@
<template>
<div class="app-container">
<el-card class="mb20">
<template #header>
<div class="card-header">
<span>{{ productDetail.productName }} - 产品详情</span>
<el-button type="primary" plain size="small" @click="handleBack">返回列表</el-button>
</div>
</template>
<div class="product-info">
<div class="info-item">
<span class="label">产品名称</span>
<span class="value">{{ productDetail.productName }}</span>
</div>
<div class="info-item">
<span class="label">产品规格</span>
<span class="value">{{ productDetail.spec }}</span>
</div>
<div class="info-item">
<span class="label">产品型号</span>
<span class="value">{{ productDetail.model }}</span>
</div>
<div class="info-item">
<span class="label">产品单价</span>
<span class="value">{{ formatDecimal(productDetail.unitPrice) }} </span>
</div>
<div class="info-item">
<span class="label">备注</span>
<span class="value">{{ productDetail.remark || '无' }}</span>
</div>
</div>
<!-- 产品附加属性 -->
<div class="product-addition" v-if="productAdditionList.length > 0">
<h4>产品附加属性</h4>
<el-table :data="productAdditionList" style="width: 100%" border>
<el-table-column prop="attrName" label="属性名" width="150" />
<el-table-column prop="attrValue" label="属性值" />
</el-table>
</div>
<div class="product-images" v-if="productDetail.productImages && productDetail.productImages.trim()">
<h4>产品图片</h4>
<div class="image-list">
<el-image
v-for="(image, index) in productDetail.productImages.split(',').filter(img => img.trim())"
:key="index"
:src="image"
:preview-src-list="productDetail.productImages.split(',').filter(img => img.trim())"
style="width: 100px; height: 100px; margin-right: 10px;"
/>
</div>
</div>
</el-card>
<el-card>
<template #header>
<div class="card-header">
<span>材料明细</span>
</div>
</template>
<!-- 主材部分 -->
<div class="material-section">
<h3 class="section-title">主材</h3>
<el-table :data="mainMaterials" style="width: 100%" border>
<el-table-column prop="materialName" label="配料名称" width="150" />
<el-table-column prop="spec" label="材料规格" width="150" />
<el-table-column prop="quantity" label="数量" width="100" align="center" />
<el-table-column prop="price" label="价格" width="100" align="center">
<template #default="scope">
{{ formatDecimal(scope.row.price) }}
</template>
</el-table-column>
<el-table-column prop="subtotal" label="小计" width="100" align="center">
<template #default="scope">
{{ formatDecimal(scope.row.subtotal) }}
</template>
</el-table-column>
</el-table>
<div class="section-summary" v-if="mainMaterials.length > 0">
<span>主材小计:{{ formatDecimal(mainMaterials.reduce((sum, item) => sum + item.subtotal, 0)) }} 元</span>
</div>
</div>
<!-- 辅材部分 -->
<div class="material-section">
<h3 class="section-title">辅材</h3>
<el-table :data="auxiliaryMaterials" style="width: 100%" border>
<el-table-column prop="materialName" label="配料名称" width="150" />
<el-table-column prop="spec" label="材料规格" width="150" />
<el-table-column prop="quantity" label="数量" width="100" align="center" />
<el-table-column prop="price" label="价格" width="100" align="center">
<template #default="scope">
{{ formatDecimal(scope.row.price) }}
</template>
</el-table-column>
<el-table-column prop="subtotal" label="小计" width="100" align="center">
<template #default="scope">
{{ formatDecimal(scope.row.subtotal) }}
</template>
</el-table-column>
</el-table>
<div class="section-summary" v-if="auxiliaryMaterials.length > 0">
<span>辅材小计:{{ formatDecimal(auxiliaryMaterials.reduce((sum, item) => sum + item.subtotal, 0)) }} 元</span>
</div>
</div>
<!-- 工本部分 -->
<div class="material-section">
<h3 class="section-title">工本</h3>
<el-table :data="laborMaterials" style="width: 100%" border>
<el-table-column prop="materialName" label="项目名称" width="150" />
<el-table-column prop="spec" label="规格" width="150" />
<el-table-column prop="quantity" label="数量" width="100" align="center" />
<el-table-column prop="price" label="价格" width="100" align="center">
<template #default="scope">
{{ formatDecimal(scope.row.price) }}
</template>
</el-table-column>
<el-table-column prop="subtotal" label="小计" width="100" align="center">
<template #default="scope">
{{ formatDecimal(scope.row.subtotal) }}
</template>
</el-table-column>
</el-table>
<div class="section-summary" v-if="laborMaterials.length > 0">
<span>工本小计:{{ formatDecimal(laborMaterials.reduce((sum, item) => sum + item.subtotal, 0)) }} 元</span>
</div>
</div>
<!-- 总计部分 -->
<div class="total-section">
<div class="total-item">
<span class="total-label">合计:</span>
<span class="total-value">{{ formatDecimal(totalAmount) }} 元</span>
</div>
</div>
</el-card>
</div>
</template>
<script setup name="ProductDetail">
import { ref, computed, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { getProduct } from "@/api/mat/product";
import { listProductMaterialRelation } from "@/api/mat/productMaterialRelation";
import { getMaterial } from "@/api/mat/material";
import { listProductAddition } from "@/api/mat/productAddition";
import { formatDecimal } from '@/utils/gear';
const router = useRouter();
const route = useRoute();
const productDetail = ref({});
const loading = ref(true);
const materialLoading = ref(false);
const additionLoading = ref(false);
// 材料明细数据
const productMaterialRelationList = ref([]);
// 产品附加属性数据
const productAdditionList = ref([]);
// 计算主材、辅材和工本
const mainMaterials = computed(() => {
// 主材材料类型为2
return productMaterialRelationList.value
.filter(item => item.material && item.material.materialType === 2)
.map(item => ({
materialName: item.material.materialName,
spec: item.material.spec,
quantity: item.materialNum + (item.material.unit || ''),
price: item.material.unitPrice || 0,
subtotal: (item.materialNum * (item.material.unitPrice || 0)) || 0
}));
});
const auxiliaryMaterials = computed(() => {
// 辅材材料类型为1
return productMaterialRelationList.value
.filter(item => item.material && item.material.materialType === 1)
.map(item => ({
materialName: item.material.materialName,
spec: item.material.spec,
quantity: item.materialNum + (item.material.unit || ''),
price: item.material.unitPrice || 0,
subtotal: (item.materialNum * (item.material.unitPrice || 0)) || 0
}));
});
const laborMaterials = computed(() => {
// 工本材料类型为3
return productMaterialRelationList.value
.filter(item => item.material && item.material.materialType === 3)
.map(item => ({
materialName: item.material.materialName,
spec: item.material.spec,
quantity: item.materialNum + (item.material.unit || ''),
price: item.material.unitPrice || 0,
subtotal: (item.materialNum * (item.material.unitPrice || 0)) || 0
}));
});
// 计算总金额
const totalAmount = computed(() => {
const mainTotal = mainMaterials.value.reduce((sum, item) => sum + item.subtotal, 0);
const auxiliaryTotal = auxiliaryMaterials.value.reduce((sum, item) => sum + item.subtotal, 0);
const laborTotal = laborMaterials.value.reduce((sum, item) => sum + item.subtotal, 0);
return mainTotal + auxiliaryTotal + laborTotal;
});
// 获取产品详情
function getProductDetail() {
const productId = route.params.id;
if (productId) {
loading.value = true;
getProduct(productId).then(response => {
productDetail.value = response.data;
loading.value = false;
// 获取材料明细
getMaterialDetail(productId);
// 获取产品附加属性
getProductAddition(productId);
}).catch(error => {
console.error('获取产品详情失败:', error);
loading.value = false;
});
}
}
// 获取产品附加属性
function getProductAddition(productId) {
additionLoading.value = true;
listProductAddition({ productId }).then(response => {
productAdditionList.value = response.rows || [];
additionLoading.value = false;
}).catch(error => {
console.error('获取产品附加属性失败:', error);
additionLoading.value = false;
});
}
// 获取材料明细
function getMaterialDetail(productId) {
materialLoading.value = true;
listProductMaterialRelation({ productId }).then(response => {
const relations = response.rows;
// 为每个配方项获取物料详细信息,包括物料类型
const promises = relations.map(item => {
return getMaterial(item.materialId).then(materialResponse => {
item.material = materialResponse.data;
return item;
});
});
return Promise.all(promises);
}).then(relationsWithMaterial => {
productMaterialRelationList.value = relationsWithMaterial;
materialLoading.value = false;
}).catch(error => {
console.error('获取材料明细失败:', error);
materialLoading.value = false;
});
}
// 返回列表
function handleBack() {
router.back();
}
onMounted(() => {
getProductDetail();
});
</script>
<style scoped>
.app-container {
padding: 20px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.product-info {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin: 20px 0;
}
.info-item {
display: flex;
align-items: center;
gap: 10px;
}
.label {
font-weight: bold;
min-width: 80px;
}
.product-images {
margin-top: 20px;
}
.image-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 10px;
}
.material-section {
margin: 20px 0;
}
.section-title {
background-color: #f5f7fa;
padding: 10px;
border-left: 4px solid #409eff;
margin-bottom: 10px;
}
.section-summary {
text-align: right;
padding: 10px;
background-color: #f9f9f9;
border-top: 1px solid #e4e7ed;
margin-top: -1px;
font-weight: bold;
}
.total-section {
margin-top: 30px;
padding: 20px;
background-color: #f0f9eb;
border: 1px solid #b7eb8f;
border-radius: 4px;
}
.total-item {
display: flex;
justify-content: flex-end;
align-items: center;
gap: 20px;
}
.total-label {
font-size: 18px;
font-weight: bold;
}
.total-value {
font-size: 24px;
font-weight: bold;
color: #f56c6c;
}
</style>

View File

@@ -45,10 +45,28 @@
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="产品图片" align="center" prop="productImages">
<template #default="scope">
<div v-if="scope.row.productImages && scope.row.productImages.trim()" class="image-preview">
<el-image
v-for="(image, index) in scope.row.productImages.split(',')"
:key="index"
:src="image"
:preview-src-list="scope.row.productImages.split(',')"
:z-index="9999"
:preview-teleported="true"
style="width: 40px; height: 40px; margin-right: 8px;"
/>
</div>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Plus" @click="handleBom(scope.row)">配方</el-button>
<el-button link type="primary" icon="View" @click="handleDetail(scope.row)">详情</el-button>
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
<el-button link type="primary" icon="Setting" @click="handleAddition(scope.row)">附加属性</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
@@ -75,6 +93,26 @@
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="产品图片" prop="productImages">
<el-upload
v-model:file-list="imageFileList"
:action="uploadUrl"
:headers="headers"
:on-success="handleImageUploadSuccess"
:on-remove="handleImageRemove"
multiple
list-type="picture"
:limit="5"
:before-upload="beforeUpload"
>
<el-button type="primary" icon="Upload">上传图片</el-button>
<template #tip>
<div class="el-upload__tip">
最多上传5张图片支持 JPGPNG 格式
</div>
</template>
</el-upload>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
@@ -88,6 +126,36 @@
<bom :productId="currentProductId" @close="bomOpen = false" />
</el-dialog>
<!-- 产品附加属性对话框 -->
<el-dialog title="产品附加属性" v-model="additionOpen" width="600px" append-to-body>
<div class="addition-container">
<el-button type="primary" icon="Plus" @click="addAdditionItem" style="margin-bottom: 10px">添加属性</el-button>
<el-table :data="additionList" style="width: 100%" border>
<el-table-column prop="attrName" label="属性名" width="150">
<template #default="scope">
<el-input v-model="scope.row.attrName" placeholder="请输入属性名" />
</template>
</el-table-column>
<el-table-column prop="attrValue" label="属性值">
<template #default="scope">
<el-input v-model="scope.row.attrValue" placeholder="请输入属性值" />
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
<template #default="scope">
<el-button link type="danger" icon="Delete" @click="removeAdditionItem(scope.$index)" />
</template>
</el-table-column>
</el-table>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="saveAdditions">保存</el-button>
<el-button @click="additionOpen = false">取消</el-button>
</div>
</template>
</el-dialog>
<!-- 将这个表格改为始终吸底且外层容器可以拖拽调节高度 -->
<!-- <StickyDragContainer v-if="currentProduct.productId" :parent-ref="appContainer"> -->
<div v-if="currentProduct.productId">
@@ -110,16 +178,27 @@
<el-empty v-else description="选择产品查看配料信息" />
<!-- </StickyDragContainer> -->
</div>
</template>
<script setup name="Product">
import { ref, computed } from 'vue';
import { useRouter } from 'vue-router';
import { listProduct, getProduct, delProduct, addProduct, updateProduct } from "@/api/mat/product";
import { listProductMaterialRelation } from "@/api/mat/productMaterialRelation";
import { getMaterial } from "@/api/mat/material";
import { listProductAddition, addProductAddition, updateProductAddition, delProductAddition } from "@/api/mat/productAddition";
import bom from "@/views/mat/components/bom.vue";
import StickyDragContainer from "@/components/StickyDragContainer/index.vue";
import { formatDecimal } from '@/utils/gear'
import Raw from '@/components/Renderer/Raw.vue';
import { formatDecimal } from '@/utils/gear';
import { getToken } from '@/utils/auth';
const router = useRouter();
const bomOpen = ref(false);
const additionOpen = ref(false);
const { proxy } = getCurrentInstance();
@@ -136,6 +215,10 @@ const title = ref("");
const currentProductId = ref(null);
const currentProduct = ref({});
const appContainer = ref(null);
const imageFileList = ref([]);
const additionList = ref([]);
const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + '/system/oss/upload');
const headers = ref({ Authorization: "Bearer " + getToken() });
const formatterTime = (time) => {
return proxy.parseTime(time, '{y}-{m}-{d}')
@@ -185,8 +268,10 @@ function reset() {
createBy: null,
updateTime: null,
updateBy: null,
remark: null
remark: null,
productImages: null
};
imageFileList.value = [];
proxy.resetForm("productRef");
}
@@ -224,11 +309,61 @@ function handleUpdate(row) {
getProduct(_productId).then(response => {
loading.value = false;
form.value = response.data;
// 处理图片文件列表
if (form.value.productImages) {
imageFileList.value = form.value.productImages.split(',').map(url => ({
name: url.substring(url.lastIndexOf('/') + 1),
url: url
}));
}
open.value = true;
title.value = "修改产品基础信息";
});
}
/** 图片上传成功处理 */
function handleImageUploadSuccess(response, uploadFile) {
if (response.code === 200) {
const imageUrl = response.data.url;
if (form.value.productImages) {
form.value.productImages += ',' + imageUrl;
} else {
form.value.productImages = imageUrl;
}
} else {
proxy.$modal.msgError('上传失败:' + response.msg);
}
}
/** 图片移除处理 */
function handleImageRemove(uploadFile, uploadFiles) {
const imageUrl = uploadFile.url;
if (form.value.productImages) {
const images = form.value.productImages.split(',');
const index = images.indexOf(imageUrl);
if (index > -1) {
images.splice(index, 1);
// 当所有图片都被删除时设置为null而不是空字符串
form.value.productImages = images.length > 0 ? images.join(',') : null;
}
}
}
/** 图片上传前校验 */
function beforeUpload(file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJpgOrPng) {
proxy.$modal.msgError('只能上传 JPG/PNG 格式的图片');
return false;
}
if (!isLt2M) {
proxy.$modal.msgError('图片大小不能超过 2MB');
return false;
}
return true;
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["productRef"].validate(valid => {
@@ -287,5 +422,91 @@ function handleRowClick(row) {
currentProduct.value = row;
}
function handleDetail(row) {
// 跳转到产品详情页
router.push(`/mat/product/detail/${row.productId}`);
}
function handleAddition(row) {
currentProductId.value = row.productId;
// 清空附加属性列表
additionList.value = [];
// 获取已有的附加属性数据
listProductAddition({ productId: row.productId }).then(response => {
if (response.code === 200) {
additionList.value = response.rows || [];
}
});
additionOpen.value = true;
}
function addAdditionItem() {
additionList.value.push({ attrName: '', attrValue: '' });
}
function removeAdditionItem(index) {
additionList.value.splice(index, 1);
}
function saveAdditions() {
// 过滤掉空的属性项
const validAdditions = additionList.value.filter(item => item.attrName && item.attrName.trim());
// 保存附加属性
validAdditions.forEach(item => {
const additionData = {
productId: currentProductId.value,
attrName: item.attrName.trim(),
attrValue: item.attrValue ? item.attrValue.trim() : ''
};
// 如果有addId则是更新操作
if (item.addId) {
additionData.addId = item.addId;
// 调用API更新附加属性
updateProductAddition(additionData).then(response => {
if (response.code === 200) {
proxy.$modal.msgSuccess('保存成功');
} else {
proxy.$modal.msgError('保存失败');
}
});
} else {
// 调用API新增附加属性
addProductAddition(additionData).then(response => {
if (response.code === 200) {
proxy.$modal.msgSuccess('保存成功');
} else {
proxy.$modal.msgError('保存失败');
}
});
}
});
additionOpen.value = false;
}
getList();
</script>
<style scoped>
/* 表格样式 */
:deep(.el-table th) {
background-color: #f5f7fa;
font-weight: bold;
color: #606266;
}
:deep(.el-table tr:hover) {
background-color: #ecf5ff;
}
:deep(.el-table td) {
vertical-align: middle;
}
/* 图片预览层样式 */
:deep(.el-image-viewer__wrapper) {
z-index: 9999 !important;
}
</style>

View File

@@ -13,6 +13,11 @@
<el-form-item label="厂家" prop="factory">
<el-input v-model="queryParams.factory" placeholder="请输入厂家" clearable @keyup.enter="handleQuery" />
</el-form-item>
<!-- <el-form-item label="物料类型" prop="materialType">
<el-select v-model="queryParams.materialType" placeholder="请选择物料类型" @change="handleQuery" disabled>
<el-option label="原料" value="2" />
</el-select>
</el-form-item> -->
<!-- <el-form-item label="计量单位 个/公斤/米等" prop="unit">
<el-input v-model="queryParams.unit" placeholder="请输入计量单位 个/公斤/米等" clearable @keyup.enter="handleQuery" />
</el-form-item>
@@ -45,6 +50,11 @@
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="配料ID 主键" align="center" prop="materialId" v-if="true" /> -->
<el-table-column label="配料名称" align="center" prop="materialName" />
<el-table-column label="物料类型" align="center" prop="materialType">
<template #default="scope">
{{ scope.row.materialType === 1 ? '辅料' : '主材' }}
</template>
</el-table-column>
<el-table-column label="配料规格" align="center" prop="spec" />
<el-table-column label="配料型号" align="center" prop="model" />
<el-table-column label="厂家" align="center" prop="factory" />
@@ -79,6 +89,11 @@
<el-form-item label="配料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入配料名称" />
</el-form-item>
<el-form-item label="物料类型" prop="materialType">
<el-select v-model="form.materialType" placeholder="请选择物料类型" disabled>
<el-option label="主材" value="2" />
</el-select>
</el-form-item>
<el-form-item label="配料规格" prop="spec">
<el-input v-model="form.spec" placeholder="请输入配料规格" />
</el-form-item>
@@ -232,6 +247,7 @@ const data = reactive({
factory: undefined,
unit: undefined,
currentStock: undefined,
materialType: 2, // 固定为原料
},
rules: {
}
@@ -260,6 +276,7 @@ function reset() {
form.value = {
materialId: null,
materialName: null,
materialType: 2, // 固定为原料
spec: null,
model: null,
factory: null,
@@ -284,6 +301,7 @@ function handleQuery() {
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
queryParams.value.materialType = 2; // 重置后仍为原料
handleQuery();
}

View File

@@ -539,8 +539,8 @@ export default {
margin-bottom: 16px;
}
::v-deep .el-input-group__append,
::v-deep .el-input-group__prepend {
:deep(.el-input-group__append),
:deep(.el-input-group__prepend) {
width: 20px !important;
box-sizing: border-box !important;
padding: 0 10px !important;

View File

@@ -98,8 +98,8 @@
<el-date-picker
clearable
v-model="form.uploadTime"
type="date"
value-format="YYYY-MM-DD"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择上传时间"
/>
</el-form-item>

View File

@@ -25,6 +25,9 @@
<el-col :span="2.5">
<el-button size="small" type="info" plain icon="RefreshRight" @click="handleInitDaily(true)">重置当日名单</el-button>
</el-col>
<el-col :span="2.5">
<el-button size="small" type="danger" plain icon="Refresh" @click="resetCumulativeAmounts">重置累计金额</el-button>
</el-col>
<el-col :span="1.8">
<el-button size="small" type="primary" plain icon="Check" @click="saveAllRows">全部保存</el-button>
</el-col>
@@ -72,6 +75,7 @@
</el-table-column>
<el-table-column label="总金额" align="center" prop="totalAmount" width="110" />
<el-table-column label="累计金额" align="center" prop="cumulativeAmount" width="110" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="170">
<template #default="scope">
<el-button link type="primary" icon="Check" @click="saveRow(scope.row)">保存</el-button>
@@ -95,6 +99,27 @@ const loading = ref(true)
const showSearch = ref(true)
const total = ref(0)
// 存储累计金额数据
const cumulativeAmounts = ref({})
// 从localStorage加载累计金额数据
function loadCumulativeAmounts() {
const stored = localStorage.getItem('wageCumulativeAmounts')
if (stored) {
try {
cumulativeAmounts.value = JSON.parse(stored)
} catch (e) {
console.error('Failed to parse cumulative amounts:', e)
cumulativeAmounts.value = {}
}
}
}
// 保存累计金额数据到localStorage
function saveCumulativeAmounts() {
localStorage.setItem('wageCumulativeAmounts', JSON.stringify(cumulativeAmounts.value))
}
const data = reactive({
queryParams: {
pageNum: 1,
@@ -149,18 +174,43 @@ function recalcRowAmount(row) {
const baseAmount = round2(workload * unitPrice)
row.baseAmount = baseAmount
row.totalAmount = round2(baseAmount + extraAmount)
// 重新计算累计金额
updateCumulativeAmounts()
}
function updateCumulativeAmounts() {
// 计算当前页面的总金额
const currentEmpAmounts = {}
wageEntryDetailList.value.forEach(row => {
const empName = row.empName
if (!currentEmpAmounts[empName]) {
currentEmpAmounts[empName] = 0
}
currentEmpAmounts[empName] += parseFloat(row.totalAmount) || 0
})
// 更新每个员工的累计金额(基于存储的数据)
wageEntryDetailList.value.forEach(row => {
row.cumulativeAmount = cumulativeAmounts.value[row.empName] || 0
})
}
function getList() {
loading.value = true
// 加载存储的累计金额数据
loadCumulativeAmounts()
listWageEntryDetail(queryParams.value).then(response => {
const rows = response.rows || []
wageEntryDetailList.value = rows.map(row => {
const r = {
...row,
workload: normalizeEditableValue(row.workload),
unitPrice: normalizeEditableValue(row.unitPrice),
extraAmount: normalizeEditableValue(row.extraAmount)
extraAmount: normalizeEditableValue(row.extraAmount),
cumulativeAmount: cumulativeAmounts.value[row.empName] || 0
}
recalcRowAmount(r)
return r
@@ -202,6 +252,13 @@ function buildRowPayload(row) {
function saveRow(row) {
const payload = buildRowPayload(row)
updateWageEntryDetail(payload).then(() => {
// 更新累计金额
if (!cumulativeAmounts.value[row.empName]) {
cumulativeAmounts.value[row.empName] = 0
}
cumulativeAmounts.value[row.empName] += parseFloat(payload.totalAmount) || 0
saveCumulativeAmounts()
proxy.$modal.msgSuccess('保存成功')
getList()
})
@@ -219,11 +276,19 @@ async function saveAllRows() {
const payload = buildRowPayload(row)
try {
await updateWageEntryDetail(payload)
// 更新累计金额
if (!cumulativeAmounts.value[row.empName]) {
cumulativeAmounts.value[row.empName] = 0
}
cumulativeAmounts.value[row.empName] += parseFloat(payload.totalAmount) || 0
successCount++
} catch (e) {
failCount++
}
}
// 保存累计金额数据
saveCumulativeAmounts()
loading.value = false
if (failCount === 0) {
proxy.$modal.msgSuccess(`全部保存完成,共 ${successCount}`)
@@ -244,10 +309,20 @@ function handleDelete(row) {
function handleExport() {
proxy.download('oa/wageEntryDetail/export', {
...queryParams.value
...queryParams.value,
cumulativeAmounts: cumulativeAmounts.value
}, `wage_entry_detail_${new Date().getTime()}.xlsx`)
}
function resetCumulativeAmounts() {
proxy.$modal.confirm('是否确认重置所有员工的累计金额?此操作不可恢复。').then(() => {
cumulativeAmounts.value = {}
saveCumulativeAmounts()
proxy.$modal.msgSuccess('累计金额已重置')
getList()
})
}
function handleInitDaily(forceReset = false) {
const entryDate = queryParams.value.entryDate || proxy.parseTime(new Date(), '{y}-{m}-{d}')
const text = forceReset ? `确认重置 ${entryDate} 的当日名单吗?将先删除后重建。` : `确认初始化 ${entryDate} 的工人名单吗?`
@@ -260,15 +335,25 @@ function handleInitDaily(forceReset = false) {
proxy.$modal.msgSuccess(`操作成功,共写入 ${res.data || 0}`)
}
getList()
}).catch(err => {
console.error('重置当日名单失败:', err)
proxy.$modal.msgError('操作失败,请稍后重试')
})
}
async function autoInitFirstEnter() {
const entryDate = queryParams.value.entryDate || proxy.parseTime(new Date(), '{y}-{m}-{d}')
try {
await initDailyWorkers({ entryDate, forceReset: false })
} catch (err) {
console.error('自动初始化当日名单失败:', err)
// 静默失败,不影响页面加载
}
}
onMounted(async () => {
// 加载存储的累计金额数据
loadCumulativeAmounts()
await autoInitFirstEnter()
getList()
})

View File

@@ -91,6 +91,7 @@
<script setup name="WageMakeup">
import { listWageEntryDetail, updateWageEntryDetail, delWageEntryDetail } from '@/api/oa/wageEntryDetail'
import useUserStore from '@/store/modules/user'
import { onMounted } from 'vue'
const { proxy } = getCurrentInstance()
const userStore = useUserStore()
@@ -102,6 +103,27 @@ const open = ref(false)
const title = ref('')
const buttonLoading = ref(false)
// 存储累计金额数据
const cumulativeAmounts = ref({})
// 从localStorage加载累计金额数据
function loadCumulativeAmounts() {
const stored = localStorage.getItem('wageCumulativeAmounts')
if (stored) {
try {
cumulativeAmounts.value = JSON.parse(stored)
} catch (e) {
console.error('Failed to parse cumulative amounts:', e)
cumulativeAmounts.value = {}
}
}
}
// 保存累计金额数据到localStorage
function saveCumulativeAmounts() {
localStorage.setItem('wageCumulativeAmounts', JSON.stringify(cumulativeAmounts.value))
}
const data = reactive({
form: {},
queryParams: {
@@ -197,6 +219,18 @@ function submitForm() {
}
// 本页面补录语义:更新当前记录并标记为已补录
updateWageEntryDetail(payload).then(() => {
// 更新累计金额
const workload = parseFloat(payload.workload) || 0
const unitPrice = parseFloat(payload.unitPrice) || 0
const extraAmount = parseFloat(payload.extraAmount) || 0
const totalAmount = workload * unitPrice + extraAmount
if (!cumulativeAmounts.value[payload.empName]) {
cumulativeAmounts.value[payload.empName] = 0
}
cumulativeAmounts.value[payload.empName] += totalAmount
saveCumulativeAmounts()
proxy.$modal.msgSuccess('补录成功')
open.value = false
getList()
@@ -229,5 +263,8 @@ function handleExport() {
proxy.download('oa/wageEntryDetail/export', { ...buildQuery() }, `wage_makeup_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
loadCumulativeAmounts()
getList()
})
</script>

View File

@@ -26,6 +26,8 @@
<el-col :span="1.5"><el-button size="small" type="warning" plain icon="Download" @click="handleExport">导出</el-button></el-col>
<el-col :span="1.5"><el-button size="small" type="info" plain icon="Upload" @click="openImport">导入</el-button></el-col>
<el-col :span="1.8"><el-button size="small" plain icon="Download" @click="downloadTemplate">下载模板</el-button></el-col>
<el-col :span="2.2"><el-button size="small" type="primary" plain icon="User" @click="openUserSelectDialog">选择用户导入</el-button></el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
</el-row>
@@ -122,6 +124,21 @@
<el-button @click="importOpen = false"> </el-button>
</div>
</template>
</el-dialog>
<!-- 选择系统用户导入弹窗 -->
<el-dialog title="选择需要导入的用户" v-model="userSelectOpen" width="700px" append-to-body>
<el-input v-model="userSearchKey" placeholder="搜索账号/昵称/手机号" clearable style="width: 300px; margin-bottom: 10px"/>
<el-table ref="userSelectTableRef" v-model:selection="selectedUserIds" :data="filterUserList" border height="350" @selection-change="handleUserSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="账号" prop="userName" align="center" />
<el-table-column label="昵称" prop="nickName" align="center" />
<el-table-column label="手机号" prop="phonenumber" align="center" />
</el-table>
<template #footer>
<el-button @click="userSelectOpen = false">取消</el-button>
<el-button type="primary" @click="confirmImportSelectedUser">确认导入</el-button>
</template>
</el-dialog>
</div>
</template>
@@ -129,6 +146,7 @@
<script setup name="Worker">
import { listWorker, getWorker, addWorker, updateWorker, delWorker, importWorkerData } from '@/api/oa/worker'
import { listWageRateConfig } from '@/api/oa/wageRateConfig'
import { listUser } from '@/api/system/user'
const { proxy } = getCurrentInstance()
@@ -148,8 +166,37 @@ const importLoading = ref(false)
const updateSupport = ref(false)
const importFile = ref(null)
// 选择用户导入相关
const userSelectOpen = ref(false)
const allUserList = ref([])
const selectedUserIds = ref([])
// 已存在工号缓存
const existWorkerNos = ref([])
// 用户检索关键词
const userSearchKey = ref('')
// 过滤后的用户列表(账号/昵称/手机号模糊检索)
const filterUserList = computed(() => {
const key = userSearchKey.value.trim()
if (!key) return allUserList.value
return allUserList.value.filter(item =>
item.userName?.includes(key) ||
item.nickName?.includes(key) ||
item.phonenumber?.includes(key)
)
})
// 表格ref
const userSelectTableRef = ref(null)
// 同步选中的用户ID
function handleUserSelectionChange(selection) {
selectedUserIds.value = selection.map(item => item.userId)
}
const rateOptions = ref([])
const data = reactive({
form: {},
queryParams: {
@@ -358,5 +405,86 @@ function submitImport() {
})
}
// 打开用户选择弹窗【修复空值初始化】
async function openUserSelectDialog() {
// 每次打开都严格初始化所有变量,避免 undefined
allUserList.value = []
selectedUserIds.value = []
userSearchKey.value = ''
try {
loading.value = true
// 加载系统用户列表
const userRes = await listUser({ pageNum: 1, pageSize: 9999, status: '0' })
// 确保赋值为数组,避免 undefined
allUserList.value = userRes?.rows || []
} catch (err) {
console.error("加载用户失败", err)
proxy.$modal.msgError('加载用户列表失败')
} finally {
loading.value = false
userSelectOpen.value = true
}
}
// 确认导入选中用户【前端终极兜底 · 零报错】
async function confirmImportSelectedUser() {
if (!selectedUserIds.value?.length) {
proxy.$modal.msgWarning('请至少选择一条用户')
return
}
if (!filterUserList.value?.length) {
proxy.$modal.msgWarning('用户列表为空,无法导入')
return
}
loading.value = true
let success = 0, update = 0
try {
// 1. 一次性查询所有已存在工号构建Map
const { rows: existWorkers } = await listWorker({ pageNum: 1, pageSize: 9999 })
const existMap = new Map(existWorkers.map(w => [w.workerNo, w]))
// 2. 过滤有效用户
const users = filterUserList.value.filter(u =>
u?.userId && selectedUserIds.value.includes(u.userId)
)
// 3. 分批次处理,避免并发冲突
for (const user of users) {
const workerNo = user.userName
const data = {
workerNo,
workerName: user.nickName || user.userName,
phone: user.phonenumber,
status: '0',
defaultBillingType: '1',
defaultWorkTypeName: '普通工人',
remark: '从系统用户导入'
}
// 4. 严格判断Map中存在 → 更新,不存在 → 新增
if (existMap.has(workerNo)) {
data.workerId = existMap.get(workerNo).workerId
await updateWorker(data)
update++
} else {
await addWorker(data)
success++
// 同步更新Map避免后续重复判断
existMap.set(workerNo, { workerNo })
}
}
proxy.$modal.msgSuccess(`导入完成:新增 ${success} 条,更新 ${update}`)
userSelectOpen.value = false
getList()
} catch (err) {
console.error('导入失败:', err)
proxy.$modal.msgError('导入失败,请查看控制台日志')
} finally {
loading.value = false
}
}
getList()
</script>

View File

@@ -501,6 +501,14 @@ function handleAdd() {
function handleUpdate(row) {
reset()
const userId = row.userId || ids.value
// let userId
// if (row && row.userId) {
// userId = row.userId
// } else if (ids.value && ids.value.length > 0) {
// userId = ids.value[0]
// } else {
// return
// }
getUser(userId).then(response => {
form.value = response.data
postOptions.value = response.data.posts
@@ -509,7 +517,7 @@ function handleUpdate(row) {
form.value.roleIds = response.data.roleIds
open.value = true
title.value = "修改用户"
form.password = ""
form.value.password = ""
})
}

View File

View File

@@ -0,0 +1,13 @@
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('batch.schema.version', '6.7.2.3', 1);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('cfg.execution-related-entities-count', 'true', 1);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('cfg.task-related-entities-count', 'true', 1);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('common.schema.version', '6.8.0.0', 1);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('entitylink.schema.version', '6.8.0.0', 1);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('eventsubscription.schema.version', '6.8.0.0', 1);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('identitylink.schema.version', '6.8.0.0', 1);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('job.schema.version', '6.8.0.0', 1);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('next.dbid', '1', 1);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('schema.history', 'upgrade(6.7.2.0->6.8.0.0)', 2);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('schema.version', '6.8.0.0', 2);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('task.schema.version', '6.8.0.0', 1);
INSERT INTO `ACT_GE_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('variable.schema.version', '6.8.0.0', 1);

View File

View File

View File

View File

View File

View File

View File

View File

View File

@@ -0,0 +1 @@
INSERT INTO `ACT_ID_PROPERTY` (`NAME_`, `VALUE_`, `REV_`) VALUES ('schema.version', '6.7.2.0', 1);

View File

View File

View File

View File

View File

View File

View File

View File

@@ -0,0 +1,3 @@
INSERT INTO `FLW_EV_DATABASECHANGELOG` (`ID`, `AUTHOR`, `FILENAME`, `DATEEXECUTED`, `ORDEREXECUTED`, `EXECTYPE`, `MD5SUM`, `DESCRIPTION`, `COMMENTS`, `TAG`, `LIQUIBASE`, `CONTEXTS`, `LABELS`, `DEPLOYMENT_ID`) VALUES ('1', 'flowable', 'org/flowable/eventregistry/db/liquibase/flowable-eventregistry-db-changelog.xml', '2022-03-12 08:37:27', 1, 'EXECUTED', '8:1b0c48c9cf7945be799d868a2626d687', 'createTable tableName=FLW_EVENT_DEPLOYMENT; createTable tableName=FLW_EVENT_RESOURCE; createTable tableName=FLW_EVENT_DEFINITION; createIndex indexName=ACT_IDX_EVENT_DEF_UNIQ, tableName=FLW_EVENT_DEFINITION; createTable tableName=FLW_CHANNEL_DEFIN...', '', NULL, '4.5.0', NULL, NULL, '7074247706');
INSERT INTO `FLW_EV_DATABASECHANGELOG` (`ID`, `AUTHOR`, `FILENAME`, `DATEEXECUTED`, `ORDEREXECUTED`, `EXECTYPE`, `MD5SUM`, `DESCRIPTION`, `COMMENTS`, `TAG`, `LIQUIBASE`, `CONTEXTS`, `LABELS`, `DEPLOYMENT_ID`) VALUES ('2', 'flowable', 'org/flowable/eventregistry/db/liquibase/flowable-eventregistry-db-changelog.xml', '2022-03-12 08:37:28', 2, 'EXECUTED', '8:0ea825feb8e470558f0b5754352b9cda', 'addColumn tableName=FLW_CHANNEL_DEFINITION; addColumn tableName=FLW_CHANNEL_DEFINITION', '', NULL, '4.5.0', NULL, NULL, '7074247706');
INSERT INTO `FLW_EV_DATABASECHANGELOG` (`ID`, `AUTHOR`, `FILENAME`, `DATEEXECUTED`, `ORDEREXECUTED`, `EXECTYPE`, `MD5SUM`, `DESCRIPTION`, `COMMENTS`, `TAG`, `LIQUIBASE`, `CONTEXTS`, `LABELS`, `DEPLOYMENT_ID`) VALUES ('3', 'flowable', 'org/flowable/eventregistry/db/liquibase/flowable-eventregistry-db-changelog.xml', '2022-03-12 08:37:28', 3, 'EXECUTED', '8:3c2bb293350b5cbe6504331980c9dcee', 'customChange', '', NULL, '4.5.0', NULL, NULL, '7074247706');

View File

@@ -0,0 +1 @@
INSERT INTO `FLW_EV_DATABASECHANGELOGLOCK` (`ID`, `LOCKED`, `LOCKGRANTED`, `LOCKEDBY`) VALUES (1, b'0', NULL, NULL);

View File

View File

@@ -0,0 +1,2 @@
INSERT INTO `dv_check_machinery` (`record_id`, `plan_id`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (203, 207, 214, 'M0046', 'WG-A1型纺织机', '万国', 'WG-A1', '', NULL, NULL, 0, 0, '', '2022-09-01 23:01:54', '', NULL);
INSERT INTO `dv_check_machinery` (`record_id`, `plan_id`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (204, 208, 214, 'M0046', 'WG-A1型纺织机', '万国', 'WG-A1', '', NULL, NULL, 0, 0, '', '2022-09-01 23:02:52', '', NULL);

View File

@@ -0,0 +1,2 @@
INSERT INTO `dv_check_plan` (`plan_id`, `plan_code`, `plan_name`, `plan_type`, `start_date`, `end_date`, `cycle_type`, `cycle_count`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (207, 'PLAN2022048', '1', 'CHECK', NULL, NULL, 'DAY', 1, 'FINISHED', '', NULL, NULL, 0, 0, '', '2022-09-01 23:01:41', '', '2025-08-07 11:58:02');
INSERT INTO `dv_check_plan` (`plan_id`, `plan_code`, `plan_name`, `plan_type`, `start_date`, `end_date`, `cycle_type`, `cycle_count`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (208, 'PLAN2022050', '2', 'MAINTEN', '2025-04-09 00:00:00', '2025-04-29 00:00:00', 'WEEK', 4, 'PREPARE', '', NULL, NULL, 0, 0, '', '2022-09-01 23:02:44', '', '2025-08-07 20:07:20');

View File

@@ -0,0 +1,6 @@
INSERT INTO `dv_check_record` (`record_id`, `plan_id`, `plan_code`, `plan_name`, `plan_type`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `check_time`, `user_id`, `user_name`, `nick_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (201, 207, 'PLAN2022048', '1', 'CHECK', 213, 'M0036', '测试人员', '1', '12', '2024-12-26 00:00:00', NULL, NULL, NULL, 'FINISHED', '', NULL, NULL, 0, 0, '', '2024-12-26 16:14:18', '', '2024-12-26 16:23:24');
INSERT INTO `dv_check_record` (`record_id`, `plan_id`, `plan_code`, `plan_name`, `plan_type`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `check_time`, `user_id`, `user_name`, `nick_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (202, 207, 'PLAN2022048', '1', 'CHECK', 212, 'M0024', 'QQQQQ', 'QW', 'Q1001', '2024-12-26 18:18:20', NULL, NULL, NULL, 'PREPARE', '', NULL, NULL, 0, 0, '', '2024-12-26 18:18:25', '', NULL);
INSERT INTO `dv_check_record` (`record_id`, `plan_id`, `plan_code`, `plan_name`, `plan_type`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `check_time`, `user_id`, `user_name`, `nick_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (203, 207, 'PLAN2022048', '1', 'CHECK', 212, 'M0024', 'QQQQQ', 'QW', 'Q1001', '2024-12-26 18:36:46', NULL, NULL, NULL, 'PREPARE', '', NULL, NULL, 0, 0, '', '2024-12-26 18:36:54', '', NULL);
INSERT INTO `dv_check_record` (`record_id`, `plan_id`, `plan_code`, `plan_name`, `plan_type`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `check_time`, `user_id`, `user_name`, `nick_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (204, 207, 'PLAN2022048', '1', 'CHECK', 212, 'M0024', 'QQQQQ', 'QW', 'Q1001', '2024-12-26 18:37:49', NULL, NULL, NULL, 'PREPARE', '', NULL, NULL, 0, 0, '', '2024-12-26 18:38:01', '', '2024-12-27 15:16:53');
INSERT INTO `dv_check_record` (`record_id`, `plan_id`, `plan_code`, `plan_name`, `plan_type`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `check_time`, `user_id`, `user_name`, `nick_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (205, 207, 'PLAN2022048', '1', 'CHECK', 212, 'M0024', 'QQQQQ', 'QW', 'Q1001', '2024-12-26 18:47:05', 100, 'test', '测试员', 'PREPARE', '', NULL, NULL, 0, 0, '', '2024-12-26 18:47:27', '', NULL);
INSERT INTO `dv_check_record` (`record_id`, `plan_id`, `plan_code`, `plan_name`, `plan_type`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `check_time`, `user_id`, `user_name`, `nick_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (212, 207, 'PLAN2022048', '1', 'CHECK', 214, 'M0046', 'WG-A1型纺织机', '万国', 'WG-A1', '2025-04-30 17:22:13', 1947580187189002242, 'neko', 'neko', 'PREPARE', '', NULL, NULL, 0, 0, '', '2025-04-30 17:22:19', '', '2025-08-07 13:10:29');

View File

@@ -0,0 +1,4 @@
INSERT INTO `dv_check_record_line` (`line_id`, `record_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `check_status`, `check_result`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (204, 205, 202, 'SUB039', '123', 'CHECK', '123', '123', 'Y', NULL, NULL, NULL, 0, 0, '', '2024-12-27 15:17:04', '', NULL);
INSERT INTO `dv_check_record_line` (`line_id`, `record_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `check_status`, `check_result`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (212, 212, 202, 'SUB039', '123', 'CHECK', '123', '123', 'Y', NULL, NULL, NULL, 0, 0, '', '2025-08-07 13:14:43', '', NULL);
INSERT INTO `dv_check_record_line` (`line_id`, `record_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `check_status`, `check_result`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (213, 212, 202, 'SUB039', '123', 'CHECK', '123', '123', 'Y', NULL, NULL, NULL, 0, 0, '', '2025-08-07 17:54:14', '', NULL);
INSERT INTO `dv_check_record_line` (`line_id`, `record_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `check_status`, `check_result`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (214, 212, 202, 'SUB039', '123', 'CHECK', '123', '123', 'N', NULL, NULL, NULL, 0, 0, '', '2025-08-07 17:54:26', '', NULL);

View File

@@ -0,0 +1,3 @@
INSERT INTO `dv_check_subject` (`record_id`, `plan_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (1, 207, 202, 'SUB039', '123', 'CHECK', '123', '123', '', NULL, NULL, 0, 0, '', '2024-12-26 16:03:48', '', NULL);
INSERT INTO `dv_check_subject` (`record_id`, `plan_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (2, 207, 203, 'SUB049', '点检项目2', 'CHECK', '液压是否正常', NULL, '', NULL, NULL, 0, 0, '', '2024-12-26 16:03:48', '', NULL);
INSERT INTO `dv_check_subject` (`record_id`, `plan_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (4, 208, 202, 'SUB039', '123', 'CHECK', '123', '123', '', NULL, NULL, 0, 0, '', '2025-08-07 11:55:04', '', NULL);

View File

@@ -0,0 +1,4 @@
INSERT INTO `dv_machinery` (`machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `workshop_id`, `workshop_code`, `workshop_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`, `last_mainten_time`, `last_check_time`) VALUES (212, 'M0024', 'QQQQ', 'QW', 'Q1001', 202, NULL, NULL, 213, 'WS079', '组装车间', 'REPAIR', 'QQ', NULL, NULL, 0, 0, '', '2022-08-18 11:01:42', '', '2025-08-07 11:22:18', NULL, NULL);
INSERT INTO `dv_machinery` (`machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `workshop_id`, `workshop_code`, `workshop_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`, `last_mainten_time`, `last_check_time`) VALUES (213, 'M0036', '测试人员', '1', '12', 213, NULL, NULL, 213, 'WS079', '组装车间', 'STOP', '123', NULL, NULL, 0, 0, '', '2022-08-19 14:36:15', '', '2025-05-16 14:09:23', NULL, NULL);
INSERT INTO `dv_machinery` (`machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `workshop_id`, `workshop_code`, `workshop_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`, `last_mainten_time`, `last_check_time`) VALUES (214, 'M0046', 'WG-A1型纺织机', '万国', 'WG-A1', 214, NULL, NULL, 209, NULL, NULL, 'STOP', '', NULL, NULL, 0, 0, '', '2022-08-21 19:42:53', '', NULL, NULL, NULL);
INSERT INTO `dv_machinery` (`machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `workshop_id`, `workshop_code`, `workshop_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`, `last_mainten_time`, `last_check_time`) VALUES (215, 'M0047', 'uytuyu', 'tyu', 'utu', 204, NULL, NULL, 200, NULL, NULL, 'STOP', '', NULL, NULL, 0, 0, '', '2022-08-22 09:48:52', '', NULL, NULL, NULL);

View File

@@ -0,0 +1,19 @@
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (1, 'M_TYPE_000', '设备分类', 0, '0', 'Y', '', NULL, NULL, 0, 0, 'admin', '2022-05-08 19:26:57', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (200, 'M_TYPE_002', '注塑机', 210, '0,1', 'Y', '这个是一种类型的裁剪机', NULL, NULL, 0, 0, '', '2022-05-08 19:50:41', '', '2022-08-22 09:47:02');
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (201, 'M_TYPE_003', '组装机', 1, '0,1', 'Y', '', NULL, NULL, 0, 0, '', '2022-05-08 19:50:57', '', '2025-07-25 14:01:56');
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (202, 'M_TYPE_004', '大型注塑机', 200, '0,1,200', 'Y', '', NULL, NULL, 0, 0, '', '2022-05-08 19:51:10', '', '2022-05-14 13:39:51');
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (203, 'M_TYPE_005', '大型组装机', 201, '0,1,201', 'Y', '', NULL, NULL, 0, 0, '', '2022-05-08 19:51:25', '', '2022-07-17 12:19:14');
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (204, 'M_TYPE_006', '包装机', 1, '0,1', 'Y', '', NULL, NULL, 0, 0, '', '2022-05-14 13:40:03', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (205, 'M_TYPE_007', '清洗类', 1, '0,1', 'Y', '', NULL, NULL, 0, 0, '', '2022-05-14 13:43:59', '', '2022-05-14 13:44:11');
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (206, 'M_TYPE_008', '喷砂机', 205, '0,1,205', 'Y', '', NULL, NULL, 0, 0, '', '2022-05-14 13:44:23', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (207, 'M_TYPE_009', '清洗机', 205, '0,1,205', 'Y', '', NULL, NULL, 0, 0, '', '2022-05-14 13:44:33', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (208, 'M_TYPE_010', '检测类', 1, '0,1', 'Y', '', NULL, NULL, 0, 0, '', '2022-05-14 13:49:13', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (209, 'M_TYPE_011', 'CCD检测台', 208, '0,1,208', 'Y', '', NULL, NULL, 0, 0, '', '2022-05-14 13:49:25', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (210, 'M_TYPE_015', '臂架焊机', 1, '0,1', 'Y', '', NULL, NULL, 0, 0, '', '2022-08-17 15:32:56', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (211, 'M_TYPE_016', '华远焊机', 1, '0,1', 'Y', '', NULL, NULL, 0, 0, '', '2022-08-17 15:33:16', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (212, 'M_TYPE_017', '麦格米特焊机', 1, '0,1', 'Y', '', NULL, NULL, 0, 0, '', '2022-08-17 15:33:24', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (213, 'M_TYPE_018', '测试类', 1, '0,1', 'Y', '', NULL, NULL, 0, 0, '', '2022-08-19 14:35:27', '', '2022-08-19 14:35:45');
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (214, 'M_TYPE_021', '纺织机', 1, '0,1', 'Y', '', NULL, NULL, 0, 0, '', '2022-08-21 19:03:44', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (215, 'MT-CE80374768A6', '1', 1, '0,1', 'Y', '', NULL, NULL, 0, 0, '', '2025-08-06 23:18:59', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (216, 'MT-3BF121D84891', '2', 215, '0,1,215', 'Y', '', NULL, NULL, 0, 0, '', '2025-08-06 23:21:33', '', NULL);
INSERT INTO `dv_machinery_type` (`machinery_type_id`, `machinery_type_code`, `machinery_type_name`, `parent_type_id`, `ancestors`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (217, 'MT-BF779FBC7492', '设备1', 0, '0', 'Y', '1111', NULL, NULL, 0, 0, '', '2025-09-24 15:01:48', '', NULL);

View File

@@ -0,0 +1,4 @@
INSERT INTO `dv_mainten_record` (`record_id`, `plan_id`, `plan_code`, `plan_name`, `plan_type`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `mainten_time`, `user_id`, `user_name`, `nick_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (200, NULL, NULL, NULL, NULL, 212, 'M0024', 'QQQQQ', 'QW', 'Q1001', '2024-12-26 00:00:00', 1, 'admin', '若依', 'FINISHED', '', NULL, NULL, 0, 0, '', '2024-12-26 19:20:14', '', '2024-12-26 19:23:12');
INSERT INTO `dv_mainten_record` (`record_id`, `plan_id`, `plan_code`, `plan_name`, `plan_type`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `mainten_time`, `user_id`, `user_name`, `nick_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (201, NULL, NULL, '', NULL, 212, 'M0024', 'QQQQQ', 'QW', 'Q1001', '2025-07-10 00:00:00', NULL, 'admin', NULL, 'FINISHED', '', NULL, NULL, 0, 0, '', '2025-07-25 14:03:57', '', '2025-07-25 14:04:02');
INSERT INTO `dv_mainten_record` (`record_id`, `plan_id`, `plan_code`, `plan_name`, `plan_type`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `mainten_time`, `user_id`, `user_name`, `nick_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (202, NULL, NULL, NULL, NULL, 212, 'M0024', 'QQQQQ', 'QW', 'Q1001', '2025-06-29 00:00:00', NULL, 'admin', NULL, 'PREPARE', '', NULL, NULL, 0, 0, '', '2025-07-25 14:04:24', '', '2025-07-25 14:05:24');
INSERT INTO `dv_mainten_record` (`record_id`, `plan_id`, `plan_code`, `plan_name`, `plan_type`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `mainten_time`, `user_id`, `user_name`, `nick_name`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (204, NULL, NULL, NULL, NULL, 215, 'M0047', 'uytuyu', 'tyu', 'utu', '2025-08-12 00:00:00', 1947579932234039297, 'xinlei', 'xinlei', 'PREPARE', '', NULL, NULL, 0, 0, '', '2025-08-07 13:26:08', '', NULL);

View File

@@ -0,0 +1,3 @@
INSERT INTO `dv_mainten_record_line` (`line_id`, `record_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `mainten_status`, `mainten_result`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (3, 21, 21, '2', '2', '', '<p><br></p>', '2', '1', '2', NULL, NULL, 0, 0, '', '2025-07-25 14:26:24', '', '2025-08-07 13:27:37');
INSERT INTO `dv_mainten_record_line` (`line_id`, `record_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `mainten_status`, `mainten_result`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (7, 1, 1, '1', '1', '', '<p>1</p>', '1', '1', NULL, NULL, NULL, 0, 0, '', '2025-08-07 13:27:03', '', NULL);
INSERT INTO `dv_mainten_record_line` (`line_id`, `record_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `mainten_status`, `mainten_result`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (8, 1, 1, '1', NULL, NULL, '<p>1</p>', '1', '0', NULL, NULL, NULL, 0, 0, '', '2025-08-07 20:30:54', '', NULL);

View File

@@ -0,0 +1,2 @@
INSERT INTO `dv_repair` (`repair_id`, `repair_code`, `repair_name`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `machinery_type_id`, `require_date`, `finish_date`, `confirm_date`, `repair_result`, `accepted_id`, `accepted_name`, `accepted_by`, `confirm_id`, `confirm_name`, `confirm_by`, `source_doc_type`, `source_doc_id`, `source_doc_code`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (200, 'REP2025001', NULL, 214, 'M0046', 'WG-A1型纺织机', '万国', 'WG-A1', 214, '2025-05-06 16:08:15', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'PREPARE', '', NULL, NULL, 0, 0, '', '2025-05-06 16:09:10', '', '2025-07-25 14:05:42');
INSERT INTO `dv_repair` (`repair_id`, `repair_code`, `repair_name`, `machinery_id`, `machinery_code`, `machinery_name`, `machinery_brand`, `machinery_spec`, `machinery_type_id`, `require_date`, `finish_date`, `confirm_date`, `repair_result`, `accepted_id`, `accepted_name`, `accepted_by`, `confirm_id`, `confirm_name`, `confirm_by`, `source_doc_type`, `source_doc_id`, `source_doc_code`, `status`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (201, 'REP202500', NULL, 214, 'M0046', 'WG-A1型纺织机', '万国', 'WG-A1', 214, '2025-05-06 16:10:26', NULL, NULL, NULL, 100, 'test', '报工审核员', 102, 'sg', '王主管', NULL, NULL, NULL, 'FINISHED', '', NULL, NULL, 0, 0, '', '2025-05-06 16:10:38', '', '2025-08-07 13:57:40');

View File

@@ -0,0 +1,4 @@
INSERT INTO `dv_repair_line` (`line_id`, `repair_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `malfunction`, `malfunction_url`, `repair_des`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (200, 201, NULL, NULL, NULL, NULL, 'u呼呼', NULL, '花城广场吧', NULL, '何处合成愁_耶耶耶', '', NULL, NULL, 0, 0, '', '2025-05-06 17:55:49', '', '2025-05-06 18:02:05');
INSERT INTO `dv_repair_line` (`line_id`, `repair_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `malfunction`, `malfunction_url`, `repair_des`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (201, 200, 200, 'SUB011', '润滑', NULL, '冲床无明显摩擦声', NULL, '1', '1', '1', '', NULL, NULL, 0, 0, '', '2025-07-25 14:01:24', '', NULL);
INSERT INTO `dv_repair_line` (`line_id`, `repair_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `malfunction`, `malfunction_url`, `repair_des`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (202, 202, 201, 'SUB003', '测试萨博', NULL, '不知道为了什么.....', NULL, '42', '42', '42', '', NULL, NULL, 0, 0, '', '2025-07-25 15:11:06', '', NULL);
INSERT INTO `dv_repair_line` (`line_id`, `repair_id`, `subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `malfunction`, `malfunction_url`, `repair_des`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (203, 203, 201, 'SUB003', '测试萨博', NULL, '不知道为了什么.....', NULL, '1', '1', '1', '', NULL, NULL, 0, 0, '', '2025-07-25 15:25:17', '', NULL);

View File

@@ -0,0 +1,3 @@
INSERT INTO `dv_subject` (`subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (200, 'SUB01', '润滑', 'MAINTEN', '冲床无明显摩擦声', NULL, 'Y', '', NULL, NULL, 0, 0, '', '2022-06-16 20:32:20', '', '2025-08-07 11:35:30');
INSERT INTO `dv_subject` (`subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (201, 'SUB003', '测试萨博', 'MAINTEN', '不知道为了什么.....', 'SD1/SD2/SD3', 'Y', '', NULL, NULL, 0, 0, '', '2022-08-13 22:01:08', '', NULL);
INSERT INTO `dv_subject` (`subject_id`, `subject_code`, `subject_name`, `subject_type`, `subject_content`, `subject_standard`, `enable_flag`, `remark`, `attr1`, `attr2`, `attr3`, `attr4`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (202, 'SUB039', '123', 'CHECK', '123', '123', 'Y', '', NULL, NULL, 0, 0, '', '2022-08-19 15:03:25', '', NULL);

View File

@@ -0,0 +1,11 @@
INSERT INTO `gear_attendance_piece_detail` (`detail_id`, `record_id`, `workpiece_code`, `workpiece_name`, `piece_quantity`, `unit_price`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1, 1953354034685231106, 'WP001', '齿轮A', 10, 5.00, '2025-09-17 05:08:56', 'system', '2025-09-17 05:10:18', NULL, 0, '标准件');
INSERT INTO `gear_attendance_piece_detail` (`detail_id`, `record_id`, `workpiece_code`, `workpiece_name`, `piece_quantity`, `unit_price`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (2, 1953354034685231107, 'WP002', '齿轮B', 15, 6.67, '2025-09-17 05:08:56', 'system', '2025-09-17 05:10:17', NULL, 0, '精密件');
INSERT INTO `gear_attendance_piece_detail` (`detail_id`, `record_id`, `workpiece_code`, `workpiece_name`, `piece_quantity`, `unit_price`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (3, 1953354034685231108, 'WP003', '轴承', 20, 5.00, '2025-09-17 05:08:56', 'system', '2025-09-17 05:10:17', NULL, 0, '通用轴承');
INSERT INTO `gear_attendance_piece_detail` (`detail_id`, `record_id`, `workpiece_code`, `workpiece_name`, `piece_quantity`, `unit_price`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (4, 1953354034685231109, 'WP004', '轴套', 10, 14.00, '2025-09-17 05:08:56', 'system', '2025-09-17 05:10:17', NULL, 0, '特殊材质');
INSERT INTO `gear_attendance_piece_detail` (`detail_id`, `record_id`, `workpiece_code`, `workpiece_name`, `piece_quantity`, `unit_price`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (5, 1953354034685231110, 'WP001', '齿轮A', 8, 5.00, '2025-09-17 05:08:56', 'system', '2025-09-17 05:10:17', NULL, 0, '常规生产');
INSERT INTO `gear_attendance_piece_detail` (`detail_id`, `record_id`, `workpiece_code`, `workpiece_name`, `piece_quantity`, `unit_price`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (6, 1953354034685231111, 'WP005', '垫片', 10, 4.40, '2025-09-17 05:08:56', 'system', '2025-09-17 05:10:17', NULL, 0, '批量生产');
INSERT INTO `gear_attendance_piece_detail` (`detail_id`, `record_id`, `workpiece_code`, `workpiece_name`, `piece_quantity`, `unit_price`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (7, 1953354034685231112, 'WP006', '螺栓', 5, 2.00, '2025-09-17 05:08:56', 'system', '2025-09-17 05:10:17', NULL, 0, '辅助零件');
INSERT INTO `gear_attendance_piece_detail` (`detail_id`, `record_id`, `workpiece_code`, `workpiece_name`, `piece_quantity`, `unit_price`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (8, 1953354034685231113, 'WP007', '螺母', 15, 1.33, '2025-09-17 05:08:56', 'system', '2025-09-17 05:10:17', NULL, 0, '配套零件');
INSERT INTO `gear_attendance_piece_detail` (`detail_id`, `record_id`, `workpiece_code`, `workpiece_name`, `piece_quantity`, `unit_price`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (9, 1953354034685231114, 'WP008', '销子', 5, 3.00, '2025-09-17 05:08:56', 'system', '2025-09-17 05:10:17', NULL, 0, '标准件');
INSERT INTO `gear_attendance_piece_detail` (`detail_id`, `record_id`, `workpiece_code`, `workpiece_name`, `piece_quantity`, `unit_price`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (10, 1953354034685231115, 'WP009', '弹簧', 10, 3.00, '2025-09-17 05:08:56', 'system', '2025-09-17 05:10:17', NULL, 0, '小规格');
INSERT INTO `gear_attendance_piece_detail` (`detail_id`, `record_id`, `workpiece_code`, `workpiece_name`, `piece_quantity`, `unit_price`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1968191550609207297, 1953354034685231108, 'WP004', '弓箭', 10, 20.00, '2025-09-17 13:53:28', 'admin', '2025-09-17 13:53:28', 'admin', 0, NULL);

View File

@@ -0,0 +1,32 @@
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953011248296226819, 1, '2025-08-06', 'attendance', '2025-08-06 09:40:16', '2025-08-06 17:40:25', 8, NULL, NULL, NULL, 'pending', '2025-08-06 09:40:43', 'system', '2025-08-06 09:40:43', NULL, 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953296921707483137, 1953296510648913922, '2025-08-07', 'overtime', '2025-08-07 00:00:00', '2025-08-07 08:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 11:27:31', 'admin', '2025-08-07 14:58:25', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953300232422625281, 1953296510648913922, '2025-08-06', 'attendance', '2025-08-06 09:00:00', '2025-08-06 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 11:40:41', 'admin', '2025-08-07 05:43:38', 'admin', 2, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953301490252476418, 1953296510648913922, '2025-08-07', 'attendance', '2025-08-07 09:00:00', '2025-08-07 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 11:45:41', 'admin', '2025-08-07 05:43:34', 'admin', 2, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953302266844639233, 1953296510648913922, '2025-08-07', 'attendance', '2025-08-07 09:00:00', '2025-08-07 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 11:48:46', 'admin', '2025-08-07 11:48:46', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953343755536646145, 1953296510648913922, '2025-08-08', 'attendance', '2025-08-08 09:00:00', '2025-08-08 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:33:37', 'admin', '2025-08-07 14:33:37', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953346784226787329, 1953296510648913922, '2025-08-06', 'attendance', '2025-08-06 09:00:00', '2025-08-06 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:45:39', 'admin', '2025-08-07 14:45:39', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953346821518344193, 1953296510648913922, '2025-08-05', 'attendance', '2025-08-05 09:00:00', '2025-08-05 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:45:48', 'admin', '2025-08-07 14:45:48', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953346846235377665, 1953296510648913922, '2025-08-04', 'attendance', '2025-08-04 09:00:00', '2025-08-04 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:45:54', 'admin', '2025-08-07 14:45:54', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953346874945388545, 1953296510648913922, '2025-08-03', 'attendance', '2025-08-03 09:00:00', '2025-08-03 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:46:01', 'admin', '2025-08-07 14:46:01', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953346897913397250, 1953296510648913922, '2025-08-02', 'attendance', '2025-08-02 09:00:00', '2025-08-02 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:46:07', 'admin', '2025-08-07 14:46:07', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953346924144574465, 1953296510648913922, '2025-08-01', 'attendance', '2025-08-01 09:00:00', '2025-08-01 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:46:13', 'admin', '2025-08-07 14:46:13', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953348329890725890, 1953296599563964417, '2025-08-07', 'attendance', '2025-08-07 09:00:00', '2025-08-07 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:51:48', 'admin', '2025-08-07 14:51:48', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953348361016655873, 1953296599563964417, '2025-08-06', 'attendance', '2025-08-06 09:00:00', '2025-08-06 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:51:55', 'admin', '2025-08-07 14:51:55', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953348430897954818, 1953296599563964417, '2025-08-05', 'attendance', '2025-08-05 09:00:00', '2025-08-05 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:52:12', 'admin', '2025-08-07 14:52:12', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953348455304609794, 1953296599563964417, '2025-08-04', 'attendance', '2025-08-04 09:00:00', '2025-08-04 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:52:18', 'admin', '2025-08-07 14:52:18', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953348480894058498, 1953296599563964417, '2025-08-03', 'attendance', '2025-08-03 09:00:00', '2025-08-03 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 14:52:24', 'admin', '2025-08-07 14:52:24', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953348693243281409, 1953296599563964417, '2025-08-03', 'overtime', '2025-08-03 20:00:00', '2025-08-03 23:59:59', 4, NULL, NULL, NULL, 'pending', '2025-08-07 14:53:15', 'admin', '2025-08-07 14:53:15', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953349133267714050, 1953296599563964417, '2025-08-05', 'overtime', '2025-08-05 21:00:39', '2025-08-05 22:00:39', 1, NULL, NULL, NULL, 'pending', '2025-08-07 14:55:00', 'admin', '2025-08-07 14:55:00', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953353699853942785, 1953296689095577601, '2025-08-09', 'attendance', '2025-08-09 09:00:00', '2025-08-09 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 15:13:08', 'admin', '2025-08-07 15:13:46', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953353756955197442, 1953296689095577601, '2025-08-06', 'attendance', '2025-08-06 09:00:00', '2025-08-06 18:00:00', 8, NULL, NULL, NULL, 'pending', '2025-08-07 15:13:22', 'admin', '2025-08-07 15:13:22', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953354034685231105, 1953296689095577601, '2025-08-05', 'overtime', '2025-08-05 15:00:00', '2025-08-05 17:00:00', 2, NULL, NULL, NULL, 'pending', '2025-08-07 15:14:28', 'admin', '2025-08-07 15:14:28', 'admin', 0, '');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953354034685231106, 1953296689095577601, '2025-08-05', 'attendance', '2025-08-05 15:00:00', '2025-08-05 17:00:00', 8, 'hourly', NULL, 160.00, 'approved', '2025-09-17 05:08:56', 'system', '2025-09-18 07:22:47', NULL, 2, '正常工作日出勤');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953354034685231107, 1953296689095577601, '2025-08-05', 'overtime', '2025-08-05 15:00:00', '2025-08-05 17:00:00', 4, 'hourly', NULL, 120.00, 'approved', '2025-09-17 05:08:56', 'system', '2025-09-17 05:09:49', NULL, 0, '项目紧急加班');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953354034685231108, 1953296689095577601, '2025-08-05', 'attendance', '2025-08-05 15:00:00', '2025-08-05 17:00:00', 8, 'piecework', 25, 200.00, 'processed', '2025-09-17 05:08:56', 'system', '2025-09-17 05:09:49', NULL, 0, '计件工资出勤');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953354034685231109, 1953296689095577601, '2025-08-05', 'travel', '2025-08-05 15:00:00', '2025-08-05 17:00:00', 10, 'hourly', NULL, 250.00, 'approved', '2025-09-17 05:08:56', 'system', '2025-09-17 05:09:49', NULL, 0, '外地出差');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953354034685231110, 1953296689095577601, '2025-08-05', 'leave', '2025-08-05 15:00:00', '2025-08-05 17:00:00', NULL, NULL, NULL, 0.00, 'approved', '2025-09-17 05:08:56', 'system', '2025-09-17 05:09:49', NULL, 0, '年假');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953354034685231111, 1953296689095577601, '2025-08-05', 'attendance', '2025-08-05 15:00:00', '2025-08-05 17:00:00', 8, 'hourly', NULL, 180.00, 'pending', '2025-09-17 05:08:56', 'system', '2025-09-18 07:22:49', NULL, 2, '待审批出勤');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953354034685231112, 1953296689095577601, '2025-08-05', 'overtime', '2025-08-05 15:00:00', '2025-08-05 17:00:00', 4, 'hourly', NULL, 140.00, 'rejected', '2025-09-17 05:08:56', 'system', '2025-09-17 05:09:49', NULL, 0, '加班申请未通过');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953354034685231113, 1953296689095577601, '2025-08-05', 'attendance', '2025-08-05 15:00:00', '2025-08-05 17:00:00', 8, 'piecework', 30, 240.00, 'processed', '2025-09-17 05:08:56', 'system', '2025-09-17 05:09:49', NULL, 0, '计件工作完成30件');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953354034685231114, 1953296689095577601, '2025-08-05', 'travel', '2025-08-05 15:00:00', '2025-08-05 17:00:00', 12, 'hourly', NULL, 360.00, 'approved', '2025-09-17 05:08:56', 'system', '2025-09-17 05:09:49', NULL, 0, '长途出差');
INSERT INTO `gear_attendance_record` (`record_id`, `user_id`, `record_date`, `record_type`, `start_time`, `end_time`, `duration_hour`, `payment_type`, `piece_count`, `wage`, `status`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`, `remark`) VALUES (1953354034685231115, 1953296689095577601, '2025-08-05', 'attendance', '2025-08-05 15:00:00', '2025-08-05 17:00:00', 8, 'piecework', 18, 144.00, 'processed', '2025-09-17 05:08:56', 'system', '2025-09-17 05:09:49', NULL, 0, '计件工作完成18件');

Some files were not shown because too many files have changed in this diff Show More