功能完善

This commit is contained in:
bns_han 2024-03-06 17:59:51 +08:00
parent 89f30114a8
commit 14dedcf440
5 changed files with 267 additions and 28 deletions

View File

@ -68,7 +68,7 @@
<if test="wpName != null and wpName != ''">and mt3.type_name = #{wpName}</if>
<if test="isBind != null and isBind != ''">and b.is_bind = #{isBind}</if>
ORDER BY b.is_bind ASC,a.bind_time DESC,b.create_time DESC
ORDER BY b.is_bind ASC,b.label_id DESC
</select>
<select id="selecthistoryList" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO" resultMap="MaLabelBindVOResult">
SELECT b.label_id,a.id,b.is_bind,b.label_code,a.bind_time,b.label_type,mt.type_id,mt.type_name,

View File

@ -26,6 +26,10 @@ public class PurchaseCheckInfo extends BaseEntity
@ApiModelProperty(value = "任务ID")
private Long taskId;
/** 类型id */
@ApiModelProperty(value = "类型id")
private Long typeId;
@ApiModelProperty(value = "采购单号")
@Excel(name = "采购单号")
private String code;
@ -100,6 +104,12 @@ public class PurchaseCheckInfo extends BaseEntity
@ApiModelProperty(value = "数据所属组织")
private Integer companyId;
@ApiModelProperty(value="开始时间")
private String startTime;
@ApiModelProperty(value="结束时间")
private String endTime;
public String getKeyWord() {
return keyWord;
}
@ -289,6 +299,30 @@ public class PurchaseCheckInfo extends BaseEntity
this.inputStatus = inputStatus;
}
public Long getTypeId() {
return typeId;
}
public void setTypeId(Long typeId) {
this.typeId = typeId;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -23,18 +23,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectPurchaseCheckInfoList" parameterType="com.bonus.sgzb.material.domain.PurchaseCheckInfo" resultMap="PurchaseCheckInfoResult">
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time, pci.update_by,
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,su.user_name purchaserName,tk.task_status taskStatus
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time,
pci.update_by,
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,su.user_name
purchaserName,tk.task_status taskStatus
from purchase_check_info pci
left join tm_task tk on pci.task_id = tk.task_id
left join (select id,name from sys_dic where p_id = 23) dict on tk.task_status = dict.id
left join sys_user su on pci.purchaser = su.user_id
LEFT JOIN purchase_check_details pcd on pcd.task_id=pci.task_id
where task_type = 23
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if>
<if test="purchaseTime != null and purchaseTime != ''"> and pci.purchase_time = #{purchaseTime}</if>
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if>
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if>
<if test="companyId != null "> and pci.company_id = #{companyId}</if>
<if test="keyWord != null and keyWord != ''">
and (tk.code like concat('%',#{keyWord},'%') or
su.user_name like concat('%',#{keyWord},'%')
)
</if>
<if test="purchaseTime != null and purchaseTime != ''">and pci.purchase_time = #{purchaseTime}</if>
<if test="arrivalTime != null and arrivalTime != ''">and pci.arrival_time = #{arrivalTime}</if>
<if test="purchaser != null ">and pci.purchaser = #{purchaser}</if>
<if test="companyId != null ">and pci.company_id = #{companyId}</if>
<if test="typeId != null">AND #{typeId} IN (SELECT mt2.type_id
FROM purchase_check_details pcd
LEFT JOIN ma_type mt on mt.type_id=pcd.type_id
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
WHERE pcd.task_id = pci.task_id
)
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND ((pci.purchase_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59'))
or (pci.arrival_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')))
</if>
GROUP BY pcd.task_id
order by pci.create_time desc
</select>

View File

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.sgzb.material.mapper.ScrapRecordMapper">
<select id="getScrapRecordList" resultType="com.bonus.sgzb.material.domain.ScrapRecord">
SELECT sad.id,
unit.unit_name as unitName,
lot.lot_name as proName,
tt.`code`,
tt2.`code` as sourceCode,
mt2.type_name as typeName,
mt.type_name as typeModelName,
mt.unit_name as unit,
mm.ma_code as maCode,
sad.audit_time as scrapTime,
sad.scrap_num as scrapNum,
sad.remark,
su.user_name as userName
FROM scrap_apply_details sad
LEFT JOIN tm_task tt on tt.task_id = sad.task_id
LEFT JOIN repair_audit_details rad on rad.id = sad.parent_id
LEFT JOIN tm_task tt2 on tt2.task_id = rad.task_id
LEFT JOIN tm_task_agreement tta on tta.task_id = sad.task_id
LEFT JOIN bm_agreement_info bai on bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot lot on lot.lot_id = bai.project_id
LEFT JOIN bm_unit_info unit on unit.unit_id = bai.unit_id
LEFT JOIN ma_type mt on mt.type_id = sad.type_id
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm on mm.ma_id = sad.ma_id
LEFT JOIN sys_user su on su.user_id = sad.audit_by
WHERE sad.scrap_source = '2'
<if test="keyWord != null and keyWord != ''">
and (unit.unit_name like concat('%',#{keyWord},'%') or
lot.lot_name like concat('%',#{keyWord},'%') or
mt2.type_name like concat('%',#{keyWord},'%') or
mt.type_name like concat('%',#{keyWord},'%') or
mt.unit_name like concat('%',#{keyWord},'%') or
mm.ma_code like concat('%',#{keyWord},'%') or
su.user_name like concat('%',#{keyWord},'%'))
</if>
<if test="typeName != null and typeName != ''">
and mt2.type_name like concat('%',#{typeName},'%')
</if>
<if test="typeModelName != null and typeModelName != ''">
and mt.type_name like concat('%',#{typeModelName},'%')
</if>
<if test="unitId != null">
and unit.unit_id = #{unitId}
</if>
<if test="proId != null">
and lot.lot_id = #{proId}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND sad.audit_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
UNION ALL
SELECT sad.id,
unit.unit_name as unitName,
lot.lot_name as proName,
tt.`code`,
tt2.`code` as sourceCode,
mt2.type_name as typeName,
mt.type_name as typeModelName,
mt.unit_name as unit,
mm.ma_code as maCode,
sad.audit_time as scrapTime,
sad.scrap_num as scrapNum,
sad.remark,
su.user_name as userName
FROM scrap_apply_details sad
LEFT JOIN tm_task tt on tt.task_id = sad.task_id
LEFT JOIN back_apply_info baif on baif.id = sad.parent_id
LEFT JOIN tm_task tt2 on tt2.task_id = baif.task_id
LEFT JOIN tm_task_agreement tta on tta.task_id = sad.task_id
LEFT JOIN bm_agreement_info bai on bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot lot on lot.lot_id = bai.project_id
LEFT JOIN bm_unit_info unit on unit.unit_id = bai.unit_id
LEFT JOIN ma_type mt on mt.type_id = sad.type_id
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm on mm.ma_id = sad.ma_id
LEFT JOIN sys_user su on su.user_id = sad.audit_by
WHERE sad.scrap_source = '1'
<if test="keyWord != null and keyWord != ''">
and (unit.unit_name like concat('%',#{keyWord},'%') or
lot.lot_name like concat('%',#{keyWord},'%') or
mt2.type_name like concat('%',#{keyWord},'%') or
mt.type_name like concat('%',#{keyWord},'%') or
mt.unit_name like concat('%',#{keyWord},'%') or
mm.ma_code like concat('%',#{keyWord},'%') or
su.user_name like concat('%',#{keyWord},'%'))
</if>
<if test="typeName != null and typeName != ''">
and mt2.type_name like concat('%',#{typeName},'%')
</if>
<if test="typeModelName != null and typeModelName != ''">
and mt.type_name like concat('%',#{typeModelName},'%')
</if>
<if test="unitId != null">
and unit.unit_id = #{unitId}
</if>
<if test="proId != null">
and lot.lot_id = #{proId}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND sad.audit_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
</select>
</mapper>

View File

@ -1,6 +1,33 @@
<template>
<div class="app-container" id="newDevicesList">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="日期">
<el-date-picker
v-model="queryParams.time"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="设备类型" prop="typeId">
<el-select
v-model="queryParams.typeId"
placeholder="请选择设备类型"
clearable filterable
style="width: 240px"
>
<el-option
v-for="typeItem in typesList"
:key="typeItem.typeId"
:label="typeItem.typeName"
:value="typeItem.typeId"
/>
</el-select>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
@ -33,7 +60,7 @@
plain
icon="el-icon-plus"
size="mini"
>发布入库</el-button>
</el-col> -->
<!-- <el-col :span="1.5">-->
@ -84,13 +111,13 @@
<span v-if="scope.row.purchasingStatus=='28'">已入库</span>
</template> -->
</el-table-column>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
<template slot-scope="scope">
<el-button
@ -128,7 +155,7 @@
v-if="scope.row.purchasingStatus=='已验收合格'||scope.row.purchasingStatus=='已入库'"
@click="handlePrint(scope.row)"
>验收单</el-button>
<el-button
size="mini"
type="danger"
@ -182,22 +209,22 @@
</div>
<div class="info" style="margin-top: 10px;display: flex;flex-wrap: wrap;">
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>工程名称</span>
<span>工程名称</span>
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>验收单编号</span>{{ printData.code }}
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>合同名称</span>
<span>合同名称</span>
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>合同编号</span>
<span>合同编号</span>
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>验收地点</span>
<span>验收地点</span>
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>供应商</span><span v-if="printTableData.length>0">{{ printTableData[0].supplier }}</span>
<span>供应商</span><span v-if="printTableData.length>0">{{ printTableData[0].supplier }}</span>
</div>
</div>
<el-table :data="printTableData" class="table" style="margin-top: 20px;width: 1000px;padding-bottom: 1px;" border>
@ -232,7 +259,7 @@
<span>验收负责人 </span>
</div>
</div>
<div class="item" style="width: 50%;">
<div>
<span>供应商</span>
@ -265,7 +292,9 @@
<script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { listPurchaseCheckInfo,getPurchaseCheckInfo,getAcceptanceForm } from "@/api/store/newBuy";
import { getRepairedList, getRepairedDetailList, inputByType,getTypeList } from "@/api/store/warehousing";
import vueEasyPrint from 'vue-easy-print';
import {getLeaseAuditListAll} from "@/api/claimAndRefund/receive";
export default {
// name: "NewDevicesList",
@ -285,6 +314,9 @@ export default {
showSearch: true,
//
total: 0,
//
typesList: [],
modelList: [],
//
typeList: [],
//
@ -297,6 +329,7 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
time:null, //
name: undefined,
},
openPrint: false,
@ -317,19 +350,60 @@ export default {
},
created() {
//refresh
const refresh = this.$route.query && this.$route.query.refresh;
console.log(refresh,'111111111')
if(refresh){
this.queryParams.keyWord = ''
this.getList();
}
// const refresh = this.$route.query && this.$route.query.refresh;
// console.log(refresh,'111111111')
// if(refresh){
// this.queryParams.keyWord = ''
// this.queryParams.typeId = ''
// this.getList();
// this.getTypeList();
// }
this.getList();
this.getTypeList();
},
methods: {
getTypeList() {
getTypeList({level:'3'}).then(response => {
this.typesList = response.data;
}
);
getTypeList({level:'4'}).then(response => {
this.modelList = response.data;
}
);
},
/** 查询字典类型列表 */
// async getList() {
// this.loading = true;
//
// const params = {
// keyWord:this.queryParams.keyWord,
// startTime:this.queryParams.time && this.queryParams.time[0],
// endTime:this.queryParams.time && this.queryParams.time[1],
// typId:this.queryParams.typId,
// pageSize: this.queryParams.pageSize,
// pageNum: this.queryParams.pageNum
// }
//
// const res = await listPurchaseCheckInfo(params)
// this.loading = false;
// this.typeList = res.data.rows;
// this.total = res.data.total;
//
// },
getList() {
this.loading = true;
listPurchaseCheckInfo(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
const params = {
keyWord:this.queryParams.keyWord,
startTime:this.queryParams.time && this.queryParams.time[0],
endTime:this.queryParams.time && this.queryParams.time[1],
typeId:this.queryParams.typeId,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
listPurchaseCheckInfo(this.addDateRange(params)).then(response => {
this.typeList = response.rows;
this.total = response.total;
this.loading = false;
@ -427,7 +501,7 @@ export default {
},
//
getPrintTable(taskId){
getPrintTable(taskId){
getAcceptanceForm({taskId:taskId}).then(response => {
this.printData = response.data;
this.printTableData = response.data.checkDetailsList;
@ -439,7 +513,7 @@ export default {
// this.query.taskId = row.taskId
this.getPrintTable(row.taskId)
this.openPrint = true
this.title = "新购工机具验收单";
this.title = "新购工机具验收单";
},
//
print(){
@ -478,4 +552,4 @@ export default {
width: 60px !important;
margin-bottom: 10px;
}
</style>
</style>