综合查询在用可以点击查看编码设备

This commit is contained in:
liang.chao 2024-11-20 14:51:15 +08:00
parent 38a7bc7336
commit 4fcd53e0e9
6 changed files with 151 additions and 15 deletions

View File

@ -40,6 +40,9 @@ public class MaType extends BaseEntity {
/** 规格型号 */ /** 规格型号 */
@ApiModelProperty(value = "机具编码") @ApiModelProperty(value = "机具编码")
private String maCode; private String maCode;
/** 工程名称 */
@ApiModelProperty(value = "工程名称")
private String proName;
/** 类型ID */ /** 类型ID */
@ApiModelProperty(value = "类型ID,用作组织树筛选") @ApiModelProperty(value = "类型ID,用作组织树筛选")

View File

@ -70,5 +70,15 @@ public class StorageStatusController extends BaseController {
List<MaType> list = storageStatusMapper.getMaCodeList(bean); List<MaType> list = storageStatusMapper.getMaCodeList(bean);
return AjaxResult.success(getDataTable(list)); return AjaxResult.success(getDataTable(list));
} }
/**
* 查询机具编码
*/
@ApiOperation(value = "综合查询--查询在用设备详情")
@GetMapping("/getUserRecords")
public AjaxResult getUserRecords(StorageStatus bean) {
startPage();
List<MaType> list = storageStatusMapper.getUserRecords(bean);
return AjaxResult.success(getDataTable(list));
}
} }

View File

@ -23,4 +23,6 @@ public interface StorageStatusMapper {
List<StorageStatus> getStorageStatusList(StorageStatus bean); List<StorageStatus> getStorageStatusList(StorageStatus bean);
List<MaType> getMaCodeList(StorageStatus bean); List<MaType> getMaCodeList(StorageStatus bean);
List<MaType> getUserRecords(StorageStatus bean);
} }

View File

@ -185,4 +185,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and mm.ma_code like concat('%',#{maCode},'%') and mm.ma_code like concat('%',#{maCode},'%')
</if> </if>
</select> </select>
<select id="getUserRecords" resultType="com.bonus.sgzb.base.api.domain.MaType">
SELECT
bpl.lot_name proName,
mt.type_name modelName,
mt2.type_name typeName,
mm.ma_code
FROM
slt_agreement_info sai
LEFT JOIN bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id
LEFT JOIN ma_type mt on mt.type_id = sai.type_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
LEFT JOIN ma_machine mm on mm.ma_id = sai.ma_id
WHERE
sai.type_id = #{typeId}
AND sai.end_time IS NULL
AND sai.back_id IS NULL
</select>
</mapper> </mapper>

View File

@ -54,6 +54,14 @@ export function getUseMaCode(query) {
params: query params: query
}) })
} }
// 获取 在用机具设备
export function getUserRecords(query) {
return request({
url: '/material/storageStatus/getUserRecords',
method: 'get',
params: query
})
}

View File

@ -166,6 +166,7 @@
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- manageType '编码' 使用可点击的 span -->
<span <span
v-if="scope.row.manageType === '编码'" v-if="scope.row.manageType === '编码'"
class="clickText" class="clickText"
@ -184,7 +185,14 @@
align="center" align="center"
prop="usNum" prop="usNum"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> >
<template slot-scope="scope">
<span
class="clickText"
@click="openUserRecords(scope.row)"
>{{ scope.row.usNum }}</span>
</template>
</el-table-column>
<el-table-column <el-table-column
label="在修数量" label="在修数量"
align="center" align="center"
@ -232,7 +240,7 @@
:page-sizes="[5, 10, 15, 20, 30]" :page-sizes="[5, 10, 15, 20, 30]"
@pagination="getList" @pagination="getList"
/> />
<!-- 编码设备弹窗--> <!-- 编码设备弹窗-->
<el-dialog <el-dialog
:title="title" :title="title"
:visible.sync="openRecord" :visible.sync="openRecord"
@ -252,7 +260,7 @@
v-model="dialogQuery.maCode" v-model="dialogQuery.maCode"
placeholder="请输入机具编码" placeholder="请输入机具编码"
clearable clearable
:maxlength="20" :maxlength="30"
style="width: 240px" style="width: 240px"
@keyup.enter.native="handleDialogQuery" @keyup.enter.native="handleDialogQuery"
/> />
@ -265,12 +273,6 @@
size="mini" size="mini"
@click="handleDialogQuery" @click="handleDialogQuery"
>查询</el-button> >查询</el-button>
<!-- <el-button
icon="el-icon-refresh"
size="mini"
@click="resetDialogQuery"
>重置</el-button>-->
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -282,11 +284,6 @@
type="index" type="index"
:index="indexContinuation(dialogQuery.pageNum, dialogQuery.pageSize)" :index="indexContinuation(dialogQuery.pageNum, dialogQuery.pageSize)"
> >
<!-- <template slot-scope="scope">
<span>{{
(dialogQuery.pageNum - 1) * 10 + scope.$index + 1
}}</span>
</template> -->
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="类型名称" label="类型名称"
@ -316,6 +313,87 @@
@pagination="getUseMaCodeList" @pagination="getUseMaCodeList"
/> />
</el-dialog> </el-dialog>
<!-- 在用编码设备弹窗-->
<el-dialog
:title="title"
:visible.sync="openUseRecord"
width="1200px"
append-to-body
>
<!-- <el-form
:model="dialogQuery"
ref="dialogQuery"
size="small"
:inline="true"
label-width="80px"
>
<el-form-item label="机具编码" prop="maCode">
<el-input
v-model="dialogQuery.maCode"
placeholder="请输入机具编码"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleDialogQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleDialogQuery"
>查询</el-button>
</el-form-item>
</el-form>-->
<el-table v-loading="loading" :data="UserRecords">
<el-table-column
label="序号"
align="center"
width="80"
type="index"
:index="indexContinuation(dialogQuery.pageNum, dialogQuery.pageSize)"
>
</el-table-column>
<el-table-column
label="类型名称"
align="center"
prop="typeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="modelName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="编码"
align="center"
prop="maCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="所在工程"
align="center"
prop="proName"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="dialogTotal > 0"
:total="dialogTotal"
:page.sync="dialogQuery.pageNum"
:limit.sync="dialogQuery.pageSize"
@pagination="getUserRecords"
/>
</el-dialog>
</div> </div>
</template> </template>
@ -325,6 +403,7 @@ import {
exportList, exportList,
getUnitData,getUseMaCode, getUnitData,getUseMaCode,
getProData, getTypeKeeper, getProData, getTypeKeeper,
getUserRecords,
} from '@/api/stquery/deviceStatusRecord' } from '@/api/stquery/deviceStatusRecord'
import {getRecords} from "@/api/claimAndRefund/secondStore"; import {getRecords} from "@/api/claimAndRefund/secondStore";
@ -369,6 +448,7 @@ export default {
}, },
// //
openRecord: false, openRecord: false,
openUseRecord: false,
dialogQuery: { dialogQuery: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
@ -376,7 +456,8 @@ export default {
maCode: undefined, maCode: undefined,
}, },
unitList: [], // unitList: [], //
dialogList: [], dialogList: [], //
UserRecords: [], //
keepIdList: [], //id keepIdList: [], //id
proList: [], // proList: [], //
dialogTotal: 0, dialogTotal: 0,
@ -499,6 +580,13 @@ export default {
this.dialogQuery.typeId= row.typeId this.dialogQuery.typeId= row.typeId
this.getUseMaCodeList() this.getUseMaCodeList()
}, },
//
openUserRecords(row) {
this.openUseRecord = true
this.dialogQuery.typeId= row.typeId
this.getUserRecords()
},
/** 查询编码机具列表 */ /** 查询编码机具列表 */
getUseMaCodeList() { getUseMaCodeList() {
getUseMaCode(this.dialogQuery).then((response) => { getUseMaCode(this.dialogQuery).then((response) => {
@ -506,6 +594,13 @@ export default {
this.dialogTotal = response.data.total this.dialogTotal = response.data.total
}) })
}, },
/** 查询在用设备列表 */
getUserRecords() {
getUserRecords(this.dialogQuery).then((response) => {
this.UserRecords = response.data.rows
this.dialogTotal = response.data.total
})
},
// //
/* mergeRow ({ row, column, rowIndex, columnIndex}) { /* mergeRow ({ row, column, rowIndex, columnIndex}) {
if (rowIndex == 0) { if (rowIndex == 0) {