pull/1/head
siontion 9 months ago
commit 32ddd20cac

@ -176,4 +176,7 @@ public class ProjectOrderRespVO {
@Schema(description = "变更的字段列表")
private Set<String> alterFieldNames;
@Schema(description = "创建人名称")
private String creatorName;
}

@ -196,6 +196,21 @@ public class ProjectOrderDO extends BaseDO {
@TableField(exist = false)
private String businessManName;
@TableField(exist = false)
private String creatorName;
@TableField(exist = false)
private String auditName;
@TableField(exist = false)
private Long auditTime;
@TableField(exist = false)
private String approveName;
@TableField(exist = false)
private Long approveTime;
/**
*
* */

@ -72,4 +72,9 @@ public class ProjectOrderSubDO extends BaseDO {
@TableField(exist = false)
private Set<String> alterFieldNames;
/**
*
*/
@TableField(exist = false)
private String compositionName;
}

@ -3,6 +3,7 @@ package com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderPageReqVO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
import com.chanko.yunxi.mes.module.system.dal.dataobject.dept.DeptDO;
@ -42,4 +43,17 @@ public interface ProjectOrderMapper extends BaseMapperX<ProjectOrderDO> {
return selectPage(reqVO, query);
}
default ProjectOrderDO selectById(Long id) {
MPJLambdaWrapper<ProjectOrderDO> query = new MPJLambdaWrapper<>();
query.selectAll(ProjectOrderDO.class)
.select("u.nickname as businessManName", "d.name as businessDeptName", "u1.nickname as creatorName")
.leftJoin(AdminUserDO.class, "u", AdminUserDO::getId, ProjectOrderDO::getBusinessMan)
.leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, ProjectOrderDO::getCreator)
.leftJoin(DeptDO.class, "d", DeptDO::getId, ProjectOrderDO::getBusinessDeptId)
.eq(ProjectOrderDO::getId, id)
.last("LIMIT 1")
.disableSubLogicDel();
return selectOne(query);
}
}

@ -6,7 +6,9 @@ import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectordersub.ProjectOrderSubDO;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.ibatis.annotations.Mapper;
/**
@ -18,7 +20,13 @@ import org.apache.ibatis.annotations.Mapper;
public interface ProjectOrderSubMapper extends BaseMapperX<ProjectOrderSubDO> {
default List<ProjectOrderSubDO> selectListByProjectOrderId(Long projectOrderId) {
return selectList(ProjectOrderSubDO::getProjectOrderId, projectOrderId);
MPJLambdaWrapper<ProjectOrderSubDO> query = new MPJLambdaWrapper<>();
query.selectAll(ProjectOrderSubDO.class)
.select("b.name as compositionName")
.leftJoin(CompositionDO.class, "b", CompositionDO::getId, ProjectOrderSubDO::getCompositionId)
.disableSubLogicDel()
.eq(ProjectOrderSubDO::getProjectOrderId, projectOrderId);
return selectList(query);
}
default int deleteByProjectOrderId(Long projectOrderId) {

@ -219,6 +219,8 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
// do nothing
log.error("generate alterFieldNames error, id: {}, exception: {}", id, e.getMessage(), e);
}
// 查询操作日志获取审核/批准
return projectOrderDO;
}

@ -6,6 +6,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -28,6 +29,9 @@ public class OperateLogPageReqVO extends PageParam {
@Schema(description = "操作分类,参见 OperateLogTypeEnum 枚举类", example = "1")
private Integer type;
@Schema(description = "操作分类列表", example = "1")
private List<Integer> typeList;
@Schema(description = "操作状态", example = "true")
private Boolean success;

@ -20,7 +20,9 @@ public interface OperateLogMapper extends BaseMapperX<OperateLogDO> {
.likeIfPresent(OperateLogDO::getModule, reqVO.getModule())
.inIfPresent(OperateLogDO::getUserId, userIds)
.eqIfPresent(OperateLogDO::getType, reqVO.getType())
.betweenIfPresent(OperateLogDO::getStartTime, reqVO.getStartTime());
.betweenIfPresent(OperateLogDO::getStartTime, reqVO.getStartTime())
.inIfPresent(OperateLogDO::getType, reqVO.getTypeList())
;
if (Boolean.TRUE.equals(reqVO.getSuccess())) {
query.eq(OperateLogDO::getResultCode, GlobalErrorCodeConstants.SUCCESS.getCode());
} else if (Boolean.FALSE.equals(reqVO.getSuccess())) {

@ -95,7 +95,9 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery" type="primary"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="handleQuery" type="primary"
><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button
>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@ -120,7 +122,13 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" class="hl-table">
<el-table
v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
class="hl-table"
>
<el-table-column fixed label="序号" type="index" width="100" />
<el-table-column fixed label="项目编号" align="center" prop="code" width="240" />
<el-table-column
@ -198,8 +206,10 @@
<dict-tag :type="DICT_TYPE.HELI_DELIVERY_STATUS" :value="scope.row.deliveryStatus" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="260">
<el-table-column label="操作" align="center" fixed="right" min-width="260">
<template #default="scope">
<el-row>
<el-col>
<el-button
link
type="danger"
@ -228,9 +238,10 @@
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="detail">查看详情</el-dropdown-item>
<el-dropdown-item v-if="scope.row.orderStatus == 32" command="printProject"
>打印开发项目启动单</el-dropdown-item
>
<el-dropdown-item v-if="scope.row.orderStatus == 32" command="printProject">
打印开发项目启动单
</el-dropdown-item>
<el-dropdown-item v-if="scope.row.orderStatus == 32" command="alter"
>订单变更</el-dropdown-item
>
@ -243,6 +254,8 @@
</el-dropdown-menu>
</template>
</el-dropdown>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
@ -255,6 +268,8 @@
/>
</ContentWrap>
</el-card>
<!-- 打印启动单 - 弹框-->
<Print ref="printRef" />
</template>
<script setup lang="ts">
@ -262,6 +277,8 @@ import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { dateFormatter, dateFormatter2, formatDate } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ProjectOrderApi from '@/api/heli/projectorder'
import Print from './startprint.vue' //
import {ref} from "vue";
defineOptions({ name: 'ProjectOrder' })
@ -380,7 +397,7 @@ const handleCommand = async (command, id, code) => {
openDetail('detail', id)
break
case 'printProject':
// TODO
printHandle(id)
break
case 'alter':
openDetail('alter', id)
@ -399,6 +416,14 @@ const handleCommand = async (command, id, code) => {
}
}
//
const printRef = ref() //
const dialogInfo = ref({}) //
//
const printHandle = (id) => {
printRef.value.open(id)
}
/** 初始化 **/
onMounted(() => {
getList()
@ -406,11 +431,13 @@ onMounted(() => {
onActivated(() => {
getList()
})
</script>
<style scoped>
.el-dropdown-link {
cursor: pointer;
margin: 5px;
color: var(--el-color-primary);
display: flex;
align-items: center;

@ -0,0 +1,426 @@
<template>
<Dialog title="打印预览" v-model="dialogVisible" width="1000">
<!-- 打印预览 -->
<div class="print-wrap page" ref="print">
<table border="2" cellspacing="0" id="table">
<tbody>
<tr>
<td colspan="2">
<div style="width: 110px; text-align: center">
<img src="/src/assets/imgs/exlogo.png" style="width: 100%; padding: 0 5px" alt="" />
</div>
</td>
<td colspan="6">
<span style="font-size: 20px; font-weight: 700">开发项目启动单</span>
</td>
<td colspan="2">
<div style="border-bottom: 1px solid #666">项目编号</div>
<div>{{ formData.code }}</div>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2"> 客户名称 </td>
<td colspan="5">
<span>{{ formData.customer.name }}</span>
</td>
<td colspan="1">{{ formData.customer.brief }}</td>
<td> 编码 </td>
<td>{{ formData.customer.code }} </td>
</tr>
</tbody>
<tr>
<td colspan="2"> 项目名称 </td>
<td colspan="6">
{{ formData.mouldName }}
</td>
<td> 业务员 </td>
<td>{{ formData.businessManName }} </td>
</tr>
<tr>
<td colspan="2"> 项目工期 </td>
<td colspan="1"> </td>
<td colspan="1">
<span>{{ formatDate(new Date(formData.projectStartTime), 'YYYY-MM-DD') }}</span>
</td>
<td colspan="1"></td>
<td colspan="1">{{ formatDate(new Date(formData.projectEndTime), 'YYYY-MM-DD') }}</td>
<td>天数</td>
<td colspan="1">{{ betweenDay(new Date(formData.projectStartTime), new Date(formData.projectEndTime)) }}</td>
<td colspan="1"> 是否紧急 </td>
<td colspan="1">{{ getDictLabel(DICT_TYPE.HELI_COMMON_IS_OR_NOT, formData.isUrgency) }} </td>
</tr>
<tr>
<td colspan="10">
<div style="display: flex; justify-content: space-between">
<div style="width: 42%; font-size: 12px; display: flex; flex-direction: column">
<div style="text-align: left; width: 100%">客户提供资料</div>
<div
id="fruitForm"
style="display: flex; justify-content: flex-start; align-items: center"
>
<span class="checkbox" v-if="formData.hasContract == 0"></span>
<span class="checkbox" v-else-if="formData.hasContract == 1"></span>
<label for="checkbox1">开发合同</label>
<span class="checkbox" v-if="formData.hasTechnologyProtocol == 0"></span>
<span class="checkbox" v-else-if="formData.hasTechnologyProtocol == 1"></span>
<label for="checkbox2">技术协议</label>
<span class="checkbox" v-if="formData.hasBlueprint == 0"></span>
<span class="checkbox" v-else-if="formData.hasBlueprint == 1"></span>
<label for="checkbox3">图纸/数模</label>
</div>
</div>
<div style="width: 27%; display: flex; justify-content: center; font-size: 12px">
<span>费用说明</span>
<div style="border: 1px solid #333">
<div style="border-bottom: 1px solid #333">
<span v-if="formData.hasPrice == 1"></span>
<span v-else></span>
</div>
<div style="padding: 0 3px">
<span v-if="formData.hasPrice == 1">{{ formData.price }}()</span>
<span v-else> </span>
</div>
</div>
</div>
<div style="width: 22%; display: flex; justify-content: center; font-size: 12px">
<div>
<div>类别</div>
<div>性质</div>
</div>
<div style="border: 1px solid #333; width: 100px">
<div style="border-bottom: 1px solid #333">{{ getDictLabel(DICT_TYPE.HELI_BUSINESS_LINE, formData.businessLine) }}</div>
<div>{{ getDictLabel(DICT_TYPE.HELI_PROJECT_PROPERTY, formData.property) }}</div>
</div>
</div>
</div>
</td>
</tr>
<tbody>
<tr
><td colspan="10"> <div style="text-align: left; width: 100%">子项目信息</div></td></tr
>
<tr>
<td class="xh"> 序号 </td>
<td colspan="2"> 名称 </td>
<td> 设备型号 </td>
<td> 简称 </td>
<td> 数量 </td>
<td> 主要材料 </td>
<td colspan="3"> 子项目编号 </td>
</tr>
<tr v-for="(item,idx) in formData.projectOrderSubs" :key="idx">
<td>{{ idx+1 }}</td>
<td colspan="2">{{item.name}}</td>
<td>{{item.deviceModel}}</td>
<td></td>
<td>{{item.amount}}</td>
<td>{{item.compositionName}}</td>
<td colspan="3"></td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="10">
<div style="text-align: left; width: 100%">备注</div>
</td>
</tr>
<tr>
<td colspan="10">
<div style="text-align: left; height: 150px; padding: 10px">
<p> {{ formData.remark }}</p>
</div>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="3"> 编制/日期 </td>
<td colspan="3"> 审核/日期 </td>
<td colspan="4"> 批准/日期 </td>
</tr>
<tr>
<td colspan="3">{{formData.creatorName}}</td>
<td colspan="3">{{formData.auditUserName}}</td>
<td colspan="4">{{formData.approveUserName}}</td>
</tr>
<tr>
<td colspan="3">{{formatDate(new Date(formData.createTime), 'YYYY-MM-DD')}}</td>
<td colspan="3">{{formatDate(new Date(formData.auditTime), 'YYYY-MM-DD')}}</td>
<td colspan="4">{{formatDate(new Date(formData.approveTime), 'YYYY-MM-DD')}}</td>
</tr>
</tbody>
</table>
</div>
<template #footer>
<!-- 打印 -->
<el-button @click="onPrint" type="primary">打印</el-button>
<el-button @click="outopen"></el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
// import { ref, reactive } from 'vue'
import * as ProjectOrderApi from '@/api/heli/projectorder'
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getDictLabel } from '@/utils/dict'
import { betweenDay, dateFormatter, formatDate } from '@/utils/formatTime'
import { Check } from '@element-plus/icons-vue'
import {getCustomer} from "@/api/heli/customer";
const dialogVisible = ref(false) //
const onPrint = () => {
// dom
const printNode = document.querySelector('.print-wrap')
if (!printNode) return
//
const newIframe: any = document.createElement('iframe')
newIframe.setAttribute(
'style',
'width:0px;height:0px;position:absolute;left:-9999px;top:-9999px;'
)
newIframe.setAttribute('align', 'center')
document.body.appendChild(newIframe)
//
let doc: any = null
doc = newIframe.contentWindow.document
doc.write(`
<style type="text/css">
/* 浏览器打印基本样式 */
.page {
width: 21cm;
min-height: 29.7cm;
padding: 10mm;
margin: 20px auto;
border: 1px #d3d3d3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
position: relative;
font-size: 14px !important;
}
@page {
size: A4;
margin:1cm;
}
@media print {
.page {
margin: 10mm;
border: initial;
border-radius: initial;
width: initial;
min-height: initial;
box-shadow: initial;
background: initial;
page-break-after: always;
}
}
table {
width: 100%; /* 让表格宽度100%占满其父元素宽度 */
height: auto; /* 高度根据内容自适应 */
font-size: 14px;
text-align: center;
border-collapse: collapse;
margin-top: 5mm; /* 添加顶部外边距,替代原先的页内边距 */
td {
padding: 10px 0;
border: 1px solid #333;
}
}
.xh {
width: 50px !important;
}
.checkbox {
border: 2px solid #999;
width: 10px;
height: 10px;
display: flex;
justify-content: center;
align-items: center;
margin-left:10px ;
}
</style>
<div>
${printNode.innerHTML}
</div>`)
doc.close()
//
setTimeout(() => {
newIframe.contentWindow.focus()
newIframe.contentWindow.print()
document.body.removeChild(newIframe) //
dialogVisible.value = false
}, 100)
}
const outopen = () => {
dialogVisible.value = false
}
const queryParams: any = ref({
code: undefined
})
const isSelected = ref([1, 3])
const formData = ref({
id: undefined,
code: undefined,
orderStatus: 4,
deliveryStatus: 1,
businessDeptId: undefined,
customerId: undefined,
mouldName: undefined,
businessLine: undefined,
blueprintNo: undefined,
hasPrice: 1,
price: undefined,
currency: '1',
projectStartTime: undefined,
projectEndTime: undefined,
isUrgency: 0,
property: 1,
referenceTechnology: undefined,
hasAlter: 0,
lastAlterTime: undefined,
qualityRequirement: undefined,
remark: undefined,
hasContract: 0,
hasTechnologyProtocol: 0,
hasBlueprint: 0,
blueprintRemark: undefined,
status: 1,
businessMan: undefined,
createTime: new Date(),
projectOrderSubs: [],
attachments: [],
operateLogs: [],
contractNo: undefined,
active: '',
activeOpinion: '',
isSnapshot: 0,
snapshotId: undefined,
snapshotCode: undefined,
orderTime: new Date(),
snapshotOrderTime: undefined,
alterFieldNames: [],
customer: {}
})
/** 打开弹窗 */
const open = async (id?: number) => {
dialogVisible.value = true
resetForm()
formData.value = await ProjectOrderApi.getProjectOrder(id)
//
formData.value.projectOrderSubs = await ProjectOrderApi.getProjectOrderSubListByProjectOrderId(id)
formData.value.customer = await getCustomer(formData.value.customerId)
}
defineExpose({ open }) // open
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
code: undefined,
orderStatus: 4,
deliveryStatus: 1,
businessDeptId: undefined,
customerId: undefined,
mouldName: undefined,
businessLine: undefined,
blueprintNo: undefined,
hasPrice: 1,
price: undefined,
currency: '1',
projectStartTime: undefined,
projectEndTime: undefined,
isUrgency: 0,
property: 1,
referenceTechnology: undefined,
hasAlter: 0,
lastAlterTime: undefined,
qualityRequirement: undefined,
remark: undefined,
hasContract: 0,
hasTechnologyProtocol: 0,
hasBlueprint: 0,
blueprintRemark: undefined,
status: 1,
businessMan: undefined,
createTime: new Date(),
projectOrderSubs: [],
attachments: [],
operateLogs: [],
contractNo: undefined,
active: '',
activeOpinion: '',
isSnapshot: 0,
snapshotId: undefined,
snapshotCode: undefined,
orderTime: new Date(),
snapshotOrderTime: undefined,
alterFieldNames: [],
customer: {}
}
}
</script>
<style scoped lang="scss">
.page {
width: 21cm;
min-height: 29.7cm;
padding: 10mm;
margin: 20px auto;
border: 1px #d3d3d3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
position: relative;
font-size: 14px !important;
}
@page {
size: A4;
margin: 0;
}
@media print {
.page {
margin: 0;
border: initial;
border-radius: initial;
width: initial;
min-height: initial;
box-shadow: initial;
background: initial;
page-break-after: always;
}
}
table {
width: 100%; /* 让表格宽度100%占满其父元素宽度 */
height: auto; /* 高度根据内容自适应 */
font-size: 14px;
text-align: center;
border-collapse: collapse;
margin-top: 5mm; /* 添加顶部外边距,替代原先的页内边距 */
td {
padding: 10px 0;
border: 1px solid #333;
}
}
.xh {
width: 50px !important;
}
.checkbox {
border: 2px solid #999;
width: 15px;
height: 15px;
display: flex;
justify-content: center;
align-items: center;
margin-left: 10px;
}
/*
A4的大小21cm*29.7cmwidth:794px;
单位换算1 inch = 2.54 cm 1mm = 96 px 1 cm = 37.79528 px*/
</style>

@ -108,7 +108,7 @@
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" class="hl-table">
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
<el-table-column label="入库单号" align="center" prop="stockNo" min-width="140" fixed />
<el-table-column label="入库单号" align="center" prop="stockNo" min-width="200" fixed />
<el-table-column label="入库类型" align="center" prop="stockInType" min-width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_STORAGE_IN_TYPE" :value="scope.row.stockInType" />
@ -158,7 +158,7 @@
:formatter="dateFormatter"
min-width="240"
/>
<el-table-column label="单据状态" align="center" prop="status" min-width="120">
<el-table-column label="单据状态" align="center" prop="status" min-width="120" fixed="right">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_STORAGE_STATUS" :value="scope.row.status" />
</template>

@ -108,7 +108,7 @@
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" class="hl-table">
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
<el-table-column label="出库单号" align="center" prop="stockNo" fixed min-width="140" />
<el-table-column label="出库单号" align="center" prop="stockNo" fixed min-width="200" />
<el-table-column label="出库类型" align="center" prop="stockInType" min-width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_STORAGE_IN_TYPE" :value="scope.row.stockInType" />
@ -158,7 +158,7 @@
:formatter="dateFormatter"
min-width="240"
/>
<el-table-column label="单据状态" align="center" prop="status" min-width="120">
<el-table-column label="单据状态" align="center" prop="status" min-width="120" fixed="right">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_STORAGE_STATUS" :value="scope.row.status" />
</template>

Loading…
Cancel
Save