Merge branch 'dev-nx' of http://192.168.0.56:3000/bonus/devicesmgt into dev-nx

This commit is contained in:
BianLzhaoMin 2024-06-24 14:29:27 +08:00
commit f590286a09
18 changed files with 1254 additions and 12 deletions

View File

@ -221,5 +221,9 @@ public class MaMachine extends BaseEntity {
@ApiModelProperty(value = "1二维码绑定标识 2rfid绑定标识")
private Integer flag;
/** 1.机具仓储 2.调试仓储 */
private String maType;
private String maTypeName;
}

View File

@ -153,4 +153,9 @@ public class Constants
*/
public static final String privateKey = "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKNPuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gAkM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWowcSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99EcvDQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthhYhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3UP8iWi1Qw0Y=";
/** 机具设备分公司*/
public static final String JJ = "机具设备分公司";
/** 调试分公司*/
public static final String TS = "调试分公司";
}

View File

@ -139,6 +139,7 @@ public interface TmTaskMapper {
int getDeptId(String createBy);
List<TmTask> getLeaseOutListByjjbz(TmTask task);
List<TmTask> getLeaseOutListByAdmin(TmTask task);
int updateLeaseAuditListByOne(TmTask task);

View File

@ -598,7 +598,9 @@ public class TmTaskServiceImpl implements TmTaskService {
@Override
public List<TmTask> getLeaseOutListByUser(TmTask task) {
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
if (roles.contains("jjbz") || roles.contains("fbz")) {
if (roles.contains("admin")){
return tmTaskMapper.getLeaseOutListByAdmin(task);
} else if (roles.contains("jjbz") || roles.contains("fbz")) {
//机具班长和副班长可以出库机具设备
return tmTaskMapper.getLeaseOutListByjjbz(task);
} else {

View File

@ -11,6 +11,7 @@ import com.bonus.sgzb.base.mapper.MaMachineMapper;
import com.bonus.sgzb.base.mapper.MaPropInfoMapper;
import com.bonus.sgzb.base.mapper.MaTypeMapper;
import com.bonus.sgzb.base.service.MaMachineService;
import com.bonus.sgzb.common.core.constant.Constants;
import com.bonus.sgzb.common.core.exception.ServiceException;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import org.springframework.stereotype.Service;
@ -38,6 +39,12 @@ public class MaMachineServiceImpl implements MaMachineService {
@Override
public List<MaMachine> getMaMachine(MaMachine maMachine) {
if (maMachine.getMaType() != null && ("1").equals(maMachine.getMaType())) {
maMachine.setMaTypeName(Constants.JJ);
}
if (maMachine.getMaType() != null && ("2").equals(maMachine.getMaType())) {
maMachine.setMaTypeName(Constants.TS);
}
return maMachineMapper.getMaMachine(maMachine);
}

View File

@ -1059,9 +1059,7 @@
LEFT JOIN lease_apply_details lad on lai.id = lad.parennt_id
LEFT JOIN ma_type_keeper mtk on lad.type_id = mtk.type_id
WHERE tt.task_status in(33,34,35)
<if test="userId != 1">
and mtk.user_id = #{userId}
</if>
and mtk.user_id = #{userId}
<if test="code != null and code != ''">
and tt.code like concat('%', #{code}, '%')
</if>
@ -1292,4 +1290,48 @@
</if>
GROUP BY lad.type_id
</select>
<select id="getLeaseOutListByAdmin" resultType="com.bonus.sgzb.app.domain.TmTask">
SELECT
tt.*,
lai.id AS id,
bpl.lot_id AS proId,
bpl.lot_name AS proName,
bui.unit_id AS unitId,
bui.unit_name AS unitName,
lai.lease_person AS leasePerson,
lai.phone AS leasePhone,
tt.create_by AS applyFor,
d.`name` AS taskName,
lai.lease_type AS leaseType,
d.id AS examineStatusId,
bai.agreement_code AS agreementCode,
tt.create_time AS createTimes,
IFNULL(sum(lad.pre_num),0) as preCountNum,
IFNULL(sum(lad.al_num),0) as alNum,
tt.update_time AS updateTimes
from
lease_apply_info lai
LEFT JOIN tm_task tt on lai.task_id = tt.task_id
LEFT JOIN sys_dic d ON d.id = tt.task_status
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN lease_apply_details lad on lai.id = lad.parennt_id
WHERE tt.task_status in(33,34,35)
<if test="code != null and code != ''">
and tt.code like concat('%', #{code}, '%')
</if>
<if test="unitId != null">
and bui.unit_id = #{unitId}
</if>
<if test="proId != null">
and bpl.lot_id = #{proId}
</if>
<if test="taskStatus != null">
and tt.task_status = #{taskStatus}
</if>
GROUP BY lai.id
ORDER BY tt.task_status,tt.create_time desc
</select>
</mapper>

View File

@ -48,10 +48,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_type mt on m.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
left join ma_type mt2 on mt1.parent_id = mt2.type_id
LEFT JOIN sys_dept sd ON sd.dept_id = mt.company_id
left join ma_label_bind mmb on m.ma_id = mmb.ma_id and m.type_id = mmb.type_id
left join ma_prop_set mps on mt.type_id = mps.type_id
left join ma_house_info mhi on m.own_house = mhi.house_id
<where>
<if test="maTypeName!=null and maTypeName != ''">
AND sd.dept_name = #{maTypeName}
</if>
<if test="maId != null and maId != ''">
AND ma_id = #{maId}
</if>

View File

@ -203,4 +203,9 @@ public class StorageStatus {
@ApiModelProperty(value = "装备管理方式名称")
private String manageTypeName;
/** 1.机具仓储 2.调试仓储 */
private String maType;
private String maTypeName;
}

View File

@ -1,10 +1,8 @@
package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.material.domain.ProjUsingRecord;
import com.bonus.sgzb.common.core.constant.Constants;
import com.bonus.sgzb.material.domain.StorageStatus;
import com.bonus.sgzb.material.mapper.ProjUsingRecordMapper;
import com.bonus.sgzb.material.mapper.StorageStatusMapper;
import com.bonus.sgzb.material.service.ProjUsingRecordService;
import com.bonus.sgzb.material.service.StorageStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -24,6 +22,12 @@ public class StorageStatusServiceImpl implements StorageStatusService {
@Override
public List<StorageStatus> getStorageStatusList(StorageStatus bean) {
if (bean.getMaType() != null && ("1").equals(bean.getMaType())) {
bean.setMaTypeName(Constants.JJ);
}
if (bean.getMaType() != null && ("2").equals(bean.getMaType())) {
bean.setMaTypeName(Constants.TS);
}
return storageStatusMapper.getStorageStatusList(bean);
}
}

View File

@ -86,8 +86,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and tt.task_status !=107 and tt.task_status !=106
GROUP BY mt.type_id) AS subquery4 ON subquery4.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
LEFT JOIN sys_dept sd ON sd.dept_id = mt.company_id
WHERE mt.`level` = 4
and mt.del_flag = '0'
<if test="maTypeName!=null and maTypeName != ''">
AND sd.dept_name = #{maTypeName}
</if>
<if test="typeName != null and typeName != ''">
and mt2.type_name like concat('%',#{typeName},'%')
</if>

View File

@ -140,4 +140,6 @@ public interface SysUserMapper
List<SysUser> selectUserByEm();
List<SysUser> selectUserByDm();
void updatePurchaseNoticePerson(SysUser user);
}

View File

@ -328,6 +328,7 @@ public class SysUserServiceImpl implements ISysUserService {
//表示属于分公司下的某个部门
user.setCompanyId(Long.parseLong(split[2]));
}
userMapper.updatePurchaseNoticePerson(user);
return userMapper.updateUser(user);
}

View File

@ -342,8 +342,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="resetUserPwd" parameterType="com.bonus.sgzb.system.api.domain.SysUser">
update sys_user set password = #{password} where user_name = #{userName}
</update>
<delete id="deleteUserById" parameterType="Long">
<update id="updatePurchaseNoticePerson">
update purchase_notice_person set telphone = #{phonenumber} where user_id = #{userId}
</update>
<delete id="deleteUserById" parameterType="Long">
update sys_user set del_flag = '2' where user_id = #{userId}
</delete>

View File

@ -1,7 +1,7 @@
module.exports = {
tabWidth: 4,
semi: false,
vueIndentScriptAndStyle: true,
vueIndentScriptAndStyle: false,
singleQuote: true,
trailingComma: 'all',
proseWrap: 'never',

View File

@ -165,12 +165,12 @@
prop="repairInputNum"
:show-overflow-tooltip="true"
/>
<el-table-column
<!-- <el-table-column
label="新购待入库"
align="center"
prop="inputNum"
:show-overflow-tooltip="true"
/>
/> -->
<el-table-column
label="总保有量"
align="center"
@ -265,6 +265,7 @@ export default {
endTime:this.queryParams.time && this.queryParams.time[1], */
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
maType: '1'
}
const res = await statusList(params)

View File

@ -0,0 +1,348 @@
<template>
<div class="app-container" id="backRecord">
<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="往来单位">
<el-select v-model="queryParams.unitId" clearable @change="GetProData" style="width: 240px" placeholder="请选择">
<el-option
v-for="item in unitList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="工程名称">
<el-select v-model="queryParams.proId" clearable @change="GetUnitData" style="width: 240px" placeholder="请选择">
<el-option
v-for="item in proList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="协议号" prop="agreementCode">
<el-input
v-model="queryParams.agreementCode"
placeholder="请输入协议号"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item label="机具名称" prop="typeName">
<el-input
v-model="queryParams.typeName"
placeholder="请输入机具名称"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规格型号" prop="typeModelName">
<el-input
v-model="queryParams.typeModelName"
placeholder="请输入规格型号"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
:maxlength="20"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>查询</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
<span style="margin-left: 20px; color: red"
>保有量=在库+在用+在修+修试后待入库</span
>
</el-form-item>
</el-form>
<!-- <el-col :span="1.5">
</el-col> -->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
<el-table v-loading="loading" :data="leaseAuditList">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
/>
<el-table-column
label="机具名称"
align="center"
prop="typeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="typeModelName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="单位"
align="center"
prop="unit"
:show-overflow-tooltip="true"
/>
<el-table-column
label="在库数量"
align="center"
prop="num"
:show-overflow-tooltip="true"
/>
<el-table-column
label="在用数量"
align="center"
prop="usNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="在修数量"
align="center"
prop="repairNum"
:show-overflow-tooltip="true"
/>
<el-table-column
label="修试后待入库"
align="center"
prop="repairInputNum"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column
label="新购待入库"
align="center"
prop="inputNum"
:show-overflow-tooltip="true"
/> -->
<el-table-column
label="总保有量"
align="center"
prop="allNum"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column label="总保有量资产(万元)" align="center" prop="proName" :show-overflow-tooltip="true" /> -->
<el-table-column
label="是否计数"
align="center"
prop="manageType"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page-sizes="[5, 10, 15, 20, 30]"
@pagination="getList"
/>
</div>
</template>
<script>
import {
statusList,
exportList,
getUnitData,
getProData,
} from '@/api/stquery/deviceStatusRecord'
export default {
name: 'backRecord',
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
leaseAuditList: [],
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined,
time: null, //
unitId: null, //id
proId: null, //id
types: 1, // 1 2
},
unitList: [], //
proList: [], //
}
},
created() {
this.getList()
/* this.getUnitList();
this.getProList(); */
},
methods: {
//
async getList() {
this.loading = true
const params = {
/* unitId:this.queryParams.unitId,
proId:this.queryParams.proId,
keyWord:this.queryParams.keyWord,
agreementCode:this.queryParams.agreementCode, */
typeName: this.queryParams.typeName,
typeModelName: this.queryParams.typeModelName,
/* startTime:this.queryParams.time && this.queryParams.time[0],
endTime:this.queryParams.time && this.queryParams.time[1], */
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
maType: '2',
}
const res = await statusList(params)
console.log('机具状态', res)
this.loading = false
this.leaseAuditList = res.data.rows
this.total = res.data.total
},
//
async getUnitList() {
const params = {
id: this.queryParams.proId,
}
const res = await getUnitData(params)
this.unitList = res.data
console.log('GetUnitData ======================', res)
},
//
async getProList() {
const params = {
id: this.queryParams.unitId,
}
const res = await getProData(params)
this.proList = res.data
console.log('GetProData ======================', res)
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = []
this.resetForm('queryForm')
this.handleQuery()
},
/** 导出按钮操作 */
handleExport() {
this.download(
'material/backRecord/export',
{
...this.queryParams,
},
`综合查询_退料记录_${new Date().getTime()}.xlsx`,
)
},
//
/* mergeRow ({ row, column, rowIndex, columnIndex}) {
if (rowIndex == 0) {
return {
rowspan: 3,
colspan: 1
}
}
} */
},
}
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,808 @@
<template>
<!-- 编码设备管理 -->
<div class="app-container" id="devices">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物品种类" prop="itemId">
<el-select
v-model="queryParams.itemId"
placeholder="请选择物品种类"
clearable
filterable
style="width: 240px"
@change="selectItem"
>
<el-option
v-for="typeItem in itemList"
:key="typeItem.typeId"
:label="typeItem.typeName"
:value="typeItem.typeId"
/>
</el-select>
</el-form-item>
<el-form-item label="设备类型" prop="deviceId">
<el-select
v-model="queryParams.deviceId"
placeholder="请选择设备类型"
clearable
filterable
style="width: 240px"
:disabled="!queryParams.itemId"
@change="selectDevice"
>
<el-option
v-for="typeItem in typeList"
:key="typeItem.typeId"
:label="typeItem.typeName"
:value="typeItem.typeId"
/>
</el-select>
</el-form-item>
<el-form-item label="规格型号" prop="typeId">
<el-select
v-model="queryParams.typeId"
placeholder="请选择规格型号"
clearable
filterable
:disabled="!queryParams.deviceId"
style="width: 240px"
>
<el-option
v-for="model in modelList"
:key="model.typeId"
:label="model.typeName"
:value="model.typeId"
/>
</el-select>
</el-form-item>
<el-form-item label="资产属性" prop="propId">
<el-select
v-model="queryParams.propId"
clearable
filterable
placeholder="请选择资产属性"
>
<el-option
v-for="keeper in propList"
:key="keeper.propId"
:label="keeper.propName"
:value="keeper.propId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['machinery:debug:export']"
>导出</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="devicesList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
/>
<el-table-column label="物品种类" align="center" prop="itemType" />
<el-table-column
label="设备类型"
align="center"
prop="deviceType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="specificationType"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="设备编码"
align="center"
prop="maCode"
width="200"
/>
<el-table-column
label="采购单号"
align="center"
prop="buyTask"
width="180"
/>
<el-table-column
label="设备状态"
align="center"
prop="maStatusName"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_normal_disable"
:value="scope.row.maStatusName"
/>
</template>
</el-table-column>
<el-table-column
label="固定资产编号"
align="center"
prop="assetsCode"
/>
<el-table-column label="设备原编号" align="center" prop="preCode" />
<el-table-column
label="二维码"
align="center"
prop="qrCode"
width="120"
>
<template slot-scope="scope">
<span
style="color: blue; cursor: pointer"
@click="showQrCode(scope.row)"
>
{{ scope.row.qrCode }}</span
>
</template>
</el-table-column>
<el-table-column
label="所在仓库"
align="center"
prop="ownHouseName"
/>
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
label="操作"
align="center"
width="150"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['machinery:debug:edit']"
>编辑</el-button
>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['machinery:debug:del']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="1000px"
append-to-body
:close-on-click-modal="false"
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="100px"
>
<el-row>
<el-col :span="8">
<el-form-item label="物品种类" prop="itemType">
<el-input
v-model="form.itemType"
placeholder="请输入物品种类"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备类型" prop="deviceType">
<el-input
v-model="form.deviceType"
placeholder="请输入设备类型"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="规格型号" prop="specificationType">
<el-input
v-model="form.specificationType"
placeholder="请输入规格型号"
disabled
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="设备编号" prop="maCode">
<el-input
v-model="form.maCode"
placeholder="请输入设备编号"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备状态" prop="maStatusName">
<el-input
v-model="form.maStatusName"
placeholder="请输入设备状态"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="二维码编号">
<el-input v-model="form.qrCode" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="采购单号" prop="buyTask">
<el-input
v-model="form.buyTask"
placeholder="请输入采购单号"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备原编号" prop="preCode">
<el-input
v-model="form.preCode"
placeholder="请输入设备原编号"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="固定资产编号" prop="assetsCode">
<el-input
v-model="form.assetsCode"
placeholder="请输入固定资产编号"
maxlength="50"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="所在仓库" prop="ownHouse">
<treeselect
v-model="form.ownHouse"
:options="deptOptions"
placeholder="请选择所在仓库"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出入库次数" prop="inOutNum">
<el-input
v-model="form.inOutNum"
placeholder="请输入出入库次数"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产属性" prop="propId">
<el-select
v-model="form.propId"
filterable
placeholder="请选择资产属性"
>
<el-option
label="请选择"
:value="0"
></el-option>
<el-option
v-for="keeper in propList"
:key="keeper.propId"
:label="keeper.propName"
:value="keeper.propId"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="本次检验人员" prop="checkMan">
<el-input
v-model="form.checkMan"
placeholder="请输入本次检验人员"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="本次检验时间" prop="thisCheckTime">
<el-date-picker
v-model="form.thisCheckTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="本次检验时间"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="下次检验时间" prop="nextCheckTime">
<el-date-picker
v-model="form.nextCheckTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="下次检验时间"
></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="出厂时间" prop="outFacTime">
<el-date-picker
v-model="form.outFacTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="出厂时间"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出厂编号" prop="outFacCode">
<el-input
v-model="form.outFacCode"
placeholder="请输入出厂编号"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="厂家" prop="maVender">
<el-select
v-model="form.maVender"
placeholder="机具厂家"
clearable
filterable
style="width: 180px"
>
<el-option
v-for="item in supplierList"
:key="item.supplierId"
:label="item.supplier"
:value="item.supplierId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
type="textarea"
placeholder=""
maxlength="150"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<!-- <el-col :span="8">
<el-form-item label="维修员" prop="dictName">
<el-input v-model="form.dictName" placeholder="" />
</el-form-item>
</el-col> -->
</el-row>
<!-- <el-form-item label="状态" prop="status">-->
<!-- <el-radio-group v-model="form.status">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.sys_normal_disable"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog
:title="title"
:visible.sync="uploadOpen"
width="500px"
append-to-body
>
<div style="text-align: center">
<div class="uploadImg">
<div id="qrcode" class="qrcode" ref="codeItem"></div>
<!-- <img src="" alt="">-->
</div>
<div class="maCode">二维码编号{{ rowObj.qrCode }}</div>
</div>
<div slot="footer" class="dialog-footer" style="text-align: center">
<!-- <el-button type="primary" @click="downloadCode"> </el-button> -->
</div>
</el-dialog>
</div>
</template>
<script>
import {
addMachine,
delMachine,
getMachine,
listMachine,
updateMachine,
supplierInfoList,
getListByMaType,
} from '@/api/store/tools'
import { getProLists } from '@/api/base/base'
import { imgUpLoad } from '@/api/system/upload'
import { getTypeList } from '@/api/store/warehousing'
import { listHouseTree } from '@/api/store/shelves'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import QRCode from 'qrcodejs2'
export default {
name: 'Devices',
dicts: ['sys_normal_disable'],
components: { Treeselect },
data() {
return {
//
loading: true,
//
ids: [],
//
propList: null,
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
devicesList: [],
//
title: '',
uploadOpen: false,
qrCode: '',
qrUrl: this.globalUrl.qrUrl,
rowObj: {},
//
open: false,
//
dateRange: [],
supplierList: [],
itemList: [],
typeList: [],
modelList: [],
deptOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '',
itemId: '',
deviceId: '',
typeId: '',
propId: '',
maType: '2',
// dictName: undefined,
// dictType: undefined,
// status: undefined
},
//
form: {},
//
rules: {
dictName: [
{
required: true,
message: '字典名称不能为空',
trigger: 'blur',
},
],
dictType: [
{
required: true,
message: '字典类型不能为空',
trigger: 'blur',
},
],
},
}
},
created() {
this.getList()
this.getPropData()
this.getTypeList()
this.supplierInfoList()
this.getHouseTree()
},
methods: {
/** 查询仓库下拉树结构 */
getHouseTree() {
listHouseTree().then((response) => {
this.deptOptions = response.data
})
},
//
supplierInfoList() {
supplierInfoList().then((response) => {
this.supplierList = response.rows
})
},
//
getTypeList() {
getTypeList({ level: '2' }).then((response) => {
this.itemList = response.data
})
// getTypeList({ level: '3' }).then((response) => {
// this.typeList = response.data
// })
// getTypeList({ level: '4' }).then((response) => {
// this.modelList = response.data
// })
},
//
selectItem(id) {
console.log(id)
this.queryParams.deviceId = ''
this.queryParams.typeId = ''
getListByMaType({ typeId: id }).then((response) => {
this.typeList = response.data
})
},
//
selectDevice(id) {
console.log(id)
this.queryParams.typeId = ''
getListByMaType({ typeId: id }).then((response) => {
this.modelList = response.data
})
},
/** 查询资产属性下拉 */
getPropData() {
getProLists().then((response) => {
this.propList = response.rows
})
},
/** 查询列表 */
getList() {
this.loading = true
this.queryParams.beginTime = this.dateRange[0]
this.queryParams.endTime = this.dateRange[1]
listMachine(this.queryParams).then((response) => {
this.devicesList = response.rows
// this.devicesList[0].qrCode = "11212asdasd"
this.total = response.total
this.loading = false
})
},
showQrCode(row) {
console.log(row)
if (row.qrCode == null) {
this.$message.error('当前设备没有二维码')
return
}
// this.labelCodeName = ''
this.rowObj = row
this.uploadOpen = true
this.title = '二维码查看'
this.qrCode = row.qrCode
let str = this.qrUrl + row.qrCode
this.$nextTick(() => {
this.$refs.codeItem.innerHTML = ''
var qrcode = new QRCode(this.$refs.codeItem, {
text: str, //
width: 256,
height: 256,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H,
})
}, 500)
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
maId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.typeList = []
this.modelList = []
this.resetForm('queryForm')
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '新建'
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.maId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const maId = row.maId || this.ids
getMachine(maId).then((response) => {
this.form = response.data
this.open = true
this.title = '编辑'
})
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.maId != undefined) {
updateMachine(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addMachine(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const maIds = row.maId
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return delMachine(maIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/dict/type/export', {
// ...this.queryParams
// }, `type_${new Date().getTime()}.xlsx`)
},
},
}
</script>
<style lang="scss" scoped>
.uploadImg {
display: flex;
align-items: center;
justify-content: center;
}
.maCode {
margin-top: 15px;
font-size: 18px;
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
</style>

View File

@ -580,6 +580,7 @@ export default {
deviceId: '',
typeId: '',
propId: '',
maType: '1',
// dictName: undefined,
// dictType: undefined,
// status: undefined