move coreEquipment
@ -82,7 +82,7 @@
|
||||
|
||||
<script>
|
||||
import { getAccessToken } from '@/utils/auth';
|
||||
import defaultBg from '../../../../../assets/images/default-file-icon.png';
|
||||
import defaultBg from '../../../../assets/images/default-file-icon.png';
|
||||
|
||||
function checkSize(file, message) {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
@ -139,56 +139,7 @@ export default {
|
||||
headers: { Authorization: 'Bearer ' + getAccessToken() }, // 设置上传的请求头部
|
||||
fileList: [],
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload',
|
||||
files: [
|
||||
// 服务器返回的结构
|
||||
// {
|
||||
// fileName: 'sf.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://hbimg.b0.upaiyun.com/cc7475787bd08ed926b68eaf53fa1f2c5473259115e3c-gJdObd_fw658',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'sddf.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl: 'https://img0.sc115.com/wm/xqx/pic1/1501xofo4ssolji.jpg',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'jjj.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://www.mms591.com/www.mms591.com-photo/2013081823/1-130QR34544.jpg',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'asdfasdf.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://hbimg.b0.upaiyun.com/8f6bced5f2e38d3a021b2c48d5a98dfb6317e3e12c6a0-QmhJ5v_fw658',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'asdkj.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://www.mms591.com/www.mms591.com-photo/2013013021/1-130130212034.jpg',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'lkasjdf.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://www.mms591.com/www.mms591.com-photo/2013072122/1-130H1223057.jpg',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'asdf.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://img.1ppt.com/uploads/allimg/1212/1-1212101ZH5A2.jpg',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'afdffff.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://www.mms591.com/www.mms591.com-photo/2013051721/1-13051H11945.jpg',
|
||||
// },
|
||||
],
|
||||
files: [],
|
||||
updateTimer: null,
|
||||
};
|
||||
},
|
||||
@ -414,7 +365,7 @@ export default {
|
||||
}
|
||||
|
||||
.default-icon {
|
||||
background: url(../../../../../assets/images/default-file-icon.png) no-repeat;
|
||||
background: url(../../../../assets/images/default-file-icon.png) no-repeat;
|
||||
background-position: center;
|
||||
background-size: 64px;
|
||||
}
|
@ -6,150 +6,105 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form
|
||||
class="equipment-info-form"
|
||||
ref="form"
|
||||
:model="form"
|
||||
label-width="200px"
|
||||
label-position="top"
|
||||
<el-form class="equipment-info-form" ref="form" :model="form" label-width="200px" label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="设备名称"
|
||||
prop="name"
|
||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入设备名称"></el-input>
|
||||
<el-form-item label="设备名称" prop="name" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="form.name" :disabled="disabled" placeholder="请输入设备名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备编码" prop="code" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入设备编码"></el-input>
|
||||
<el-input v-model="form.code" :disabled="disabled" placeholder="请输入设备编码"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="英文名称" prop="enName" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.enName"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入英文名称"></el-input>
|
||||
<el-input v-model="form.enName" :disabled="disabled" placeholder="请输入英文名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="缩写" prop="abbr" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.abbr"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入名称缩写"></el-input>
|
||||
<el-input v-model="form.abbr" :disabled="disabled" placeholder="请输入名称缩写"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备类型" prop="equipmentTypeId" :rules="[]">
|
||||
<el-select
|
||||
v-model="form.equipmentTypeId"
|
||||
:disabled="disabled"
|
||||
filterable
|
||||
placeholder="请选择设备类型">
|
||||
<el-option
|
||||
v-for="eqType in eqTypeList"
|
||||
:key="eqType.id"
|
||||
:label="eqType.name"
|
||||
<el-form-item label="设备类型" prop="equipmentTypeId"
|
||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="form.equipmentTypeId" :disabled="disabled" filterable placeholder="请选择设备类型">
|
||||
<el-option v-for="eqType in eqTypeList" :key="eqType.id" :label="eqType.name"
|
||||
:value="eqType.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入备注"></el-input>
|
||||
<el-form-item label="预计生产时间(min/天)" prop="workTime" :rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input v-model="form.workTime" :disabled="disabled" placeholder="请输入预计生产时间"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产日期" prop="productionTime" :rules="[]">
|
||||
<el-date-picker
|
||||
v-model="form.enterTime"
|
||||
:disabled="disabled"
|
||||
type="datetime"
|
||||
placeholder="请选择生产日期"
|
||||
<el-date-picker v-model="form.enterTime" :disabled="disabled" type="datetime" placeholder="请选择生产日期"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="进场日期" prop="enterTime" :rules="[]">
|
||||
<el-date-picker
|
||||
v-model="form.enterTime"
|
||||
:disabled="disabled"
|
||||
type="datetime"
|
||||
placeholder="请选择进场日期"
|
||||
<el-date-picker v-model="form.enterTime" :disabled="disabled" type="datetime" placeholder="请选择进场日期"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="设备TT值"
|
||||
prop="tvalue"
|
||||
:rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.tvalue"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入设备TT值"></el-input>
|
||||
<el-form-item label="设备TT值" prop="tvalue" :rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input v-model="form.tvalue" :disabled="disabled" placeholder="请输入设备TT值"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="产品加工时间(s)"
|
||||
prop="processingTime"
|
||||
:rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.processingTime"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入产品加工时间"></el-input>
|
||||
<el-form-item label="产品加工时间(s)" prop="processingTime" :rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input v-model="form.processingTime" :disabled="disabled" placeholder="请输入产品加工时间"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="制造商" prop="manufacturer" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.manufacturer"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入制造商"></el-input>
|
||||
<el-input v-model="form.manufacturer" :disabled="disabled" placeholder="请输入制造商"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备规格" prop="spec" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.spec"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入设备规格"></el-input>
|
||||
<el-input v-model="form.spec" :disabled="disabled" placeholder="请输入设备规格"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -157,14 +112,19 @@
|
||||
<!-- 功能描述 -->
|
||||
<el-col>
|
||||
<el-form-item label="功能描述" prop="description" :rules="[]">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:disabled="disabled"
|
||||
v-model="form.description"
|
||||
<el-input type="textarea" :disabled="disabled" v-model="form.description"
|
||||
placeholder="请填写功能描述"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<!-- 功能描述 -->
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark" :rules="[]">
|
||||
<el-input v-model="form.remark" :disabled="disabled" placeholder="请输入备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<!-- 上传资料 -->
|
||||
<el-col>
|
||||
@ -177,10 +137,7 @@
|
||||
<!-- 上传图片 -->
|
||||
<el-col>
|
||||
<el-form-item label="上传图片" prop="pics" :rules="[]">
|
||||
<AssetsUpload
|
||||
:is-pic-mode="true"
|
||||
v-model="form.pics"
|
||||
:disabled="disabled" />
|
||||
<AssetsUpload :is-pic-mode="true" v-model="form.pics" :disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -229,6 +186,7 @@ export default {
|
||||
equipmentTypeId: '',
|
||||
remark: '',
|
||||
productionTime: '',
|
||||
workTime: '',
|
||||
enterTime: '',
|
||||
tvalue: '',
|
||||
processingTime: '',
|
||||
@ -305,16 +263,9 @@ export default {
|
||||
return response.data;
|
||||
},
|
||||
// 上传成功的特殊处理
|
||||
beforeUpload() {},
|
||||
beforeUpload() { },
|
||||
// 上传前的验证规则可通过 bind 属性传入
|
||||
handleUploadSuccess(response, file, fileList) {
|
||||
console.log(
|
||||
'[dialogForm:handleUploadSuccess]',
|
||||
response,
|
||||
file,
|
||||
fileList,
|
||||
this.form
|
||||
);
|
||||
// 保存原始文件名
|
||||
if ('fileNames' in this.form) this.form.fileNames.push(file.name);
|
||||
// 保存完整地址
|
@ -1,61 +1,29 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
width="60%"
|
||||
<base-dialog :dialogTitle="title" :dialogVisible="open" @close="cancel" @cancel="cancel" width="60%"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
key="index-dialog-form"
|
||||
ref="form"
|
||||
label-position="top"
|
||||
size="small"
|
||||
:dataForm="form"
|
||||
<DialogForm v-if="open" key="index-dialog-form" ref="form" label-position="top" size="small" :dataForm="form"
|
||||
:rows="computedRows" />
|
||||
</base-dialog>
|
||||
|
||||
<!-- 设备 详情 - 编辑 -->
|
||||
<EquipmentDrawer
|
||||
v-if="editVisible"
|
||||
ref="drawer"
|
||||
:mode="editMode"
|
||||
@update-mode="editMode = $event"
|
||||
:data-id="form.id"
|
||||
:sections="[
|
||||
<EquipmentDrawer v-if="editVisible" ref="drawer" :mode="editMode" @update-mode="editMode = $event"
|
||||
:data-id="form.id" :sections="[
|
||||
{
|
||||
name: '基本信息',
|
||||
key: 'base',
|
||||
@ -69,36 +37,33 @@
|
||||
name: '属性列表',
|
||||
key: 'attrs',
|
||||
props: drawerListProps,
|
||||
url: '/base/equipment-attr/page',
|
||||
urlCreate: '/base/equipment-attr/create',
|
||||
urlUpdate: '/base/equipment-attr/update',
|
||||
urlDelete: '/base/equipment-attr/delete',
|
||||
urlDetail: '/base/equipment-attr/get',
|
||||
url: '/base/core-equipment-attr/page',
|
||||
urlCreate: '/base/core-equipment-attr/create',
|
||||
urlUpdate: '/base/core-equipment-attr/update',
|
||||
urlDelete: '/base/core-equipment-attr/delete',
|
||||
urlDetail: '/base/core-equipment-attr/get',
|
||||
queryParams: {
|
||||
equipmentId: form.id,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:equipment-attr:update')
|
||||
this.$auth.hasPermi('base:core-equipment-attr:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:equipment-attr:delete')
|
||||
this.$auth.hasPermi('base:core-equipment-attr:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
allowAdd: true,
|
||||
},
|
||||
]"
|
||||
@refreshDataList="getList"
|
||||
@cancel="cancelEdit"
|
||||
@destroy="cancelEdit" />
|
||||
]" @refreshDataList="getList" @cancel="cancelEdit" @destroy="cancelEdit" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -129,23 +94,23 @@ export default {
|
||||
return {
|
||||
searchBarKeys: ['name', 'code'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:equipment:update`)
|
||||
this.$auth.hasPermi(`base:core-equipment:update`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:equipment:update')
|
||||
this.$auth.hasPermi('base:core-equipment:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:equipment:delete')
|
||||
this.$auth.hasPermi('base:core-equipment:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
@ -211,14 +176,14 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:equipment:export') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:core-equipment:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:equipment:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:core-equipment:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
@ -268,17 +233,31 @@ export default {
|
||||
label: '设备类型',
|
||||
prop: 'equipmentTypeId',
|
||||
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
bind: {
|
||||
filterable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '预计生产时间(min/天)',
|
||||
prop: 'workTime',
|
||||
rules: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// select: true,
|
||||
// label: '设备分组',
|
||||
// prop: 'groupId',
|
||||
// url: '/base/equipment-group/page?pageNo=1&pageSize=100',
|
||||
// url: '/base/core-equipment-group/page?pageNo=1&pageSize=100',
|
||||
// },
|
||||
{ input: true, label: '备注', prop: 'remark' },
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -309,7 +288,7 @@ export default {
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '产品加工时间(s)',
|
||||
label: '产品加工时间(s)',
|
||||
prop: 'processingTime',
|
||||
rules: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
@ -330,7 +309,7 @@ export default {
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '设备规格',
|
||||
label: '规格描述',
|
||||
prop: 'spec',
|
||||
},
|
||||
],
|
||||
@ -342,6 +321,9 @@ export default {
|
||||
prop: 'description',
|
||||
},
|
||||
],
|
||||
[
|
||||
{ input: true, label: '备注', prop: 'remark' }
|
||||
]
|
||||
// [
|
||||
// {
|
||||
// assetUpload: true,
|
||||
@ -453,36 +435,36 @@ export default {
|
||||
computedRows() {
|
||||
return this.showUploadComponents
|
||||
? [
|
||||
...this.rows,
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-assets', // 用于区分不同的上传组件
|
||||
label: '上传资料',
|
||||
fieldName: 'assets',
|
||||
subcomponent: AssetsUpload,
|
||||
prop: 'uploadedAssets',
|
||||
default: [],
|
||||
bind: {
|
||||
'is-pic-mode': false,
|
||||
},
|
||||
...this.rows,
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-assets', // 用于区分不同的上传组件
|
||||
label: '上传资料',
|
||||
fieldName: 'assets',
|
||||
subcomponent: AssetsUpload,
|
||||
prop: 'uploadedAssets',
|
||||
default: [],
|
||||
bind: {
|
||||
'is-pic-mode': false,
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-pics', // 用于区分不同的上传组件
|
||||
label: '上传图片',
|
||||
fieldName: 'images',
|
||||
subcomponent: AssetsUpload,
|
||||
// prop: '',
|
||||
// default: [],
|
||||
bind: {
|
||||
'is-pic-mode': true,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-pics', // 用于区分不同的上传组件
|
||||
label: '上传图片',
|
||||
fieldName: 'images',
|
||||
subcomponent: AssetsUpload,
|
||||
// prop: '',
|
||||
// default: [],
|
||||
bind: {
|
||||
'is-pic-mode': true,
|
||||
},
|
||||
],
|
||||
]
|
||||
},
|
||||
],
|
||||
]
|
||||
: this.rows;
|
||||
},
|
||||
},
|
||||
@ -580,7 +562,7 @@ export default {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@ -598,7 +580,7 @@ export default {
|
||||
this.$download.excel(response, '设备.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
},
|
||||
// 查看详情
|
||||
viewDetail(id) {
|
@ -70,13 +70,13 @@ export default {
|
||||
return {
|
||||
searchBarKeys: ['name'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:equipment-type:update')
|
||||
this.$auth.hasPermi('base:core-equipment-type:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:equipment-type:delete')
|
||||
this.$auth.hasPermi('base:core-equipment-type:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
@ -112,7 +112,7 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:equipment-type:create')
|
||||
type: this.$auth.hasPermi('base:core-equipment-type:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
@ -237,25 +237,6 @@ export default {
|
||||
const id = row.id;
|
||||
getEquipmentType(id).then((response) => {
|
||||
this.form = response.data;
|
||||
// this.form = {
|
||||
// code: 'SBLX20230925184444000041',
|
||||
// name: '测试131',
|
||||
// remark: '测试可删除',
|
||||
// id: '1706258479729336322',
|
||||
// files: [
|
||||
// { fileName: '1.png', fileUrl: '', fileType: 2 },
|
||||
// { fileName: '1.asdfaslkjfkasdf.png', fileUrl: '', fileType: 2 },
|
||||
// { fileName: '2.txt', fileUrl: '', fileType: 2 },
|
||||
// { fileName: '1.rar', fileUrl: '', fileType: 2 },
|
||||
// { fileName: '1.kkk', fileUrl: '', fileType: 2 },
|
||||
// { fileName: 'test.file', fileUrl: '', fileType: 2 },
|
||||
// { fileName: '222', fileUrl: '', fileType: 2 },
|
||||
// { fileName: 'g', fileUrl: '', fileType: 2 },
|
||||
// ],
|
||||
// createTime: 1695638697000,
|
||||
// parentId: '1701869972319584257',
|
||||
// };
|
||||
// debugger;
|
||||
this.open = true;
|
||||
this.title = '修改设备类型';
|
||||
});
|
301
src/views/base/coreEquipmentType/index.vue
Normal file
@ -0,0 +1,301 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:has-files="true"
|
||||
:rows="rows" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
|
||||
import {
|
||||
createEquipmentType,
|
||||
updateEquipmentType,
|
||||
deleteEquipmentType,
|
||||
getEquipmentType,
|
||||
getEquipmentTypePage,
|
||||
exportEquipmentTypeExcel,
|
||||
} from '@/api/base/equipmentType';
|
||||
|
||||
// import { getAccessToken } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'EquipmentType',
|
||||
components: {},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['name'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:core-equipment-type:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment-type:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'name', label: '设备类型名称' },
|
||||
{ prop: 'code', label: '检测类型编码' },
|
||||
{ prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备类型',
|
||||
placeholder: '请输入设备类型名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:core-equipment-type:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:quality-inspection-type:export')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '设备类型名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
// bind: {
|
||||
// disabled: true, // some condition, like detail mode...
|
||||
// }
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '设备类型编码',
|
||||
prop: 'code',
|
||||
url: '/base/core-equipment-type/getCode',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '父类',
|
||||
prop: 'parentId',
|
||||
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
|
||||
},
|
||||
{},
|
||||
],
|
||||
[
|
||||
{
|
||||
upload: true,
|
||||
label: '上传资料',
|
||||
prop: 'files',
|
||||
},
|
||||
],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: '',
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// form: {
|
||||
// handler: function (val, oldVal) {
|
||||
// console.log('[watch:form]', val, oldVal);
|
||||
// },
|
||||
// deep: true,
|
||||
// },
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getEquipmentTypePage(this.queryParams).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
parentId: undefined,
|
||||
remark: undefined,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加设备类型';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getEquipmentType(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改设备类型';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateEquipmentType(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipmentType(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除设备类型"' + row.name + '"?')
|
||||
.then(function () {
|
||||
return deleteEquipmentType(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有设备类型数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentTypeExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备类型.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
之前 寬度: | 高度: | 大小: 42 KiB |
之前 寬度: | 高度: | 大小: 50 KiB |
之前 寬度: | 高度: | 大小: 78 KiB |
之前 寬度: | 高度: | 大小: 71 KiB |
之前 寬度: | 高度: | 大小: 41 KiB |
之前 寬度: | 高度: | 大小: 61 KiB |
之前 寬度: | 高度: | 大小: 37 KiB |
之前 寬度: | 高度: | 大小: 69 KiB |
之前 寬度: | 高度: | 大小: 54 KiB |
之前 寬度: | 高度: | 大小: 45 KiB |