Commit c36b446a authored by kzy's avatar kzy

Merge branch 'project1' of http://gitlab.91isoft.com:90/yangshuo/template_vue into project1

parents d64777a7 0981350b
This diff is collapsed.
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>home_logo.png"> <link rel="icon" href="<%= BASE_URL %>home_logo.png">
<link rel="stylesheet" href="//at.alicdn.com/t/font_2011217_f70ptj9y4oc.css"> <link rel="stylesheet" href="./alicdn.css">
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
</head> </head>
<body> <body>
......
...@@ -46,4 +46,11 @@ export function deleteLogical(id) { ...@@ -46,4 +46,11 @@ export function deleteLogical(id) {
method: 'delete' method: 'delete'
}) })
} }
export function getDictData(params) {
return request({
url: '/wbbaseinfo/queryDict',
method: 'get',
params
})
}
...@@ -7,6 +7,14 @@ export function listWbApply(query) { ...@@ -7,6 +7,14 @@ export function listWbApply(query) {
params: query params: query
}) })
} }
// apply_detail分页查询接口
export function detailList(query) {
return request({
url: '/wbapplydetail/queryWbApplyDetailByPagination',
method: 'get',
params: query
})
}
// 逻辑删除基础信息接口 // 逻辑删除基础信息接口
export function deleteLogical(id) { export function deleteLogical(id) {
return request({ return request({
......
...@@ -46,3 +46,12 @@ export function deleteLogical(id) { ...@@ -46,3 +46,12 @@ export function deleteLogical(id) {
method: 'delete' method: 'delete'
}) })
} }
// 导出信息接口
export function exporTable(param) {
return request({
url: '/wbchemistrybaseinfo/export',
method: 'get',
param,
responseType: 'blob'
})
}
...@@ -14,11 +14,11 @@ export function listLog(queryParams, queryMaps) { ...@@ -14,11 +14,11 @@ export function listLog(queryParams, queryMaps) {
} }
/* TODO: 用来查询单项出入库记录的废弃详情信息 */ /* TODO: 用来查询单项出入库记录的废弃详情信息 */
export function findSingleLogDetail(singleLogIdAndUser) { export function findSingleLogDetail(singleLogIdAndPn) {
return request({ return request({
url: '/wbchemistrylog/detail', url: '/wbchemistrylog/detail',
method: 'post', method: 'post',
data: singleLogIdAndUser, data: singleLogIdAndPn,
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8' 'Content-Type': 'application/json;charset=UTF-8'
} }
......
// TODO: 查询条件 (检查查询条件的类型) // TODO: 组件表单所需的所有参数(未完善类型检测)
export function BaseTableArgumentsTest(listName, loading, List, queryParams, columObj) {
this.listName = listName
this.loading = loading
this.List = List
this.queryParams = queryParams
this.columObj = columObj
}
// TODO: 以下导出皆暂时不可用,都未完善
// 查询条件 (检查查询条件的类型)
export function queryParamsType(pageNum, pageSize, pageTotal) { export function queryParamsType(pageNum, pageSize, pageTotal) {
if (typeof pageNum !== 'number' && typeof pageSize !== 'number' && typeof pageTotal !== 'number') { if (typeof pageNum !== 'number' && typeof pageSize !== 'number' && typeof pageTotal !== 'number') {
console.warn('queryParams查询参数的type类型错误!请检查后重新赋值') console.warn('queryParams查询参数的type类型错误!请检查后重新赋值')
...@@ -11,7 +21,7 @@ export function queryParamsType(pageNum, pageSize, pageTotal) { ...@@ -11,7 +21,7 @@ export function queryParamsType(pageNum, pageSize, pageTotal) {
} }
} }
// TODO: 操作选项的类型判断 // 操作选项的类型判断
export function operationType(type, label, icon, color, buttonClick, isShow) { export function operationType(type, label, icon, color, buttonClick, isShow) {
this.type = type this.type = type
this.label = label this.label = label
...@@ -23,7 +33,7 @@ export function operationType(type, label, icon, color, buttonClick, isShow) { ...@@ -23,7 +33,7 @@ export function operationType(type, label, icon, color, buttonClick, isShow) {
} }
} }
// TODO: 列的类型以及参数判断 // 列的类型以及参数判断
export function columnDataType(text, status, ownDefined, isSwitch, image, isOperation, prop, label, width, align, operation) { export function columnDataType(text, status, ownDefined, isSwitch, image, isOperation, prop, label, width, align, operation) {
this.text = text this.text = text
this.status = status this.status = status
...@@ -44,7 +54,7 @@ export function columnDataType(text, status, ownDefined, isSwitch, image, isOper ...@@ -44,7 +54,7 @@ export function columnDataType(text, status, ownDefined, isSwitch, image, isOper
} }
} }
// TODO: 组件表单所需的所有参数 // 组件表单所需的所有参数
export function BaseTableArguments(selection, loading, processList, queryParams, columnData) { export function BaseTableArguments(selection, loading, processList, queryParams, columnData) {
// TODO: 选择框是否需要存在 (selection判断表单选择框是否需要存在) // TODO: 选择框是否需要存在 (selection判断表单选择框是否需要存在)
if (typeof selection !== 'boolean') { if (typeof selection !== 'boolean') {
...@@ -60,19 +70,19 @@ export function BaseTableArguments(selection, loading, processList, queryParams, ...@@ -60,19 +70,19 @@ export function BaseTableArguments(selection, loading, processList, queryParams,
} }
} }
// TODO: 加载进度 (判断是否显示加载进度) // 加载进度 (判断是否显示加载进度)
if (typeof loading !== 'boolean') { if (typeof loading !== 'boolean') {
console.warn('loading进度条参数的type类型错误!请检查后重新赋值') console.warn('loading进度条参数的type类型错误!请检查后重新赋值')
} else { } else {
this.loading = loading this.loading = loading
} }
// TODO: 查询参数 (判断查询条件是否符合类型) // 查询参数 (判断查询条件是否符合类型)
if (queryParams instanceof queryParamsType) { if (queryParams instanceof queryParamsType) {
this.queryParams = queryParamsType this.queryParams = queryParamsType
} }
// TODO: 每一列的参数 // 每一列的参数
if (columnData instanceof columnDataType) { if (columnData instanceof columnDataType) {
this.columnData = columnData this.columnData = columnData
} }
...@@ -80,11 +90,3 @@ export function BaseTableArguments(selection, loading, processList, queryParams, ...@@ -80,11 +90,3 @@ export function BaseTableArguments(selection, loading, processList, queryParams,
this.processList = processList this.processList = processList
} }
// TODO: 组件表单所需的所有参数
export function BaseTableArgumentsTest(listName, loading, List, queryParams, columObj) {
this.listName = listName
this.loading = loading
this.List = List
this.queryParams = queryParams
this.columObj = columObj
}
...@@ -36,11 +36,12 @@ ...@@ -36,11 +36,12 @@
<!-- <el-badge :value="200" :max="99" class="item">--> <!-- <el-badge :value="200" :max="99" class="item">-->
<!-- <i class="el-icon-message-solid" />--> <!-- <i class="el-icon-message-solid" />-->
<!-- </el-badge>--> <!-- </el-badge>-->
<span class="username-text">
[您好,{{ userName }}]
</span>
<el-dropdown class="avatar-container" trigger="click"> <el-dropdown class="avatar-container" trigger="click">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<span class="username-text">
[您好,{{ userName }}]
</span>
<!-- <img :src="avatar" class="user-avatar">--> <!-- <img :src="avatar" class="user-avatar">-->
<i class="el-icon-caret-bottom" /> <i class="el-icon-caret-bottom" />
</div> </div>
...@@ -202,6 +203,10 @@ export default { ...@@ -202,6 +203,10 @@ export default {
.avatar-container { .avatar-container {
margin-right: 30px; margin-right: 30px;
.avatar-wrapper :hover{
cursor: pointer;
}
.avatar-wrapper { .avatar-wrapper {
position: relative; position: relative;
height: 40px; height: 40px;
......
...@@ -143,6 +143,7 @@ export default { ...@@ -143,6 +143,7 @@ export default {
key: 'GX_CODE' key: 'GX_CODE'
} }
getDictData(obj).then(res => { getDictData(obj).then(res => {
console.log('res', res)
if (res.code === 200 && res.data !== null) { if (res.code === 200 && res.data !== null) {
this.pissbList = res.data this.pissbList = res.data
} }
......
...@@ -13,24 +13,35 @@ ...@@ -13,24 +13,35 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="pgx" prop="pgx"> <el-form-item label="pgx" prop="pgx">
<el-input <el-select
v-model="queryParams.pgx" v-model="form.pgx"
placeholder="请输入pgx"
clearable clearable
size="small" placeholder="请选择pgx"
style="width: 150px" :style="{ width: '150px', height: '30px' }"
@keyup.enter.native="handleQuery" >
/> <el-option
v-for="(dict,index) in pgxList"
:key="index"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="prank" prop="prank"> <el-form-item label="ptype" prop="ptype">
<el-input <el-select
v-model="queryParams.prank" v-model="form.ptype"
placeholder="请输入prank" placeholder="请选择ptype"
clearable clearable
size="small" size="small"
style="width: 150px" style="width: 150px"
@keyup.enter.native="handleQuery" >
/> <el-option
v-for="dict in ptypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button> <el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
...@@ -48,7 +59,7 @@ ...@@ -48,7 +59,7 @@
</el-form> </el-form>
<div class="placeholder" /> <div class="placeholder" />
<div style="padding:5px 10px"> <div style="padding:5px 10px">
<div class="mb12 font-small-bold">设备基本信息列表</div> <div class="mb12 font-small-bold">基本信息</div>
<el-table v-loading="loading" border :data="basicInfoList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" border :data="basicInfoList" @selection-change="handleSelectionChange">
<el-table-column type="index" label="序号" width="50" /> <el-table-column type="index" label="序号" width="50" />
<el-table-column label="pn" prop="pn"> <el-table-column label="pn" prop="pn">
...@@ -58,7 +69,13 @@ ...@@ -58,7 +69,13 @@
</el-table-column> </el-table-column>
<el-table-column label="pgx" prop="pgx"> <el-table-column label="pgx" prop="pgx">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.pgx || '-' }} <span v-if="scope.row.pgx === '001'">压缩</span>
<span v-if="scope.row.pgx === '002'">排水</span>
</template>
</el-table-column>
<el-table-column label="ptype" prop="ptype">
<template slot-scope="scope">
{{ scope.row.ptype || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="prank" prop="prank"> <el-table-column label="prank" prop="prank">
...@@ -122,15 +139,49 @@ ...@@ -122,15 +139,49 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false" @close="cancel"> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false" @close="cancel">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="pn" prop="pn"> <el-form-item label="pn" prop="pn">
<el-input v-model.trim="form.pn" :maxlength="30" placeholder="请输入pn" /> <el-input
ref="input1"
v-model.trim="form.pn"
:maxlength="5"
placeholder="请输入pn"
@keyup.enter.native="handelTab(1,$event)"
/>
</el-form-item> </el-form-item>
<el-form-item label="pgx" prop="pgx"> <el-form-item label="pgx" prop="pgx">
<el-input v-model.trim="form.pgx" :maxlength="30" placeholder="请输入pgx" /> <el-select
v-model="form.pgx"
clearable
placeholder="请选择pgx"
:style="{ width: '150px', height: '30px' }"
>
<el-option
v-for="(dict,index) in pgxList"
:key="index"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="ptype" prop="ptype">
<el-select
v-model="form.ptype"
placeholder="请选择ptype"
clearable
size="small"
style="width: 150px"
>
<el-option
v-for="dict in ptypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="prank" prop="prank"> <el-form-item label="prank" prop="prank">
<el-input v-model.trim="form.prank" :maxlength="30" placeholder="请输入prank" /> <el-input v-model.trim="form.prank" :maxlength="10" placeholder="请输入prank" />
</el-form-item> </el-form-item>
<el-form-item label="pissb" prop="pissb" > <el-form-item label="pissb" prop="pissb">
<el-select <el-select
v-model="form.pissb" v-model="form.pissb"
placeholder="请选择pissb" placeholder="请选择pissb"
...@@ -147,10 +198,10 @@ ...@@ -147,10 +198,10 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="psm" prop="psm"> <el-form-item label="psm" prop="psm">
<el-input v-model.trim="form.psm" :maxlength="30" placeholder="请输入psm" /> <el-input v-model.trim="form.psm" :maxlength="10" placeholder="请输入psm" />
</el-form-item> </el-form-item>
<el-form-item label="psy" prop="psy"> <el-form-item label="psy" prop="psy">
<el-input v-model.trim="form.psy" :maxlength="30" placeholder="请输入psy" /> <el-input v-model.trim="form.psy" :maxlength="10" placeholder="请输入psy" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -164,6 +215,7 @@ ...@@ -164,6 +215,7 @@
<script> <script>
import { add, listBasicInfo, updataInfo, getDetailById, deleteLogical } from '@/api/equipment/basicInfo' import { add, listBasicInfo, updataInfo, getDetailById, deleteLogical } from '@/api/equipment/basicInfo'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { getDictData } from '@/api/equipment/application'
export default { export default {
name: 'Role', name: 'Role',
data() { data() {
...@@ -178,7 +230,7 @@ export default { ...@@ -178,7 +230,7 @@ export default {
multiple: true, multiple: true,
// 总条数 // 总条数
total: 0, total: 0,
// 角色表格数据 // 基础信息数据
basicInfoList: [], basicInfoList: [],
// 弹出层标题 // 弹出层标题
title: '', title: '',
...@@ -194,6 +246,17 @@ export default { ...@@ -194,6 +246,17 @@ export default {
menuNodeAll: false, menuNodeAll: false,
deptExpand: true, deptExpand: true,
deptNodeAll: false, deptNodeAll: false,
// ptype数据字典
ptypeOptions: [
{
dictLabel: '1',
dictValue: '1'
},
{
dictLabel: '2',
dictValue: '2'
}
],
// 状态数据字典 // 状态数据字典
statusOptions: [ statusOptions: [
{ {
...@@ -205,6 +268,8 @@ export default { ...@@ -205,6 +268,8 @@ export default {
dictValue: '0' dictValue: '0'
} }
], ],
// 数据字典
pgxList: [],
// 查询参数 // 查询参数
queryParams: { queryParams: {
page: 1, page: 1,
...@@ -223,21 +288,22 @@ export default { ...@@ -223,21 +288,22 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
pn: [ pn: [
{ required: true, message: '请输入pn', trigger: 'blur' } { required: true, message: '请输入pn', trigger: 'blur' },
{ pattern: /^\d{1,5}$/, message: '请输入少于五位数字', trigger: 'blur' }
], ],
ptype: [ ptype: [
{ required: true, message: '请输入ptype', trigger: 'blur' } { required: true, message: '请输入ptype', trigger: 'blur' }
], ],
pgx: [ pgx: [
{ required: true, message: '请输入pgx', trigger: 'blur' } { required: true, pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }
], ],
prank: [{ required: true,pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }], prank: [{ required: true, pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }],
pissb: [ pissb: [
{ required: true, message: '请输入pissb', trigger: 'blur' } { required: true, message: '请选择pissb', trigger: 'blur' }
], ],
psm: [{ required: true,pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }], psm: [{ required: true, pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }],
psy: [ psy: [
{ required: true, message: '请输入psy', trigger: 'blur' } { required: true, pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }
] ]
}, },
deptOptions: [] deptOptions: []
...@@ -260,11 +326,27 @@ export default { ...@@ -260,11 +326,27 @@ export default {
this.queryParams = { ...param } this.queryParams = { ...param }
} }
this.getList() this.getList()
this.init()
// this.getDicts(dictCons['NORMAL_DISABLE']).then(response => { // this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
// this.statusOptions = response.data; // this.statusOptions = response.data;
// }); // });
}, },
methods: { methods: {
// 初始化要调的接口
init() {
this.getDict()
},
// 回车到下一个输入框方法
handelTab(i, e) {
const that = this
if (that.$refs['input' + i]) {
that.$nextTick(() => {
e.target.blur()
const index = i + 1
that.$refs['input' + index].focus()
})
}
},
/** 查询基础信息列表 */ /** 查询基础信息列表 */
getList() { getList() {
this.loading = true this.loading = true
...@@ -360,11 +442,11 @@ export default { ...@@ -360,11 +442,11 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.open = true this.open = true
this.title = '添加设备基础信息表单' this.title = '基础信息'
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.title = '编辑基础信息表单' this.title = '基础信息'
const id = row.businessId const id = row.businessId
getDetailById(id).then(res => { getDetailById(id).then(res => {
this.form = res.data this.form = res.data
...@@ -417,6 +499,18 @@ export default { ...@@ -417,6 +499,18 @@ export default {
} }
}) })
}) })
},
// 调数据字典查询
getDict() {
const obj = {
key: 'GX_CODE'
}
getDictData(obj).then(res => {
console.log('res', res)
if (res.code === 200 && res.data !== null) {
this.pgxList = res.data
}
})
} }
} }
} }
......
This diff is collapsed.
...@@ -389,7 +389,7 @@ export default { ...@@ -389,7 +389,7 @@ export default {
that.$refs['input' + index].focus() that.$refs['input' + index].focus()
}) })
}, },
/** 查询角色列表 */ /** 查询设备列表 */
getList() { getList() {
this.loading = true this.loading = true
listdevice(this.queryParams).then( listdevice(this.queryParams).then(
......
...@@ -50,12 +50,12 @@ ...@@ -50,12 +50,12 @@
class="buttons-content" class="buttons-content"
> >
<el-checkbox v-model="loginForm.rememberMe" class="rem-code">记住密码</el-checkbox> <el-checkbox v-model="loginForm.rememberMe" class="rem-code">记住密码</el-checkbox>
<el-link <!-- <el-link-->
:underline="false" <!-- :underline="false"-->
@click="goDetail('/forgetPwd')" <!-- @click="goDetail('/forgetPwd')"-->
> <!-- >-->
<router-link to="/forgetPwd">忘记密码</router-link> <!-- <router-link to="/forgetPwd">忘记密码</router-link>-->
</el-link> <!-- </el-link>-->
</div> </div>
</div> </div>
</el-form> </el-form>
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
<el-form-item label="fq_dd:" prop="fq_dd"> <el-form-item label="fq_dd:" prop="fq_dd">
{{ singleDetails.fq_dd }} {{ singleDetails.fq_dd }}
</el-form-item> </el-form-item>
<el-form-item label="fq_mcode:" prop="fq_mcode"> <el-form-item label="fq_mcode:" prop="fq_mcode">
{{ singleDetails.fq_mcode }} {{ singleDetails.fq_mcode }}
</el-form-item> </el-form-item>
<el-form-item label="fq_yy:" prop="fq_yy"> <el-form-item label="fq_yy:" prop="fq_yy">
...@@ -480,7 +480,6 @@ export default { ...@@ -480,7 +480,6 @@ export default {
/** TODO: 重置按钮操作 */ /** TODO: 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryEntity = { this.queryEntity = {
tableSortMark: 0,
entity: { entity: {
pn: '', pn: '',
lot: '', lot: '',
...@@ -496,7 +495,7 @@ export default { ...@@ -496,7 +495,7 @@ export default {
/* TODO: 控制单项表单关闭的详情 */ /* TODO: 控制单项表单关闭的详情 */
handleClose() { handleClose() {
this.activateAbandonedState = false this.activateAbandonedState = false
this.singleLogIdAndPn= {} this.singleLogIdAndPn = {}
}, },
/* TODO: 进行排序 */ /* TODO: 进行排序 */
changeTableSort: function(val) { changeTableSort: function(val) {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button> <el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> <el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
<div style="float: right"> <div style="float: right">
<el-form-item> <el-form-item>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
@click="handleAdd" @click="handleAdd"
>新增</el-button> >新增</el-button>
<el-button <el-button
style="padding: 8px 7px;" style="padding: 8px 7px; width: 79px"
type="success" type="success"
size="small" size="small"
icon="el-icon-download" icon="el-icon-download"
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<div class="placeholder" /> <div class="placeholder" />
<!-- 表单区 --> <!-- 表单区 -->
<div style="padding:5px 10px"> <div style="padding:5px 10px">
<div class="mb12 font-small-bold">基础信息列表</div> <div class="mb12 font-small-bold">样品库</div>
<el-table v-loading="loading" border :data="basicinfoMationList"> <el-table v-loading="loading" border :data="basicinfoMationList">
<el-table-column type="index" label="序号" width="50" /> <el-table-column type="index" label="序号" width="50" />
<el-table-column label="pn" prop="pn" :show-overflow-tooltip="true"> <el-table-column label="pn" prop="pn" :show-overflow-tooltip="true">
...@@ -92,29 +92,29 @@ ...@@ -92,29 +92,29 @@
{{ parseTime(scope.row.createDate,'{y}-{m}-{d} {h}:{i}') || '-' }} {{ parseTime(scope.row.createDate,'{y}-{m}-{d} {h}:{i}') || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <!-- <el-table-column label="操作">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<el-button <!-- <el-button-->
size="mini" <!-- size="mini"-->
type="text" <!-- type="text"-->
style="color: #49cec9" <!-- style="color: #49cec9"-->
@click="handleUpdate(scope.row)" <!-- @click="handleUpdate(scope.row)"-->
>修改</el-button> <!-- >修改</el-button>-->
<!-- <el-button--> <!-- &lt;!&ndash; <el-button&ndash;&gt;-->
<!-- v-hasPermi="['sys:role:update']"--> <!-- &lt;!&ndash; v-hasPermi="['sys:role:update']"&ndash;&gt;-->
<!-- size="mini"--> <!-- &lt;!&ndash; size="mini"&ndash;&gt;-->
<!-- type="text"--> <!-- &lt;!&ndash; type="text"&ndash;&gt;-->
<!-- icon="el-icon-circle-check"--> <!-- &lt;!&ndash; icon="el-icon-circle-check"&ndash;&gt;-->
<!-- @click="handleMenu(scope.row)"--> <!-- &lt;!&ndash; @click="handleMenu(scope.row)"&ndash;&gt;-->
<!-- >数据权限</el-button>--> <!-- &lt;!&ndash; >数据权限</el-button>&ndash;&gt;-->
<el-button <!-- <el-button-->
size="mini" <!-- size="mini"-->
type="text" <!-- type="text"-->
icon="el-icon-delete" <!-- icon="el-icon-delete"-->
@click="handleDelete(scope.row)" <!-- @click="handleDelete(scope.row)"-->
>删除</el-button> <!-- >删除</el-button>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
</el-table> </el-table>
</div> </div>
<!-- 分页区--> <!-- 分页区-->
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 新增修改弹出 --> <!-- 新增修改弹出 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false" @close="cancel"> <el-dialog title="样品库信息" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false" @close="cancel">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="pn" prop="pn"> <el-form-item label="pn" prop="pn">
<el-input v-model.trim="form.pn" :maxlength="30" placeholder="请输入pn" /> <el-input v-model.trim="form.pn" :maxlength="30" placeholder="请输入pn" />
...@@ -156,8 +156,8 @@ ...@@ -156,8 +156,8 @@
</template> </template>
<script> <script>
import { queryList, add, getDetailById, updataInfo, deleteLogical } from '@/api/sample/basicInformation' import { queryList, add, getDetailById, updataInfo, deleteLogical, exporTable } from '@/api/sample/basicInformation'
import { parseTime } from "@/utils"; import { parseTime } from '@/utils'
export default { export default {
name: 'Index', name: 'Index',
...@@ -173,8 +173,7 @@ export default { ...@@ -173,8 +173,7 @@ export default {
name: [{ required: true, message: '请输入name', trigger: 'blur' }], name: [{ required: true, message: '请输入name', trigger: 'blur' }],
qty: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }], qty: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }],
maxQty: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }], maxQty: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }],
minQty: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }], minQty: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }]
unit: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }]
}, },
total: 0, total: 0,
loading: false, loading: false,
...@@ -275,7 +274,7 @@ export default { ...@@ -275,7 +274,7 @@ export default {
this.loading = true this.loading = true
queryList(this.queryParams).then(res => { queryList(this.queryParams).then(res => {
console.log('res', res) console.log('res', res)
res.rows.createDate = parseTime(res.rows.createDate,'{y}-{m}-{d}') res.rows.createDate = parseTime(res.rows.createDate, '{y}-{m}-{d}')
this.total = res.total this.total = res.total
this.basicinfoMationList = res.rows this.basicinfoMationList = res.rows
this.loading = false this.loading = false
...@@ -301,7 +300,29 @@ export default { ...@@ -301,7 +300,29 @@ export default {
this.title = '添加基础信息表单' this.title = '添加基础信息表单'
}, },
handleExport() { handleExport() {
this.$confirm('是否确认导出所有样品库记录信息?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exporTable(this.queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
// TODO: 创建下载的链接
const href = window.URL.createObjectURL(blob)
downloadElement.href = href
// TODO: 下载后文件名
downloadElement.download = '样品库记录' + '.xls'
document.body.appendChild(downloadElement)
// TODO: 点击下载
downloadElement.click()
// TODO: 下载完成移除元素
document.body.removeChild(downloadElement)
// TODO: 释放掉blob对象
window.URL.revokeObjectURL(href)
// this.download(response.msg);
})
})
} }
} }
} }
......
...@@ -27,29 +27,29 @@ ...@@ -27,29 +27,29 @@
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button> <el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> <el-button type="primary" style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
<div style="float: right"> <!-- <div style="float: right">-->
<el-form-item> <!-- <el-form-item>-->
<el-button <!-- <el-button-->
type="primary" <!-- type="primary"-->
size="small" <!-- size="small"-->
icon="el-icon-plus" <!-- icon="el-icon-plus"-->
@click="handleAdd" <!-- @click="handleAdd"-->
>新增</el-button> <!-- >新增</el-button>-->
<el-button <!-- <el-button-->
style="padding: 8px 7px;" <!-- style="padding: 8px 7px;"-->
type="success" <!-- type="success"-->
size="small" <!-- size="small"-->
icon="el-icon-download" <!-- icon="el-icon-download"-->
@click="handleExport" <!-- @click="handleExport"-->
>导出</el-button> <!-- >导出</el-button>-->
</el-form-item> <!-- </el-form-item>-->
</div> <!-- </div>-->
</el-form> </el-form>
<!-- 分割线 --> <!-- 分割线 -->
<div class="placeholder" /> <div class="placeholder" />
<!-- 表单区 --> <!-- 表单区 -->
<div style="padding:5px 10px"> <div style="padding:5px 10px">
<div class="mb12 font-small-bold">基础样式列表</div> <div class="mb12 font-small-bold">库存修正</div>
<el-table v-loading="loading" border :data="basicinfoMationList"> <el-table v-loading="loading" border :data="basicinfoMationList">
<el-table-column type="index" label="序号" width="50" /> <el-table-column type="index" label="序号" width="50" />
<el-table-column label="pn" prop="pn" :show-overflow-tooltip="true"> <el-table-column label="pn" prop="pn" :show-overflow-tooltip="true">
...@@ -67,14 +67,14 @@ ...@@ -67,14 +67,14 @@
{{ scope.row.name || '-' }} {{ scope.row.name || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="max_qty" prop="max_qty" :show-overflow-tooltip="true"> <el-table-column label="maxQty" prop="maxQty" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.max_qty || '-' }} {{ scope.row.maxQty || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="min_qty" prop="min_qty" :show-overflow-tooltip="true"> <el-table-column label="minQty" prop="minQty" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.min_qty || '-' }} {{ scope.row.minQty || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="unit" prop="unit" :show-overflow-tooltip="true"> <el-table-column label="unit" prop="unit" :show-overflow-tooltip="true">
...@@ -126,17 +126,55 @@ ...@@ -126,17 +126,55 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 新增修改弹出 --> <!-- 新增修改弹出 -->
<el-dialog title="库存修正信息" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false" @close="cancel">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="pn" prop="pn">
<el-input v-model.trim="form.pn" :maxlength="30" placeholder="请输入pn" />
</el-form-item>
<el-form-item label="name" prop="name">
<el-input v-model.trim="form.name" :maxlength="30" placeholder="请输入name" />
</el-form-item>
<el-form-item label="qty" prop="qty">
<el-input v-model.trim="form.qty" :maxlength="30" placeholder="请输入qty" />
</el-form-item>
<el-form-item label="maxQty" prop="maxQty">
<el-input v-model.trim="form.maxQty" :maxlength="30" placeholder="请输入max_qty" />
</el-form-item>
<el-form-item label="minQty" prop="minQty">
<el-input v-model.trim="form.minQty" :maxlength="30" placeholder="请输入min_qty" />
</el-form-item>
<el-form-item label="unit" prop="unit">
<el-input v-model.trim="form.unit" :maxlength="30" placeholder="请输入unit" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {queryList} from '@/api/sample/basicInformation' import { add, deleteLogical, exporTable, getDetailById, queryList, updataInfo } from '@/api/sample/basicInformation'
import { parseTime } from '@/utils'
export default { export default {
name: 'Index', name: 'Index',
data() { data() {
return { return {
title: '',
open: false,
form: {
},
rules: {
pn: [{ required: true, message: '请输入pn', trigger: 'blur' }],
name: [{ required: true, message: '请输入name', trigger: 'blur' }],
qty: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }],
maxQty: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }],
minQty: [{ pattern: /^[0-9]{1,9}(\.[0-9]{1,3})?$/, message: '仅能输入数字和小数,限制三位小数', trigger: 'change' }]
},
total: 0, total: 0,
loading: false, loading: false,
queryParams: { queryParams: {
...@@ -153,17 +191,89 @@ export default { ...@@ -153,17 +191,89 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
handleDelete() { // 清空表单
reFrom() {
this.form = {
businessId: undefined,
pn: '',
name: '',
qty: '',
maxQty: '',
minQty: '',
unit: ''
}
this.$refs.form.clearValidate()
}, },
handleUpdate() { // 提交
submitForm() {
this.$refs.form.validate((valid) => {
if (valid) {
// 校验通过,提交表单或进行其他操作
console.log('form', this.form)
if (this.form.businessId !== undefined) {
console.log('更新')
updataInfo(this.form).then(res => {
console.log('res', res)
if (res.code === 200) {
this.open = false
this.$message.success('操作成功')
this.getList()
this.reFrom()
} else if (res.code === null) {
this.$message.error(res.message)
}
})
} else {
add(this.form).then(res => {
if (res.code === 200) {
this.open = false
this.$message.success('操作成功')
this.getList()
this.reFrom()
} else if (res.code === null) {
this.$message.error(res.message)
}
})
}
} else {
// 校验失败,显示错误信息或进行其他操作
}
})
},
cancel() {
this.open = false
this.reFrom()
},
handleDelete(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
deleteLogical(id).then(res => {
console.log('res', res)
if (res.code === 200) {
this.$message.success('操作成功')
this.getList()
}
})
})
},
// 编辑
handleUpdate(row) {
const id = row.businessId
getDetailById(id).then(res => {
this.form = res.data
this.open = true
})
}, },
// 初始化获取数据 // 初始化获取数据
getList() { getList() {
this.loading = true this.loading = true
queryList(this.queryParams).then(res => { queryList(this.queryParams).then(res => {
console.log('res', res) console.log('res', res)
res.rows.createDate = parseTime(res.rows.createDate, '{y}-{m}-{d}')
this.total = res.total this.total = res.total
this.basicinfoMationList = res.rows this.basicinfoMationList = res.rows
this.loading = false this.loading = false
...@@ -185,10 +295,32 @@ export default { ...@@ -185,10 +295,32 @@ export default {
this.getList() this.getList()
}, },
handleAdd() { handleAdd() {
this.open = true
}, },
handleExport() { handleExport() {
this.$confirm('是否确认导出所有样品库记录信息?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exporTable(this.queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
// TODO: 创建下载的链接
const href = window.URL.createObjectURL(blob)
downloadElement.href = href
// TODO: 下载后文件名
downloadElement.download = '样品库记录' + '.xls'
document.body.appendChild(downloadElement)
// TODO: 点击下载
downloadElement.click()
// TODO: 下载完成移除元素
document.body.removeChild(downloadElement)
// TODO: 释放掉blob对象
window.URL.revokeObjectURL(href)
// this.download(response.msg);
})
})
} }
} }
} }
......
...@@ -138,34 +138,6 @@ ...@@ -138,34 +138,6 @@
</el-col> </el-col>
</el-row> </el-row>
<!-- TODO: 这里是 库状态为废弃时才会触发显示的模块 -->
<transition name="fade-transform" mode="out-in">
<el-row v-if=" activateAbandonedState " style="height: 160px">
<el-col :span="12">
<el-form-item label="fq_ys:" prop="fq_ys">
{{ singleDetails.fq_ys }}
</el-form-item>
<el-form-item label="fq_bz:" prop="fq_bz">
{{ singleDetails.fq_bz }}
</el-form-item>
<el-form-item label="fq_dbxi:" prop="fq_dbxi">
{{ singleDetails.fq_dbxi }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="fq_dd:" prop="fq_dd">
{{ singleDetails.fq_dd }}
</el-form-item>
<el-form-item label="fq_mcode:" :label-width="10" prop="fq_mcode">
{{ singleDetails.fq_mcode }}
</el-form-item>
<el-form-item label="fq_yy:" prop="fq_yy">
{{ singleDetails.fq_yy }}
</el-form-item>
</el-col>
</el-row>
</transition>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="操作员:" prop="userName"> <el-form-item label="操作员:" prop="userName">
...@@ -337,14 +309,13 @@ export default { ...@@ -337,14 +309,13 @@ export default {
] ]
}, },
// TODO: 表单里的单项详情参数
title: '', title: '',
openDetails: false, openDetails: false,
isReadOnly: true, isReadOnly: true,
// TODO: 表单里的单项详情参数
singleDetails: {}, singleDetails: {},
// TODO: 获取表单单项详情的参数 // TODO: 获取表单单项详情的参数
singleLogIdAndFqYs: {}, singleLogIdAndPn: {}
activateAbandonedState: false
} }
}, },
computed: { computed: {
...@@ -416,14 +387,20 @@ export default { ...@@ -416,14 +387,20 @@ export default {
}, },
/** TODO: 重置按钮操作 */ /** TODO: 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm') this.queryEntity = {
entity: {
pn: '',
lot: '',
ptype: ''
}
}
this.dateRange = []
this.handleQuery() this.handleQuery()
}, },
/* TODO: 控制单项表单关闭的详情 */ /* TODO: 控制单项表单关闭的详情 */
handleClose() { handleClose() {
this.activateAbandonedState = false this.singleLogIdAndPn = {}
this.singleLogIdAndFqYs = {}
}, },
/* TODO: 进行排序 */ /* TODO: 进行排序 */
changeTableSort: function(val) { changeTableSort: function(val) {
...@@ -444,25 +421,13 @@ export default { ...@@ -444,25 +421,13 @@ export default {
this.singleDetails = { ...row } this.singleDetails = { ...row }
} else { } else {
/* TODO: 设置单项详情的查询的条件 */ /* TODO: 设置单项详情的查询的条件 */
this.singleLogIdAndFqYs['businessId'] = row.businessId this.singleLogIdAndPn['businessId'] = row.businessId
this.singleLogIdAndPn['pn'] = row.pn
this.singleLogIdAndFqYs['fqYs'] = row.fqYs /* TODO: 进行单项详情的查询 */
/* TODO: 进行查询,如果返回的code为200,则表示返回的值成功 */ findSingleLogDetail(this.singleLogIdAndPn).then(
findSingleLogDetail(this.singleLogIdAndFqYs).then(
response => { response => {
if (response.code === 200) { this.title = '记录详情'
this.singleDetails = Object.assign({}, response.data, { ...row }) this.singleDetails = Object.assign({}, response.data, { ...row })
/* TODO: 如果库状态==='4' 并且返回的状态码为200的时候,才会将可变的详情字段设置为true,去激活并打开 */
this.activateAbandonedState = true
} else {
/* TODO: 如果状态码不对则不会激活可变字段,只会对普通字段进行赋值,并且抛出错误信息response.message */
this.$message({
showClose: true,
message: response.message,
type: 'warning'
})
this.singleDetails = { ...row }
}
} }
) )
} }
......
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