Commit 3028bd87 authored by 罗林杰's avatar 罗林杰

增加盘点功能

parent 5d4df410
import request from '@/utils/request'
import Qs from 'qs'
// import da from "element-ui/src/locale/lang/da";
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询仪器管理列表
export function listInsStrumentInfo(query) {
return request({
url: '/insstrumentinfo/list', method: 'get', params: query
})
}
// 2. 查询仪器管理详细信息
export function getInsStrumentInfo(businessId) {
return request({
url: '/insstrumentinfo/detail/' + businessId, method: 'get'
})
}
// 3. 新增仪器管理
export function addInsStrumentInfo(data) {
return request({
url: '/insstrumentinfo/add', method: 'post', data: data, headers: { 'content-type': 'application/json' }
})
}
// 4. 修改仪器管理
export function updateInsStrumentInfo(data) {
const businessId = data.businessId
return request({
url: '/insstrumentinfo/update/' + businessId, method: 'put', data, headers: { 'content-type': 'application/json' }
})
}
// 5. 逻辑删除仪器管理
export function delInsStrumentInfo(businessId) {
return request({
url: '/insstrumentinfo/deleteLogical/' + businessId, method: 'delete'
})
}
// 6. 导出仪器管理
export function exportInsStrumentInfo(query) {
return request({
url: '/insstrumentinfo/export', method: 'get', params: query, responseType: 'blob'
})
}
// 7. 获取echarts图表数据
export function getEchartsData(query) {
return request({
url: '/insstrumentinfo/echarts/pie', method: 'get', params: query
})
}
// 审批驳回操作
export function rejectStrumentInfo(data, status) {
data = Qs.stringify(data)
return request({
url: '/insstrumentinfo/batch/' + status, method: 'put', data
})
}
// 审批通过操作
export function approveStrumentInfo(data, status) {
data = Qs.stringify(data)
return request({
url: '/insstrumentinfo/batch/' + status, method: 'put', data
})
}
// 添加备份数据
export function insertBackup(data) {
data = Qs.stringify(data)
return request({
url: '/insstrumentinfo/addBackup', method: 'post', data: data
})
}
// 校验数据库是否存在相同的管理编号
export function isExistsSameInsCode(insCode, businessId) {
return request({
url: '/insstrumentinfo/isExists/' + insCode + '?businessId=' + businessId, method: 'get'
})
}
// 返回最新的管理编号
export function generateInsCode(insCode) {
return request({
url: '/insstrumentinfo/generate/' + insCode, method: 'get'
})
}
// 获取各设备待审批数量
export function getAllAssetNum() {
return request({
url: '/insstrumentinfo/getAssetNum', method: 'get'
})
}
export function getHistoryInfo(query) {
return request({
url: '/insstrumentinfo/history', method: 'get', params: query
})
}
export function addInstrumentFile(data) {
data = Qs.stringify(data)
return request({
url: '/insstrumentinfo/addInstrumentFile', method: 'post', data: data
})
}
export function updateInstrumentFile(data) {
data = Qs.stringify(data)
return request({
url: '/insstrumentinfo/updateInstrumentFile', method: 'post', data: data
})
}
export function uploadImages(query) {
return request({
url: '/insstrumentinfo/uploadImages', params: query, responseType: 'blob'
})
}
export function getStatistics() {
return request({
url: '/insstrumentinfo/getStatistics', method: 'get'
})
}
export function getPendingStats() {
return request({
url: '/insstrumentinfo/getPendingStats', method: 'get'
})
}
// 查询总列表
export function findAll(query) {
return request({
url: '/insstrumentinfo/listAll',
method: 'get',
params: query
})
}
// 查询仪器管理总列表
export function getInsNameList(query) {
return request({
url: '/insstrumentinfo/getInsNameList',
method: 'get',
params: query
})
}
// 查询用户列表
export function getUserList(query) {
return request({
url: '/insstrumentinfo/listUser',
method: 'get',
params: query
})
}
export function addInventoryPd(data) {
return request({
url: '/insstrumentinfo/addInventoryPd', method: 'post', data: data, headers: { 'content-type': 'application/json' }
})
}
export function listInventoryPd(query) {
return request({
url: '/insstrumentinfo/findInventoryPd', method: 'get', params: query
})
}
export function getInventoryPdDetail(query) {
return request({
url: '/insstrumentinfo/findInventoryPdDetail', method: 'get', params: query
})
}
export function delInventoryPd(query) {
return request({
url: '/insstrumentinfo/deleteInventoryPd', method: 'get', params: query
})
}
...@@ -94,6 +94,27 @@ export const constantRoutes = [ ...@@ -94,6 +94,27 @@ export const constantRoutes = [
meta: { title: '欢迎', icon: 'dashboard' } meta: { title: '欢迎', icon: 'dashboard' }
}, },
// { // {
// path: '/inventory/detail',
// component: () => import('@/views/inventory/detail.vue'),
// name: 'detail',
// hidden: true,
// meta: { title: '盘点', icon: 'dashboard' }
// },
{
path: '/inventorys',
component: Layout,
hidden: true,
children: [
{
path: '/inventorys/detail',
component: () => import('@/views/inventory/detail.vue'),
name: 'detail',
hidden: true,
meta: { title: '盘点', icon: 'dashboard' }
}
]
}
// {
// path: '/dict', // path: '/dict',
// component: Layout, // component: Layout,
// hidden: true, // hidden: true,
......
...@@ -43,6 +43,10 @@ const deviceField = { ...@@ -43,6 +43,10 @@ const deviceField = {
{ dictLabel: '3' }, { dictLabel: '3' },
{ dictLabel: '6' }, { dictLabel: '6' },
{ dictLabel: '12' } { dictLabel: '12' }
],
statusList: [
{ dictValue: '0', dictLabel: '进行中' },
{ dictValue: '1', dictLabel: '已完成' }
] ]
} }
export default deviceField export default deviceField
<template>
<div class="app-container">
<div>
<el-row :gutter="20" type="flex" justify="center">
<el-col :span="12">
<el-button class="submitBtn" type="primary" :loading="isStarting" @click="startInventory">
<span>开始盘点</span>
</el-button>
</el-col>
<el-col :span="6">
<el-button class="submitBtn" type="primary" :loading="isEnding" @click="endInventory">
<span>结束盘点</span>
</el-button>
</el-col>
</el-row>
<!-- 新增统计数据展示 -->
<div class="padding">
<el-row style="margin-top: 20px;">
<el-col :span="24">
<div class="statistics">
<p>待盘: {{ this.pendingCount }}</p>
</div>
</el-col>
<el-col :span="24">
<div class="statistics">
<p>已盘:{{ this.completedCount }}</p>
</div>
</el-col>
</el-row>
</div>
<div slot="footer" class="dialog-footer">
<div class="padding">
<el-button class="submitBtn" type="primary" @click="handleInfo">
<span>查看盘点</span>
</el-button>
</div>
</div>
</div>
<!-- 设备详情对话框-->
<el-dialog
title="盘点详情"
:close-on-click-modal="true"
:visible.sync="infoOpen"
width="1700px"
append-to-body
@close="infoWinCancel"
>
<el-table :row-style="rowStyle" border :data="detailList" max-height="450">
<el-table-column type="index" label="序号" fixed="left" width="75" align="center" />
<el-table-column label="管理编号" width="140" prop="insCode" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.insCode || '-' }}
</template>
</el-table-column>
<el-table-column label="仪器名称" prop="insName" width="140" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.insName || '-' }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="detailTotal>0"
:total="detailTotal"
:page.sync="detailQueryParams.page"
:limit.sync="detailQueryParams.rows"
layout="total, prev, pager, next"
@pagination="getInventoryPdDetail(id)"
/>
</el-dialog>
</div>
</template>
<script>
import { getInventoryPdDetail } from '@/api/instrument/instrument'
import commonField from '@/utils/commonField'
import deviceField from '@/utils/device/deviceField'
export default {
name: 'Instrument',
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// 仪器管理表格数据
insStrumentInfoList: [],
// 详细表格数据
detailList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 是否显示详情弹出层
infoOpen: false,
// 盘点弹出层标题
inventoryTitle: '',
inventoryOpen: false,
// 管理字典
insManageList: {},
completedCount:0,
pendingCount:0,
// 类型字典
insTypeList: {},
// 日期范围
dateRange: [],
id: '',
// 查询参数
queryParams: {
page: 1,
rows: 10,
pdCode: undefined,
userName: undefined
},
detailTotal: 0,
detailQueryParams: {
page: 1,
rows: 10,
pdId: undefined,
insCode: undefined
},
// 表单参数
form: {},
// 表单校验
fileFakeList: [],
fileList: [],
dialogImageUrl: '',
dialogVisible: false
}
},
computed: {
themeType() {
return localStorage.getItem('theme')
},
commonField() {
return commonField
},
deviceField() {
return deviceField
}
},
created() {
this.id = this.$route.query.businessId;
this.getInventoryPdDetail(this.id)
},
methods: {
// 详情窗口关闭
infoWinCancel() {
this.infoOpen = false
},
/** 详情按钮操作 */
handleInfo() {
this.infoOpen = true
},
getInventoryPdDetail(id) {
this.detailQueryParams.pdId = id
getInventoryPdDetail(this.detailQueryParams).then(response => {
this.detailList = response.rows
this.detailTotal = response.total
this.detailQueryParams.page = response.pageNu
this.detailQueryParams.rows = response.pageSize
this.countStatus()
})
},
endInventory(){
this.$confirm('确定结束盘点吗?', '结束盘点', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.back()
})
},
countStatus() {
this.completedCount = this.detailList.filter(item => item.pdStatus === '0').length;
this.pendingCount = this.detailList.filter(item => item.pdStatus === '1').length;
},
// 根据状态控制当前行的颜色
changeColor({ row, rowIndex }) {
if (row.pdStatus === '1') {
return {
background: 'orange'
}
}
},
// 结合有效期和悬停的样式
rowStyle({ row, rowIndex }) {
const style = this.changeColor({ row, rowIndex })
return Object.assign({}, style)
}
}
}
</script>
<style lang="scss" scoped>
.app-container {
font-size: 18px;
padding: 0;
.placeholder {
height: 1.3vh;
background-color: #F4F4F4;
margin-bottom: 10px
}
}
.table-operate-column {
display: flex;
align-items: center;
}
.table-operate-column .upload-btn-box {
margin-left: auto;
width: 30px;
margin-right: 3px;
}
.table-operate-column .info-btn-box {
margin-right: auto;
width: 30px;
margin-left: 3px;
}
.padding {
padding-left: 50px; /* 设置左边的间距 */
padding-top: 50px;
}
</style>
<template>
<div class="app-container">
<div v-if="themeType === '8'" class="tableTitle">设备盘点</div>
<div style="padding:5px 10px">
<el-table v-loading="loading" border :data="insStrumentInfoList">
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="编号" width="150" prop="insCode" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.pdCode || '-' }}
</template>
</el-table-column>
<el-table-column label="创建时间" width="200" prop="insJdrq" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm:ss' ) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" class-name="small-padding fixed-width" width="60px">
<template slot-scope="scope">
<div class="download-btn-box">
<el-button
:class="commonField.updateClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleInventory(scope.row)"
>盘点
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<!-- 设备详情对话框-->
<el-dialog
title="盘点详情"
:close-on-click-modal="true"
:visible.sync="infoOpen"
width="1700px"
append-to-body
@close="infoWinCancel"
>
<el-table v-loading="loading" :row-style="rowStyle" border :data="detailList" max-height="450">
<el-table-column type="index" label="序号" fixed="left" width="75" align="center" />
<el-table-column label="管理编号" width="140" prop="insCode" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.insCode || '-' }}
</template>
</el-table-column>
<el-table-column label="仪器名称" prop="insName" width="140" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.insName || '-' }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="detailTotal>0"
:total="detailTotal"
:page.sync="detailQueryParams.page"
:limit.sync="detailQueryParams.rows"
layout="total, prev, pager, next"
@pagination="getInventoryPdDetail(id)"
/>
</el-dialog>
<el-dialog :visible.sync="inventoryOpen" :close-on-click-modal="true" width="1700px" append-to-body @close="infoWinCancel">
<el-row>
<el-col :span="6">
<el-button class="submitBtn" type="primary">
<span>开始盘点</span>
</el-button>
</el-col>
<el-col :span="18">
<el-button class="submitBtn" type="primary">
<span>结束盘点</span>
</el-button>
</el-col>
</el-row>
<!-- 新增统计数据展示 -->
<el-row style="margin-top: 20px;">
<el-col :span="12">
<div class="statistics">
<p><strong>待盘:</strong> {{ pendingCount }}</p>
</div>
</el-col>
<el-col :span="12">
<div class="statistics">
<p><strong>已盘:</strong> {{ completedCount }}</p>
</div>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button class="submitBtn" type="primary" @click="handleInfo">查看盘点</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
delInventoryPd,
getInventoryPdDetail, listInventoryPd
} from '@/api/instrument/instrument'
import commonField from '@/utils/commonField'
import deviceField from '@/utils/device/deviceField'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
import { getDict } from '@/api/system/dict/data'
import inventory from "@/views/inventory/index.vue";
export default {
name: 'Instrument',
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// 仪器管理表格数据
insStrumentInfoList: [],
// 详细表格数据
detailList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 是否显示详情弹出层
infoOpen: false,
// 盘点弹出层标题
inventoryTitle: '',
inventoryOpen: false,
// 管理字典
insManageList: {},
// 类型字典
insTypeList: {},
// 日期范围
dateRange: [],
id: '',
// 查询参数
queryParams: {
page: 1,
rows: 10,
pdCode: undefined,
userName: undefined
},
detailTotal: 0,
detailQueryParams: {
page: 1,
rows: 10,
pdId: undefined,
insCode: undefined
},
// 表单参数
form: {},
// 表单校验
rules: {
insValidDate: [
{ required: true, message: '有效期不能为空', trigger: 'blur' }
]
},
fileFakeList: [],
fileList: [],
dialogImageUrl: '',
dialogVisible: false
}
},
computed: {
themeType() {
return localStorage.getItem('theme')
},
commonField() {
return commonField
},
deviceField() {
return deviceField
}
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
this.queryParams.dateRange = this.dateRange
setDataCache(this.$route.path, this.queryParams)
next()
},
created() {
if (getDataCache(this.$route.path) === '{}') {
this.queryParams.insCategory = '1'
} else {
this.queryParams = JSON.parse(getDataCache(this.$route.path)) // 获取存储的筛选项
}
this.getInsType()// 仪器类型
this.getInsManageList()// 仪器管理
this.getList() // 列表查询
},
methods: {
/** 查询设备管理列表 */
getList() {
this.queryParams.peCode = '1'
this.loading = true
listInventoryPd(this.queryParams).then(response => {
this.insStrumentInfoList = response.rows
this.total = response.total
this.loading = false
}
)
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 详情窗口关闭
infoWinCancel() {
this.infoOpen = false
this.reset()
this.detailList = []
this.detailQueryParams.pdId = undefined
},
/** 盘点按钮操作 */
handleInventory(row) {
this.$router.push({
path: '/inventorys/detail',
query: { businessId: row.businessId } // 将 businessId 作为查询参数传递
});
},
// 表单重置
reset() {
this.form = {
businessId: undefined,
insCode: undefined,
insType: undefined,
insName: undefined,
insFactoryCode: undefined,
insCategory: undefined,
insModel: undefined,
insAccuracy: undefined,
insFactory: undefined,
insLc: undefined,
insTrdate: undefined,
insAddress: undefined,
insDd: undefined,
insLb: undefined,
insZq: undefined,
remarks: undefined,
insJdff: undefined,
insValidDate: undefined,
insJdrq: undefined,
insZsOssId: undefined,
insStatus: undefined,
insSureUser: undefined,
insSureDate: undefined,
insSureStatus: undefined,
insSureRemark: undefined,
flag: '1'
}
},
/** 查询按钮操作 */
handleQuery() {
this.queryParams.page = 1
this.getList()
},
handleDetailQuery() {
this.detailQueryParams.page = 1
this.getInventoryPdDetail(this.id)
},
resetDetailQuery() {
this.detailQueryParams = {
page: 1,
rows: 10,
insCode: undefined
}
this.handleDetailQuery()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.queryParams = {
page: 1,
rows: 10,
insCode: undefined,
insType: undefined,
insName: undefined,
insFactoryCode: undefined,
insCategory: undefined,
insModel: undefined,
insAccuracy: undefined,
insFactory: undefined,
insLc: undefined,
insTrdate: undefined,
insAddress: undefined,
insDd: undefined,
insLb: undefined,
insZq: undefined,
insJdff: undefined,
insValidDate: undefined,
insJdrq: undefined,
insZsOssId: undefined,
insStatus: undefined,
insSureUser: undefined,
insSureDate: undefined,
insSureStatus: undefined,
insSureRemark: undefined,
flag: ''
}
this.handleQuery()
},
/** 详情按钮操作 */
handleInfo() {
this.reset() // 重置表单
this.getInventoryPdDetail(this.id)
},
getInventoryPdDetail(id) {
this.detailQueryParams.pdId = id
getInventoryPdDetail(this.detailQueryParams).then(response => {
this.infoOpen = true
this.detailList = response.rows
this.detailTotal = response.total
this.detailQueryParams.page = response.pageNu
this.detailQueryParams.rows = response.pageSize
})
},
// 获取管理字典
getInsManageList() {
getDict('INS_MANAGE').then(result => {
this.insManageList = result.data
})
},
// 获取类型字典
getInsType() {
getDict('INS_TYPE').then(result => {
this.insTypeList = result.data
})
},
// 根据状态控制当前行的颜色
changeColor({ row, rowIndex }) {
if (row.pdStatus === '1') {
return {
background: 'orange'
}
}
},
// 结合有效期和悬停的样式
rowStyle({ row, rowIndex }) {
const style = this.changeColor({ row, rowIndex })
return Object.assign({}, style)
}
}
}
</script>
<style lang="scss" scoped>
.app-container {
font-size: 18px;
padding: 0;
.placeholder {
height: 1.3vh;
background-color: #F4F4F4;
margin-bottom: 10px
}
}
.table-operate-column {
display: flex;
align-items: center;
}
.table-operate-column .upload-btn-box {
margin-left: auto;
width: 30px;
margin-right: 3px;
}
.table-operate-column .info-btn-box {
margin-right: auto;
width: 30px;
margin-left: 3px;
}
</style>
<template>
<div @keyup.enter="handleQuery" style="display: flex; flex-direction: column; height: 78vh;">
<el-form ref="queryForm" :model="queryParams" :inline="true"
style="border-bottom: 1px solid #dcdcdc;">
<el-form-item label="编号" prop="insCode" style="padding-left: 10px">
<el-input
v-model="queryParams.businessId"
placeholder="请输入编号"
clearable
autofocus
:maxlength="30"
size="small"
style="width: 120px;"
/>
<el-button
style="width: 75px;margin-left: 0"
:class="commonField.queryClass"
:type="commonField.typePrimary"
:icon="commonField.queryIcon"
:size="commonField.smallSize"
@click="handleQuery"
>查询
</el-button>
<el-button
style="width: 75px;margin-left: 0"
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetQuery"
>重置
</el-button>
</el-form-item>
<div style="float: right"/>
</el-form>
<div class="scrollable-form">
<el-form ref="formRef" :model="form" size="small" label-width="90px" style="flex: 1;">
<!-- 管理编号和仪器名称 -->
<el-row>
<el-form-item label="管理:" prop="insCode">
<span>{{ form.insManage }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="类型:" prop="insType">
<template v-for="dict in insTypeList">
{{ form.insType === dict.dictValue ? dict.dictLabel : '' }}
</template>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="管理编号:" prop="insCode">
<span>{{ form.insCode }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="所属部门:" prop="deptName">
<span>{{ form.deptName }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="投入日期:" prop="insTrdate">
<span>{{ form.insTrdate | transformDateByFormat('yyyy-MM-DD') }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="使用地点:" prop="insAddress">
<span>{{ form.insAddress }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="负责人:" prop="insDd">
<span>{{ form.insDd }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="仪器名称:" prop="insName">
<span>{{ form.insName }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="生产厂家:" prop="insFactory">
<span>{{ form.insFactory }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="型号:" prop="insModel">
<span>{{ form.insModel }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="出厂编号:" prop="insFactoryCode">
<span>{{ form.insFactoryCode }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="一般量程:" prop="insLc">
<span>{{ form.insLc }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="精度:" prop="insAccuracy">
<span>{{ form.insAccuracy }}</span>
</el-form-item>
</el-row>
<el-row :span="24">
<el-form-item label="实物:" prop="insImplementation">
<div class="photo-wall" v-if="fileFakeList.length > 0">
<el-carousel height="150px" style="width: 150px;" indicator-position="none">
<el-carousel-item v-for="(item, index) in fileFakeList" >
<el-image
@click="handlePreview(item)"
:key="index"
:src="item.url"
:teleported="true"
style="width: 150px; height: 150px;"
fit="cover"
/>
</el-carousel-item>
</el-carousel>
</div>
</el-form-item>
</el-row>
<el-row :span="24">
<el-form-item label="参照物:" prop="file">
<div class="photo-wall" v-if="fileList.length > 0">
<el-carousel height="150px" style="width: 150px;" indicator-position="none">
<el-carousel-item v-for="(item, index) in fileList">
<el-image
@click="handlePreview(item)"
:key="index"
:src="item.url"
z-index="2000"
style="width: 150px; height: 150px;"
fit="cover"
/>
</el-carousel-item>
</el-carousel>
</div>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="检定方法:" prop="insJdff">
<span>
<template v-for="dict in deviceField.jdffList">
{{ form.insJdff === dict.dictValue ? dict.dictLabel : '' }}
</template>
</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="检定周期:" prop="insZq">
<span>
<template v-for="dict in deviceField.zqList">
{{ form.insZq === dict.dictValue ? dict.dictLabel : '' }}
</template>
</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="有效期:" prop="insValidDate">
<span>{{ form.insValidDate | transformDateByFormat('yyyy-MM-DD') }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="检定日期:" prop="insJdrq">
<span>{{ form.insJdrq | transformDateByFormat('yyyy-MM-DD') }}</span>
</el-form-item>
</el-row>
<el-row :span="24">
<el-form-item label="等级:" prop="insLb">
<span>
<template v-for="dict in deviceField.insLbList">
{{ form.insLb === dict.dictValue ? dict.dictLabel : '' }}
</template>
</span>
</el-form-item>
</el-row>
<el-row :span="24">
<el-form-item label="备注:" prop="remarks">
<span>{{ form.remarks }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="创建人:" prop="createBy">
<span>{{ form.createUsername }}</span>
</el-form-item>
</el-row>
<el-row :span="12">
<el-form-item label="创建时间:" prop="createDate">
<span>{{ form.createDate }}</span>
</el-form-item>
</el-row>
</el-form>
</div>
<el-dialog :visible.sync="dialogVisible" :close-on-click-modal="true">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import commonField from "@/utils/commonField";
import {getInsStrumentInfo} from "@/api/query/query";
import {getDict} from "@/api/system/dict/data";
import deviceField from "@/utils/device/deviceField";
export default {
name: "index",
data() {
return {
dialogVisible: false,
dialogImageUrl: '',
// 管理字典
insManageList: {},
// 类型字典
insTypeList: {},
// 参照物列表
fileList: [],
// 实物列表
fileFakeList: [],
// 查询参数
queryParams: {
businessId: '',
},
// 表单参数
form: {
businessId: '',
insCode: '',
insType: '',
insName: '',
insFactoryCode: '',
insCategory: '',
insModel: '',
insAccuracy: '',
insFactory: '',
insLc: '',
insTrdate: '',
insAddress: '',
insDd: '',
insLb: '',
insZq: '',
remarks: '',
insJdff: '',
insValidDate: '',
insJdrq: '',
insZsOssId: '',
insStatus: '',
insSureUser: '',
insSureDate: '',
insSureStatus: '',
insSureRemark: '',
insManage: '',
insDeptId: '',
deptName: '',
createDate: '',
createUsername: '',
flag: '1'
}
}
},
computed: {
commonField() {
return commonField
},
deviceField() {
return deviceField
}
},
created() {
this.getInsManageList()
this.getInsType()// 获取类型字典
},
methods: {
handlePreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
query() {
if (this.queryParams.businessId === '') {
return
}
getInsStrumentInfo(this.queryParams.businessId).then(response => {
this.form = response.data
this.fileList = response.data.filelist.filter(fileItem => {
return fileItem.insFileType === '2'
})
this.fileList.forEach(fileItem => {
fileItem.instrumentId = this.form.businessId
})
this.fileFakeList = response.data.filelist.filter(fileItem => {
return fileItem.insFileType === '1'
})
this.fileFakeList.forEach(fileItem => {
fileItem.instrumentId = this.form.businessId
})
})
},
/** 查询按钮操作 */
handleQuery() {
this.query() // 列表查询
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
businessId: '',
}
// 参照物列表
this.fileList = []
// 实物列表
this.fileFakeList = []
this.form = {}
},
// 获取管理字典
getInsManageList() {
getDict('INS_MANAGE').then(result => {
this.insManageList = result.data
})
},
// 获取类型字典
getInsType() {
getDict('INS_TYPE').then(result => {
this.insTypeList = result.data
})
},
}
}
</script>
<style scoped>
.scrollable-form {
overflow-y: auto;
border: 1px solid #dcdcdc;
padding: 10px;
flex: 1;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment